]> git.scottworley.com Git - nixos-qemu-vm-isolation/blame - checks/mount-grep.nix
Use the new nixpkgs.lib.nixos.runTest interface for checks
[nixos-qemu-vm-isolation] / checks / mount-grep.nix
CommitLineData
ab670ada 1pkgs: {
69619e0b
SW
2 name = "qemu-private-store-mount-grep";
3
ab670ada
SW
4 hostPkgs = pkgs;
5
69619e0b
SW
6 nodes = {
7 shared = _: { };
8 private = _: { imports = [ ../modules/qemu-vm-isolation.nix ]; };
0fb3685a
SW
9 useNixStoreImage = {
10 virtualisation = {
ab670ada 11 sharedDirectories = pkgs.lib.mkForce { };
0fb3685a
SW
12 useNixStoreImage = true;
13 };
14 };
69619e0b
SW
15 };
16
17 testScript = ''
18 start_all()
19 shared.wait_for_unit("multi-user.target")
20 private.wait_for_unit("multi-user.target")
0fb3685a 21 useNixStoreImage.wait_for_unit("multi-user.target")
69619e0b
SW
22
23 shared.succeed("[[ $(mount | grep -c virt) -gt 0 ]]")
24 private.succeed("[[ $(mount | grep -c virt) -eq 0 ]]")
0fb3685a 25 useNixStoreImage.succeed("[[ $(mount | grep -c virt) -eq 0 ]]")
e1430264
SW
26
27 shared.succeed("[[ -e ${pkgs.pv} ]]")
28 private.fail("[[ -e ${pkgs.pv} ]]")
0fb3685a
SW
29
30 # useNixStoreImage isn't ready until this works:
31 # useNixStoreImage.fail("[[ -e ${pkgs.pv} ]]")
69619e0b
SW
32 '';
33}