summaryrefslogtreecommitdiff
path: root/test/integration/test-allow
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2015-08-18 11:57:35 +0200
committerMichael Vogt <mvo@debian.org>2015-08-18 11:57:35 +0200
commitb53c9cea2902572822bbbece5bac236c1bbf846e (patch)
tree6c6b0524e0971c0623ccbff71383523ee0b2a5cc /test/integration/test-allow
parent21248c0f00ee71412dbadc6ebf84011cf974346d (diff)
parent2a22cd60f04c4291ea9b9b72e15b6d2ec378b001 (diff)
Merge remote-tracking branch 'upstream/debian/experimental' into feature/srv-records
Diffstat (limited to 'test/integration/test-allow')
-rwxr-xr-xtest/integration/test-allow98
1 files changed, 98 insertions, 0 deletions
diff --git a/test/integration/test-allow b/test/integration/test-allow
new file mode 100755
index 000000000..3d773ee95
--- /dev/null
+++ b/test/integration/test-allow
@@ -0,0 +1,98 @@
+#!/bin/sh
+#
+# Test for --allow-remove-essential and friends replacing --force-yes
+#
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'amd64'
+
+insertpackage 'unstable' 'downgrade' 'all' '1'
+insertinstalledpackage 'downgrade' 'all' '2'
+
+insertpackage 'unstable' 'hold' 'all' '2'
+insertinstalledpackage 'hold' 'all' '1'
+
+insertinstalledpackage 'essential' 'all' '1' 'Essential: yes'
+
+setupaptarchive
+
+testsuccess aptmark hold hold
+
+# Test --allow-remove--essential
+
+testfailureequal 'Reading package lists...
+Building dependency tree...
+The following packages will be REMOVED:
+ essential
+WARNING: The following essential packages will be removed.
+This should NOT be done unless you know exactly what you are doing!
+ essential
+0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
+E: Essential packages were removed and -y was used without --allow-remove-essential.' aptget remove essential -y -s
+
+testsuccessequal 'Reading package lists...
+Building dependency tree...
+The following packages will be REMOVED:
+ essential
+WARNING: The following essential packages will be removed.
+This should NOT be done unless you know exactly what you are doing!
+ essential
+0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
+Remv essential [1]' aptget remove essential -y --allow-remove-essential -s
+
+# Test --allow-change-held-packages (should not influence dist-upgrade, but an install)
+
+testsuccessequal 'Reading package lists...
+Building dependency tree...
+Calculating upgrade...
+The following packages have been kept back:
+ hold
+0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.' aptget dist-upgrade --allow-change-held-packages -s
+
+testfailureequal 'Reading package lists...
+Building dependency tree...
+The following held packages will be changed:
+ hold
+The following packages will be upgraded:
+ hold
+1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+E: Held packages were changed and -y was used without --allow-change-held-packages.' aptget install hold -y -s
+
+testfailureequal 'Reading package lists...
+Building dependency tree...
+The following held packages will be changed:
+ hold
+The following packages will be upgraded:
+ hold
+1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+E: Held packages were changed and -y was used without --allow-change-held-packages.' aptget install hold -y -s
+
+testsuccessequal 'Reading package lists...
+Building dependency tree...
+The following held packages will be changed:
+ hold
+The following packages will be upgraded:
+ hold
+1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+Inst hold [1] (2 unstable [all])
+Conf hold (2 unstable [all])' aptget install hold -y -s --allow-change-held-packages
+
+# Test --allow-downgrades
+
+testfailureequal 'Reading package lists...
+Building dependency tree...
+The following packages will be DOWNGRADED:
+ downgrade
+0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 1 not upgraded.
+E: Packages were downgraded and -y was used without --allow-downgrades.' aptget install downgrade=1 -y -s
+
+testsuccessequal 'Reading package lists...
+Building dependency tree...
+The following packages will be DOWNGRADED:
+ downgrade
+0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 1 not upgraded.
+Inst downgrade [2] (1 unstable [all])
+Conf downgrade (1 unstable [all])' aptget install downgrade=1 --allow-downgrades -y -s