Skip to content

Commit ccbf0f4

Browse files
Marketenclaude
andcommitted
Stop the first-boot test hanging when ICMP is filtered
The connectivity check was ping-only, so any network that filters ICMP failed it. error_exit then blocks on `read` forever, .firstboot is never removed, and the machine sits on "Check installation source. Press enter to continue". That is not just CI: corporate, hotel and cloud networks filter ICMP too, and a real DAppNode behind one dies the same way on its first boot. GitHub runners hit it because Azure drops ICMP egress -- the ping_group_range sysctl in the e2e workflows lets QEMU open the socket but cannot make the echo come back. Fall back to an HTTPS probe, then to a bare TCP connect for the case where neither curl nor wget is installed yet. Verified on a local QEMU UEFI USB install of the Ubuntu 24.04.3 unattended ISO with `iptables -A OUTPUT -p icmp --icmp-type echo-request -j DROP` applied in the guest before the test ran: ping fails, the check passes, and the run completes instead of stalling for the full 30 minute timeout. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 9fbd7d4 commit ccbf0f4

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

‎scripts/dappnode_test_install.sh‎

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,33 @@ detect_installation_type() {
2222
fi
2323
}
2424

25+
# ICMP is filtered on many corporate, hotel and cloud networks, so a failed
26+
# ping alone does not mean the machine is offline. Confirm over HTTPS before
27+
# declaring the installation broken.
28+
check_connectivity() {
29+
ping -c 1 -q google.com >/dev/null 2>&1 && return 0
30+
31+
if command -v curl >/dev/null 2>&1; then
32+
curl -fsS --max-time 10 -o /dev/null https://www.google.com/generate_204 && return 0
33+
fi
34+
35+
if command -v wget >/dev/null 2>&1; then
36+
wget -q --timeout=10 -O /dev/null https://www.google.com/generate_204 && return 0
37+
fi
38+
39+
# Neither downloader is guaranteed to be present this early, so fall back to
40+
# a plain TCP connect, which bash can do on its own.
41+
if (exec 3<>/dev/tcp/www.google.com/443) 2>/dev/null; then
42+
exec 3<&- 3>&-
43+
return 0
44+
fi
45+
46+
return 1
47+
}
48+
2549
components=(BIND IPFS VPN DAPPMANAGER WIFI)
2650
detect_installation_type
27-
if ping -c 1 -q google.com >&/dev/null; then
51+
if check_connectivity; then
2852
echo -e "\e[32m Connectivity OK\n \e[0m"
2953
else
3054
error_exit

0 commit comments

Comments
 (0)