From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] cgroup_regression_test.sh: fixed test_5
Date: Tue, 11 Dec 2018 12:16:49 +0100 [thread overview]
Message-ID: <20181211111648.GA14703@dell5510> (raw)
In-Reply-To: <20181206164120.42877-1-cristian.marussi@arm.com>
Hi Cristian,
> test_5 checked for possible regressions using a pair of cgroups mounts
> operations designed to expose a kernel crash; the trigger being the
> attempt to co-mount and mount the same cgroup subsystem onto two
> distinct fs hierarchies: the expected failure in the second mount
> attempt was not properly handled in 2.6.29-rc2 and lead to a kernel
> crash.
> Unfortunately the test assumed that the randomly chosen subsystems
> were NOT already mounted somewhere when attempting the first co-mount:
> this assumption is falsified when userspace is configured to mount all
> available subsystems at /sysfs on boot (systemd).
> So the test was failing straight away during the setup phase:
> cgroup_regression_test 5 TFAIL : ltpapicmd.c:188: mount pids and hugetlb failed
> Being not trivial to forcibly release and unmount the populated
> /sysfs cgroups once booted, the script has been reviewed to detect
> this condition upfront and cope with it dynamically:
> - if not already mounted: co-mount + failing mount (as before)
> - already mounted: use existing mntpoint + failing co-mount
> Since the original fix was on a 2.6.29 kernel the surrounding cgroup
> code has changed a lot and so the patch was no more trivially 'revertable'
> for testing purposes: as such this reviewed test script has been verified
> using a QEMU x86_64 instance running a Kernel 2.6.39 with and without
> the known fix as detailed in test_5 comments.
Thanks for your testing.
> Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Acked-by: Petr Vorel <pvorel@suse.cz>
Thanks for your patch! Two tiny details bellow.
...
> +++ b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
> @@ -253,6 +253,10 @@ test_4()
> #---------------------------------------------------------------------------
> test_5()
> {
> + local mounted
> + local failing
> + local t_mntpoint
I'd use just mntpoint. But that's nitpicking, up to you.
> + cat /proc/mounts | grep cgroup | grep -q $subsys1 2> /dev/null && mounted=$subsys1
> + [ -z "$mounted" ] && cat /proc/mounts | grep cgroup | grep -q $subsys2 2> /dev/null && mounted=$subsys2
Is stderr redirection really needed?
Kind regards,
Petr
next prev parent reply other threads:[~2018-12-11 11:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-06 16:41 [LTP] [PATCH v2] cgroup_regression_test.sh: fixed test_5 Cristian Marussi
2018-12-11 11:16 ` Petr Vorel [this message]
2018-12-11 12:38 ` Cristian Marussi
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=20181211111648.GA14703@dell5510 \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
/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