]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: hostapd global-to-local control interface redirection
authorAnton Nayshtut <qca_antonn@qca.qualcomm.com>
Mon, 22 Jun 2015 08:27:13 +0000 (11:27 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 16 Jul 2015 17:23:26 +0000 (20:23 +0300)
This implements basic global-to-local control interface command
redirection tests.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/hostapd.py
tests/hwsim/test_hapd_ctrl.py

index 69eeb1d3463ba143493d5876479d598add3a33dd..c8df679236b2809a4e20b58bee1c99ab6417ac35 100644 (file)
@@ -44,6 +44,9 @@ class HostapdGlobal:
                 break
         return None
 
+    def request(self, cmd):
+        return self.ctrl.request(cmd)
+
     def add(self, ifname):
         res = self.ctrl.request("ADD " + ifname + " " + hapd_ctrl)
         if not "OK" in res:
index da2c270195066b1ba6fc54d443b0943c835bf2fe..d176641fc94d1ec2336007da8fd8f0b64aa82e63 100644 (file)
@@ -435,3 +435,17 @@ def test_hapd_ctrl_set_error_cases(dev, apdev):
     for e in no_err:
         if "OK" not in hapd.request("SET " + e):
             raise Exception("Unexpected SET failure: '%s'" % e)
+
+def test_hapd_ctrl_global(dev, apdev):
+    """hostapd and GET ctrl_iface command"""
+    ssid = "hapd-ctrl"
+    params = { "ssid": ssid }
+    ifname = apdev[0]['ifname']
+    hapd = hostapd.add_ap(ifname, params)
+    hapd_global = hostapd.HostapdGlobal()
+    res = hapd_global.request("IFNAME=" + ifname + " PING")
+    if "PONG" not in res:
+            raise Exception("Could not ping hostapd interface " + ifname + " via global control interface")
+    res = hapd_global.request("IFNAME=" + ifname + " GET version")
+    if "FAIL" in res:
+           raise Exception("Could not get hostapd version for " + ifname + " via global control interface")