From fb9cf82eb3d170b2fc01168ef526d8146a80dd38 Mon Sep 17 00:00:00 2001 From: Ilan Peer Date: Wed, 4 Feb 2015 04:30:24 -0500 Subject: [PATCH] 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 --- tests/hwsim/wpasupplicant.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index b8d153fcb..0ee653b82 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -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()