wifi_throughput

Source code: wifi_throughput.py

WiFi throughput test.

Description

Accepts a list of wireless services, checks for their signal strength and quality, connects to them, and tests data throughput rate using iperf3.

One notable difference about this test is how it processes arguments:
  1. Each service configuration must provide two required arguments “ssid” and “password”.

  2. If a service configuration does not provide an argument, it defaults to the “test-level” argument.

  3. If it was not provided as a “test-level” argument, it takes the default value passed to the Arg() constructor.

Test Procedure

Accepts a list of wireless services.

For each service:
  1. Checks signal strength.

  2. Checks quality devices.

  3. Connects to devices.

  4. Tests data throughput rate using iperf3.

Dependency

  • ifconfig utility

  • iperf3 utility

Examples

Here’s an example of input arguments. Users need to adjust the network topology and the IP. To pass go/pe-sw-gates, the device has to pass suite:wifi_perf which includes some iperf3 tests.:

{
  "pytest_name": "wifi_throughput",
  "label": "Wifi Throughput",
  "related_components": [
    "test_tags.TestCategory.WIFI"
  ],
  "exclusive_resources": [
    "NETWORK"
  ],
  "args": {
    "event_log_name": "wifi_throughput_in_chamber",
    "services": [
      {
        "ssid": "GoogleGuest-Legacy",
        "password": "",
        "min_rx_throughput": 80,
        "min_strength": -80,
        "iperf_host": "127.0.0.1",
        "iperf_port": 5201
      },
      {
        "ssid": "GoogleGuest-IPv4",
        "password": "",
        "min_rx_throughput": 80,
        "min_strength": -80,
        "iperf_host": "127.0.0.1",
        "iperf_port": 5201
      }
    ],
    "enable_iperf_server": true
  }
}

Test Arguments

Name

Type

Description

event_log_name

str

Name of the event_log. We might want to re-run the conductive test at different points in the factory, so this can be used to separate them. e.g. “wifi_throughput_in_chamber”

pre_command

str, None

(optional; default: None) Command to be run before executing the test. For example, this could be used to run “insmod” to load a WiFi module on the DUT. Does not check output of the command.

post_command

str, None

(optional; default: None) Command to be run after executing the test. For example, this could be used to run “rmmod” to unload a WiFi module on the DUT. Does not check output of the command.

interface

str, None

(optional; default: None) WLAN interface being used. e.g. wlan0. If not specified, it willfail if multiple devices are found, otherwise use the only one device it found.

arduino_high_pins

list, None

(optional; default: None) A list of ints. If not None, set arduino pins in the list to high.

blink_leds

bool

(optional; default: False) Whether or not to blink keyboard LEDs while running the test. Useful when running with DUT inside of a chamber, and using an external keyboard to show test status.

bind_wifi

bool

(optional; default: True) Whether we should restrict iperf3 to running on the WiFi interface.

disable_eth

bool

(optional; default: False) Whether we should disable ethernet interfaces while running the test.

use_ui_retry

bool

(optional; default: False) In the case that the iperf3 server is currently busy running a test, use the goofy UI to show a message forcing the tester to retry indefinitely until it can connect or until another error is received. When running at the command-line, this behaviour is not available.

services

list, dict

(optional; default: []) A list of dicts, each representing a WiFi service to test. At minimum, each must have a “ssid” field. Usually, a “password” field is also included. (Omit or set to None or “” for an open network.) Additionally, the following fields can be provided to override arguments passed to this test (refer to _SHARED_ARGS): min_strength, min_quality, iperf_host, transmit_time, transmit_interval, min_rx_throughput, min_tx_throughput. If services are not specified, this test will simply list APs. Also note that each service may only be specified once.

iperf_host

str, None

(optional; default: None) Host running iperf3 in server mode, used for testing data transmission speed. If it is CIDR format (IP/prefix), then interfaces will be scanned to find the one with an IP within the given CIDR, and iperf_host will take on this value. Useful for cases where the host’s IP may change (from using DHCP). The CIDR format is valid only when enable_iperf_server argument is enabled.

iperf_port

int, None

(optional; default: None) The port of the iperf server.

enable_iperf_server

bool

(optional; default: False) Start iperf server locally. In station-based testing we can run iperf server at the test station directly, instead of preparing another machine.

min_strength

int, None

(optional; default: None) Minimum signal strength required (measured in dBm). If the driver does not report this value, setting a limit always fail.

min_quality

int, None

(optional; default: None) Minimum link quality required (out of 100). If the driver does not report this value, setting a limit always fail.

transmit_time

int

(optional; default: 5) Time in seconds for which to transmit data.

transmit_interval

int, float

(optional; default: 1) There will be an overall average of transmission speed. But it may also be useful to check bandwidth within subintervals of this time. This argument can be used to check bandwidth for every interval of n seconds. Assuming nothing goes wrong, there will be ceil(transmit_time / n) intervals reported.

min_tx_throughput

int, None

(optional; default: None) Required DUT-to-host (TX) minimum throughput in Mbits/sec. If the average throughput is lower than this, will report a failure.

min_rx_throughput

int, None

(optional; default: None) Required host-to-DUT (RX) minimum throughput in Mbits/sec. If the average throughput is lower than this, will report a failure.