Skip to contentSkip to conversation

commands/df01.sh: Add check for mkfs.${FS_TYPE} command

PATCH New Xiao Yang 2 participants 3 messages Feb 14, 2018 – Feb 27, 2018

lore
Share & tools
lore

Xiao Yang

author
#0 lore raw

PATCH 1/1 commands/df01.sh: Add check for mkfs.${FS_TYPE} command

Since commit 521df0e, tst_rod can detect nonexistent command and report TBROK in tst_mkfs(), so we can check mkfs.${FS_TYPE} command before tst_mkfs().

If mkfs.exfat command did not exist, running df01_exfat got the following errors:
-----------------------------------------------------------------
tst_device.c:230: INFO: Using test device LTP_DEV='/dev/loop0'
1 TINFO: Formatting /dev/loop0 with exfat extra opts=''
1 TBROK: mkfs.exfat /dev/loop0 failed
1 TINFO: The /dev/loop0 is not mounted, skipping umount
-----------------------------------------------------------------

---
 testcases/commands/df/df01.sh | 4 ++++
 1 file changed, 4 insertions(+)
testcases/commands/df/df01.sh +4 -0
index 0552327..fbf1e2f 100755
@@ -49,6 +49,10 @@ parse_args()
 
 setup()
 {
+	if [ -n "$FS_TYPE" ]; then
+		tst_check_cmds mkfs.${FS_TYPE}
+	fi
+
 	tst_mkfs ${FS_TYPE} ${TST_DEVICE}
 
 	ROD_SILENT mkdir -p mntpoint
Signature · 1 line
1.8.3.1
author
#1 lore raw

PATCH 1/1 commands/df01.sh: Add check for mkfs.${FS_TYPE} command

Hi,

Ping :-)

Thanks,
Xiao Yang

Quoted 31 lines · Xiao Yang

Since commit 521df0e, tst_rod can detect nonexistent command and report TBROK in tst_mkfs(), so we can check mkfs.${FS_TYPE} command before tst_mkfs().

If mkfs.exfat command did not exist, running df01_exfat got the following errors:
-----------------------------------------------------------------
tst_device.c:230: INFO: Using test device LTP_DEV='/dev/loop0'
1 TINFO: Formatting /dev/loop0 with exfat extra opts=''
1 TBROK: mkfs.exfat /dev/loop0 failed
1 TINFO: The /dev/loop0 is not mounted, skipping umount
-----------------------------------------------------------------

---
 testcases/commands/df/df01.sh | 4 ++++
 1 file changed, 4 insertions(+)
testcases/commands/df/df01.sh +4 -0
index 0552327..fbf1e2f 100755
@@ -49,6 +49,10 @@ parse_args()
 
 setup()
 {
+	if [ -n "$FS_TYPE" ]; then
+		tst_check_cmds mkfs.${FS_TYPE}
+	fi
+
 	tst_mkfs ${FS_TYPE} ${TST_DEVICE}
 
 	ROD_SILENT mkdir -p mntpoint
#2 lore raw

PATCH 1/1 commands/df01.sh: Add check for mkfs.${FS_TYPE} command

In reply to Xiao Yang

Hi Xiao,

Quoted 21 lines

Since commit 521df0e, tst_rod can detect nonexistent command and report TBROK in tst_mkfs(), so we can check mkfs.${FS_TYPE} command before tst_mkfs().

If mkfs.exfat command did not exist, running df01_exfat got the following errors:
-----------------------------------------------------------------
tst_device.c:230: INFO: Using test device LTP_DEV='/dev/loop0'
1 TINFO: Formatting /dev/loop0 with exfat extra opts=''
1 TBROK: mkfs.exfat /dev/loop0 failed
1 TINFO: The /dev/loop0 is not mounted, skipping umount
-----------------------------------------------------------------

---
 testcases/commands/df/df01.sh | 4 ++++
 1 file changed, 4 insertions(+)
testcases/commands/df/df01.sh +0 -0
index 0552327..fbf1e2f 100755

testcases/commands/df/df01.sh parse_args() · line 58

Quoted 10 lines
testcases/commands/df/df01.sh +4 -0
@@ -49,6 +49,10 @@ parse_args()
 
 setup()
 {
+	if [ -n "$FS_TYPE" ]; then
+		tst_check_cmds mkfs.${FS_TYPE}
+	fi
+
 	tst_mkfs ${FS_TYPE} ${TST_DEVICE}
 
 	ROD_SILENT mkdir -p mntpoint

Pushed, thanks!

Kind regards,
Petr