summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2020-06-18 17:29:21 +0200
committerRobert Hensing <robert@roberthensing.nl>2020-06-19 10:08:34 +0200
commitcaf47063b4b5d82a61753ea437f97e5642eedd03 (patch)
tree5a1ccb2f975eb72863b060cde3f6f936fb0fbc59 /nixos
parentc04e95573ace9892d9898e5821e66cef29c164b5 (diff)
dockerTools: test that tar keeps nix binary symlinks intact
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/docker-tools.nix14
1 files changed, 14 insertions, 0 deletions
diff --git a/nixos/tests/docker-tools.nix b/nixos/tests/docker-tools.nix
index 2375d15b38134..c48e5b0797628 100644
--- a/nixos/tests/docker-tools.nix
+++ b/nixos/tests/docker-tools.nix
@@ -42,6 +42,20 @@ import ./make-test-python.nix ({ pkgs, ... }: {
             "docker rmi ${examples.nix.imageName}",
         )
 
+    with subtest("The nix binary symlinks are intact"):
+        docker.succeed(
+            "docker load --input='${examples.nix}'",
+            "docker run --rm ${examples.nix.imageName} ${pkgs.bash}/bin/bash -c 'test nix == $(readlink ${pkgs.nix}/bin/nix-daemon)'",
+            "docker rmi ${examples.nix.imageName}",
+        )
+
+    with subtest("The nix binary symlinks are intact when the image is layered"):
+        docker.succeed(
+            "docker load --input='${examples.nixLayered}'",
+            "docker run --rm ${examples.nixLayered.imageName} ${pkgs.bash}/bin/bash -c 'test nix == $(readlink ${pkgs.nix}/bin/nix-daemon)'",
+            "docker rmi ${examples.nixLayered.imageName}",
+        )
+
     with subtest("The pullImage tool works"):
         docker.succeed(
             "docker load --input='${examples.nixFromDockerHub}'",