From 11367b2db107f318c5ca5634a94c85d185f2c498 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Thu, 19 Nov 2020 18:12:36 +0100 Subject: [PATCH] dockerTools: Add cross compilation test --- nixos/tests/docker-tools.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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" + ) ''; })