summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-get-autoremove
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-03-10 15:45:47 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2011-03-10 15:45:47 +0100
commit67da93c38eb3904b36537e025e2f63f77d830e20 (patch)
tree8ff57ccafb2f471fc97f97bfe8f0da11ca1eb7b1 /test/integration/test-apt-get-autoremove
parentc9952021ba65db0581f6053cd6d6e8bf7d563e8f (diff)
parenta75b8cfeb6d7e2468b19534d5b5872c3885f0e1c (diff)
merged from debian-sid
Diffstat (limited to 'test/integration/test-apt-get-autoremove')
-rwxr-xr-xtest/integration/test-apt-get-autoremove51
1 files changed, 51 insertions, 0 deletions
diff --git a/test/integration/test-apt-get-autoremove b/test/integration/test-apt-get-autoremove
new file mode 100755
index 000000000..c25ce3f58
--- /dev/null
+++ b/test/integration/test-apt-get-autoremove
@@ -0,0 +1,51 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'i386'
+
+buildsimplenativepackage 'unrelated' 'all' '1' 'unstable'
+buildsimplenativepackage 'po-debconf' 'all' '1.0.16' 'unstable'
+buildsimplenativepackage 'debhelper' 'all' '8.0.0' 'unstable' 'Depends: po-debconf'
+setupaptarchive
+
+aptget install unrelated debhelper -qq 2>&1 > /dev/null
+testdpkginstalled 'unrelated' 'debhelper' 'po-debconf'
+
+testmarkedauto 'po-debconf'
+aptget remove debhelper -y -qq 2>&1 > /dev/null
+testdpkgnotinstalled 'debhelper'
+testdpkginstalled 'po-debconf' 'unrelated'
+
+echo 'APT::NeverAutoRemove { "^debc.*nf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
+testequal 'Reading package lists...
+Building dependency tree...
+Reading state information...
+The following packages will be REMOVED:
+ po-debconf
+0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
+Remv po-debconf [1.0.16]' aptget autoremove -s
+testdpkginstalled 'po-debconf'
+
+echo 'APT::NeverAutoRemove { "^po-debconf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
+aptget autoremove -y -qq 2>&1 > /dev/null
+testdpkginstalled 'po-debconf'
+
+echo 'APT::NeverAutoRemove { "^po-.*$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
+aptget autoremove -y -qq 2>&1 > /dev/null
+testdpkginstalled "po-debconf"
+
+rm rootdir/etc/apt/apt.conf.d/00autoremove
+aptget autoremove -y -qq 2>&1 > /dev/null
+testdpkgnotinstalled 'po-debconf'
+testmarkedauto
+
+sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d'
+testfileequal 'rootdir/var/log/apt/history.log' '
+Install: unrelated:i386 (1), debhelper:i386 (8.0.0), po-debconf:i386 (1.0.16, automatic)
+
+Remove: debhelper:i386 (8.0.0)
+
+Remove: po-debconf:i386 (1.0.16)'