From 6b075ddc8fc02358e5bd4b41cb3c36a691a1f424 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 19 Aug 2019 17:59:30 +0200 Subject: [PATCH] nixos/systemd: add cgroup accounting test --- nixos/tests/systemd.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nixos/tests/systemd.nix b/nixos/tests/systemd.nix index 3168c026d514..1c201e3b5dcc 100644 --- a/nixos/tests/systemd.nix +++ b/nixos/tests/systemd.nix @@ -89,5 +89,12 @@ import ./make-test.nix ({ pkgs, ... }: { $machine->waitForUnit('multi-user.target'); $machine->succeed('sysctl net.core.default_qdisc | grep -q "fq_codel"'); }; + + # Test cgroup accounting is enabled + subtest "systemd cgroup accounting is enabled", sub { + $machine->waitForUnit('multi-user.target'); + $machine->succeed('systemctl show testservice1.service -p IOAccounting | grep -q "yes"'); + $machine->succeed('systemctl status testservice1.service | grep -q "CPU:"'); + }; ''; })