X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/bd95e2b29d1048f4c8ada07def7b1a5da5eb7716..dabe9e2482180ada77d2adda2b3c03db22059fb8:/test/integration/test-external-dependency-solver-protocol?ds=sidebyside diff --git a/test/integration/test-external-dependency-solver-protocol b/test/integration/test-external-dependency-solver-protocol index 17a30cf2f..d126cd84b 100755 --- a/test/integration/test-external-dependency-solver-protocol +++ b/test/integration/test-external-dependency-solver-protocol @@ -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)'