X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/385d9f2f23057bc5808b5e013e77ba16d1c94da4..2906182db398419a9c59a928b7ae73cf7c7aa307:/test/integration/test-external-dependency-solver-protocol diff --git a/test/integration/test-external-dependency-solver-protocol b/test/integration/test-external-dependency-solver-protocol index 10b07e896..d126cd84b 100755 --- a/test/integration/test-external-dependency-solver-protocol +++ b/test/integration/test-external-dependency-solver-protocol @@ -26,7 +26,7 @@ insertpackage 'experimental' 'coolstuff' 'i386,amd64' '3' 'Depends: cool, stuff' setupaptarchive testsuccess aptget install --solver apt coolstuff -s -testempty find -name 'edsp.last.*' +testempty find . -name 'edsp.last.*' echo 'Dir::Log::Solver "edsp.last.xz";' > rootdir/etc/apt/apt.conf.d/log-edsp.conf testfailure aptget install --solver dump coolstuff -s @@ -152,7 +152,7 @@ testsuccess grep 'ERR_UNSOLVABLE' rootdir/tmp/testfailure.output configarchitecture 'armel' testfailure aptget install --solver apt awesomecoolstuff:i386 -s msgtest 'An invalid EDSP file generates a' 'hard error' -if echo "Request: This is a test\nFoo: bar\n\n" | aptinternalsolver > solver.result 2>&1; then +if printf "%b\n" "Request: This is a test\nFoo: bar\n\n" | aptinternalsolver > solver.result 2>&1; then cat solver.result msgfail else @@ -262,3 +262,24 @@ EOF chmod +x rootdir/usr/lib/apt/solvers/installall testfailure apt full-upgrade -s --solver installall testsuccess grep "is already installed!" rootdir/tmp/testfailure.output + +testsolverfailuremsg() { + local SOLVER="rootdir/usr/lib/apt/solvers/$1" + echo "$2" > "$SOLVER" + chmod +x "$SOLVER" + testfailuremsg "$3" apt full-upgrade -s --solver $1 +} + +testsolverfailuremsg 'exit0withmsg' "#!/bin/sh +echo 'Error: instant-exit +Message: This solver exits instantly' +exit 0" 'E: External solver failed with: This solver exits instantly' + +testsolverfailuremsg 'exit1withoutmsg' "#!/bin/sh +exit 1" 'E: Sub-process exit1withoutmsg returned an error code (1)' + +testsolverfailuremsg 'exit1withmsg' "#!/bin/sh +echo 'Error: instant-exit +Message: This solver exits instantly' +exit 1" 'E: External solver failed with: This solver exits instantly +E: Sub-process exit1withmsg returned an error code (1)'