From b5a328e58f32354676310c511e3834d2b805f810 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Tue, 1 Dec 2020 16:03:53 +0000 Subject: [PATCH] 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. --- nixos/tests/misc.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/tests/misc.nix b/nixos/tests/misc.nix index ae150553273..40661cdca0a 100644 --- a/nixos/tests/misc.nix +++ b/nixos/tests/misc.nix @@ -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