Skip to content

Commit

Permalink
Wait for pod to be running in e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
mfojtik committed Oct 11, 2016
1 parent 8f6030a commit c6b5512
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/end-to-end/core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,16 @@ os::cmd::expect_success 'oc whoami'
echo "[INFO] Running a CLI command in a container using the service account"
os::cmd::expect_success 'oc policy add-role-to-user view -z default'
oc run cli-with-token --attach --image="openshift/origin:${TAG}" --restart=Never -- cli status --loglevel=4 > "${LOG_DIR}/cli-with-token.log" 2>&1
os::cmd::try_until_text 'oc get pod test/cli-with-token -o jsonpath="{.status.phase}"' "Running"
os::cmd::expect_success_and_text "cat '${LOG_DIR}/cli-with-token.log'" 'Using in-cluster configuration'
os::cmd::expect_success_and_text "cat '${LOG_DIR}/cli-with-token.log'" 'In project test'
os::cmd::expect_success 'oc delete pod cli-with-token'
oc run cli-with-token-2 --attach --image="openshift/origin:${TAG}" --restart=Never -- cli whoami --loglevel=4 > "${LOG_DIR}/cli-with-token2.log" 2>&1
os::cmd::try_until_text 'oc get pod test/cli-with-token-2 -o jsonpath="{.status.phase}"' "Running"
os::cmd::expect_success_and_text "cat '${LOG_DIR}/cli-with-token2.log'" 'system:serviceaccount:test:default'
os::cmd::expect_success 'oc delete pod cli-with-token-2'
oc run kubectl-with-token --attach --image="openshift/origin:${TAG}" --restart=Never --command -- kubectl get pods --loglevel=4 > "${LOG_DIR}/kubectl-with-token.log" 2>&1
os::cmd::try_until_text 'oc get pod test/kubectl-with-token -o jsonpath="{.status.phase}"' "Running"
os::cmd::expect_success_and_text "cat '${LOG_DIR}/kubectl-with-token.log'" 'Using in-cluster configuration'
os::cmd::expect_success_and_text "cat '${LOG_DIR}/kubectl-with-token.log'" 'kubectl-with-token'

Expand Down

0 comments on commit c6b5512

Please sign in to comment.