about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorChristian Kemper <christian.kemper@me.com>2022-11-21 12:10:07 +0000
committerRobert Hensing <robert@roberthensing.nl>2022-12-08 20:29:09 +0100
commitf6ae4479ea712a7f478a4e0dce92bd06b6f75370 (patch)
treed4d1f0772797e9126daf51aea47c5d39d55fd040 /nixos/tests
parentf21f11aa2a02cb78651c6d57546c7d7541f9240c (diff)
dockerTools: allowing architecture to be specified
... for buildImage, buildLayeredImage and streamLayeredImage,
adding docs and tests.
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/docker-tools.nix14
1 files changed, 14 insertions, 0 deletions
diff --git a/nixos/tests/docker-tools.nix b/nixos/tests/docker-tools.nix
index e76a46131929d..71ef9ecc5d7bd 100644
--- a/nixos/tests/docker-tools.nix
+++ b/nixos/tests/docker-tools.nix
@@ -419,6 +419,20 @@ import ./make-test-python.nix ({ pkgs, ... }: {
             "docker rmi layered-image-with-path",
         )
 
+    with subtest("Ensure correct architecture is present in manifests."):
+        docker.succeed(
+            "docker load --input='${examples.build-image-with-architecture}'",
+            "docker inspect ${examples.build-image-with-architecture} "
+              + "| ${pkgs.jq}/bin/jq -er '.[] | select(.Architecture=="arm64").Architecture'",
+            "docker rmi build-image-with-architecture",
+        )
+        docker.succeed(
+            "${examples.layered-image-with-architecture} | docker load",
+            "docker inspect ${examples.layered-image-with-architecture} "
+              + "| ${pkgs.jq}/bin/jq -er '.[] | select(.Architecture=="arm64").Architecture'",
+            "docker rmi layered-image-with-architecture",
+        )
+
     with subtest("etc"):
         docker.succeed("${examples.etc} | docker load")
         docker.succeed("docker run --rm etc | grep localhost")