[PATCH 07/18] tests: Fetch BSS from P2P device interface

Benjamin Berg benjamin at sipsolutions.net
Thu Oct 30 01:24:38 PDT 2025


From: Benjamin Berg <benjamin.berg at intel.com>

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 <benjamin.berg at intel.com>

---

Hi,

On the one hand, this seems reasonable to me in a way. On the other
hand, this is fallout from commit 4435bc1b8abc ("Fix sibling scan
results update criteria for different channels") which does not really
seem quite right in general (see previous patches).

So, I guess a decision needs to be made how the sibling scan result
update should work. The current situation doesn't seem quite right and
we can still pull in this patch if it is needed after adjustments.

Benjamin

Signed-off-by: Benjamin Berg <benjamin.berg at intel.com>
---
 tests/hwsim/test_p2p_wifi_display.py | 3 ++-
 tests/hwsim/wpasupplicant.py         | 6 ++----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/tests/hwsim/test_p2p_wifi_display.py b/tests/hwsim/test_p2p_wifi_display.py
index 7daf7b93aa..d174fdde3b 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,7 @@ 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 2bce874270..fb512eddae 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
-- 
2.51.0




More information about the Hostap mailing list