X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/e5bdcc8708ee571a7d7d54bbdfa7e226300344ea..f98d9bd2adf4f24a72d973f5752b47987843984c:/test/integration/test-kernel-helper-autoremove diff --git a/test/integration/test-kernel-helper-autoremove b/test/integration/test-kernel-helper-autoremove index a4c31283e..2b165d100 100755 --- a/test/integration/test-kernel-helper-autoremove +++ b/test/integration/test-kernel-helper-autoremove @@ -23,11 +23,33 @@ 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 +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 +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\.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 -apt-config -c ${APT_CONFIG} dump|grep -q "APT::NeverAutoRemove::.*\^linux-image-10.0.0-1-generic\.\*" +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 -msgpass \ No newline at end of file