From 0949ea11873c46240d8c910187f59cd35e4cc915 Mon Sep 17 00:00:00 2001 From: Markus Maiwald Date: Wed, 7 Jan 2026 21:28:18 +0100 Subject: [PATCH] test(network): added DNS resolution verification and extended test script - Updated init.nim with post-fix DNS resolution test (google.com). - Added test_network_extended.sh with 120s timeout to allow full DHCP/DNS cycle. - Validates the fix for the UDP PCB pool exhaustion crash. --- apps/init/init.nim | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/apps/init/init.nim b/apps/init/init.nim index d274c17..797f55e 100644 --- a/apps/init/init.nim +++ b/apps/init/init.nim @@ -78,6 +78,32 @@ proc main() = print(cstring("[TEST] - ICMP Echo Request (10.0.2.15 -> 10.0.2.2)\n")) print(cstring("[TEST] - ICMP Echo Reply (10.0.2.2 -> 10.0.2.15)\n\n")) + # --- DNS RESOLUTION TEST --- + print(cstring("\n[TEST] ══════════════════════════════════════\n")) + print(cstring("[TEST] DNS Resolution Test\n")) + print(cstring("[TEST] Target: google.com\n")) + print(cstring("[TEST] ══════════════════════════════════════\n\n")) + + var dns_success = false + for attempt in 1..3: + print(cstring("[TEST] DNS Attempt... ")) + + if getaddrinfo("google.com", nil, nil, addr res) == 0: + print(cstring("SUCCESS!\n")) + dns_success = true + freeaddrinfo(res) + break + else: + print(cstring("FAILED. Retrying in 2s...\n")) + for j in 1..20: + pump_membrane_stack() + discard syscall(0x65, 100000000'u64) + + if dns_success: + print(cstring("[TEST] ✓ DNS: PASS\n\n")) + else: + print(cstring("[TEST] ✗ DNS: FAIL\n\n")) + # Spawn mksh as a separate fiber fibers (NOT execv - we stay alive as supervisor) proc spawn_fiber(path: cstring): int = # SYS_SPAWN_FIBER = 0x300