Skip to content

Commit

Permalink
tc
Browse files Browse the repository at this point in the history
  • Loading branch information
msune committed Oct 7, 2024
1 parent bed1052 commit 96b146f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
11 changes: 8 additions & 3 deletions test/cni/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,24 @@ _check_affinity: _wait_up _wait_running
$(QUIET) SRC_IPS="$(SRC_IPS)" ITERATIONS=$(ITERATIONS) ./check_affinity.sh

_check_perf: _wait_up _wait_running
$(QUIET) echo "Adjusting NS MTU..."
$(QUIET) sudo ip netns exec client ip link set veth1 mtu 1450
$(QUIET) echo "Unloading DEBUG sfunnel in NS..."
$(QUIET) $(MAKE) _unload
$(QUIET) echo "Loading NDEBUG sfunnel in NS..."
$(QUIET) $(MAKE) _load_perf
$(QUIET) echo "Replacing nginx with iperf temporally..."
$(QUIET) minikube kubectl -- apply -k perf/
$(QUIET) echo "Wait for all containers to be up and running..."
$(QUIET) sleep 30
$(QUIET) while [[ "$$(minikube kubectl -- get pods | grep my-nginx | grep -v Running)" != "" ]]; do sleep 1; done
$(QUIET) for POD in $$(minikube kubectl -- get pods | grep my-nginx | awk '{print $$1}'); do \
while [[ "$$(minikube kubectl -- logs $$POD | grep 'Up and running...')" == "" ]]; do sleep 1; done; \
done;
$(QUIET) echo "Launching iperf tests..."
$(QUIET) NETNS=client ./perf/check_perf.sh
$(QUIET) NETNS=client ./perf/check_perf.sh 2>&1 | tee .last_perf_report.txt
$(QUIET) echo "Unloading NDEBUG sfunnel in NS..."
$(QUIET) $(MAKE) _unload
$(QUIET) echo "Loading DEBUG sfunnel in NS..."
$(QUIET) $(MAKE) _load
$(QUIET) echo "Restoring nginx..."
#$(QUIET) $(MAKE) _deploy
$(QUIET) $(MAKE) _deploy
2 changes: 1 addition & 1 deletion test/cni/perf/check_perf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ LB_IP=${1:-$(minikube kubectl -- get service my-loadbalancer-service -o jsonpath

CMD=iperf
if [[ "${NETNS}" != "" ]]; then
CMD="sudo ip netns exec ${NETNS} iperf"
CMD="sudo ip netns exec ${NETNS} iperf -f m"
fi

# $1: worker
Expand Down
6 changes: 4 additions & 2 deletions test/cni/perf/perf-patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ spec:
initContainers:
- name: sfunnel-init
image: sfunnel
- name: sfunnel-init-egress"
- name: sfunnel-init-egress
image: sfunnel
containers:
- name: nginx
image: debian:stable-slim
imagePullPolicy: IfNotPresent
command: ["/bin/bash", "-c", "apt-get update && apt-get install -y iperf && (iperf -s -p 80 &) && (iperf -s -p 8080 &) && sleep 5 && echo 'Up and running...' && tail -f /dev/null "]
securityContext:
privileged: true
command: ["/bin/bash", "-c", "apt-get update && apt-get install -y iproute2 iperf && ip link set eth0 mtu 1450 && (iperf -s -p 80 &) && (iperf -s -p 8080 &) && sleep 5 && echo 'Up and running...' && tail -f /dev/null "]

0 comments on commit 96b146f

Please sign in to comment.