[LTP] [PATCH v3 ltp 1/4] fs/ext4: check if the big block device is mounted at do_setup()

Yixin Zhang yixin.zhang@intel.com
Thu Jul 26 11:22:16 CEST 2018


The test requires the big block device is umounted before test, so check
at do_setup(), TBROK if it's mounted

Signed-off-by: Yixin Zhang <yixin.zhang@intel.com>
---
 testcases/kernel/fs/ext4-new-features/ext4_funcs.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/testcases/kernel/fs/ext4-new-features/ext4_funcs.sh b/testcases/kernel/fs/ext4-new-features/ext4_funcs.sh
index a9eb54e8d..1514da5a2 100755
--- a/testcases/kernel/fs/ext4-new-features/ext4_funcs.sh
+++ b/testcases/kernel/fs/ext4-new-features/ext4_funcs.sh
@@ -45,6 +45,9 @@ ext4_setup()
 		tst_brkm TCONF "tests need a big block device(5G-10G)"
 	else
 		export EXT4_DEV=$LTP_BIG_DEV
+		if mount | cut -d' ' -f1 | grep -q ^$EXT4_DEV$ ; then
+			tst_brkm TBROK "$EXT4_DEV should be umounted before test"
+		fi
 	fi
 
 	tst_tmpdir
-- 
2.14.1



More information about the ltp mailing list