From: Li Wang via ltp <ltp@lists.linux.it>
To: Samir <samir@linux.ibm.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] [LTP v2] controllers/cgroup: Skip regression test on cgroup v2 systems
Date: Tue, 17 Mar 2026 17:59:18 +0800 [thread overview]
Message-ID: <abkl9sUAP6H0W86Y@redhat.com> (raw)
In-Reply-To: <20260317084203.2956-1-samir@linux.ibm.com>
On Tue, Mar 17, 2026 at 09:42:03AM +0100, Samir wrote:
> The cgroup_regression_test.sh test2 attempts to mount a cgroup
> filesystem and expects a cgroup v1 hierarchy. On systems using
> cgroup v2 (unified hierarchy), the test fails with:
>
> TFAIL: Failed to mount cgroup filesystem
>
> because the legacy cgroup v1 mount layout is not available.
> Use the cgroup_lib.sh helpers to detect the cgroup version:
>
> cgroup_require "memory"
> cgroup_version=$(cgroup_get_version "memory")
>
> If the memory controller is on a cgroup v2 hierarchy, mark the
> test as TCONF since it is only applicable to cgroup v1.
>
> This avoids false failures when running the controllers suite
> on systems where cgroup v2 is enabled.
>
> Changelog:
> V2 -> V2
> 1. Use cgroup_lib.sh helpers to detect the cgroup version instead of relying on the /sys/fs/cgroup/cgroup.controllers file check.
> Older Patch link: https://lore.kernel.org/ltp/20260316115800.GA311158@pevik/T/#mc4b1bb1d0f73d0267a74f3de9764fa8fb398eecc
>
> Signed-off-by: Samir <samir@linux.ibm.com>
> ---
> .../controllers/cgroup/cgroup_regression_test.sh | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
> index 276231fe8..cc8fa1f99 100755
> --- a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
> +++ b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
> @@ -117,6 +117,17 @@ test2()
> {
> local val1
> local val2
> + local cgroup_version
> +
> + # This test is specific to cgroup v1
> + # Use cgroup_lib.sh standard way for version check
The tst_res printing is clear enough, so we do not need code comments here.
I modified a bit and merged this patch, thanks!
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2026-03-17 9:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-17 8:42 [LTP] [PATCH] [LTP v2] controllers/cgroup: Skip regression test on cgroup v2 systems Samir
2026-03-17 9:59 ` Li Wang via ltp [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=abkl9sUAP6H0W86Y@redhat.com \
--to=ltp@lists.linux.it \
--cc=liwang@redhat.com \
--cc=samir@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox