]> git.scottworley.com Git - nixos-qemu-vm-isolation/blob - checks/mount-grep.nix
f7eb3a327a367e2ec4d16dee8cf271f0308b0e03
[nixos-qemu-vm-isolation] / checks / mount-grep.nix
1 pkgs: {
2 name = "qemu-private-store-mount-grep";
3
4 hostPkgs = pkgs;
5
6 includeTestScriptReferences = false;
7
8 nodes = {
9 shared = _: { };
10 private = _: { imports = [ ../modules/qemu-vm-isolation.nix ]; };
11 useNixStoreImage = {
12 virtualisation = {
13 sharedDirectories = pkgs.lib.mkForce { };
14 useNixStoreImage = true;
15 };
16 };
17 };
18
19 testScript = ''
20 start_all()
21 for machine in [shared, private, useNixStoreImage]:
22 machine.wait_for_unit("multi-user.target")
23
24 shared.succeed("[[ $(mount | grep -c virt) -gt 0 ]]")
25 shared.succeed("[[ -e ${pkgs.pv} ]]")
26
27 for machine in [private, useNixStoreImage]:
28 machine.succeed("[[ $(mount | grep -c virt) -eq 0 ]]")
29 machine.fail("[[ -e ${pkgs.pv} ]]")
30 '';
31 }