[LTP] [PATCH] lib/tst_mkfs: bugfix for lib/tst_mkfs.c
zhao gongyi
zhaogongyi@huawei.com
Thu Feb 18 07:57:58 CET 2021
Tmpfs is the only one filesystem in many embedded system, so
LTP_DEV_FS_TYPE should be set to tmpfs in many testcases, for
example syscalls/chown04, and in these cases, tests will be failed
because there is no mkfs tool for tmpfs.
Signed-off-by: zhao gongyi <zhaogongyi@huawei.com>
---
lib/tst_mkfs.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/tst_mkfs.c b/lib/tst_mkfs.c
index 45dd83ad3..40141fead 100644
--- a/lib/tst_mkfs.c
+++ b/lib/tst_mkfs.c
@@ -44,6 +44,11 @@ void tst_mkfs_(const char *file, const int lineno, void (cleanup_fn)(void),
return;
}
+ if (!strcmp(fs_type, "tmpfs")) {
+ tst_resm_(file, lineno, TINFO, "Need not fomat for TMPFS filesystem");
+ return;
+ }
+
snprintf(mkfs, sizeof(mkfs), "mkfs.%s", fs_type);
if (fs_opts) {
--
2.17.1
More information about the ltp
mailing list