ci: cram: random: network_security.t cram test fails randomly due to missing 80/tcp port and 53/tcp port

Problem:
network_security.t fails randomly due to missing ports

Root cause:
CI does not guarantee lighttpd and dnsmasq are fully up, causing a race where ports 80 and 53 are sometimes not open during nmap checks

Solution:
ensure services are fully up using process check (pgrep)

Referene: PPW-455, PPW-887
Signed-off-by: Salma Bouchaala <salma.bouchaala@sofrecom.com>
This commit is contained in:
Salma Bouchaala 2026-05-21 16:05:43 +01:00 committed by FAOUZI YAHYA
parent a3a23e2145
commit adc82ee3fd

View File

@ -1,8 +1,22 @@
Create R alias:
$ alias R="${CRAM_REMOTE_COMMAND:-}"
Check that NO port is open from WAN:
$ nmap --open 10.0.0.2 | grep open
[1]
Wait for services to become ready:
$ R '
> timeout=10
> while [ $timeout -gt 0 ] && (! pgrep lighttpd >/dev/null || ! pgrep dnsmasq >/dev/null); do
> sleep 1
> timeout=$((timeout - 1))
> done
> '
Check that only certain ports are open from LAN:
$ nmap --exclude-ports T:5000 --open 192.168.1.1 | grep open