From f634c149e47982845ec23de7ebe94efd7744e47c Mon Sep 17 00:00:00 2001 From: Milan Date: Fri, 15 Jan 2021 03:38:15 +0100 Subject: nixos/tests/docker: wait for docker service (#109418) 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 --- nixos/tests/docker-tools.nix | 2 +- nixos/tests/docker.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'nixos/tests') diff --git a/nixos/tests/docker-tools.nix b/nixos/tests/docker-tools.nix index 6638ec4927ce..e2bd9ddf6470 100644 --- a/nixos/tests/docker-tools.nix +++ b/nixos/tests/docker-tools.nix @@ -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( diff --git a/nixos/tests/docker.nix b/nixos/tests/docker.nix index 58e33535ed31..a0f328af775c 100644 --- a/nixos/tests/docker.nix +++ b/nixos/tests/docker.nix @@ -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" -- cgit v1.2.3