diff --git a/test/840_weave_kube_3_test.sh b/test/840_weave_kube_3_test.sh index 387c8fb1..6b39d756 100755 --- a/test/840_weave_kube_3_test.sh +++ b/test/840_weave_kube_3_test.sh @@ -18,6 +18,7 @@ NUM_HOSTS=$(howmany $HOSTS) SUCCESS="$(( $NUM_HOSTS * ($NUM_HOSTS-1) )) established" KUBECTL="sudo kubectl --kubeconfig /etc/kubernetes/admin.conf" KUBE_PORT=6443 +IMAGE=weaveworks/network-tester:latest tear_down_kubeadm @@ -64,21 +65,35 @@ assert "run_on $HOST2 ps aux | grep -c '[d]efunct'" "0" assert "run_on $HOST3 ps aux | grep -c '[d]efunct'" "0" # See if we can get some pods running that connect to the network -run_on $HOST1 "$KUBECTL run hello --image=weaveworks/hello-world --replicas=3" +run_on $HOST1 "$KUBECTL run --image-pull-policy=Never nettest --image=$IMAGE --replicas=3 -- -peers=3 -dns-name=nettest.default.svc.cluster.local." +# Create a headless service so they can be found in Kubernetes DNS +run_on $HOST1 "$KUBECTL create -f -" </dev/null") + if [ -n podIP ] ; then + status=$($SSH $HOST1 "curl -s -S http://$podIP:8080/status") + if [ $status = "pass" ] ; then + return 0 fi - echo "Waiting for pods" - sleep 1 - done - echo "Timed out waiting for pods" >&2 - exit 1 + fi + return 1 } -assert_raises wait_for_pods +assert_raises 'wait_for_x check_all_pods_communicate pods' tear_down_kubeadm