All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] mkswap: make the test device size is aligned to pagesize
@ 2016-07-27  9:58 Li Wang
  2016-08-09 16:41 ` Cyril Hrubis
  0 siblings, 1 reply; 10+ messages in thread
From: Li Wang @ 2016-07-27  9:58 UTC (permalink / raw)
  To: ltp

We get failures like below because of 'DEVICE_SIZE-10000' makes the
loop device size is not 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.

Signed-off-by: Li Wang <liwang@redhat.com>
---
 testcases/commands/mkswap/mkswap01.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testcases/commands/mkswap/mkswap01.sh b/testcases/commands/mkswap/mkswap01.sh
index 9727b0f..e89c720 100755
--- a/testcases/commands/mkswap/mkswap01.sh
+++ b/testcases/commands/mkswap/mkswap01.sh
@@ -169,8 +169,8 @@ mkswap_test()
 setup
 
 mkswap_test "" "" "$TST_DEVICE"
-mkswap_test "" "" "$TST_DEVICE" "$((DEVICE_SIZE-10000))"
-mkswap_test "-f" "" "$TST_DEVICE" "$((DEVICE_SIZE+10000))"
+mkswap_test "" "" "$TST_DEVICE" "$((DEVICE_SIZE-PAGE_SIZE/1024))"
+mkswap_test "-f" "" "$TST_DEVICE" "$((DEVICE_SIZE+PAGE_SIZE/1024))"
 mkswap_test "-c" "" "$TST_DEVICE"
 mkswap_test "-p" "2048" "$TST_DEVICE"
 mkswap_test "-L" "ltp_testswap" "-L ltp_testswap" "" "/dev/disk/by-label/ltp_testswap"
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-08-18 11:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-27  9:58 [LTP] [PATCH] mkswap: make the test device size is aligned to pagesize Li Wang
2016-08-09 16:41 ` Cyril Hrubis
2016-08-15  9:25   ` Li Wang
2016-08-15 12:39     ` Cyril Hrubis
2016-08-16  3:24       ` Li Wang
2016-08-16 12:15         ` Cyril Hrubis
2016-08-17  3:39           ` Li Wang
2016-08-17 11:18             ` Cyril Hrubis
2016-08-18 11:08               ` Li Wang
2016-08-18 11:33                 ` Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.