summary refs log tree commit diff
path: root/nixos/tests/fsck.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/tests/fsck.nix')
-rw-r--r--nixos/tests/fsck.nix10
1 files changed, 7 insertions, 3 deletions
diff --git a/nixos/tests/fsck.nix b/nixos/tests/fsck.nix
index ec6bfa69ae8..31ed8bdf78c 100644
--- a/nixos/tests/fsck.nix
+++ b/nixos/tests/fsck.nix
@@ -21,13 +21,17 @@ import ./make-test-python.nix {
     boot.initrd.systemd.enable = systemdStage1;
   };
 
-  testScript = ''
+  testScript =  { nodes, ...}:
+  let
+    rootDevice = nodes.machine.virtualisation.rootDevice;
+  in
+  ''
     machine.wait_for_unit("default.target")
 
     with subtest("root fs is fsckd"):
         machine.succeed("journalctl -b | grep '${if systemdStage1
-          then "fsck.*vda.*clean"
-          else "fsck.ext4.*/dev/vda"}'")
+          then "fsck.*${builtins.baseNameOf rootDevice}.*clean"
+          else "fsck.ext4.*${rootDevice}"}'")
 
     with subtest("mnt fs is fsckd"):
         machine.succeed("journalctl -b | grep 'fsck.*vdb.*clean'")