Skip to content

feat: add optional static IP support for devices without DHCP#1566

Open
IMINABO1 wants to merge 10 commits into
google:mainfrom
IMINABO1:main
Open

feat: add optional static IP support for devices without DHCP#1566
IMINABO1 wants to merge 10 commits into
google:mainfrom
IMINABO1:main

Conversation

@IMINABO1

@IMINABO1 IMINABO1 commented Jul 2, 2026

Copy link
Copy Markdown

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.json includes an "ip_addr" field, the network orchestrator skips the DHCP wait and uses that IP directly. Devices without ip_addr are completely unaffected, existing behaviour is unchanged.

Changes:

  • device_config.json accepts an optional "ip_addr" (validated as IPv4)
  • Network orchestrator skips DHCP startup capture for static-IP devices
  • _dhcp_lease_ack no longer overwrites a pre-configured static IP
  • Unit tests for the new static IP path (testing/unit/framework/static_ip_test.py)
  • CI action version bumps (Node 20 → 24)

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.
@google-cla

google-cla Bot commented Jul 2, 2026

Copy link
Copy Markdown

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.

@IMINABO1

IMINABO1 commented Jul 2, 2026

Copy link
Copy Markdown
Author

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

device has static IP support only

1 participant