[lxc-devel] [PATCH] lxc-test-unpriv: test for different cgroups per subsystem
Stéphane Graber
stgraber at ubuntu.com
Mon Oct 27 20:31:48 UTC 2014
On Thu, Oct 09, 2014 at 04:50:49PM +0000, Serge Hallyn wrote:
> To keep the test case simply, only do it if cgm exists, as it should
> in any reasonably new cgmanager package.
>
> Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>
> ---
> src/tests/lxc-test-unpriv | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/src/tests/lxc-test-unpriv b/src/tests/lxc-test-unpriv
> index a27857c..93c91a9 100755
> --- a/src/tests/lxc-test-unpriv
> +++ b/src/tests/lxc-test-unpriv
> @@ -141,4 +141,22 @@ p1=$(run_cmd lxc-info -n c2 -p -H)
>
> run_cmd lxc-stop -n c2
>
> +if which cgm >/dev/null 2>&1; then
> + echo "Testing containers under different cgroups per subsystem"
> + run_cmd cgm create freezer x1/x2
> + cgm movepid freezer x1 $$
> + run_cmd lxc-start -n c1 -d
> + p1=$(run_cmd lxc-info -n c1 -p -H)
> + [ "$p1" != "-1" ] || { echo "Failed to start container c1"; false; }
> + run_cmd lxc-info -n c1
> + run_cmd lxc-attach -n c1 -- /bin/true
> + run_cmd lxc-cgroup -n c1 freezer.state
> +
> + echo "Testing lxc-attach and lxc-cgroup from different cgroup"
> + cgm movepid freezer x2 $$
> + run_cmd lxc-attach -n c1 -- /bin/true
> + run_cmd lxc-cgroup -n c1 freezer.state
> + run_cmd lxc-cgroup -n c1 memory.limit_in_bytes
> +fi
> +
> DONE=1
> --
> 2.1.0
>
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20141027/7b05828f/attachment.sig>
More information about the lxc-devel
mailing list