summaryrefslogtreecommitdiff
path: root/test/integration/test-external-dependency-solver-protocol
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-05-12 16:21:10 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-05-12 16:21:10 +0200
commit90e7fba4ac16fc764bf6aac7b59c17c3be551b60 (patch)
tree5a4f43c83cbfe0b11a872e8efbc813ac9c0f070a /test/integration/test-external-dependency-solver-protocol
parentd67db03c2ab853eba7b67c8870af41796eea387c (diff)
edsp: warn if unexpected stanzas appear in the solution
Unexpected are for examples removal requests for versions which aren't installed, installations of already installed versions & requests to install and remove a package at the same time.
Diffstat (limited to 'test/integration/test-external-dependency-solver-protocol')
-rwxr-xr-xtest/integration/test-external-dependency-solver-protocol52
1 files changed, 51 insertions, 1 deletions
diff --git a/test/integration/test-external-dependency-solver-protocol b/test/integration/test-external-dependency-solver-protocol
index 32c5fc354..e22684ec5 100755
--- a/test/integration/test-external-dependency-solver-protocol
+++ b/test/integration/test-external-dependency-solver-protocol
@@ -113,7 +113,7 @@ The following package was automatically installed and is no longer required:
Use '$AUTOREMOVE' to remove it.
The following packages will be REMOVED:
cool* somestuff*
-0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
+0 upgraded, 0 newly installed, 2 to remove and 1 not upgraded.
Purg somestuff [1]
Purg cool [1]" aptget purge --solver apt cool -s
@@ -194,3 +194,53 @@ Priority: optional
Section: other
APT-Pin: 100
' aptinternalsolver scenario stuff
+
+cat > rootdir/usr/lib/apt/solvers/explicitremove << EOF
+#!/bin/sh
+set -e
+while read line; do
+ if [ "APT-ID" = "\${line%:*}" ]; then
+ cat << APT
+Install: \${line#*:}
+
+Remove: \${line#*:}
+
+APT
+ fi
+done
+EOF
+chmod +x rootdir/usr/lib/apt/solvers/explicitremove
+testfailure apt full-upgrade -s --solver explicitremove
+testsuccess grep 'had a previous stanza' rootdir/tmp/testfailure.output
+
+cat > rootdir/usr/lib/apt/solvers/removeall << EOF
+#!/bin/sh
+set -e
+while read line; do
+ if [ "APT-ID" = "\${line%:*}" ]; then
+ cat << APT
+Remove: \${line#*:}
+
+APT
+ fi
+done
+EOF
+chmod +x rootdir/usr/lib/apt/solvers/removeall
+testwarning apt full-upgrade -s --solver removeall
+testsuccess grep "which isn't installed!" rootdir/tmp/testwarning.output
+
+cat > rootdir/usr/lib/apt/solvers/installall << EOF
+#!/bin/sh
+set -e
+while read line; do
+ if [ "APT-ID" = "\${line%:*}" ]; then
+ cat << APT
+Install: \${line#*:}
+
+APT
+ fi
+done
+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