[LTP] [PATCH] max_map_count: Add judgment of abnormal situation

Zhao Gongyi zhaogongyi@huawei.com
Wed Mar 10 03:03:48 CET 2021


When max_iters < max_maps, there is no post processing,
and the test will report "TBROK: Test haven't reported results".

Signed-off-by: Zhao Gongyi <zhaogongyi@huawei.com>
---------------
v1->v2: modify comparison span of the judgment.
---------------

---
 testcases/kernel/mem/tunable/max_map_count.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/testcases/kernel/mem/tunable/max_map_count.c b/testcases/kernel/mem/tunable/max_map_count.c
index aa70fde59..cf2df338a 100644
--- a/testcases/kernel/mem/tunable/max_map_count.c
+++ b/testcases/kernel/mem/tunable/max_map_count.c
@@ -164,6 +164,9 @@ static void max_map_count_test(void)
 		max_iters = MAX_MAP_COUNT;

 	max_maps = MAP_COUNT_DEFAULT;
+	if (max_iters < max_maps)
+		tst_brk(TCONF, "test requires more free memory");
+
 	while (max_maps <= max_iters) {
 		set_sys_tune("max_map_count", max_maps, 1);

--
2.17.1



More information about the ltp mailing list