From 4f9c58d25ff52fbb69cd3439fc1484bea47e1566 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 15 Apr 2019 09:40:20 +0200 Subject: Widen regular expressions for versioned kernel packages Since we append a concrete kernel version to each pattern, and then anchor the pattern, let's just pick any package starting with a kernel name (linux-, kfreebsd-, gnumach-), and not worry about linux-headers, linux-tools, etc specifically, as they'll be caught by the generic pattern. LP: #1607845 --- test/integration/test-kernel-helper-autoremove | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/integration/test-kernel-helper-autoremove b/test/integration/test-kernel-helper-autoremove index 8cde3432f..9cc978645 100755 --- a/test/integration/test-kernel-helper-autoremove +++ b/test/integration/test-kernel-helper-autoremove @@ -46,10 +46,10 @@ testprotected() { testfailure --nomsg grep '^[A-Z]: ' protected.list msgtest 'Check kernel autoremoval protection list includes' 'most recent kernel' - testsuccess --nomsg grep '^\^linux-image-100\\\.0\\\.0-1-generic\$$' protected.list + testsuccess --nomsg grep '^\^linux-.*-100\\\.0\\\.0-1-generic\$$' protected.list msgtest 'Check kernel autoremoval protection list includes' 'running kernel' - testsuccess --nomsg grep "^\\^linux-image-$(uname -r | tr '[A-Z]' '[a-z]' | sed -e 's#\.#\\\\.#g')\\\$\$" protected.list + testsuccess --nomsg grep "^\\^linux-.*-$(uname -r | tr '[A-Z]' '[a-z]' | sed -e 's#\.#\\\\.#g')\\\$\$" protected.list msgtest 'Check kernel autoremoval protection list does not include' 'metapackages' testfailure --nomsg grep -e '^\^linux-image-amd64\$$' -e '^\^linux-image-686-pae\$$' -e ':i386' protected.list @@ -115,7 +115,7 @@ Remv ${CURRENTKERNEL}-dbg [5-1]" aptget autoremove -sV msgmsg "run without parameter" testprotected msgtest 'Check kernel autoremoval protection list does not include' 'old kernel' -testfailure --nomsg grep '^\^linux-image-1\\\.0\\\.0-2-generic\$$' protected.list +testfailure --nomsg grep '^\^linux-.*-1\\\.0\\\.0-2-generic\$$' protected.list export COLUMNS=99999 testsuccessequal "Reading package lists... Building dependency tree... @@ -134,9 +134,9 @@ msgmsg "install unknown kernel" # know for sure without complicated detection mechanisms testprotected 1.0.0-2-ungeneric msgtest 'Check kernel autoremoval protection list does not include' 'old kernel' -testfailure --nomsg grep '^\^linux-image-1\\\.0\\\.0-2-generic\$$' protected.list +testfailure --nomsg grep '^\^linux-.*-1\\\.0\\\.0-2-generic\$$' protected.list msgtest 'Check kernel autoremoval protection list does include' 'unknown installed kernel' -testsuccess --nomsg grep '^\^linux-image-1\\\.0\\\.0-2-ungeneric\$$' protected.list +testsuccess --nomsg grep '^\^linux-.*-1\\\.0\\\.0-2-ungeneric\$$' protected.list export COLUMNS=9 testsuccessequal "Reading package lists... Building dependency tree... @@ -154,7 +154,7 @@ unset COLUMNS msgmsg "install an old kernel" testprotected 1.0.0-2-generic msgtest 'Check kernel autoremoval protection list includes' 'installed kernel' -testsuccess --nomsg grep '^\^linux-image-1\\\.0\\\.0-2-generic\$$' protected.list +testsuccess --nomsg grep '^\^linux-.*-1\\\.0\\\.0-2-generic\$$' protected.list export COLUMNS=9 testsuccessequal "Reading package lists... Building dependency tree... -- cgit v1.2.3