Skip to content

Commit 3b3d151

Browse files
authored
fix(ci): wait until snmpsim has fully started before running robot tests (#6121)
Refs: CTOR-2270
1 parent ba375ff commit 3b3d151

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/generic-plugins.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,12 @@ jobs:
175175
mkdir -p /var/lib/snmp/cert_indexes/
176176
useradd snmp || true
177177
snmpsim-command-responder --logging-method=null --agent-udpv4-endpoint=127.0.0.1:2024 --process-user=snmp --process-group=snmp --data-dir='./tests' &
178-
sleep 2
178+
# waiting till localhost is listening on UDP port 2024
179+
timeout 60 bash -c 'while : ; do
180+
# 0100007F:07E8 is 127.0.0.1:2024 in HEX
181+
grep " 0100007F:07E8 " /proc/net/udp >/dev/null && break
182+
sleep 0.5
183+
done ; echo "snmpsim is listening"' || exit 1
179184
robot --include centreon-generic-snmp --exclude notauto --outputdir /tmp/robot-tests ./tests/os/linux/snmp/
180185
shell: bash
181186

0 commit comments

Comments
 (0)