<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 23, 2022 at 11:01 PM Joerg Vehlow <<a href="mailto:lkml@jv-coder.de">lkml@jv-coder.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Joerg Vehlow <<a href="mailto:joerg.vehlow@aox.de" target="_blank">joerg.vehlow@aox.de</a>><br>
<br>
This allows the test to run successfully on systems without swap enabled<br>
It restores the behaviour of the test before<br>
a77b65bbe ("controllers: Update memcg_control_test to newer test lib and cgroup lib")<br>
<br>
Signed-off-by: Joerg Vehlow <<a href="mailto:joerg.vehlow@aox.de" target="_blank">joerg.vehlow@aox.de</a>><br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">Reviewed-by: Li Wang <<a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a>></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
 .../kernel/controllers/memcg/control/memcg_control_test.sh  | 6 +++++-<br>
 1 file changed, 5 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/testcases/kernel/controllers/memcg/control/memcg_control_test.sh b/testcases/kernel/controllers/memcg/control/memcg_control_test.sh<br>
index 093d50c2a..941d918fc 100644<br>
--- a/testcases/kernel/controllers/memcg/control/memcg_control_test.sh<br>
+++ b/testcases/kernel/controllers/memcg/control/memcg_control_test.sh<br>
@@ -47,7 +47,11 @@ test1()<br>
        tst_res TINFO "Test #1: Checking if the memory usage limit imposed by the topmost group is enforced"<br>
<br>
        ROD echo "$ACTIVE_MEM_LIMIT" \> "$test_dir/$memory_limit"<br>
-       ROD echo "$TOT_MEM_LIMIT" \> "$test_dir/$memsw_memory_limit"<br>
+       <br>
+       # If the kernel is built without swap, the $memsw_memory_limit file is missing<br>
+       if [ -e "$test_dir/$memsw_memory_limit" ]; then<br>
+               ROD echo "$TOT_MEM_LIMIT" \> "$test_dir/$memsw_memory_limit"<br>
+       fi<br>
<br>
        KILLED_CNT=0<br>
        test_proc_kill<br>
-- <br>
2.25.1<br>
<br>
<br>
-- <br>
Mailing list info: <a href="https://lists.linux.it/listinfo/ltp" rel="noreferrer" target="_blank">https://lists.linux.it/listinfo/ltp</a><br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>