about summary refs log tree commit diff
path: root/nixos/tests/containers-unified-hierarchy.nix
diff options
context:
space:
mode:
authorJakub Okoński <jakub@okonski.org>2022-10-29 22:22:57 +0200
committerJakub Okoński <jakub@okonski.org>2022-11-06 17:12:02 +0100
commit12508ac79a3b940d42580e9cfb7d2037e7af3b00 (patch)
tree5d15998a7a2d4ad0f248aa35de8b9a431ce4689e /nixos/tests/containers-unified-hierarchy.nix
parentb0bce6ae731d5be0aed3277eab29d7ae7491d08d (diff)
nixos-container: force systemd-nspawn to use unified cgroups hierarchy
Diffstat (limited to 'nixos/tests/containers-unified-hierarchy.nix')
-rw-r--r--nixos/tests/containers-unified-hierarchy.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/nixos/tests/containers-unified-hierarchy.nix b/nixos/tests/containers-unified-hierarchy.nix
new file mode 100644
index 0000000000000..978d59e12c8a1
--- /dev/null
+++ b/nixos/tests/containers-unified-hierarchy.nix
@@ -0,0 +1,21 @@
+import ./make-test-python.nix ({ pkgs, lib, ... }: {
+  name = "containers-unified-hierarchy";
+  meta = {
+    maintainers = with lib.maintainers; [ farnoy ];
+  };
+
+  nodes.machine = { ... }: {
+    containers = {
+      test-container = {
+        autoStart = true;
+        config = { };
+      };
+    };
+  };
+
+  testScript = ''
+    machine.wait_for_unit("default.target")
+
+    machine.succeed("echo 'stat -fc %T /sys/fs/cgroup/ | grep cgroup2fs' | nixos-container root-login test-container")
+  '';
+})