]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: hostapd control interface - STATUS commands
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 10 Mar 2014 08:39:23 +0000 (10:39 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 10 Mar 2014 08:39:23 +0000 (10:39 +0200)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_hapd_ctrl.py [new file with mode: 0644]

diff --git a/tests/hwsim/test_hapd_ctrl.py b/tests/hwsim/test_hapd_ctrl.py
new file mode 100644 (file)
index 0000000..b82c037
--- /dev/null
@@ -0,0 +1,30 @@
+# hostapd control interface
+# Copyright (c) 2014, Qualcomm Atheros, Inc.
+#
+# This software may be distributed under the terms of the BSD license.
+# See README for more details.
+
+import hostapd
+
+def test_hapd_ctrl_status(dev, apdev):
+    """hostapd ctrl_iface STATUS commands"""
+    ssid = "hapd-ctrl"
+    bssid = apdev[0]['bssid']
+    params = hostapd.wpa2_params(ssid=ssid, passphrase="12345678")
+    hapd = hostapd.add_ap(apdev[0]['ifname'], params)
+    status = hapd.get_status()
+    driver = hapd.get_driver_status()
+
+    if status['bss[0]'] != apdev[0]['ifname']:
+        raise Exception("Unexpected bss[0]")
+    if status['ssid[0]'] != ssid:
+        raise Exception("Unexpected ssid[0]")
+    if status['bssid[0]'] != bssid:
+        raise Exception("Unexpected bssid[0]")
+    if status['freq'] != "2412":
+        raise Exception("Unexpected freq")
+
+    if driver['beacon_set'] != "1":
+        raise Exception("Unexpected beacon_set")
+    if driver['addr'] != bssid:
+        raise Exception("Unexpected addr")