diff --git a/tests/k8s.sh b/tests/k8s.sh index bd8e6067..17afd149 100755 --- a/tests/k8s.sh +++ b/tests/k8s.sh @@ -32,38 +32,38 @@ function test_k8s { kubectl wait --for=condition=ready pod/gwctl # install iperf3 and jq - kubectl exec -it gwctl -- apk add iperf3 jq + kubectl exec -i gwctl -- apk add iperf3 jq # start iperf3 server - kubectl exec -it gwctl -- iperf3 -s -D -p 1234 + kubectl exec -i gwctl -- iperf3 -s -D -p 1234 # expose iperf3 server kubectl expose pod gwctl --name=foo --port=80 --target-port=1234 # wait for API server to come up - kubectl exec -it gwctl -- timeout 30 sh -c 'until gwctl get peer; do sleep 0.1; done > /dev/null 2>&1' + kubectl exec -i gwctl -- timeout 30 sh -c 'until gwctl get peer; do sleep 0.1; done > /dev/null 2>&1' # export iperf server - kubectl exec -it gwctl -- gwctl create export --name foo --host foo --port 80 + kubectl exec -i gwctl -- gwctl create export --name foo --host foo --port 80 # import - kubectl exec -it gwctl -- gwctl create peer --host cl-dataplane --port 443 --name peer1 - kubectl exec -it gwctl -- gwctl create import --name foo --host bla --port 9999 - kubectl exec -it gwctl -- gwctl create binding --import foo --peer peer1 + kubectl exec -i gwctl -- gwctl create peer --host cl-dataplane --port 443 --name peer1 + kubectl exec -i gwctl -- gwctl create import --name foo --host bla --port 9999 + kubectl exec -i gwctl -- gwctl create binding --import foo --peer peer1 # get imported service port - PORT=$(kubectl exec -it gwctl -- /bin/bash -c "gwctl get import --name foo | jq '.Status.Listener.Port' | tr -d '\n'") + PORT=$(kubectl exec -i gwctl -- /bin/bash -c "gwctl get import --name foo | jq '.Status.Listener.Port' | tr -d '\n'") # expose imported service (TODO: remove this when controlplane automatically creates a service) kubectl expose deployment cl-dataplane --name=bla --port=9999 --target-port=$PORT # wait for imported service socket to come up - kubectl exec -it gwctl -- timeout 30 sh -c 'until nc -z $0 $1; do sleep 0.1; done' bla 9999 + kubectl exec -i gwctl -- timeout 30 sh -c 'until nc -z $0 $1; do sleep 0.1; done' bla 9999 # wait for iperf server to come up - kubectl exec -it gwctl -- timeout 30 sh -c 'until nc -z $0 $1; do sleep 0.1; done' gwctl 1234 + kubectl exec -i gwctl -- timeout 30 sh -c 'until nc -z $0 $1; do sleep 0.1; done' gwctl 1234 # run iperf client - kubectl exec -it gwctl -- iperf3 -c bla -p 9999 -t 1 + kubectl exec -i gwctl -- iperf3 -c bla -p 9999 -t 1 } cd $TEST_DIR