Fix TCP Traffic Shifting test script (#7016)

The `TestTCPTrafficShifting` test script relies on fetching the port
named "tcp" on the istio-ingressgateway service, but that port is not
present in the default installation profile -- only in the demo
profile.  This patches the service to add the port in the setup
script, and also fixes the usage of `nc` in the test script.
This commit is contained in:
Brad Ison 2020-04-01 22:44:03 +02:00 committed by GitHub
parent 86260edb30
commit ccf3e134d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -32,3 +32,12 @@ $ kubectl label namespace istio-io-tcp-traffic-shifting istio-injection=enabled
# $snippet deploy_tcp_echo_v1.sh
$ kubectl apply -f @samples/tcp-echo/tcp-echo-services.yaml@ -n istio-io-tcp-traffic-shifting
# $endsnippet
# Add the TCP port to the ingress-gateway
kubectl -n istio-system patch service istio-ingressgateway --patch "
spec:
ports:
- port: 31400
targetPort: 31400
name: tcp
"

View File

@ -32,7 +32,7 @@ echo "sending traffic to $INGRESS_HOST:$INGRESS_PORT"
# $snippet send_traffic_to_echo_v1.sh
$ for i in {1..20}; do \
docker run -e INGRESS_HOST=$INGRESS_HOST -e INGRESS_PORT=$INGRESS_PORT \
--rm busybox sh -c "(date; sleep 1) | nc $INGRESS_HOST:$INGRESS_PORT"
--rm busybox sh -c "(date; sleep 1) | nc $INGRESS_HOST $INGRESS_PORT"
done
# $verify verifier="notContains"
two
@ -71,8 +71,8 @@ spec:
# $snippet more_tcp_traffic_to_echos.sh
$ for i in {1..20}; do \
docker run -e INGRESS_HOST=$INGRESS_HOST -e INGRESS_PORT=$INGRESS_PORT \
--rm busybox sh -c "(date; sleep 1) | nc $INGRESS_HOST:$INGRESS_PORT"
--rm busybox sh -c "(date; sleep 1) | nc $INGRESS_HOST $INGRESS_PORT"
done
# $verify verifier="contains"
two
# $endsnippet
# $endsnippet