diff options
Diffstat (limited to 'infra/libkookie/nixpkgs/nixos/tests/docker-tools.nix')
-rw-r--r-- | infra/libkookie/nixpkgs/nixos/tests/docker-tools.nix | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/infra/libkookie/nixpkgs/nixos/tests/docker-tools.nix b/infra/libkookie/nixpkgs/nixos/tests/docker-tools.nix index edb9aec62db3..3d1e39a379c1 100644 --- a/infra/libkookie/nixpkgs/nixos/tests/docker-tools.nix +++ b/infra/libkookie/nixpkgs/nixos/tests/docker-tools.nix @@ -115,9 +115,10 @@ import ./make-test-python.nix ({ pkgs, ... }: { "docker load --input='${examples.nginx}'", "docker run --name nginx -d -p 8000:80 ${examples.nginx.imageName}", ) - docker.wait_until_succeeds("curl http://localhost:8000/") + docker.wait_until_succeeds("curl -f http://localhost:8000/") docker.succeed( - "docker rm --force nginx", "docker rmi '${examples.nginx.imageName}'", + "docker rm --force nginx", + "docker rmi '${examples.nginx.imageName}'", ) with subtest("A pulled image can be used as base image"): @@ -234,5 +235,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}'", + ) + assert ( + docker.succeed( + "docker inspect ${pkgs.dockerTools.examples.cross.imageName} " + + "| ${pkgs.jq}/bin/jq -r .[].Architecture" + ).strip() + == "${if pkgs.system == "aarch64-linux" then "amd64" else "arm64v8"}" + ) ''; }) |