]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Test p2p_long_listen longer than remain-on-channel
authorBenjamin Berg <bberg@redhat.com>
Fri, 3 Jan 2020 21:18:52 +0000 (22:18 +0100)
committerJouni Malinen <j@w1.fi>
Sat, 4 Jan 2020 21:07:31 +0000 (23:07 +0200)
This tests an error, where the p2p_long_listen information from the
wrong device was used internally in wpa_supplicant when using the
separate P2P Device interface.

Signed-off-by: Benjamin Berg <bberg@redhat.com>
tests/hwsim/test_p2p_discovery.py

index 5f9f6c9404dc5ead9894d61a6d177360f00552c0..f4353e80fc359e32adb2f2ca2b98859fa439af44 100644 (file)
@@ -654,6 +654,22 @@ def test_discovery_long_listen(dev):
     dev[1].p2p_stop_find()
     wpas.p2p_stop_find()
 
+def test_discovery_long_listen2(dev):
+    """Long P2P_LISTEN longer than remain-on-channel time"""
+    with HWSimRadio(use_p2p_device=True) as (radio, iface):
+        wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
+        wpas.interface_add(iface)
+        addr = wpas.p2p_dev_addr()
+        wpas.request("P2P_LISTEN 15")
+
+        # Wait for remain maximum remain-on-channel time to pass
+        time.sleep(7)
+
+        if not dev[0].discover_peer(addr):
+            raise Exception("Device discovery timed out")
+        dev[0].p2p_stop_find()
+        wpas.p2p_stop_find()
+
 def pd_test(dev, addr):
     if not dev.discover_peer(addr, freq=2412):
         raise Exception("Device discovery timed out")