nixos/tests/misc: account for cgroupv2

Since #104094 (d22b3ed4bc), 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.
This commit is contained in:
Luke Granger-Brown 2020-12-01 16:03:53 +00:00 committed by Frederik Rietdijk
parent 9d82d8b3c0
commit b5a328e58f

View file

@ -88,8 +88,8 @@ import ./make-test-python.nix ({ pkgs, ...} : rec {
with subtest("whether kernel.poweroff_cmd is set"):
machine.succeed('[ -x "$(cat /proc/sys/kernel/poweroff_cmd)" ]')
with subtest("whether the blkio controller is properly enabled"):
machine.succeed("[ -e /sys/fs/cgroup/blkio/blkio.reset_stats ]")
with subtest("whether the io cgroupv2 controller is properly enabled"):
machine.succeed("grep -q '\\bio\\b' /sys/fs/cgroup/cgroup.controllers")
with subtest("whether we have a reboot record in wtmp"):
machine.shutdown