From b78e57a2d7e1871a55ab72758a99e34cf7596e26 Mon Sep 17 00:00:00 2001 From: Marc Hoersken Date: Sat, 20 Jun 2020 18:44:30 +0200 Subject: [PATCH] tests: restore retry behaviour for docker-machine ip command --- tests/openssh_fixture.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/openssh_fixture.c b/tests/openssh_fixture.c index 093f31e..e2c6f8b 100644 --- a/tests/openssh_fixture.c +++ b/tests/openssh_fixture.c @@ -167,9 +167,11 @@ static int ip_address_from_container(char *container_id, char **ip_address_out) int attempt_no = 0; int wait_time = 500; for(;;) { - return run_command(ip_address_out, "docker-machine ip %s", active_docker_machine); - - if(attempt_no > 5) { + int ret = run_command(ip_address_out, "docker-machine ip %s", active_docker_machine); + if(ret == 0) { + return 0; + } + else if(attempt_no > 5) { fprintf( stderr, "Unable to get IP from docker-machine after %d attempts\n",