summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2021-01-04 10:17:45 +0000
committerJulian Andres Klode <jak@debian.org>2021-01-04 10:17:45 +0000
commitfba6d562bda307bb1e619c255682079aa86c68ac (patch)
treec66205b3d0def0fb9b47d3a6b61edae0045dc906 /test
parentda468783ecfb0b5a8575b1d91abae193519ef5a7 (diff)
parent38c49b8adeadf54f147140b3a5db7693e9b9b50f (diff)
Merge branch 'pu/kernel-autoremove' into 'master'
Determine autoremovable kernels at run-time See merge request apt-team/apt!138
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-kernel-helper-autoremove15
1 files changed, 7 insertions, 8 deletions
diff --git a/test/integration/test-kernel-helper-autoremove b/test/integration/test-kernel-helper-autoremove
index 9cc978645..8dac44b93 100755
--- a/test/integration/test-kernel-helper-autoremove
+++ b/test/integration/test-kernel-helper-autoremove
@@ -38,9 +38,8 @@ testprotected() {
testsuccess --nomsg test -e rootdir/etc/apt/apt.conf.d/01autoremove-kernels
testfilestats 'rootdir/etc/apt/apt.conf.d/01autoremove-kernels' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:444"
- msgtest 'Check kernel autoremoval protection list' 'can be dumped'
- testsuccess --nomsg aptconfig dump --no-empty --format '%v%n' 'APT::NeverAutoRemove'
- cp rootdir/tmp/testsuccess.output protected.list
+ testsuccess --nomsg apt -o Debug::PkgAutoRemove=1 autoremove -s
+ grep "Kernel protection regex" rootdir/tmp/testsuccess.output | cut -f2- -d: | tr '|' '\n' | sed 's/\s*//g' | sort -u > protected.list
msgtest 'Check kernel autoremoval protection list' 'can be parsed'
testfailure --nomsg grep '^[A-Z]: ' protected.list
@@ -71,7 +70,7 @@ The following packages were automatically installed and are no longer required:
${CURRENTKERNEL}-686-pae:i386 (5-1)
${CURRENTKERNEL}-dbg (5-1)
Use '$AUTOREMOVE' to remove them.
-0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -sV
+0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -sV -o APT::Protect-Kernels=0
testsuccessequal "Reading package lists...
Building dependency tree...
Reading state information...
@@ -85,13 +84,13 @@ The following packages were automatically installed and are no longer required:
${CURRENTKERNEL}-dbg (5-1)
${CURRENTKERNEL}-rt (5-1)
Use '$AUTOREMOVE' to remove them.
-0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -sV --ignore-hold
+0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -sV --ignore-hold -o APT::Protect-Kernels=0
testequal "Reading package lists...
Building dependency tree...
Reading state information...
7 packages were automatically installed and are no longer required.
Use '$AUTOREMOVE' to remove them.
-0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small
+0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small -o APT::Protect-Kernels=0
testequal "Reading package lists...
Building dependency tree...
Reading state information...
@@ -110,7 +109,7 @@ Remv linux-image-100.0.0-1-generic [100.0.0-1]
Remv $CURRENTKERNEL [5-1]
Remv ${CURRENTKERNEL}+variant [5-1]
Remv ${CURRENTKERNEL}-686-pae:i386 [5-1]
-Remv ${CURRENTKERNEL}-dbg [5-1]" aptget autoremove -sV
+Remv ${CURRENTKERNEL}-dbg [5-1]" aptget autoremove -sV -o APT::Protect-Kernels=0
msgmsg "run without parameter"
testprotected
@@ -168,7 +167,7 @@ Remv ${CURRENTKERNEL}-dbg [5-1]" aptget autoremove -s
unset COLUMNS
# rt kernel was put on hold while the protected list was generated
-testsuccess aptmark unhold "${CURRENTKERNEL}-rt"
+testsuccess aptmark hold "${CURRENTKERNEL}-rt"
export COLUMNS=99999
testsuccessequal "Reading package lists...
Building dependency tree...