]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: load the io controller before checking if io.latency exists
authorFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 5 Dec 2023 11:22:20 +0000 (12:22 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 5 Dec 2023 19:58:48 +0000 (19:58 +0000)
Otherwise the following test gets always skipped.

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

index 348c164b86f2c9757df56fa6c620d7ab3afd44d6..5fb7dddf8915315bb2394430e8c6d334ec3b8079 100755 (executable)
@@ -119,8 +119,9 @@ if ! systemd-detect-virt -cq; then
         -p IODeviceWeight="/foo/bar 999"
     )
 
+    systemctl set-property system.slice IOAccounting=yes
     # io.latency not available by default on Debian stable
-    if [ -e /sys/fs/cgroup/system.slice/io.latency ]; then
+    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