1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-01-22 14:45:27 +00:00

nixos/tests/docker: wait for docker service

Previously the Docker daemon was started by systemd socket activation.
Thus, the Docker test waited for the sockets.target unit.
But when the docker module was changed to start the Docker daemon at
boot instead of by socket activation, the test was left untouched.
With the Docker 20.10 update this lead to a timing issue, where the
docker command is run before the Docker daemon has started and hangs.

Fixes #109416
This commit is contained in:
Milan Pässler 2021-01-15 02:02:43 +01:00
parent 3be09b94fb
commit c14bafd6c7
No known key found for this signature in database
GPG key ID: A6DC6A7CB0B97859
2 changed files with 2 additions and 2 deletions

View file

@ -18,7 +18,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
testScript = with pkgs.dockerTools; ''
unix_time_second1 = "1970-01-01T00:00:01Z"
docker.wait_for_unit("sockets.target")
docker.wait_for_unit("docker.service")
with subtest("Ensure Docker images use a stable date by default"):
docker.succeed(

View file

@ -33,7 +33,7 @@ import ./make-test-python.nix ({ pkgs, ...} : {
testScript = ''
start_all()
docker.wait_for_unit("sockets.target")
docker.wait_for_unit("docker.service")
docker.succeed("tar cv --files-from /dev/null | docker import - scratchimg")
docker.succeed(
"docker run -d --name=sleeping -v /nix/store:/nix/store -v /run/current-system/sw/bin:/bin scratchimg /bin/sleep 10"