tests: Add option to specify ifname to get_bss()

This is needed for cases that the group interface differs from the main
interface, i.e., when a dedicated P2P Device interface is used.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
This commit is contained in:
Ilan Peer 2015-02-04 04:30:24 -05:00 committed by Jouni Malinen
parent 5270b2fbb7
commit fb9cf82eb3

View file

@ -946,8 +946,14 @@ class WpaSupplicant:
return None
return res.split(' ')
def get_bss(self, bssid):
res = self.request("BSS " + bssid)
def get_bss(self, bssid, ifname=None):
if not ifname or ifname == self.ifname:
res = self.request("BSS " + bssid)
elif ifname == self.group_ifname:
res = self.group_request("BSS " + bssid)
else:
return None
if "FAIL" in res:
return None
lines = res.splitlines()