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.
This commit is contained in:
Markus Maiwald 2026-01-07 21:28:18 +01:00
parent fd8e3beb84
commit 0949ea1187
1 changed files with 26 additions and 0 deletions

View File

@ -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