From 1b4933376f4e6738ff3a0c42a2e27c6d21c07e7c Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Wed, 29 Jul 2020 16:42:40 -0400 Subject: Add a system test to verify --runtime is preserved Signed-off-by: Matthew Heon --- test/system/helpers.bash | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/system/helpers.bash') diff --git a/test/system/helpers.bash b/test/system/helpers.bash index 73cf1e5b2..2cced10c2 100644 --- a/test/system/helpers.bash +++ b/test/system/helpers.bash @@ -253,6 +253,7 @@ function is_cgroupsv1() { ! is_cgroupsv2 } +# True if cgroups v2 are enabled function is_cgroupsv2() { cgroup_type=$(stat -f -c %T /sys/fs/cgroup) test "$cgroup_type" = "cgroup2fs" @@ -305,6 +306,15 @@ function skip_if_no_selinux() { fi } +####################### +# skip_if_cgroupsv1 # ...with an optional message +####################### +function skip_if_cgroupsv1() { + if ! is_cgroupsv2; then + skip "${1:-test requires cgroupsv2}" + fi +} + ######### # die # Abort with helpful message ######### -- cgit v1.2.3-54-g00ecf