]> git.scottworley.com Git - nixos-qemu-vm-isolation/blobdiff - checks/mount-grep.nix
Follow NixOS PR 236656's changes about device naming
[nixos-qemu-vm-isolation] / checks / mount-grep.nix
index 99084eaf3b8f461b9c934287a72db00e14f26fa6..5354d26c41492f7bb33e2539ef8fee989b9b3f69 100644 (file)
@@ -1,12 +1,20 @@
-{ lib, pkgs, ... }: {
+pkgs: {
   name = "qemu-private-store-mount-grep";
 
+  hostPkgs = pkgs;
+
+  includeTestScriptReferences = false;
+
   nodes = {
     shared = _: { };
     private = _: { imports = [ ../modules/qemu-vm-isolation.nix ]; };
+    privateErofs = _: {
+      imports = [ ../modules/qemu-vm-isolation.nix ];
+      virtualisation.qemu.isolation.nixStoreFilesystemType = "erofs";
+    };
     useNixStoreImage = {
       virtualisation = {
-        sharedDirectories = lib.mkForce { };
+        sharedDirectories = pkgs.lib.mkForce { };
         useNixStoreImage = true;
       };
     };
 
   testScript = ''
     start_all()
-    shared.wait_for_unit("multi-user.target")
-    private.wait_for_unit("multi-user.target")
-    useNixStoreImage.wait_for_unit("multi-user.target")
+    for machine in [shared, private, privateErofs, useNixStoreImage]:
+      machine.wait_for_unit("multi-user.target")
 
     shared.succeed("[[ $(mount | grep -c virt) -gt 0 ]]")
-    private.succeed("[[ $(mount | grep -c virt) -eq 0 ]]")
-    useNixStoreImage.succeed("[[ $(mount | grep -c virt) -eq 0 ]]")
-
     shared.succeed("[[ -e ${pkgs.pv} ]]")
-    private.fail("[[ -e ${pkgs.pv} ]]")
 
-    # useNixStoreImage isn't ready until this works:
-    # useNixStoreImage.fail("[[ -e ${pkgs.pv} ]]")
+    for machine in [private, privateErofs, useNixStoreImage]:
+      machine.succeed("[[ $(mount | grep -c virt) -eq 0 ]]")
+      machine.fail("[[ -e ${pkgs.pv} ]]")
   '';
 }