From: Benjamin Berg Date: Thu, 30 Oct 2025 08:24:38 +0000 (+0100) Subject: tests: Fetch BSS from P2P device interface X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c193dba38c53a2bef0b2e22e7c5777f115c38357;p=thirdparty%2Fhostap.git tests: Fetch BSS from P2P device interface The wifi_display test needs to fetch the BSS from the P2P device interface when a separate interface is in use. Adjust the test so that it works in all configurations. Signed-off-by: Benjamin Berg --- diff --git a/tests/hwsim/test_p2p_wifi_display.py b/tests/hwsim/test_p2p_wifi_display.py index 7daf7b93a..effa53ab7 100644 --- a/tests/hwsim/test_p2p_wifi_display.py +++ b/tests/hwsim/test_p2p_wifi_display.py @@ -101,6 +101,7 @@ def test_wifi_display(dev): timeout=20, go_intent=15, freq=2437) res2 = dev[0].p2p_go_neg_auth_result() + # WPS enrollment does not happen on the P2P device interface bss = dev[0].get_bss("p2p_dev_addr=" + dev[1].p2p_dev_addr()) if bss['bssid'] != dev[1].p2p_interface_addr(): raise Exception("Unexpected BSSID in the BSS entry for the GO") @@ -128,7 +129,8 @@ def test_wifi_display(dev): raise Exception("Could not discover GO") if "wfd_dev_info=0x" + wfd_devinfo2 not in ev: raise Exception("Wi-Fi Display Info not in P2P-DEVICE-FOUND event") - bss = dev[2].get_bss("p2p_dev_addr=" + dev[1].p2p_dev_addr()) + bss = dev[2].get_bss("p2p_dev_addr=" + dev[1].p2p_dev_addr(), + ifname=dev[2].p2p_dev_ifname) if bss['bssid'] != dev[1].p2p_interface_addr(): raise Exception("Unexpected BSSID in the BSS entry for the GO") if wfd_devinfo2 not in bss['wfd_subelems']: diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index 2bce87427..fb512edda 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -1349,12 +1349,10 @@ class WpaSupplicant: return res.split(' ') def get_bss(self, bssid, ifname=None): - if not ifname or ifname == self.ifname: + if not ifname: res = self.request("BSS " + bssid) - elif ifname == self.group_ifname: - res = self.group_request("BSS " + bssid) else: - return None + res = self.global_request("IFNAME=" + ifname + " BSS " + bssid) if "FAIL" in res: return None