aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJonathan Afek <jonathan@wizery.com>2016-05-29 12:03:40 (GMT)
committerJouni Malinen <j@w1.fi>2016-05-30 14:56:43 (GMT)
commitd28cfc2a255a6702c5aea0c37b53034e4baae4fc (patch)
tree2ebf6580d4988cf4d2d4533e7ddcc8fe42bfd27a /tests
parentf4b4ddfdd962cc1afea9dc3965bae4e5d8be8f5c (diff)
downloadhostap-d28cfc2a255a6702c5aea0c37b53034e4baae4fc.zip
hostap-d28cfc2a255a6702c5aea0c37b53034e4baae4fc.tar.gz
hostap-d28cfc2a255a6702c5aea0c37b53034e4baae4fc.tar.bz2
tests: Support P2P group interfaces in hwsim remote tests
Start using the wpa_supplicant remote UDP interface for the control and monitor sockets for P2P group interfaces so that P2P tests would work on real hardware. Also have the group requests and events show in the test log with the hostname and the interface name of the group interface. Signed-off-by: Jonathan Afek <jonathanx.afek@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/wpasupplicant.py30
1 files changed, 26 insertions, 4 deletions
diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py
index 77c84f8..7d80d6b 100644
--- a/tests/hwsim/wpasupplicant.py
+++ b/tests/hwsim/wpasupplicant.py
@@ -23,6 +23,7 @@ class WpaSupplicant:
self.group_ifname = None
self.gctrl_mon = None
self.host = remotehost.Host(hostname, ifname)
+ self._group_dbg = None
if ifname:
self.set_ifname(ifname, hostname, port)
res = self.get_driver_status()
@@ -156,10 +157,26 @@ class WpaSupplicant:
logger.debug(self.global_dbg + ifname + ": CTRL(global): " + cmd)
return self.global_ctrl.request(cmd)
+ @property
+ def group_dbg(self):
+ if self._group_dbg is not None:
+ return self._group_dbg
+ if self.group_ifname is None:
+ raise Exception("Cannot have group_dbg without group_ifname")
+ if self.hostname is None:
+ self._group_dbg = self.group_ifname
+ else:
+ self._group_dbg = self.hostname + "/" + self.group_ifname
+ return self._group_dbg
+
def group_request(self, cmd):
if self.group_ifname and self.group_ifname != self.ifname:
- logger.debug(self.group_ifname + ": CTRL: " + cmd)
- gctrl = wpaspy.Ctrl(os.path.join(wpas_ctrl, self.group_ifname))
+ if self.hostname is None:
+ gctrl = wpaspy.Ctrl(os.path.join(wpas_ctrl, self.group_ifname))
+ else:
+ port = self.get_ctrl_iface_port(self.group_ifname)
+ gctrl = wpaspy.Ctrl(self.hostname, port)
+ logger.debug(self.group_dbg + ": CTRL(group): " + cmd)
return gctrl.request(cmd)
return self.request(cmd)
@@ -574,7 +591,12 @@ class WpaSupplicant:
res['ifname'] = s[2]
self.group_ifname = s[2]
try:
- self.gctrl_mon = wpaspy.Ctrl(os.path.join(wpas_ctrl, self.group_ifname))
+ if self.hostname is None:
+ self.gctrl_mon = wpaspy.Ctrl(os.path.join(wpas_ctrl,
+ self.group_ifname))
+ else:
+ port = self.get_ctrl_iface_port(self.group_ifname)
+ self.gctrl_mon = wpaspy.Ctrl(self.hostname, port)
self.gctrl_mon.attach()
except:
logger.debug("Could not open monitor socket for group interface")
@@ -755,7 +777,7 @@ class WpaSupplicant:
while True:
while self.gctrl_mon.pending():
ev = self.gctrl_mon.recv()
- logger.debug(self.group_ifname + ": " + ev)
+ logger.debug(self.group_dbg + "(group): " + ev)
for event in events:
if event in ev:
return ev