<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 Sat, Mar 5, 2022 at 7:19 AM Luke Nowakowski-Krijger <<a href="mailto:luke.nowakowskikrijger@canonical.com">luke.nowakowskikrijger@canonical.com</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">The older function in the cgroup lib 'get_cgroup_mountpoint' has been<br>
removed, so instead replace it with its old functionaility to get<br>
mountpoint.<br>
<br>
Also use the newer cgroup lib require operation to mount and cleanup a<br>
cpu controller.<br>
<br>
Signed-off-by: Luke Nowakowski-Krijger <<a href="mailto:luke.nowakowskikrijger@canonical.com" target="_blank">luke.nowakowskikrijger@canonical.com</a>><br>
---<br>
 .../cgroup/cgroup_regression_test.sh            | 17 ++++-------------<br>
 1 file changed, 4 insertions(+), 13 deletions(-)<br>
<br>
diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh<br>
index 592a1d3b1..2df216f43 100755<br>
--- a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh<br>
+++ b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh<br>
@@ -170,17 +170,8 @@ test3()<br>
                return<br>
        fi<br>
<br>
-       cpu_subsys_path=$(get_cgroup_mountpoint "cpu")<br>
-<br>
-       # Run the test for 30 secs<br>
-       if [ -z "$cpu_subsys_path" ]; then<br>
-               mount -t cgroup -o cpu xxx cgroup/<br>
-               if [ $? -ne 0 ]; then<br>
-                       tst_res TFAIL "Failed to mount cpu subsys"<br>
-                       return<br>
-               fi<br>
-               cpu_subsys_path=cgroup<br>
-       fi<br>
+       cgroup_require "cpu"<br>
+       cpu_subsys_path=$(cgroup_get_mountpoint "cpu")<br>
<br>
        cgroup_regression_3_1.sh $cpu_subsys_path &<br>
        pid1=$!<br>
@@ -193,7 +184,7 @@ test3()<br>
        wait $pid2 2>/dev/null<br>
<br>
        rmdir $cpu_subsys_path/0 2> /dev/null<br>
-       tst_umount $PWD/cgroup<br>
+       cgroup_cleanup<br>
        check_kernel_bug<br>
 }<br>
<br>
@@ -310,7 +301,7 @@ test_7_1()<br>
        # could be passed here as params and this will lead to ambiguity and<br>
        # errors when grepping simply for 'debug' in /proc/mounts since we'll<br>
        # find also /sys/kernel/debug. Helper takes care of this.<br>
-       local subsys_path=$(get_cgroup_mountpoint $subsys)<br>
+       local subsys_path=$(grep cgroup /proc/mounts | grep -w $subsys | awk '{ print $2 }')<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Why not use 'cgroup_get_mountpoint' like test3 but</div><div class="gmail_default" style="font-size:small">switch back to grep for getting the subsys path? </div><div class="gmail_default" style="font-size:small">The grep way won't work on Cgroup V2, isn't it?</div></div><div class="gmail_default" style="font-size:small"><br></div></div><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>