summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2019-04-15 09:40:20 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2020-01-30 16:58:23 +0100
commit4f9c58d25ff52fbb69cd3439fc1484bea47e1566 (patch)
treedb1c7f15f112916062cd1e0b116e0987bc58050c /test
parentfaa51dcbf63cbf3593ce00495c03c27360b239b7 (diff)
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
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-kernel-helper-autoremove12
1 files changed, 6 insertions, 6 deletions
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...