mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Merge pull request #131 from lavalamp/faster_test
Parse status; makes test much faster
This commit is contained in:
commit
bad4318b95
@ -26,10 +26,27 @@ detect-project
|
|||||||
# Launch a container
|
# Launch a container
|
||||||
$CLOUDCFG -p 8080:80 run dockerfile/nginx 2 myNginx
|
$CLOUDCFG -p 8080:80 run dockerfile/nginx 2 myNginx
|
||||||
|
|
||||||
|
function remove-quotes() {
|
||||||
|
local in=$1
|
||||||
|
stripped="${in%\"}"
|
||||||
|
stripped="${stripped#\"}"
|
||||||
|
echo $stripped
|
||||||
|
}
|
||||||
|
|
||||||
|
POD_ID_LIST=$($CLOUDCFG -json -l name=myNginx list pods | jq ".items[].id")
|
||||||
# Container turn up on a clean cluster can take a while for the docker image pull.
|
# Container turn up on a clean cluster can take a while for the docker image pull.
|
||||||
# Sleep for 2 minutes just to be sure.
|
ALL_RUNNING=false
|
||||||
echo "Waiting for containers to come up."
|
while [[ $ALL_RUNNING -ne "true" ]]; do
|
||||||
sleep 120
|
echo "Waiting for containers to come up."
|
||||||
|
sleep 5
|
||||||
|
ALL_RUNNING=true
|
||||||
|
for id in $POD_ID_LIST; do
|
||||||
|
CURRENT_STATUS=$(remove-quotes $($CLOUDCFG -json get "pods/$(remove-quotes ${id})" | jq '.currentState.status'))
|
||||||
|
if [[ $CURRENT_STATUS -ne "Running" ]]; then
|
||||||
|
ALL_RUNNING=false
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
# Get minion IP addresses
|
# Get minion IP addresses
|
||||||
detect-minions
|
detect-minions
|
||||||
|
@ -20,13 +20,6 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
HAVE_JQ=$(which jq)
|
|
||||||
if [[ -z ${HAVE_JQ} ]]; then
|
|
||||||
echo "Please install jq, e.g.: 'sudo apt-get install jq' or, "
|
|
||||||
echo "if you're on a mac with homebrew, 'brew install jq'."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
source "${KUBE_REPO_ROOT}/cluster/util.sh"
|
source "${KUBE_REPO_ROOT}/cluster/util.sh"
|
||||||
GUESTBOOK="${KUBE_REPO_ROOT}/examples/guestbook"
|
GUESTBOOK="${KUBE_REPO_ROOT}/examples/guestbook"
|
||||||
|
|
||||||
|
@ -25,6 +25,13 @@ LEAVE_UP=${2:-0}
|
|||||||
# Exit on error
|
# Exit on error
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
HAVE_JQ=$(which jq)
|
||||||
|
if [[ -z ${HAVE_JQ} ]]; then
|
||||||
|
echo "Please install jq, e.g.: 'sudo apt-get install jq' or, "
|
||||||
|
echo "if you're on a mac with homebrew, 'brew install jq'."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Use testing config
|
# Use testing config
|
||||||
export KUBE_CONFIG_FILE="config-test.sh"
|
export KUBE_CONFIG_FILE="config-test.sh"
|
||||||
export KUBE_REPO_ROOT="$(dirname $0)/.."
|
export KUBE_REPO_ROOT="$(dirname $0)/.."
|
||||||
|
Loading…
Reference in New Issue
Block a user