Skip to content

Commit

Permalink
chore(CI/CD): Add e2e test for stable version too
Browse files Browse the repository at this point in the history
Scheduled to run on every second Tuesday
  • Loading branch information
levaitamas committed Sep 20, 2023
1 parent b5b2b40 commit 6f16d00
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run End-to-End Test
name: Run End-to-End Test (dev)

on:
workflow_dispatch:
Expand Down
91 changes: 91 additions & 0 deletions .github/workflows/e2e-test-stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Run End-to-End Test (stable)

on:
workflow_dispatch:
schedule:
- cron: '0 11 1-7,15-21 * 2'

jobs:
e2e_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Download modules
run: go mod download
- name: Go install
run: go install
- name: Build turncat
run: CGO_ENABLED=0 go build -ldflags="-w -s" -o turncat cmd/turncat/main.go

- name: Start minikube
uses: medyagh/setup-minikube@master
with:
driver: docker
container-runtime: containerd
wait: all
cache: false

- name: Start minikube tunnel
run: minikube tunnel &>mktunnel.log &

- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.11.3

- name: Install STUNner
run: |
helm repo add stunner https://l7mp.io/stunner
helm repo update
helm install stunner-gateway-operator stunner/stunner-gateway-operator --create-namespace --namespace=stunner
helm install stunner stunner/stunner --create-namespace --namespace=stunner
- name: Deploy iperf server
run: kubectl apply -f docs/examples/simple-tunnel/iperf-server.yaml

- name: Configure STUNner
run: |
kubectl apply -f docs/examples/simple-tunnel/iperf-stunner.yaml
sleep 75
- name: Install iperf client
run: |
sudo apt-get update
sudo apt-get -y install iperf
- name: Wait for LoadBalancer IP
run: |
while [[ -z $(kubectl get svc udp-gateway -n stunner -o jsonpath="{.status.loadBalancer.ingress[0].ip}") ]]; do echo "Waiting for LoadBalancer IP"; sleep 2; done
kubectl get all -A
- name: Start turncat
run: |
./turncat --log=all:INFO udp://127.0.0.1:5000 k8s://stunner/stunnerd-config:udp-listener udp://$(kubectl get svc iperf-server -o jsonpath="{.spec.clusterIP}"):5001 &>turncat.log &
sleep 1
- name: Run iperf client
run: |
iperf -c 127.0.0.1 -p 5000 -u -l 100 -b 5M -t 5 | tee iperf.log
- name: Show logs
run: |
echo "* IPERF"
echo "** Client"
cat iperf.log
echo "** Server"
kubectl logs $(kubectl get pods -l app=iperf-server -o jsonpath='{.items[0].metadata.name}')
echo "* MINIKUBE TUNNEL"
cat mktunnel.log
echo "* TURNCAT"
cat turncat.log
echo "* STUNNER"
kubectl logs -n stunner $(kubectl get pods -n stunner -l app=stunner -o jsonpath='{.items[0].metadata.name}')
- name: Check iperf conectivity
run: grep "Server Report" iperf.log

0 comments on commit 6f16d00

Please sign in to comment.