diff options
author | Li Wang <liwang@redhat.com> | 2016-08-18 21:09:23 +0800 |
---|---|---|
committer | Cyril Hrubis <chrubis@suse.cz> | 2016-08-22 19:04:35 +0200 |
commit | 0a1dc7521cc3fd4bc148f086ec9cb9452e01a414 (patch) | |
tree | ded3c2a238c5d59bbbf6b2eab2093ea607a46354 /runltp | |
parent | 8ef71aa698de1f199dcefbf0ff0f46da8ac21beb (diff) |
mkswap: align the test device size to pagesize
We get failures like below because 'DEVICE_SIZE-10000' may not be
aligned to system PAGE_SIZE any more.
mkswap01 1 TINFO : Found free device '/dev/loop1'
mkswap01 1 TPASS : 'mkswap /dev/loop1 ' passed.
mkswap01 2 TFAIL : 'mkswap -f /dev/loop1 92400' failed, not expected.
mkswap01 3 TINFO : Can not do swapon on /dev/loop1.
mkswap01 3 TINFO : Device size specified by 'mkswap' greater than real size.
mkswap01 3 TINFO : Swapon failed expectedly.
mkswap01 3 TPASS : 'mkswap -f /dev/loop1 112400' passed.
For the issue, we do some changes in this patch:
1. The orignal test device(LTP_DEV) size is also not aligned to
PAGE_SIZE on all arches. Here fix it.
2. Get the size of the device and align it down to be the multiple
of $PAGE_SIZE and use that as the size for testing.
3. Increase/decrease the $DEVICE_SIZE according to system PAGE_SIZE
Signed-off-by: Li Wang <liwang@redhat.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Diffstat (limited to 'runltp')
-rwxr-xr-x | runltp | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -978,7 +978,7 @@ main() create_block() { #create a block device - dd if=/dev/zero of=${TMP}/test.img bs=1kB count=153600 >/dev/null 2>&1 + dd if=/dev/zero of=${TMP}/test.img bs=1024 count=153600 >/dev/null 2>&1 if [ $? -ne 0 ]; then echo "Failed to create loopback device image, please check disk space and re-run" return 1 |