]> git.saurik.com Git - apt.git/blobdiff - test/integration/test-external-dependency-solver-protocol
correct cross & disappear progress detection
[apt.git] / test / integration / test-external-dependency-solver-protocol
index c86038b1b2a01488af1d527c460d9a4be08c1d52..d126cd84b4c87cea1571c15be77df97daf419216 100755 (executable)
@@ -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
@@ -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)'