This repository has been archived by the owner on Mar 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 136
/
run_tests.sh
executable file
·68 lines (58 loc) · 1.92 KB
/
run_tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
set -e
export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
counter=0
while [[ "$(kubectl get pod --all-namespaces | grep -v Running | grep -v Completed | wc -l)" != 1 ]]; do
counter=$((counter + 1))
if [ "$counter" -gt "30" ]
then
exit 1
fi
kubectl get pod --all-namespaces -o wide
echo "waiting for K8s to be ready"
sleep 10;
done
make run_$KONG_TEST_DATABASE
sleep 10
counter=0
while [[ "$(kubectl get deployment kong-control-plane -n kong | tail -n +2 | awk '{print $4}')" != 1 ]]; do
counter=$((counter + 1))
if [ "$counter" -gt "30" ]
then
exit 1
fi
echo "waiting for Kong control plane to be ready"
kubectl get pod --all-namespaces -o wide
sleep 10;
done
counter=0
while [[ "$(kubectl get deployment kong-ingress-data-plane -n kong | tail -n +2 | awk '{print $4}')" != 1 ]]; do
counter=$((counter + 1))
if [ "$counter" -gt "30" ]
then
exit 1
fi
echo "waiting for Kong data plane to be ready"
kubectl get pod --all-namespaces -o wide
sleep 10;
done
counter=0
while [[ "$(kubectl get pod --all-namespaces | grep -v Running | grep -v Completed | wc -l)" != 1 ]]; do
counter=$((counter + 1))
if [ "$counter" -gt "30" ]
then
exit 1
fi
kubectl get pod --all-namespaces -o wide
echo "something is still not ready"
sleep 10;
done
KONG_VERSION=$(kubectl exec -n kong -it $(kubectl get pods -n kong | grep Running | grep kong | head -n 1 | awk '{print $1}') -- kong version | tr -d '[:space:]')
kubectl port-forward -n kong deployment/kong-control-plane 8001 &
HOST="$(kubectl get nodes --namespace kong -o jsonpath='{.items[0].status.addresses[0].address}')"
echo $HOST
PROXY_PORT=$(kubectl get svc --namespace kong kong-ingress-data-plane -o jsonpath='{.spec.ports[0].nodePort}')
echo $PROXY_PORT
pushd kong-build-tools
TEST_ADMIN_URI=http://localhost:8001 TEST_PROXY_URI=http://$HOST:$PROXY_PORT KONG_VERSION=$KONG_VERSION make -f Makefile run_tests
popd