tests: hostapd control interface - STATUS commands
[mech_eap.git] / tests / hwsim / test_hapd_ctrl.py
1 # hostapd control interface
2 # Copyright (c) 2014, Qualcomm Atheros, Inc.
3 #
4 # This software may be distributed under the terms of the BSD license.
5 # See README for more details.
6
7 import hostapd
8
9 def test_hapd_ctrl_status(dev, apdev):
10     """hostapd ctrl_iface STATUS commands"""
11     ssid = "hapd-ctrl"
12     bssid = apdev[0]['bssid']
13     params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
14     hapd = hostapd.add_ap(apdev[0]['ifname'], params)
15     status = hapd.get_status()
16     driver = hapd.get_driver_status()
17
18     if status['bss[0]'] != apdev[0]['ifname']:
19         raise Exception("Unexpected bss[0]")
20     if status['ssid[0]'] != ssid:
21         raise Exception("Unexpected ssid[0]")
22     if status['bssid[0]'] != bssid:
23         raise Exception("Unexpected bssid[0]")
24     if status['freq'] != "2412":
25         raise Exception("Unexpected freq")
26
27     if driver['beacon_set'] != "1":
28         raise Exception("Unexpected beacon_set")
29     if driver['addr'] != bssid:
30         raise Exception("Unexpected addr")