mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-17 06:06:13 +03:00
nixosTests.docker-tools: Use both code paths in includeStorePath test
This commit is contained in:
parent
8353fad13d
commit
1f9e86f314
@ -71,16 +71,29 @@ in {
|
||||
docker.succeed("${examples.helloOnRoot} | docker load")
|
||||
docker.succeed("docker run --rm hello | grep -i hello")
|
||||
docker.succeed("docker image rm hello:latest")
|
||||
|
||||
with subtest("includeStorePath = false; breaks example"):
|
||||
docker.succeed("${examples.helloOnRootNoStore} | docker load")
|
||||
docker.fail("docker run --rm hello | grep -i hello")
|
||||
docker.succeed("docker image rm hello:latest")
|
||||
with subtest("includeStorePath = false; breaks example (fakechroot)"):
|
||||
docker.succeed("${examples.helloOnRootNoStoreFakechroot} | docker load")
|
||||
docker.fail("docker run --rm hello | grep -i hello")
|
||||
docker.succeed("docker image rm hello:latest")
|
||||
|
||||
with subtest("Ensure ZERO paths are added to the store"):
|
||||
docker.fail("${examples.helloOnRootNoStore} | ${pkgs.crane}/bin/crane export - - | tar t | grep 'nix/store/'")
|
||||
with subtest("Ensure ZERO paths are added to the store (fakechroot)"):
|
||||
docker.fail("${examples.helloOnRootNoStoreFakechroot} | ${pkgs.crane}/bin/crane export - - | tar t | grep 'nix/store/'")
|
||||
|
||||
with subtest("includeStorePath = false; works with mounted store"):
|
||||
docker.succeed("${examples.helloOnRootNoStore} | docker load")
|
||||
docker.succeed("docker run --rm --volume ${builtins.storeDir}:${builtins.storeDir}:ro hello | grep -i hello")
|
||||
docker.succeed("docker image rm hello:latest")
|
||||
with subtest("includeStorePath = false; works with mounted store (fakechroot)"):
|
||||
docker.succeed("${examples.helloOnRootNoStoreFakechroot} | docker load")
|
||||
docker.succeed("docker run --rm --volume ${builtins.storeDir}:${builtins.storeDir}:ro hello | grep -i hello")
|
||||
docker.succeed("docker image rm hello:latest")
|
||||
|
||||
with subtest("Ensure Docker images use a stable date by default"):
|
||||
docker.succeed(
|
||||
|
@ -637,6 +637,19 @@ rec {
|
||||
];
|
||||
config.Cmd = [ "hello" ];
|
||||
includeStorePaths = false;
|
||||
};
|
||||
|
||||
helloOnRootNoStoreFakechroot = pkgs.dockerTools.streamLayeredImage {
|
||||
name = "hello";
|
||||
tag = "latest";
|
||||
contents = [
|
||||
(pkgs.buildEnv {
|
||||
name = "hello-root";
|
||||
paths = [ pkgs.hello ];
|
||||
})
|
||||
];
|
||||
config.Cmd = [ "hello" ];
|
||||
includeStorePaths = false;
|
||||
enableFakechroot = true;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user