memcg_conctrol_test: fix if CONFIG_SWAP=n
PATCH 1/1 memcg_conctrol_test: fix if CONFIG_SWAP=n
From: Joerg Vehlow <[email protected]>
This allows the test to run successfully on systems without swap enabled It restores the behaviour of the test beforea77b65bbe ("controllers: Update memcg_control_test to newer test lib and cgroup lib")
--- .../kernel/controllers/memcg/control/memcg_control_test.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
testcases/kernel/controllers/memcg/control/memcg_control_test.sh +5 -1
@@ -47,7 +47,11 @@ test1() tst_res TINFO "Test #1: Checking if the memory usage limit imposed by the topmost group is enforced" ROD echo "$ACTIVE_MEM_LIMIT" \> "$test_dir/$memory_limit" - ROD echo "$TOT_MEM_LIMIT" \> "$test_dir/$memsw_memory_limit" + + # If the kernel is built without swap, the $memsw_memory_limit file is missing + if [ -e "$test_dir/$memsw_memory_limit" ]; then + ROD echo "$TOT_MEM_LIMIT" \> "$test_dir/$memsw_memory_limit" + fi KILLED_CNT=0 test_proc_kill
Signature · 5 lines
2.25.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 9 lines · Joerg Vehlow
From: Joerg Vehlow <[email protected]>
This allows the test to run successfully on systems without swap enabled It restores the behaviour of the test before
a77b65bbe("controllers: Updatememcg_control_testto newer test lib and cgroup lib")Signed-off-by Joerg Vehlow <[email protected]>
---
Quoted 33 lines
.../kernel/controllers/memcg/control/memcg_control_test.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)diff --git
a/testcases/kernel/controllers/memcg/control/memcg_control_test.shb/testcases/kernel/controllers/memcg/control/memcg_control_test.shindex093d50c2a..941d918fc100644testcases/kernel/controllers/memcg/control/memcg_control_test.sh +0
-0@@ -47,7 +47,11 @@ test1() tst_res TINFO "Test #1: Checking if the memory usage limit imposedby the topmost group is enforced"
ROD echo "$ACTIVE_MEM_LIMIT" \> "$test_dir/$memory_limit"
testcases/kernel/controllers/memcg/control/memcg_control_test.sh +2
-1- ROD echo "$TOT_MEM_LIMIT" \> "$test_dir/$memsw_memory_limit" + + # If the kernel is built without swap, the $memsw_memory_limitfile is missing
testcases/kernel/controllers/memcg/control/memcg_control_test.sh +2
-0+ if [ -e "$test_dir/$memsw_memory_limit" ]; then + ROD echo "$TOT_MEM_LIMIT" \>"$test_dir/$memsw_memory_limit"
+ fiKILLED_CNT=0
test_proc_kill
--
2.25.1--
Mailing list info: https://lists.linux.it/listinfo/ltp
Signature · 2 lines
Regards, Li Wang
Signature · 2 lines
-- Mailing list info: https://lists.linux.it/listinfo/ltp