aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/test
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-08-09 14:48:06 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-08-09 16:05:46 +0200
commit3a2fe60529aff48ba86c979157df9c1a7eefd658 (patch)
treea1aa085af769e963399a09479bcbf1751476e4f7 /sys/linux/test
parent922e8e27343704155b81f50ddd3316ec04c9d299 (diff)
executor: fix cgroups
1. Create per-proc cgroup in executor. 2. Setup cgroups after chdir into test dir (it assumes relative paths against test dir). 3. Add test.
Diffstat (limited to 'sys/linux/test')
-rw-r--r--sys/linux/test/cgroup15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/linux/test/cgroup b/sys/linux/test/cgroup
new file mode 100644
index 000000000..db6fb7317
--- /dev/null
+++ b/sys/linux/test/cgroup
@@ -0,0 +1,15 @@
+# Basic test for cgroups and executor cgroup setup.
+# This inherently does not work with sandbox="" because sandbox does part of setup.
+# TODO(dvyukov): sandbox=setuid has some permissions setup problems.
+# requires: -sandbox= -sandbox=setuid -C,norepeat
+
+r0 = getpid()
+r1 = openat(0xffffffffffffff9c, &(0x7f0000000000)='./cgroup/cgroup.procs\x00', 0x2, 0x0)
+read(r1, &(0x7f0000000100)="00", 0x1)
+write$cgroup_pid(r1, &(0x7f0000000100)=r0, 0x12)
+close(r1)
+openat(0xffffffffffffff9c, &(0x7f0000000000)='./cgroup/pids.max\x00', 0x2, 0x0)
+openat(0xffffffffffffff9c, &(0x7f0000000000)='./cgroup.cpu/cgroup.procs\x00', 0x2, 0x0)
+openat(0xffffffffffffff9c, &(0x7f0000000000)='./cgroup.cpu/cpuset.cpus\x00', 0x2, 0x0)
+openat(0xffffffffffffff9c, &(0x7f0000000000)='./cgroup.net/cgroup.procs\x00', 0x2, 0x0)
+openat(0xffffffffffffff9c, &(0x7f0000000000)='./cgroup.net/devices.allow\x00', 0x1, 0x0)