1# Running WiFi tests 2 3Most WiFi tests specify `DEPENDENCIES = 'wificell'` in their control file, 4which means they require not only an autotest server and a DUT, but also a 5special test-enabled Access Point (AP). Additionally, some tests require a 6packet capture (pcap) device or a signal attenuator. 7 8The basics of running a wificell autotest are the same as any other, except 9that autotest also needs to know where to find your test AP. For some 10configurations, this is sufficient: 11 12```bash 13# Run a 5HT40 test with DUT at 'my-host' and AP at 'my-host-router'. 14test_that my-host network_WiFi_SimpleConnect.wifi_check5HT40 15```` 16 17This works for most of the Chrome OS lab WiFi cells, where we configure DNS to 18pair a DUT at address `${HOST}` with its companion AP at an address 19`${HOST}-router`. See below for more info on addressing your test AP. 20 21## What is a test AP? 22 23A test AP can come in various forms, but as of this writing, it is typically a 24Chrome OS based router / access point such as Whirlwind or Gale, running a 25testbed-ap variant of a Chrome OS test image in Developer Mode. We have 26previously supported other consumer routers, running OpenWRT. Setting up a test 27AP is not in the scope for this document. 28 29The key purpose of a test AP is to run a variety of [hostapd] instances, such 30that we can test our DUTs using different PHY, cipher, etc., configurations. 31 32In autotest, a test AP is represented by a `LinuxRouter` object, in 33[site\_linux\_router]. 34 35## What suites should I run? 36 37There are a variety of WiFi-related suites, but developers are commonly 38interested in the functionality (`wifi_matfunc`) and performance (`wifi_perf`) 39suites. 40 41## Configuring DNS entries for test APs 42 43Autotest assumes that if you have a DUT at address `${HOST}`, then your AP is 44at an address `${HOST}-router` (see [dnsname\_mangler]). This is configured 45automatically by the lab team for most Chrome OS lab WiFi setups. 46 47For custom/local testing without modifying your DNS server, one can accomplish 48this by adding entries to your `/etc/hosts` file. Alternatively, you can supply 49the `router_addr=` arguments to autotest. For example: 50 51```bash 52# DUT at 'my-host' and AP at 'my-other-router' 53test_that --args=router_addr=my-other-router my-host suite:wifi_matfunc 54``` 55 56Also, note that if a pcap device isn't found at `${HOST}-pcap`, then we often 57can utilize the test AP to capture packets as well. 58 59[dnsname\_mangler]: ../server/cros/dnsname_mangler.py 60[hostapd]: https://w1.fi/hostapd/ 61[site\_linux\_router]: ../server/site_linux_router.py 62