Loading nixos/tests/non-default-filesystems.nix +39 −0 Original line number Diff line number Diff line Loading @@ -128,4 +128,43 @@ with pkgs.lib; assert "erofs" in file_contents ''; }; squashfs = let fsImage = "/tmp/non-default-filesystem.img"; in makeTest { name = "non-default-filesystems-squashfs"; meta.maintainers = with maintainers; [ nikstur ]; nodes.machine = { virtualisation.qemu.drives = [{ name = "non-default-filesystem"; file = fsImage; deviceExtraOpts.serial = "non-default"; }]; virtualisation.fileSystems."/non-default" = { device = "/dev/disk/by-id/virtio-non-default"; fsType = "squashfs"; neededForBoot = true; }; }; testScript = '' import subprocess with open("filesystem", "w") as f: f.write("squashfs") subprocess.run([ "${pkgs.squashfsTools}/bin/mksquashfs", "filesystem", "${fsImage}", ]) assert "squashfs" in machine.succeed("cat /non-default/filesystem") ''; }; } Loading
nixos/tests/non-default-filesystems.nix +39 −0 Original line number Diff line number Diff line Loading @@ -128,4 +128,43 @@ with pkgs.lib; assert "erofs" in file_contents ''; }; squashfs = let fsImage = "/tmp/non-default-filesystem.img"; in makeTest { name = "non-default-filesystems-squashfs"; meta.maintainers = with maintainers; [ nikstur ]; nodes.machine = { virtualisation.qemu.drives = [{ name = "non-default-filesystem"; file = fsImage; deviceExtraOpts.serial = "non-default"; }]; virtualisation.fileSystems."/non-default" = { device = "/dev/disk/by-id/virtio-non-default"; fsType = "squashfs"; neededForBoot = true; }; }; testScript = '' import subprocess with open("filesystem", "w") as f: f.write("squashfs") subprocess.run([ "${pkgs.squashfsTools}/bin/mksquashfs", "filesystem", "${fsImage}", ]) assert "squashfs" in machine.succeed("cat /non-default/filesystem") ''; }; }