summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-11-24 15:29:06 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-11-24 15:29:06 +0100
commitdd202b88590910572b5f546d631e687f215a74b1 (patch)
tree43257a31fd0e4be4751c35e237d6d56d0a75af04 /test
parent698470609cf47201101ac0e0cc541f68fb7ee8ba (diff)
downloadsystemd-dd202b88590910572b5f546d631e687f215a74b1.tar.gz
systemd-dd202b88590910572b5f546d631e687f215a74b1.tar.bz2
systemd-dd202b88590910572b5f546d631e687f215a74b1.zip
test: skip DELEGATE test if the kernel can't do cgroupv2 (#7445)
Fixes: #7440
Diffstat (limited to 'test')
-rwxr-xr-xtest/TEST-19-DELEGATE/testsuite.sh20
1 files changed, 12 insertions, 8 deletions
diff --git a/test/TEST-19-DELEGATE/testsuite.sh b/test/TEST-19-DELEGATE/testsuite.sh
index 3fbf347177..c738bea10e 100755
--- a/test/TEST-19-DELEGATE/testsuite.sh
+++ b/test/TEST-19-DELEGATE/testsuite.sh
@@ -4,16 +4,20 @@
set -ex
set -o pipefail
-systemd-run --wait --unit=test0.service -p "DynamicUser=1" -p "Delegate=" \
- test -w /sys/fs/cgroup/system.slice/test0.service/ -a \
- -w /sys/fs/cgroup/system.slice/test0.service/cgroup.procs -a \
- -w /sys/fs/cgroup/system.slice/test0.service/cgroup.subtree_control
+if grep -q cgroup2 /proc/filesystems ; then
+ systemd-run --wait --unit=test0.service -p "DynamicUser=1" -p "Delegate=" \
+ test -w /sys/fs/cgroup/system.slice/test0.service/ -a \
+ -w /sys/fs/cgroup/system.slice/test0.service/cgroup.procs -a \
+ -w /sys/fs/cgroup/system.slice/test0.service/cgroup.subtree_control
-systemd-run --wait --unit=test1.service -p "DynamicUser=1" -p "Delegate=memory pids" \
- grep memory /sys/fs/cgroup/system.slice/test1.service/cgroup.controllers
+ systemd-run --wait --unit=test1.service -p "DynamicUser=1" -p "Delegate=memory pids" \
+ grep memory /sys/fs/cgroup/system.slice/test1.service/cgroup.controllers
-systemd-run --wait --unit=test2.service -p "DynamicUser=1" -p "Delegate=memory pids" \
- grep pids /sys/fs/cgroup/system.slice/test2.service/cgroup.controllers
+ systemd-run --wait --unit=test2.service -p "DynamicUser=1" -p "Delegate=memory pids" \
+ grep pids /sys/fs/cgroup/system.slice/test2.service/cgroup.controllers
+else
+ echo "Skipping TEST-19-DELEGATE, as the kernel doesn't actually support cgroupsv2" >&2
+fi
echo OK > /testok