[LTP] [PATCH 1/2] test.sh: make the loop device size can be customized
Li Wang
liwang@redhat.com
Wed Jul 27 07:44:06 CEST 2016
Signed-off-by: Li Wang <liwang@redhat.com>
---
testcases/lib/test.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/testcases/lib/test.sh b/testcases/lib/test.sh
index 23d68c6..10a3ea7 100644
--- a/testcases/lib/test.sh
+++ b/testcases/lib/test.sh
@@ -257,6 +257,8 @@ ROD()
tst_acquire_device()
{
+ local dev_size=${1:-100}
+
if [ -z ${TST_TMPDIR} ]; then
tst_brkm "Use 'tst_tmpdir' before 'tst_acquire_device'"
fi
@@ -274,7 +276,7 @@ tst_acquire_device()
return
fi
- ROD_SILENT dd if=/dev/zero of=test_dev.img bs=1024 count=102400
+ ROD_SILENT dd if=/dev/zero of=test_dev.img bs=1024 count=$(($dev_size*1024))
TST_DEVICE=$(losetup -f)
if [ $? -ne 0 ]; then
--
1.8.3.1
More information about the ltp
mailing list