summary refs log tree commit diff
path: root/nixos/tests/docker-tools.nix
diff options
context:
space:
mode:
authorvroad <396351+vroad@users.noreply.github.com>2021-04-07 18:11:02 +0900
committervroad <396351+vroad@users.noreply.github.com>2021-04-07 18:11:02 +0900
commit63e7c4186f43190ca4ee44aeec10f81343573861 (patch)
treea11f1bf3733f6e9b5830888876ac19d703aba045 /nixos/tests/docker-tools.nix
parentc420e650c9d230fe9329f2ec9ad5b4cad5c21f5d (diff)
downloadnixpkgs-63e7c4186f43190ca4ee44aeec10f81343573861.tar
nixpkgs-63e7c4186f43190ca4ee44aeec10f81343573861.tar.gz
nixpkgs-63e7c4186f43190ca4ee44aeec10f81343573861.tar.bz2
nixpkgs-63e7c4186f43190ca4ee44aeec10f81343573861.tar.lz
nixpkgs-63e7c4186f43190ca4ee44aeec10f81343573861.tar.xz
nixpkgs-63e7c4186f43190ca4ee44aeec10f81343573861.tar.zst
nixpkgs-63e7c4186f43190ca4ee44aeec10f81343573861.zip
dockerTools.streamLayeredImage: Add test for fakeRootCommands
Diffstat (limited to 'nixos/tests/docker-tools.nix')
-rw-r--r--nixos/tests/docker-tools.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/nixos/tests/docker-tools.nix b/nixos/tests/docker-tools.nix
index 1cc554d002b..a71cf79c5a7 100644
--- a/nixos/tests/docker-tools.nix
+++ b/nixos/tests/docker-tools.nix
@@ -270,5 +270,13 @@ import ./make-test-python.nix ({ pkgs, ... }: {
         docker.succeed(
             "docker images --format '{{.Repository}}' | grep -F '${examples.prefixedLayeredImage.imageName}'"
         )
+
+    with subtest("buildLayeredImage supports running chown with fakeRootCommands"):
+        docker.succeed(
+            "docker load --input='${examples.layeredImageWithFakeRootCommands}'"
+        )
+        docker.succeed(
+            "docker run --rm ${examples.layeredImageWithFakeRootCommands.imageName} sh -c 'stat -c '%u' /home/jane | grep -E ^1000$'"
+        )
   '';
 })