diff --git a/tests/e2e/scenarios/kops-upgrade/run-test.sh b/tests/e2e/scenarios/kops-upgrade/run-test.sh index f9dc0c5d13..e0cf969a64 100755 --- a/tests/e2e/scenarios/kops-upgrade/run-test.sh +++ b/tests/e2e/scenarios/kops-upgrade/run-test.sh @@ -46,10 +46,20 @@ KOPS="${FIRST_KOPS}" # Always tear-down the cluster when we're done function finish { + + KOPS_LOG_DIR="${ARTIFACTS}/logs" + mkdir -p "${KOPS_LOG_DIR}" + + KOPS_CP=$(${KOPS} toolbox dump -o json | jq -r '.instances[] | select( .roles | index("master" )) | .publicAddresses[0]') + + ssh -i "${AWS_SSH_PRIVATE_KEY_FILE}" "ubuntu@${KOPS_CP}" sudo chmod -R a+r /var/log + scp -i "${AWS_SSH_PRIVATE_KEY_FILE}" -r "ubuntu@${KOPS_CP}:/var/log/" "${KOPS_LOG_DIR}" + ${KUBETEST2} --kops-binary-path="${KOPS}" --down || echo "kubetest2 down failed" } trap finish EXIT + ${KUBETEST2} \ --up \ --kubernetes-version="${K8S_VERSION}" \