feat: add optional static IP support for devices without DHCP#1566
feat: add optional static IP support for devices without DHCP#1566IMINABO1 wants to merge 12 commits into
Conversation
Surface which tester(s) hang and for how long when the wait loop expires silently, so the next failing CI run pinpoints the regression.
- actions/checkout v4.1.1 -> v6.0.2 - actions/setup-node v4.0.1 -> v6.4.0 - actions/upload-artifact v4.2.0 / v3.pre.node20 -> v4.6.2 - actions/download-artifact v4.1.8 -> v4.3.0 Silences the 8 Node-20 deprecation warnings ahead of the Sept 2026 runner removal.
Orphaned when TestNetworkEvent class was removed alongside the ARP-IP-detection revert.
Drops the 200-line testrun-log dump that was added during the ARP-IP-detection bug hunt. Keeps the per-tester elapsed log and the ::error:: annotation as ongoing CI signal for any future regression. Also drops the 'DIAGNOSTIC:' prefix \u2014 reads cleaner as production CI output.
The previous Node-24 bump left upload-artifact pinned at v4.6.2 and download-artifact at v4.3.0 — both still run on Node.js 20 and trigger GitHub's deprecation warnings on every Actions run. Move upload-artifact to v7.0.1 and download-artifact to v8.0.1, both on node24. Current call sites only use name/path/if-no-files-found, none of which are affected by the v5→v8 breaking changes
The ntp_compliant tester passed or failed depending on a timing lottery: the device sent a single burst of NTP queries right after its first DHCP bind, which can fall in the capture gap between startup.pcap (stops once the device gets an IP) and monitor.pcap (starts ~10s later). The ntp.pcap safety net from the NTP network container is itself subject to a container-restart race, and the entrypoint's later NTP attempts never worked: dhclient -sf is blocked by AppArmor on CI runners and the lease fallback called sudo, which is not installed in the image. Drop the broken dhclient hook, query the DHCP-provided server directly from the lease file (without sudo, with the trailing semicolon stripped), and keep sending NTP requests in a background loop - mirroring the existing arping loop - so requests are always captured during the monitor period.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
I have signed the CLA. |
Bump action pins to match upstream (checkout v6.0.2 -> v6.0.3, scorecard-action v2.3.1 -> v2.4.3), update package versions in requirements.txt, and sync .gitignore and testing.yml triggers with upstream main. Re-apply static IP additions (import ipaddress, DEVICE_IP_ADDR_KEY, ip_addr loading) on top of upstream's updated testrun.py.
IMINABO1
left a comment
There was a problem hiding this comment.
Updated the PR with a fix for the report migration failure:
- Added export URL handling for migrated reports
- Preserved report/export metadata in serialized device config
- Added regression coverage
Tested with:
python testing\unit\framework\static_ip_test.py -v
|
@IMINABO1 I've not studied the PR in depth, but does this require the user to manually add an IP address into the device_config.json following device addition within the Testrun UI? Does it cater for any private IP address? E.g. Would it work if the device had IP address 192.168.0.32/24 (i.e. outside of the default Testrun network range of 10.10.10.0/24)? I have been working on a similar feature that doesn't require any manual file modifications, but it does predicate that the DUT must have a prescribed static IP address to start with. It's not quite ready for release yet, but has been working well in testing so far. |
Closes #1450
Some devices (e.g. industrial/elevator controllers) don't support DHCP and currently cause Testrun to cancel the run when no IP is obtained.
This PR adds optional static IP support: if a device's
device_config.jsonincludes an"ip_addr"field, the network orchestrator skips the DHCP wait and uses that IP directly. Devices withoutip_addrare completely unaffected, existing behaviour is unchanged.Changes:
device_config.jsonaccepts an optional"ip_addr"(validated as IPv4)_dhcp_lease_ackno longer overwrites a pre-configured static IPtesting/unit/framework/static_ip_test.py)