summary refs log tree commit diff
path: root/nixos/tests/docker-tools.nix
diff options
context:
space:
mode:
authoradisbladis <adisbladis@gmail.com>2020-11-19 18:12:36 +0100
committeradisbladis <adisbladis@gmail.com>2020-11-19 18:13:22 +0100
commit11367b2db107f318c5ca5634a94c85d185f2c498 (patch)
tree21fe6bb905c9b35bc646b7e9240a65f1ca799f95 /nixos/tests/docker-tools.nix
parent5357abf49a9c19de84ec5333fcd07a10c05585cc (diff)
downloadnixpkgs-11367b2db107f318c5ca5634a94c85d185f2c498.tar
nixpkgs-11367b2db107f318c5ca5634a94c85d185f2c498.tar.gz
nixpkgs-11367b2db107f318c5ca5634a94c85d185f2c498.tar.bz2
nixpkgs-11367b2db107f318c5ca5634a94c85d185f2c498.tar.lz
nixpkgs-11367b2db107f318c5ca5634a94c85d185f2c498.tar.xz
nixpkgs-11367b2db107f318c5ca5634a94c85d185f2c498.tar.zst
nixpkgs-11367b2db107f318c5ca5634a94c85d185f2c498.zip
dockerTools: Add cross compilation test
Diffstat (limited to 'nixos/tests/docker-tools.nix')
-rw-r--r--nixos/tests/docker-tools.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/nixos/tests/docker-tools.nix b/nixos/tests/docker-tools.nix
index c1c41b0fc11..a20a08fc90d 100644
--- a/nixos/tests/docker-tools.nix
+++ b/nixos/tests/docker-tools.nix
@@ -234,5 +234,17 @@ import ./make-test-python.nix ({ pkgs, ... }: {
             "docker run --rm file-in-store nix-store --verify --check-contents",
             "docker run --rm file-in-store |& grep 'some data'",
         )
+
+    with subtest("Ensure cross compiled image can be loaded and has correct arch."):
+        docker.succeed(
+            "docker load --input='${pkgs.dockerTools.examples.cross-aarch64}'",
+        )
+        assert (
+            docker.succeed(
+                "docker inspect ${pkgs.dockerTools.examples.cross-aarch64.imageName} "
+                + "| ${pkgs.jq}/bin/jq -r .[].Architecture"
+            ).strip()
+            == "arm64v8"
+        )
   '';
 })