From: Ruediger Meier Date: Fri, 14 Mar 2014 23:57:47 +0000 (+0100) Subject: tests: swaplabel needs to respect pagesize X-Git-Tag: v2.25-rc1~398^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d61bff4e2bab2d594e9b3e1071634b610b4ce7e0;p=thirdparty%2Futil-linux.git tests: swaplabel needs to respect pagesize Signed-off-by: Ruediger Meier --- diff --git a/tests/expected/misc/swaplabel b/tests/expected/misc/swaplabel index 061f5bb4f9..fd442afbef 100644 --- a/tests/expected/misc/swaplabel +++ b/tests/expected/misc/swaplabel @@ -1,6 +1,6 @@ -mkswap: error: swap area needs to be at least 40 KiB +mkswap: error: swap area needs to be at least 10 pages mkswap: Label was truncated. -Setting up swapspace version 1, size = 36 KiB +Setting up swapspace version 1, size = 9 pages LABEL=1234567890abcde, UUID=12345678-abcd-abcd-abcd-1234567890ab LABEL: 1234567890abcde UUID: 12345678-abcd-abcd-abcd-1234567890ab diff --git a/tests/ts/misc/swaplabel b/tests/ts/misc/swaplabel index ef0f0ff0bd..052ee18fbf 100755 --- a/tests/ts/misc/swaplabel +++ b/tests/ts/misc/swaplabel @@ -31,20 +31,28 @@ function fallocate_or_skip() IMAGE=${TS_OUTDIR}/${TS_TESTNAME}.file -rm -f $IMAGE +PAGE_SIZE=$($TS_HELPER_SYSINFO pagesize) +PAGE_SIZE_KB=$(( $PAGE_SIZE / 1024 )) +MIN_SWAP_SIZE=$(( 10 * $PAGE_SIZE )) +MIN_SWAP_SIZE_KB=$(( MIN_SWAP_SIZE / 1024 )) -fallocate_or_skip 40959 $IMAGE +rm -f $IMAGE +fallocate_or_skip $(( $MIN_SWAP_SIZE - 1 )) $IMAGE $TS_CMD_MKSWAP \ --label 1234567890abcdef \ --uuid 12345678-abcd-abcd-abcd-1234567890ab \ - $IMAGE >> $TS_OUTPUT 2>&1 + $IMAGE 2>&1 |\ + sed "s/ $MIN_SWAP_SIZE_KB KiB/ 10 pages/" \ + >> $TS_OUTPUT 2>&1 rm -f $IMAGE -fallocate_or_skip 40960 $IMAGE +fallocate_or_skip $MIN_SWAP_SIZE $IMAGE $TS_CMD_MKSWAP \ --label 1234567890abcdef \ --uuid 12345678-abcd-abcd-abcd-1234567890ab \ - $IMAGE >> $TS_OUTPUT 2>&1 + $IMAGE 2>&1 |\ + sed "s/ $(( $MIN_SWAP_SIZE_KB - $PAGE_SIZE_KB )) KiB/ 9 pages/" \ + >> $TS_OUTPUT 2>&1 $TS_CMD_SWAPLABEL $IMAGE >> $TS_OUTPUT 2>&1 #rm -f $IMAGE