1 # A test that imports k3s airgapped images and verifies that all expected images are present
2 import ../make-test-python.nix (
5 name = "${k3s.name}-airgap-images";
6 meta.maintainers = lib.teams.k3s.members;
9 # k3s uses enough resources the default vm fails.
10 virtualisation.memorySize = 1536;
11 virtualisation.diskSize = 4096;
17 # Slightly reduce resource usage
20 "--disable local-storage"
21 "--disable metrics-server"
25 images = [ k3s.airgapImages ];
33 machine.wait_for_unit("k3s")
34 machine.wait_until_succeeds("journalctl -r --no-pager -u k3s | grep \"Imported images from /var/lib/rancher/k3s/agent/images/\"", timeout=120)
35 images = json.loads(machine.succeed("crictl img -o json"))
36 image_names = [i["repoTags"][0] for i in images["images"]]
37 with open("${k3s.imagesList}") as expected_images:
38 for line in expected_images:
39 assert line.rstrip() in image_names, f"The image {line.rstrip()} is not present in the airgap images archive"