Skip to content

Commit f4827e8

Browse files
committed
Add comprehensive debug output for GHA network state and VM networking
1 parent a91809d commit f4827e8

2 files changed

Lines changed: 72 additions & 1 deletion

File tree

.github/workflows/test-nixos.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,67 @@ jobs:
3838
echo "${{ secrets.NIXBUILD_KEY }}" | install -D -m 600 /dev/stdin ~/.ssh/nixbuild_key
3939
install -m 644 "${{ github.workspace }}/.github/assets/ssh-config" ~/.ssh/config
4040
41+
- name: Debug - GHA runner network state (before)
42+
shell: bash
43+
run: |
44+
echo "=== IP Addresses ==="
45+
ip addr
46+
echo ""
47+
echo "=== Routing Table ==="
48+
ip route
49+
echo ""
50+
echo "=== Network Interfaces ==="
51+
ip link
52+
echo ""
53+
echo "=== Iptables Rules (filter) ==="
54+
sudo iptables -L -v
55+
echo ""
56+
echo "=== Iptables Rules (nat) ==="
57+
sudo iptables -t nat -L -v
58+
echo ""
59+
echo "=== Iptables Rules (mangle) ==="
60+
sudo iptables -t mangle -L -v
61+
echo ""
62+
echo "=== Netstat listening ports ==="
63+
sudo ss -tlnp || netstat -tlnp || echo "ss/netstat not available"
64+
echo ""
65+
echo "=== Kernel IP forwarding ==="
66+
cat /proc/sys/net/ipv4/ip_forward
67+
4168
- name: Run nixos test
4269
run: nix run --file . nixosNatTest.containerd.driverInteractive --option sandbox false -- --no-interactive
4370

71+
- name: Debug - GHA runner network state (after)
72+
if: failure()
73+
shell: bash
74+
run: |
75+
echo "=== IP Addresses ==="
76+
ip addr
77+
echo ""
78+
echo "=== Routing Table ==="
79+
ip route
80+
echo ""
81+
echo "=== Network Interfaces ==="
82+
ip link
83+
echo ""
84+
echo "=== Iptables Rules (filter) ==="
85+
sudo iptables -L -v
86+
echo ""
87+
echo "=== Iptables Rules (nat) ==="
88+
sudo iptables -t nat -L -v
89+
echo ""
90+
echo "=== Iptables Rules (mangle) ==="
91+
sudo iptables -t mangle -L -v
92+
echo ""
93+
echo "=== Check for vde interfaces ==="
94+
ip link | grep -i vde || echo "No vde interfaces found"
95+
echo ""
96+
echo "=== Kernel IP forwarding ==="
97+
cat /proc/sys/net/ipv4/ip_forward
98+
echo ""
99+
echo "=== Dmesg last 50 lines ==="
100+
sudo dmesg | tail -50
101+
44102
- name: Setup upterm session
45103
if: failure()
46104
uses: owenthereal/action-upterm@v1

tests/nixos/integration.nix

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,23 @@ pkgs.testers.nixosTest {
4848
# Debug: Check if networking is available
4949
with control.nested("check networking"):
5050
control.wait_for_unit("network-online.target", timeout=30)
51-
control.succeed("ping -c 1 1.1.1.1 || ping -c 1 9.9.9.9 || echo 'WARNING: No external ping response'")
51+
52+
# Capture VM network state
53+
control.succeed("echo '=== IP Addresses ===' && ip addr")
54+
control.succeed("echo '=== Routing Table ===' && ip route")
55+
control.succeed("echo '=== Default Route ===' && ip route | grep default")
56+
control.succeed("echo '=== Kernel IP Forwarding ===' && cat /proc/sys/net/ipv4/ip_forward")
57+
58+
# Capture DNS state
5259
control.succeed("cat /etc/resolv.conf || echo 'No resolv.conf'")
5360
control.succeed("systemctl status systemd-resolved || echo 'systemd-resolved not active'")
5461
62+
# Try DNS resolution before ping
63+
control.succeed("echo '=== Testing DNS ===' && nslookup google.com || dig google.com || echo 'DNS lookup failed'")
64+
65+
# Try pings
66+
control.succeed("ping -c 1 1.1.1.1 || ping -c 1 9.9.9.9 || echo 'WARNING: No external ping response'")
67+
5568
control.wait_for_unit("containerd.service")
5669
5770
# ── Phase 1: Bootstrap kubeadm cluster ──────────────────────────────

0 commit comments

Comments
 (0)