Message ID | 20250415220845.548155-2-pvorel@suse.cz |
---|---|
State | Accepted |
Headers | show |
Series | [1/2] tst_cgroup: Add "dmem" cgroup controller | expand |
On Wed, Apr 16, 2025 at 6:09 AM Petr Vorel <pvorel@suse.cz> wrote: > Simplify last controller detection by using awk only - replace tail and > pipe with 'END' awk command (works also on Busybox). > > Signed-off-by: Petr Vorel <pvorel@suse.cz> > Tested-by: Li Wang <liwang@redhat.com> Reviewed-by: Li Wang <liwang@redhat.com> --- > testcases/kernel/controllers/cgroup/cgroup_regression_test.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh > b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh > index c241a5c4fc..276231fe8d 100755 > --- a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh > +++ b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh > @@ -352,7 +352,7 @@ test7() > return > fi > > - subsys=`tail -n 1 /proc/cgroups | awk '{ print $1 }'` > + subsys=$(awk 'END{ print $1 }' /proc/cgroups) > > # remount to add new subsystems to the hierarchy > while [ $i -le 2 ]; do > -- > 2.49.0 > >
Hi Petr,
Reviewed-by: Avinesh Kumar <akumar@suse.de>
for both patches.
Thank you,
Avinesh
diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh index c241a5c4fc..276231fe8d 100755 --- a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh +++ b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh @@ -352,7 +352,7 @@ test7() return fi - subsys=`tail -n 1 /proc/cgroups | awk '{ print $1 }'` + subsys=$(awk 'END{ print $1 }' /proc/cgroups) # remount to add new subsystems to the hierarchy while [ $i -le 2 ]; do
Simplify last controller detection by using awk only - replace tail and pipe with 'END' awk command (works also on Busybox). Signed-off-by: Petr Vorel <pvorel@suse.cz> --- testcases/kernel/controllers/cgroup/cgroup_regression_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)