diff options
author | Steve Langasek <steve.langasek@canonical.com> | 2012-11-05 13:11:39 -0800 |
---|---|---|
committer | Steve Langasek <steve.langasek@canonical.com> | 2012-11-05 13:11:39 -0800 |
commit | 1554ace0ccffd5cd8385ba85416672376e82487e (patch) | |
tree | c1e7543e7212a9b02f53ca08ba7376c109cc22d4 /test/integration/test-kernel-helper-autoremove | |
parent | a258c13a2da88dea02959f3cf296c56da453126b (diff) |
Make the test more verbose and check for the negative case of a kernel that
should not be marked not-for-autoremoval
Diffstat (limited to 'test/integration/test-kernel-helper-autoremove')
-rwxr-xr-x | test/integration/test-kernel-helper-autoremove | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/test/integration/test-kernel-helper-autoremove b/test/integration/test-kernel-helper-autoremove index 52fa01bc5..37c1b6a43 100755 --- a/test/integration/test-kernel-helper-autoremove +++ b/test/integration/test-kernel-helper-autoremove @@ -25,11 +25,18 @@ install -m755 $TESTDIR/test-kernel-helper-autoremove.fake-dpkg $TMPDIR/fake-dpkg # run the helper 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 -test -e $TMPDIR/apt.conf.d/01autoremove-kernels -apt-config -c ${APT_CONFIG} dump|grep -q "APT::NeverAutoRemove::.*\^linux-image-10.0.0-1-generic\.\*" +test -e $TMPDIR/apt.conf.d/01autoremove-kernels && msgpass || msgfail + +msgtest 'Check that most recent kernel is saved from autoremoval' +apt-config -c ${APT_CONFIG} dump|grep -q "APT::NeverAutoRemove::.*\^linux-image-10.0.0-1-generic\.\*" && msgpass || msgfail + # ... and also that the running kernel is excluded -apt-config -c ${APT_CONFIG} dump|grep -q "APT::NeverAutoRemove::.*\^linux-image-$(uname -r)\.\*" +msgtest 'Check that running kernel is saved from autoremoval' +apt-config -c ${APT_CONFIG} dump|grep -q "APT::NeverAutoRemove::.*\^linux-image-$(uname -r)\.\*" && msgpass || msgfail +# 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 # done -msgpass |