about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorRobert Hensing <roberth@users.noreply.github.com>2024-02-19 18:06:54 +0100
committerGitHub <noreply@github.com>2024-02-19 18:06:54 +0100
commitd2dfcfcfad85e12e5909e7be4bd562e2debe6e52 (patch)
treecd13ae28228a7efd42367dbb44b7d184356cd67b /nixos
parent5adb86fdf90314e7d008ebdf46882cd676dc612c (diff)
parent4b603ad9cd26f71bd17d52c2f6923ce6ba163c63 (diff)
downloadnixlib-d2dfcfcfad85e12e5909e7be4bd562e2debe6e52.tar
nixlib-d2dfcfcfad85e12e5909e7be4bd562e2debe6e52.tar.gz
nixlib-d2dfcfcfad85e12e5909e7be4bd562e2debe6e52.tar.bz2
nixlib-d2dfcfcfad85e12e5909e7be4bd562e2debe6e52.tar.lz
nixlib-d2dfcfcfad85e12e5909e7be4bd562e2debe6e52.tar.xz
nixlib-d2dfcfcfad85e12e5909e7be4bd562e2debe6e52.tar.zst
nixlib-d2dfcfcfad85e12e5909e7be4bd562e2debe6e52.zip
Merge pull request #289584 from athre0z/docker-zstd
dockerTools: configurable compression schema
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/docker-tools.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/nixos/tests/docker-tools.nix b/nixos/tests/docker-tools.nix
index 7cf794382ca1..f252eb9ff61e 100644
--- a/nixos/tests/docker-tools.nix
+++ b/nixos/tests/docker-tools.nix
@@ -155,6 +155,15 @@ in {
         docker.succeed("docker images --format '{{.Tag}}' | grep -F '${examples.nixLayered.imageTag}'")
         docker.succeed("docker rmi ${examples.nixLayered.imageName}")
 
+    with subtest("Check that images with alternative compression schemas load"):
+        docker.succeed(
+            "docker load --input='${examples.bashZstdCompressed}'",
+            "docker rmi ${examples.bashZstdCompressed.imageName}",
+        )
+        docker.succeed(
+            "docker load --input='${examples.bashUncompressed}'",
+            "docker rmi ${examples.bashUncompressed.imageName}",
+        )
 
     with subtest(
         "Check if the nix store is correctly initialized by listing "
@@ -476,6 +485,18 @@ in {
             "docker run --rm ${examples.layeredImageWithFakeRootCommands.imageName} /hello/bin/layeredImageWithFakeRootCommands-hello"
         )
 
+    with subtest("mergeImage correctly deals with varying compression schemas in inputs"):
+        docker.succeed("docker load --input='${examples.mergeVaryingCompressor}'")
+
+        for sub_image, tag in [
+            ("${examples.redis.imageName}", "${examples.redis.imageTag}"),
+            ("${examples.bashUncompressed.imageName}", "${examples.bashUncompressed.imageTag}"),
+            ("${examples.bashZstdCompressed.imageName}", "${examples.bashZstdCompressed.imageTag}"),
+        ]:
+            docker.succeed(f"docker images --format '{{{{.Repository}}}}-{{{{.Tag}}}}' | grep -F '{sub_image}-{tag}'")
+            docker.succeed(f"docker rmi {sub_image}")
+
+
     with subtest("exportImage produces a valid tarball"):
         docker.succeed(
             "tar -tf ${examples.exportBash} | grep '\./bin/bash' > /dev/null"