Extend weave-kube smoke test: add a policy with blank 'from'

Per issue #3095 this crashes the commenting code.
Also added check to see if the pods are still running.
This commit is contained in:
Bryan Boreham committed 2017-08-23 09:42:51 +00:00
1 parent 4b5299d124
commit 527bcffe3b
1 file changed
+17
+17
View File
@@ -94,6 +94,20 @@ spec:
run: nettest
EOF
# Another policy, this time with no 'from' section, just to check that doesn't cause a crash
run_on $HOST1 "$KUBECTL apply -f -" <<EOF
apiVersion: extensions/v1beta1
kind: NetworkPolicy
metadata:
name: test840f
spec:
ingress:
- {}
podSelector:
matchLabels:
run: norealpods
EOF
check_ready() {
run_on $HOST1 "$KUBECTL get nodes | grep -c -w Ready | grep $NUM_HOSTS"
}
@@ -135,6 +149,9 @@ assert_raises 'wait_for_x check_all_pods_communicate pods'
# Check that a pod can contact the outside world
assert_raises "$SSH $HOST1 $KUBECTL exec $podName -- $PING 8.8.8.8"
# Check that our pods haven't crashed
assert "$SSH $HOST1 $KUBECTL get pods -n kube-system -l name=weave-net | grep -c Running" 3
tear_down_kubeadm
# Destroy our test ipset, and implicitly check it is still there