diff options
author | Domen Kožar <domen@dev.si> | 2020-03-08 23:05:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-08 23:05:27 +0100 |
commit | 508a2c684964b66d4c3e56c912b0dd52248abd04 (patch) | |
tree | ee25929bc60113b88c8091a07a419aca2bd5378b /nixos | |
parent | dd5e9ab4f2953c0e5c76f3e7b4763a6fe3e9c692 (diff) | |
parent | 6dab1b50a63fa6e9dfb9bd9eddd3f5d5c7b055ef (diff) | |
download | nixpkgs-508a2c684964b66d4c3e56c912b0dd52248abd04.tar nixpkgs-508a2c684964b66d4c3e56c912b0dd52248abd04.tar.gz nixpkgs-508a2c684964b66d4c3e56c912b0dd52248abd04.tar.bz2 nixpkgs-508a2c684964b66d4c3e56c912b0dd52248abd04.tar.lz nixpkgs-508a2c684964b66d4c3e56c912b0dd52248abd04.tar.xz nixpkgs-508a2c684964b66d4c3e56c912b0dd52248abd04.tar.zst nixpkgs-508a2c684964b66d4c3e56c912b0dd52248abd04.zip |
Merge pull request #80921 from hercules-ci/buildLayeredImage-allow-empty-store
buildLayeredImage: Allow empty store, no paths to add
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/tests/docker-tools.nix | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/nixos/tests/docker-tools.nix b/nixos/tests/docker-tools.nix index 54dd97e5b13..51b472fcf9c 100644 --- a/nixos/tests/docker-tools.nix +++ b/nixos/tests/docker-tools.nix @@ -137,5 +137,22 @@ import ./make-test-python.nix ({ pkgs, ... }: { # Ensure the two output paths (ls and hello) are in the layer "docker run bulk-layer ls /bin/hello", ) + + with subtest("Ensure correct behavior when no store is needed"): + # This check tests two requirements simultaneously + # 1. buildLayeredImage can build images that don't need a store. + # 2. Layers of symlinks are eliminated by the customization layer. + # + docker.succeed( + "docker load --input='${pkgs.dockerTools.examples.no-store-paths}'" + ) + + # Busybox will not recognize argv[0] and print an error message with argv[0], + # but it confirms that the custom-true symlink is present. + docker.succeed("docker run --rm no-store-paths custom-true |& grep custom-true") + + # This check may be loosened to allow an *empty* store rather than *no* store. + docker.succeed("docker run --rm no-store-paths ls /") + docker.fail("docker run --rm no-store-paths ls /nix/store") ''; }) |