nixos/tests/misc: account for cgroupv2
Since #104094 (d22b3ed4bcd24dcc96fd9f99c75bb568bffe2a8c), NixOS is
using the unified cgroup hierarchy by default (aka cgroupv2).
This means the blkio controller isn't there, so we should test for
something else (e.g. the presence of the io controller).
Fixes #105581.
commitb5a328e58f32354676310c511e3834d2b805f810
authorLuke Granger-Brown <git@lukegb.com>
dateTue 1 Dec 2020, 16:03 (6 years ago)
parent9d82d8b
nixos/tests/misc.nix+2−2
@@ -88,8 +88,8 @@ import ./make-test-python.nix ({ pkgs, ...} : rec {
8888 with subtest("whether kernel.poweroff_cmd is set"):
8989 machine.succeed('[ -x "$(cat /proc/sys/kernel/poweroff_cmd)" ]')
9090
91− with subtest("whether the blkio controller is properly enabled"):
92− machine.succeed("[ -e /sys/fs/cgroup/blkio/blkio.reset_stats ]")
91+ with subtest("whether the io cgroupv2 controller is properly enabled"):
92+ machine.succeed("grep -q '\\bio\\b' /sys/fs/cgroup/cgroup.controllers")
9393
9494 with subtest("whether we have a reboot record in wtmp"):
9595 machine.shutdown