]> git.scottworley.com Git - nixos-qemu-vm-isolation/blame - checks/mount-grep.nix
Drop support for < 23.05
[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 ]; };
0fb3685a
SW
11 useNixStoreImage = {
12 virtualisation = {
ab670ada 13 sharedDirectories = pkgs.lib.mkForce { };
0fb3685a
SW
14 useNixStoreImage = true;
15 };
16 };
69619e0b
SW
17 };
18
19 testScript = ''
20 start_all()
21 shared.wait_for_unit("multi-user.target")
22 private.wait_for_unit("multi-user.target")
0fb3685a 23 useNixStoreImage.wait_for_unit("multi-user.target")
69619e0b
SW
24
25 shared.succeed("[[ $(mount | grep -c virt) -gt 0 ]]")
26 private.succeed("[[ $(mount | grep -c virt) -eq 0 ]]")
0fb3685a 27 useNixStoreImage.succeed("[[ $(mount | grep -c virt) -eq 0 ]]")
e1430264
SW
28
29 shared.succeed("[[ -e ${pkgs.pv} ]]")
30 private.fail("[[ -e ${pkgs.pv} ]]")
47cb654f 31 useNixStoreImage.fail("[[ -e ${pkgs.pv} ]]")
69619e0b
SW
32 '';
33}