summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak2016-01-26 16:49:39 +0100
committerKarel Zak2016-01-26 16:49:39 +0100
commit7ed6a6a00db04723ccde8e7a2dfb339eed1635bc (patch)
treeedd92a9f4f8adadab66e035f51dacfff8fb18d71
parenttests: update swapfile output (diff)
downloadkernel-qcow2-util-linux-7ed6a6a00db04723ccde8e7a2dfb339eed1635bc.tar.gz
kernel-qcow2-util-linux-7ed6a6a00db04723ccde8e7a2dfb339eed1635bc.tar.xz
kernel-qcow2-util-linux-7ed6a6a00db04723ccde8e7a2dfb339eed1635bc.zip
tests: make swaplabel test more robust
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--tests/expected/misc/swaplabel2
-rwxr-xr-xtests/ts/misc/swaplabel2
2 files changed, 3 insertions, 1 deletions
diff --git a/tests/expected/misc/swaplabel b/tests/expected/misc/swaplabel
index 13abc0bf8..172f876af 100644
--- a/tests/expected/misc/swaplabel
+++ b/tests/expected/misc/swaplabel
@@ -1,5 +1,5 @@
mkswap: error: swap area needs to be at least 10 pages
-mkswap: <swapfile>: insecure permissions 0644, 0600 suggested.
+mkswap: <swapfile>: insecure permissions <perm>, 0600 suggested.
mkswap: Label was truncated.
Setting up swapspace version 1, size = 9 pages (9xPGSZ bytes)
LABEL=1234567890abcde, UUID=12345678-abcd-abcd-abcd-1234567890ab
diff --git a/tests/ts/misc/swaplabel b/tests/ts/misc/swaplabel
index 5653742aa..646304508 100755
--- a/tests/ts/misc/swaplabel
+++ b/tests/ts/misc/swaplabel
@@ -44,6 +44,7 @@ $TS_CMD_MKSWAP \
$IMAGE 2>&1 |\
sed -e "s/ $MIN_SWAP_SIZE_KB KiB/ 10 pages/" \
-e "s:$IMAGE:<swapfile>:g" \
+ -e "s/insecure permissions [0-9]*/insecure permissions <perm>/g" \
>> $TS_OUTPUT 2>&1
rm -f $IMAGE
@@ -55,6 +56,7 @@ $TS_CMD_MKSWAP \
sed -e "s/ $(( $MIN_SWAP_SIZE_KB - $PAGE_SIZE_KB )) KiB/ 9 pages/" \
-e "s/($(( $MIN_SWAP_SIZE - $PAGE_SIZE )) bytes)/(9xPGSZ bytes)/" \
-e "s:$IMAGE:<swapfile>:g" \
+ -e "s/insecure permissions [0-9]*/insecure permissions <perm>/g" \
>> $TS_OUTPUT 2>&1
$TS_CMD_SWAPLABEL $IMAGE >> $TS_OUTPUT 2>&1