]> git.scottworley.com Git - nixos-qemu-vm-isolation/blobdiff - checks/mount-grep.nix
Allow this to be used as a channel
[nixos-qemu-vm-isolation] / checks / mount-grep.nix
index f8fed0e2af7a8b0188379f7a25a5d66e67eeb989..99084eaf3b8f461b9c934287a72db00e14f26fa6 100644 (file)
@@ -1,17 +1,31 @@
-{ pkgs, ... }: {
+{ lib, pkgs, ... }: {
   name = "qemu-private-store-mount-grep";
 
   nodes = {
     shared = _: { };
     private = _: { imports = [ ../modules/qemu-vm-isolation.nix ]; };
   name = "qemu-private-store-mount-grep";
 
   nodes = {
     shared = _: { };
     private = _: { imports = [ ../modules/qemu-vm-isolation.nix ]; };
+    useNixStoreImage = {
+      virtualisation = {
+        sharedDirectories = lib.mkForce { };
+        useNixStoreImage = true;
+      };
+    };
   };
 
   testScript = ''
     start_all()
     shared.wait_for_unit("multi-user.target")
     private.wait_for_unit("multi-user.target")
   };
 
   testScript = ''
     start_all()
     shared.wait_for_unit("multi-user.target")
     private.wait_for_unit("multi-user.target")
+    useNixStoreImage.wait_for_unit("multi-user.target")
 
     shared.succeed("[[ $(mount | grep -c virt) -gt 0 ]]")
     private.succeed("[[ $(mount | grep -c virt) -eq 0 ]]")
 
     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} ]]")
   '';
 }
   '';
 }