Skip to main content
Scan for access points and join networks using the box’s own wireless interface — useful when the DUT hosts an access point, or when the box needs to move between networks during a test.

Handle

WiFi is a box-level capability, not a net. There is no net name and no name().
This is the box’s own interface. It is not the NetType.Wifi net available in the Python API, which gates one DUT’s internet access through a router’s parental controls, and it is not a router net.

Methods

Types

Method Reference

status() -> Result<Vec<WifiInterface>>

Status of every wireless interface on the box.

scan(interface: &str) -> Result<Vec<WifiAccessPoint>>

Scan for access points, strongest first.

connect(ssid: &str, password: &str) -> Result<WifiConnection>

Join a network. Pass an empty password for an open network.

delete(ssid: &str) -> Result<()>

Delete a saved connection profile by SSID.

Examples

Assert the DUT brought up its access point

Notes

  • capabilities.wifi_command being true means the box serves the route, not that it can do the work. A box whose container has no nmcli installed answers scan() with Error::Box and HTTP 502 carrying [Errno 2] No such file or directory: 'nmcli', while status() returns an interface reporting Interface detection failed rather than erroring at all.
  • Every action gets a flat 90-second budget: nmcli and iwlist calls block for seconds, a connect can retry through wpa_supplicant, and they queue on the box’s wifi lock.
  • strength is an approximate percentage, not dBm.
  • Moving the box between networks can move the address you reach it at. Be careful connecting the box to a DUT-hosted AP if that is also the path your test is using.