From 3f4b963c8f3818ec1266b43667dbef49a6242d18 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Wed, 11 Dec 2019 23:26:11 +0100 Subject: [PATCH] e2e: Print gitsrv logs if it fails to start --- test/e2e/lib/install.bash | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/e2e/lib/install.bash b/test/e2e/lib/install.bash index cf3242a71..9a133d99f 100755 --- a/test/e2e/lib/install.bash +++ b/test/e2e/lib/install.bash @@ -109,7 +109,11 @@ function install_git_srv() { local_port=$(echo "$local_port" | sed 's%.*:\([0-9]*\).*%\1%') local ssh_cmd="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i $gen_dir/id_rsa -p $local_port" # Wait for the git server to be ready - GIT_SSH_COMMAND="${ssh_cmd}" poll_until_true 'gitsrv to be ready' 'git ls-remote ssh://git@localhost/git-server/repos/cluster.git master > /dev/null' + local check_gitsrv_cmd='git ls-remote ssh://git@localhost/git-server/repos/cluster.git master > /dev/null' + GIT_SSH_COMMAND="${ssh_cmd}" poll_until_true 'gitsrv to be ready' "${check_gitsrv_cmd}" || { + kubectl -n "${FLUX_NAMESPACE}" logs deployment/gitsrv + exit 1 + } if [ -n "$external_access_result_var" ]; then # return the ssh command needed for git, and the PID of the port-forwarding PID into a variable of choice