]> git.scottworley.com Git - nixos-qemu-vm-isolation/blame - checks/mount-grep.nix
Restore squashfs support with a dubious kludge
[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
47cb654f
SW
6 includeTestScriptReferences = false;
7
69619e0b
SW
8 nodes = {
9 shared = _: { };
10 private = _: { imports = [ ../modules/qemu-vm-isolation.nix ]; };
f78c24af
SW
11 privateErofs = _: {
12 imports = [ ../modules/qemu-vm-isolation.nix ];
13 virtualisation.qemu.isolation.nixStoreFilesystemType = "erofs";
14 };
a8cf2d3d
SW
15 privateSquash = _: {
16 imports = [ ../modules/qemu-vm-isolation.nix ];
17 virtualisation.qemu.isolation.nixStoreFilesystemType = "squashfs";
18 };
0fb3685a
SW
19 useNixStoreImage = {
20 virtualisation = {
ab670ada 21 sharedDirectories = pkgs.lib.mkForce { };
0fb3685a
SW
22 useNixStoreImage = true;
23 };
24 };
69619e0b
SW
25 };
26
27 testScript = ''
28 start_all()
a8cf2d3d 29 for machine in [shared, private, privateErofs, privateSquash, useNixStoreImage]:
620470ea 30 machine.wait_for_unit("multi-user.target")
69619e0b
SW
31
32 shared.succeed("[[ $(mount | grep -c virt) -gt 0 ]]")
e1430264 33 shared.succeed("[[ -e ${pkgs.pv} ]]")
620470ea 34
a8cf2d3d 35 for machine in [private, privateErofs, privateSquash, useNixStoreImage]:
620470ea
SW
36 machine.succeed("[[ $(mount | grep -c virt) -eq 0 ]]")
37 machine.fail("[[ -e ${pkgs.pv} ]]")
69619e0b
SW
38 '';
39}