1- name : Test
1+ name : E2E Tests
22
33on :
44 push :
4747 - name : Install Helm chart for testing
4848 run : |
4949 kubectl cluster-info
50- helm install test test/helm/ --set image=ghcr.io/snorwin/haproxy:${{ github.sha }}
50+ helm install test test/helm/ --set image=ghcr.io/snorwin/haproxy:${{ github.sha }}
51+ - name : Verify that client can connect to server using HAProxy
52+ run : |
53+ kubectl apply -f test/pod01.yaml
54+ sleep 90
55+ if [ $(kubectl logs http-client-01 | grep "HTTP/1.0 200" | wc -l) -le 0 ]; then
56+ exit 1
57+ fi
58+ - name : Change HAProxy configuration (change timeout)
59+ run : |
60+ kubectl get cm haproxy-config -o yaml | sed 's/timeout client 10s/timeout client 15s/' | kubectl apply -f -
61+ sleep 90
62+ - name : Verify that configuration was reloaded hitless
63+ run : |
64+ if [ $( kubectl logs haproxy | grep "reload successful" | wc -l) -ne 1 ]; then
65+ exit 1
66+ fi
67+ if [ $(kubectl logs http-client-01 | grep error | wc -l) -gt 0 ]; then
68+ exit 1
69+ fi
70+ - name : Change HAProxy configuration (invalid)
71+ run : |
72+ kubectl apply -f test/configmap-01.yaml
73+ sleep 90
74+ - name : Verify that configuration was NOT reloaded
75+ run : |
76+ if [ $( kubectl logs haproxy | grep "reload failed" | wc -l) -ne 1 ]; then
77+ exit 1
78+ fi
79+ if [ $(kubectl logs http-client-01 | grep error | wc -l) -gt 0 ]; then
80+ exit 1
81+ fi
82+ - name : Change HAProxy configuration (add listen)
83+ run : |
84+ kubectl apply -f test/configmap-02.yaml
85+ sleep 90
86+ - name : Verify that configuration was reloaded hitless
87+ run : |
88+ if [ $( kubectl logs haproxy | grep "reload successful" | wc -l) -ne 2 ]; then
89+ exit 1
90+ fi
91+ if [ $(kubectl logs http-client-01 | grep error | wc -l) -gt 0 ]; then
92+ exit 1
93+ fi
94+ - name : Verify that new client can connect to server using HAProxy
95+ run : |
96+ kubectl apply -f test/pod02.yaml
97+ sleep 90
98+ if [ $(kubectl logs http-client-02 | grep "HTTP/1.0 200" | wc -l) -le 0 ]; then
99+ exit 1
100+ fi
0 commit comments