From adc82ee3fd8f4537c8e1fb12f1276ce2c684267c Mon Sep 17 00:00:00 2001 From: Salma Bouchaala Date: Thu, 21 May 2026 16:05:43 +0100 Subject: [PATCH] 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 --- .gitlab/tests/cram/generic/network_security.t | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.gitlab/tests/cram/generic/network_security.t b/.gitlab/tests/cram/generic/network_security.t index 7efea22666..de3b2a8525 100644 --- a/.gitlab/tests/cram/generic/network_security.t +++ b/.gitlab/tests/cram/generic/network_security.t @@ -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