Skip to content

Complete LAN and router write coverage - #31

Merged
MarcLeinenDE merged 27 commits into
mainfrom
feat/lan-router-writes
Sep 21, 2026
Merged

MarcLeinenDE merged 27 commits into
mainfrom
feat/lan-router-writes

Conversation

@MarcLeinenDE

@MarcLeinenDE MarcLeinenDE commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Adds high-level SDK coverage for the remaining live-verified LAN/router write contracts:

  • lan.set_dhcp_settings() -> complete 12-field router_set_dhcp_settings_comb multicall write with validation, recovery and exact read-back
  • lan.set_static_reservations() -> complete static reservation table replacement with normalization and exact read-back
  • lan.set_address_legacy() -> deprecated dedicated LAN-IP setter with recovery/read-back and optional force=True for explicit same-state transport verification
  • device.set_work_mode() -> router/bridge multicall setter with recovery/read-back and optional force=True
  • set_dns() shares the complete combined-DHCP writer without a redundant second getter

Validation covers:

  • DHCP enabled/disabled encoding
  • IPv4 LAN/pool fields and netmask
  • lease time 60..604800 seconds
  • MTU 1280..1500
  • DNS mode auto/manual
  • IPv4/IPv6 DNS address families
  • static reservation indices 0..9, MAC syntax and IPv4 address syntax

Transport loss during disruptive setters is treated as inconclusive; success is decided only by recovered exact read-back.

Physical lifecycle:

  1. snapshot complete DHCP object, reservation table, LAN address and work mode
  2. mutate only leasetime through the full combined setter and verify read-back
  3. add/replace one synthetic static reservation and verify the complete table
  4. execute deprecated router_set_lan_ip with force=True at the same address
  5. execute router_set_work_mode with force=True at the same mode
  6. restore the exact original reservation table and complete DHCP object in finally
  7. require final DHCP/reservations/address/work-mode state to equal the initial snapshot

No real MAC/IP reservation data is printed by the physical test. USB management mode remains untouched.

Offline CI #374: SUCCESS (Python 3.10–3.13 + packaging).

Work-mode contract correction during physical preflight:

  • read-only probe on ACIY.3 returned exactly {"work_mode":"router"}
  • earlier SDK/source-derived use of mode was corrected to the live work_mode field
  • upstream nr2301-api PR Document research source escalation policy #22 merged as 0f502608f590b60234b9ab40119d433f8c2c055f
  • corrected SDK CI #378: SUCCESS

Static DHCP wire-contract correction from shipped ACIY.3 set_dhcp.html:

  • occupied rows only
  • index is a JSON integer, not a string
  • reservation IP must be inside the current LAN/subnet
  • duplicate MAC/IP and multicast MAC values are rejected by the frontend
  • enclosing frontend call uses multicall with toStringData=false
  • previous physical test used a non-frontend-equivalent string index plus 192.0.2.254 outside the active LAN subnet

SDK now:

  • normalizes reservation index to int
  • preserves numeric index on the wire
  • validates current-LAN subnet before write
  • validates duplicate MAC/IP and multicast MAC rules
  • physical test selects a free address in the active LAN but outside the DHCP pool

Upstream contract merged in nr2301-api as f6b17eeb33c249849b573576eaa6edce5a03ed83.
Corrected offline CI #385: SUCCESS.

Static DHCP live read-back correction (2026-09-21):

  • corrected physical write with numeric index and in-subnet address persisted successfully
  • ACIY.3 getter returned the same reservation with MAC canonicalized to uppercase hyphen-separated form
  • SDK parser previously accepted colon-separated MACs only; this caused the physical lifecycle failure during read-back, not a setter failure
  • parser now accepts colon/hyphen getter forms and normalizes both to stable lowercase colon form
  • residue cleanup recognizes the reserved synthetic test MACs safely and only auto-clears when the synthetic entry is the sole table entry
  • offline CI #388 / run 35588739225: SUCCESS

Upstream read-back correction merged in nr2301-api as a95759277c3d0ad915b0df163e6e89c64eb88938 (validator run #194 SUCCESS).

Physical LAN/router lifecycle verification (2026-09-21):

  • pre-run residue check found the single synthetic reservation left by the earlier parser failure and removed it safely (DHCP_STATIC_RESIDUE_CLEANUP = PASS)
  • full destructive lifecycle on physical NR2301 / ACIY.3: PASS
  • DHCP lease-time mutation: read-back verified
  • static DHCP reservation write: read-back verified from empty original table to one synthetic entry
  • deprecated LAN-address setter: same-state forced write/read-back verified
  • router work-mode setter: same-state forced write/read-back verified
  • final exact restore: DHCP, static reservations, LAN address and work mode all equal the original snapshot
  • pytest result: 1 passed in 22.76s

This closes the physical verification gap for the LAN/router write block.

Canonical upstream closure:

  • final cross-method LAN/router physical lifecycle evidence was normalized in nr2301-api first-class contract/evidence files after the final hardware pass
  • upstream API validator #196: SUCCESS
  • upstream API PR Expand live-verified read coverage #25 merged as 14c1cdf96609a558570f09ec7aaf7ceba8452cf6
  • the SDK implementation in this merged PR is aligned with that canonical API state; no additional SDK behavior change was required

@MarcLeinenDE
MarcLeinenDE marked this pull request as ready for review September 21, 2026 10:51
@MarcLeinenDE
MarcLeinenDE merged commit a6f937c into main Sep 21, 2026
5 checks passed
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.

1 participant