1 # Tests the contents attribute of nixos/lib/make-disk-image.nix
2 # including its user, group, and mode attributes.
3 { system ? builtins.currentSystem,
5 pkgs ? import ../.. { inherit system config; }
8 with import ../lib/testing-python.nix { inherit system pkgs; };
11 with import common/ec2.nix { inherit makeTest pkgs; };
14 config = (import ../lib/eval-config.nix {
17 ../modules/testing/test-instrumentation.nix
18 ../modules/profiles/qemu-guest.nix
20 fileSystems."/".device = "/dev/disk/by-label/nixos";
21 boot.loader.grub.device = "/dev/vda";
22 boot.loader.timeout = 0;
26 image = (import ../lib/make-disk-image.nix {
31 source = pkgs.writeText "testFile" "contents";
40 name = "image-contents";
45 assert "content" in machine.succeed("cat /testFile")
46 fileDetails = machine.succeed("ls -l /testFile")
47 assert "1234" in fileDetails
48 assert "5678" in fileDetails
49 assert "rwxr-xr-x" in fileDetails