diff options
Diffstat (limited to 'nixos/tests/appliance-repart-image.nix')
-rw-r--r-- | nixos/tests/appliance-repart-image.nix | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/nixos/tests/appliance-repart-image.nix b/nixos/tests/appliance-repart-image.nix index 3f256db846214..1c4495baba131 100644 --- a/nixos/tests/appliance-repart-image.nix +++ b/nixos/tests/appliance-repart-image.nix @@ -8,6 +8,9 @@ let rootPartitionLabel = "root"; + imageId = "nixos-appliance"; + imageVersion = "1-rc1"; + bootLoaderConfigPath = "/loader/entries/nixos.conf"; kernelPath = "/EFI/nixos/kernel.efi"; initrdPath = "/EFI/nixos/initrd.efi"; @@ -29,6 +32,9 @@ in # TODO(raitobezarius): revisit this when #244907 lands boot.loader.grub.enable = false; + system.image.id = imageId; + system.image.version = imageVersion; + virtualisation.fileSystems = lib.mkForce { "/" = { device = "/dev/disk/by-partlabel/${rootPartitionLabel}"; @@ -99,7 +105,7 @@ in "-f", "qcow2", "-b", - "${nodes.machine.system.build.image}/image.raw", + "${nodes.machine.system.build.image}/${nodes.machine.image.repart.imageFile}", "-F", "raw", tmp_disk_image.name, @@ -108,6 +114,10 @@ in # Set NIX_DISK_IMAGE so that the qemu script finds the right disk image. os.environ['NIX_DISK_IMAGE'] = tmp_disk_image.name + os_release = machine.succeed("cat /etc/os-release") + assert 'IMAGE_ID="${imageId}"' in os_release + assert 'IMAGE_VERSION="${imageVersion}"' in os_release + bootctl_status = machine.succeed("bootctl status") assert "${bootLoaderConfigPath}" in bootctl_status assert "${kernelPath}" in bootctl_status |