Skip to content

Commit

Permalink
[e2e] fix ssh cmd on e2e container
Browse files Browse the repository at this point in the history
this is a following PR for [#3347](#3347) where ssh command tried to emulate a local session with su, that approach is working fine on darwin platform but is not working for linux. This PR will use that approach only for darwin and leave windows and linux as they were before the PR #3347
  • Loading branch information
adrianriobo authored and praveenkumar committed Dec 1, 2022
1 parent ec0a262 commit 7c4226e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions images/build-e2e/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,17 @@ fi
if [ "${CLEANUP_HOME}" = "false" ]; then
OPTIONS+="--cleanup-home=false "
fi
if [ -n "${INSTALLER_PATH}" ]; then
OPTIONS+="--installer-path=${INSTALLER_PATH} "
fi
if [ -n "${USER_PASSWORD}" ]; then
OPTIONS+="--user-password=${USER_PASSWORD} "

TAGS="@${PLATFORM}"
if [ -n "${E2E_TAG_EXPRESSION}" ]; then
TAGS+=" && ${E2E_TAG_EXPRESSION}"
fi
OPTIONS+="--godog.tags=\"@${PLATFORM} && ${E2E_TAG_EXPRESSION}\" --godog.format=junit "
if [[ ${PLATFORM} == 'windows' ]]; then
BINARY_EXEC+="cd ${EXECUTION_FOLDER}/bin && ./${BINARY} ${OPTIONS} > ${RESULTS_FILE}.results"
if [[ ${PLATFORM} == 'darwin' ]]; then
OPTIONS+="--godog.tags=\\\"${TAGS}\\\" --godog.format=junit "
BINARY_EXEC+="sudo su - ${TARGET_HOST_USERNAME} -c \"PATH=\$PATH:/usr/local/bin && cd ${EXECUTION_FOLDER}/bin && ./${BINARY} ${OPTIONS} > ${RESULTS_FILE}.results\""
else
BINARY_EXEC+="sudo su - ${TARGET_HOST_USERNAME} -c \"cd ${EXECUTION_FOLDER}/bin && ./${BINARY} ${OPTIONS} > ${RESULTS_FILE}.results\""
OPTIONS+="--godog.tags=\"${TAGS}\" --godog.format=junit "
BINARY_EXEC+="cd ${EXECUTION_FOLDER}/bin && ./${BINARY} ${OPTIONS} > ${RESULTS_FILE}.results"
fi
# Execute command remote
$SSH ${REMOTE} ${BINARY_EXEC}
Expand Down

0 comments on commit 7c4226e

Please sign in to comment.