[LTP] [PATCH] syscalls/getdtablesize01: Add abnormal handling
Zhao Gongyi
zhaogongyi@huawei.com
Tue Mar 30 14:20:41 CEST 2021
When /etc/hosts is not exist, test would fail, actually, we chould skip the
the problem to improve maintainability.
Signed-off-by: Zhao Gongyi <zhaogongyi@huawei.com>
---
testcases/kernel/syscalls/getdtablesize/getdtablesize01.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/testcases/kernel/syscalls/getdtablesize/getdtablesize01.c b/testcases/kernel/syscalls/getdtablesize/getdtablesize01.c
index d25cac261..25d10d5fb 100644
--- a/testcases/kernel/syscalls/getdtablesize/getdtablesize01.c
+++ b/testcases/kernel/syscalls/getdtablesize/getdtablesize01.c
@@ -100,6 +100,8 @@ int main(void)
tst_resm(TPASS, "%d = %d", count, (max_val_opfiles - 1));
else if (fd < 0 && errno == ENFILE)
tst_brkm(TCONF, cleanup, "Reached maximum number of open files for the system");
+ else if (fd == 0)
+ tst_brkm(TCONF, cleanup, "Maybe /etc/hosts is not exist");
else
tst_resm(TFAIL, "%d != %d", count, (max_val_opfiles - 1));
--
2.17.1
More information about the ltp
mailing list