summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorWill Fancher <elvishjerricco@gmail.com>2023-09-19 23:39:51 -0400
committerWill Fancher <elvishjerricco@gmail.com>2023-11-09 17:53:48 -0500
commit9a0f523372cf836662421ef2603bfb93f568f399 (patch)
tree4042aa5606ad22c0d6438c926fda715142b4709a /nixos/tests
parentf8ba8be54b7277ee284850119dc156297633b6b3 (diff)
downloadnixpkgs-9a0f523372cf836662421ef2603bfb93f568f399.tar
nixpkgs-9a0f523372cf836662421ef2603bfb93f568f399.tar.gz
nixpkgs-9a0f523372cf836662421ef2603bfb93f568f399.tar.bz2
nixpkgs-9a0f523372cf836662421ef2603bfb93f568f399.tar.lz
nixpkgs-9a0f523372cf836662421ef2603bfb93f568f399.tar.xz
nixpkgs-9a0f523372cf836662421ef2603bfb93f568f399.tar.zst
nixpkgs-9a0f523372cf836662421ef2603bfb93f568f399.zip
systemd-stage-1: Enable backdoor in nixos tests
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/systemd-initrd-simple.nix12
1 files changed, 8 insertions, 4 deletions
diff --git a/nixos/tests/systemd-initrd-simple.nix b/nixos/tests/systemd-initrd-simple.nix
index a6a22e9d48e..2b7283a8219 100644
--- a/nixos/tests/systemd-initrd-simple.nix
+++ b/nixos/tests/systemd-initrd-simple.nix
@@ -2,16 +2,19 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
   name = "systemd-initrd-simple";
 
   nodes.machine = { pkgs, ... }: {
-    boot.initrd.systemd = {
-      enable = true;
-      emergencyAccess = true;
-    };
+    testing.initrdBackdoor = true;
+    boot.initrd.systemd.enable = true;
     virtualisation.fileSystems."/".autoResize = true;
   };
 
   testScript = ''
     import subprocess
 
+    with subtest("testing initrd backdoor"):
+        machine.wait_for_unit("initrd.target")
+        machine.succeed("systemctl status initrd-fs.target")
+        machine.switch_root()
+
     with subtest("handover to stage-2 systemd works"):
         machine.wait_for_unit("multi-user.target")
         machine.succeed("systemd-analyze | grep -q '(initrd)'")  # direct handover
@@ -37,6 +40,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
         subprocess.check_call(["qemu-img", "resize", "vm-state-machine/machine.qcow2", "+1G"])
 
         machine.start()
+        machine.switch_root()
         newAvail = machine.succeed("df --output=avail / | sed 1d")
 
         assert int(oldAvail) < int(newAvail), "File system did not grow"