Skip to content

Commit ff5c4f9

Browse files
committed
fix(ci): write explicit DHCP client config without Type=wlan match
The system template 80-wifi-station.network uses Type=wlan and WLANInterfaceType=station constraints that don't match inside nspawn containers with hwsim-injected PHYs (udev DEVTYPE not populated). Write a priority-50 config using only Name= match BEFORE connect so networkd has a matching config when carrier arrives.
1 parent 22c136d commit ff5c4f9

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

tests/integration/run_interop.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,25 @@ NETEOF"
237237
SCAN_RESULT=$(m_exec "$CLIENT" rxnm wifi scan --interface "$CLI_WLAN" --format json || echo "{}")
238238
if echo "$SCAN_RESULT" | grep -q "RXNM_Test_Net"; then info "✓ Simulated AP detected in client scan"; else err "Failed to detect simulated AP"; echo "Scan Output: $SCAN_RESULT"; exit 1; fi
239239

240+
# Write explicit DHCP client config BEFORE connect — the system template
241+
# 80-wifi-station.network uses Type=wlan + WLANInterfaceType=station which
242+
# don't match inside nspawn containers with injected hwsim PHYs.
243+
m_exec "$CLIENT" /bin/bash -c "cat > /run/systemd/network/50-wifi-client-test.network << 'NETEOF'
244+
[Match]
245+
Name=$CLI_WLAN
246+
247+
[Network]
248+
DHCP=yes
249+
LinkLocalAddressing=yes
250+
251+
[DHCPv4]
252+
RouteMetric=20
253+
NETEOF"
254+
m_exec "$CLIENT" networkctl reload 2>/dev/null || true
255+
240256
info "Phase 6.7: Connecting $CLI_WLAN to Virtual AP..."
241257
m_exec "$CLIENT" rxnm wifi connect "RXNM_Test_Net" --password "supersecret" --interface "$CLI_WLAN" || true
242-
# rxnm connect writes a DHCP config via _ensure_wifi_netconfig.
243-
# Force networkd to re-apply it so the DHCP client sends a fresh DISCOVER.
244258
sleep 3
245-
m_exec "$CLIENT" networkctl reload 2>/dev/null || true
246259
m_exec "$CLIENT" networkctl reconfigure "$CLI_WLAN" 2>/dev/null || true
247260
# Give DHCP exchange time to complete (DISCOVER → OFFER → REQUEST → ACK)
248261
sleep 5

0 commit comments

Comments
 (0)