summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorSteve Langasek <steve.langasek@canonical.com>2012-11-05 14:44:59 -0800
committerMichael Vogt <mvo@debian.org>2014-02-14 20:27:54 +0100
commitd269b88d95686b77a170af203d0f4a7e44d28fc8 (patch)
tree1a747a05ae6db884bc5efb874095c0516885c890 /test/integration
parentc6918c16c7b98fe709b4f7af5fa1c43f201fb1af (diff)
Additional test for the case when installed version != newest version
Diffstat (limited to 'test/integration')
-rwxr-xr-xtest/integration/test-kernel-helper-autoremove17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/integration/test-kernel-helper-autoremove b/test/integration/test-kernel-helper-autoremove
index 37c1b6a43..ffcd3963a 100755
--- a/test/integration/test-kernel-helper-autoremove
+++ b/test/integration/test-kernel-helper-autoremove
@@ -23,7 +23,7 @@ export APT_CONFIG
install -m755 $TESTDIR/test-kernel-helper-autoremove.fake-dpkg $TMPDIR/fake-dpkg
# run the helper
-sh ${TESTDIR}/../../debian/apt.auto-removal.sh
+sh ${TESTDIR}/../../debian/apt.auto-removal.sh
msgtest 'Check that kernel autoremoval list is correctly created'
# and ensure its there, valid and version 10.0.0-1 is there too
@@ -38,5 +38,18 @@ apt-config -c ${APT_CONFIG} dump|grep -q "APT::NeverAutoRemove::.*\^linux-image-
# and that the old kernel is *not* excluded from autoremoval
msgtest 'Check that older kernels are not excluded from autoremoval'
-apt-config -c ${APT_CONFIG} dump | grep -q "APT::NeverAutoRemove::.*\^linux-image-1\.0\.0-2-generic\.\*" && msgfail || msgpass
+apt-config -c ${APT_CONFIG} dump|grep -q "APT::NeverAutoRemove::.*\^linux-image-1\.0\.01-2-generic\.\*" && msgfail || msgpass
+
+msgtest "Check that the older kernel is retained when it's being installed"
+sh ${TESTDIR}/../../debian/apt.auto-removal.sh 1.0.01-2-generic
+test -e $TMPDIR/apt.conf.d/01autoremove-kernels
+if ! apt-config -c ${APT_CONFIG} dump|grep -q "APT::NeverAutoRemove::.*\^linux-image-10.0.0-1-generic\.\*" \
+ || ! apt-config -c ${APT_CONFIG} dump|grep -q "APT::NeverAutoRemove::.*\^linux-image-$(uname -r)\.\*" \
+ || ! apt-config -c ${APT_CONFIG} dump|grep -q "APT::NeverAutoRemove::.*\^linux-image-1\.0\.01-2-generic\.\*"
+then
+ msgfail
+else
+ msgpass
+fi
+
# done