nx_iot_discover_test.nx
buildroot/runtime/nx_iot_discover_test.nx
about
nx_iot_discover_test.nx -- gate for the universal discovery brain.
Proves the operator's "discovery mechanism like all the hardware
discovery" across ALL five vendor families from canned beacons, with NO
sockets (deterministic), and proves the duplicate-on-repair killer +
the measured phantom-device count.
Grounded in the live fleet: device A is the operator's REAL TP-Link Kasa
HS210 (SSID TP-LINK_HS210_C209, BSSID d8:0d:17:a1:c2:09), and its :9999
reply is built by ENCRYPTING a sysinfo plaintext with the same autokey
XOR a real bulb uses -- so the decode path is exercised end to end.
Coverage:
- discovery-verdict sealed-enum validity gate
- Kasa (:9999, XOR) -> decrypt + classify KASA + NEW
- WiZ (:38899, cleartext) -> classify WIZ + NEW
- MagicHome (service :5577) -> classify MAGICHOME by port + NEW
- Tuya (:6667, devId) -> classify TUYA + NEW
- NEG control: garbage + off-table port + no MAC -> UNKNOWN, but STILL
anchored (UNKNOWN is first-class; no silent drop)
- LIAR-KILL: the Kasa XOR decode must round-trip byte-exact + read as
sysinfo (break the codec -> RED)
- DEDUP: re-discover A (roamed IP) -> SAME logical id, NO new row
- MEASURED EXCEED: duplicates_prevented == naive_adopts - count == 1
- NEG control: bad arg (hwid_n=0) -> DISC_BAD_ARG, no state change
expect_exit: 0
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls_x86_64.nxnx_iot_discover.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 35 | func dt_buf_eq(a: *u8, b: *u8, n: i64) -> i64 called by 1: main |
| 54 | func main() -> i64 |