]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: io.latency cgroup support might not be available, skip test
authorLuca Boccassi <bluca@debian.org>
Fri, 27 Oct 2023 23:46:40 +0000 (00:46 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Sat, 28 Oct 2023 08:08:42 +0000 (08:08 +0000)
It doesn't seem to be enabled on Debian stable, and the test fails.

Follow-up for 5efc8183c9cf9b

test/units/testsuite-07.exec-context.sh

index d6a55cafe415e0383e1ce4983f8100e731f20a43..477b9e84dac4848b1e8d5fb40c4585b097299c33 100755 (executable)
@@ -109,8 +109,11 @@ if ! systemd-detect-virt -cq; then
         -p IODeviceWeight="/foo/bar 999"
     )
 
-    systemd-run --wait --pipe --unit "$SERVICE_NAME" "${ARGUMENTS[@]}" \
-        bash -xec "diff <(echo $EXPECTED_IO_MAX) $CGROUP_PATH/io.max; diff <(echo $EXPECTED_IO_LATENCY) $CGROUP_PATH/io.latency"
+    # io.latency not available by default on Debian stable
+    if [ -e /sys/fs/cgroup/system.slice/io.latency ]; then
+        systemd-run --wait --pipe --unit "$SERVICE_NAME" "${ARGUMENTS[@]}" \
+            bash -xec "diff <(echo $EXPECTED_IO_MAX) $CGROUP_PATH/io.max; diff <(echo $EXPECTED_IO_LATENCY) $CGROUP_PATH/io.latency"
+    fi
 
     # CPUScheduling=
     ARGUMENTS=(