Skip to content

Commit 59ab68b

Browse files
committed
test: Wait for iper3 server
Turns out that iperf3 is using the `simple` service type: $ sudo systemctl show iperf3 | grep ^Type= Type=simple In this case `systemctl start iperf3` does not wait for the service to signal that it is ready to handle requests or has finished initializing, so we may return before the service is ready to serve requests. We wait now until iperf3 port is in listening state. Signed-off-by: Nir Soffer <nirsof@gmail.com>
1 parent a7cc880 commit 59ab68b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/lima.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ jobs:
6565
limactl shell vm1 sudo apt-get update
6666
limactl shell vm1 sudo apt-get install -y iperf3
6767
limactl shell vm1 sudo systemctl start iperf3.service
68+
echo "Waiting for iperf3 server ..."
69+
limactl shell vm1 bash -s << EOF
70+
if ! timeout 10s bash -c "until ss -tln | grep -q :5201; do sleep 1; done"; then
71+
echo >&2 "Timeout waiting for iperf3 port"
72+
exit 1
73+
fi
74+
EOF
75+
echo "iperf3 server is ready"
6876
- name: "Lima: vm1: get the IP"
6977
run: |
7078
limactl shell vm1 ip -4 -json addr show dev lima0 | jq -r .[0].addr_info[0].local | tee /tmp/vm1_iP

0 commit comments

Comments
 (0)