@@ -378,30 +378,19 @@ os::cmd::expect_success 'oc login -u e2e-user'
378378os::cmd::expect_success ' oc project test'
379379os::cmd::expect_success ' oc whoami'
380380
381- if [[ -n " ${SOLTYSH_DEBUG:- } " ]]; then
382- os::log::info " Running a CLI command in a container using the service account"
383- os::cmd::expect_success ' oc policy add-role-to-user view -z default'
384- os::cmd::try_until_success " oc sa get-token default"
385- oc run cli-with-token --attach --image=" ${IMAGE_PREFIX} :${TAG} " --restart=Never -- cli status --loglevel=4 > " ${LOG_DIR} /cli-with-token.log" 2>&1
386- # TODO remove set +o errexit, once https://github.com/openshift/origin/issues/12558 gets proper fix
387- set +o errexit
388- os::cmd::expect_success_and_text " cat '${LOG_DIR} /cli-with-token.log'" ' Using in-cluster configuration'
389- os::cmd::expect_success_and_text " cat '${LOG_DIR} /cli-with-token.log'" ' In project test'
390- set -o errexit
391- os::cmd::expect_success ' oc delete pod cli-with-token'
392- oc run cli-with-token-2 --attach --image=" ${IMAGE_PREFIX} :${TAG} " --restart=Never -- cli whoami --loglevel=4 > " ${LOG_DIR} /cli-with-token2.log" 2>&1
393- # TODO remove set +o errexit, once https://github.com/openshift/origin/issues/12558 gets proper fix
394- set +o errexit
395- os::cmd::expect_success_and_text " cat '${LOG_DIR} /cli-with-token2.log'" ' system:serviceaccount:test:default'
396- set -o errexit
397- os::cmd::expect_success ' oc delete pod cli-with-token-2'
398- oc run kubectl-with-token --attach --image=" ${IMAGE_PREFIX} :${TAG} " --restart=Never --command -- kubectl get pods --loglevel=4 > " ${LOG_DIR} /kubectl-with-token.log" 2>&1
399- # TODO remove set +o errexit, once https://github.com/openshift/origin/issues/12558 gets proper fix
400- set +o errexit
401- os::cmd::expect_success_and_text " cat '${LOG_DIR} /kubectl-with-token.log'" ' Using in-cluster configuration'
402- os::cmd::expect_success_and_text " cat '${LOG_DIR} /kubectl-with-token.log'" ' kubectl-with-token'
403- set -o errexit
404- fi
381+ os::log::info " Running a CLI command in a container using the service account"
382+ os::cmd::expect_success ' oc policy add-role-to-user view -z default'
383+ os::cmd::try_until_success " oc sa get-token default"
384+ oc run cli-with-token --attach --image=" ${IMAGE_PREFIX} :${TAG} " --restart=Never -- cli status --loglevel=4 > " ${LOG_DIR} /cli-with-token.log" 2>&1
385+ os::cmd::expect_success_and_text " cat '${LOG_DIR} /cli-with-token.log'" ' Using in-cluster configuration'
386+ os::cmd::expect_success_and_text " cat '${LOG_DIR} /cli-with-token.log'" ' In project test'
387+ os::cmd::expect_success ' oc delete pod cli-with-token'
388+ oc run cli-with-token-2 --attach --image=" ${IMAGE_PREFIX} :${TAG} " --restart=Never -- cli whoami --loglevel=4 > " ${LOG_DIR} /cli-with-token2.log" 2>&1
389+ os::cmd::expect_success_and_text " cat '${LOG_DIR} /cli-with-token2.log'" ' system:serviceaccount:test:default'
390+ os::cmd::expect_success ' oc delete pod cli-with-token-2'
391+ oc run kubectl-with-token --attach --image=" ${IMAGE_PREFIX} :${TAG} " --restart=Never --command -- kubectl get pods --loglevel=4 > " ${LOG_DIR} /kubectl-with-token.log" 2>&1
392+ os::cmd::expect_success_and_text " cat '${LOG_DIR} /kubectl-with-token.log'" ' Using in-cluster configuration'
393+ os::cmd::expect_success_and_text " cat '${LOG_DIR} /kubectl-with-token.log'" ' kubectl-with-token'
405394
406395os::log::info " Testing deployment logs and failing pre and mid hooks ..."
407396# test hook selectors
@@ -471,7 +460,7 @@ os::log::info "Validating exec"
471460frontend_pod=$( oc get pod -l deploymentconfig=frontend --template=' {{(index .items 0).metadata.name}}' )
472461# when running as a restricted pod the registry will run with a pre-allocated
473462# user in the neighborhood of 1000000+. Look for a substring of the pre-allocated uid range
474- os::cmd::expect_success_and_text " oc exec -p ${frontend_pod} id" ' 1000'
463+ os::cmd::expect_success_and_text " oc exec ${frontend_pod} id" ' 1000'
475464os::cmd::expect_success_and_text " oc rsh pod/${frontend_pod} id -u" ' 1000'
476465os::cmd::expect_success_and_text " oc rsh -T ${frontend_pod} id -u" ' 1000'
477466
0 commit comments