From 63e7c4186f43190ca4ee44aeec10f81343573861 Mon Sep 17 00:00:00 2001 From: vroad <396351+vroad@users.noreply.github.com> Date: Wed, 7 Apr 2021 18:11:02 +0900 Subject: dockerTools.streamLayeredImage: Add test for fakeRootCommands --- nixos/tests/docker-tools.nix | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'nixos/tests') diff --git a/nixos/tests/docker-tools.nix b/nixos/tests/docker-tools.nix index 1cc554d002b2..a71cf79c5a78 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$'" + ) ''; }) -- cgit 1.4.1