From 99eb150deb85300486aff9422a65620835c9bca4 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Fri, 3 Jan 2020 22:18:52 +0100 Subject: [PATCH] tests: Test p2p_long_listen longer than remain-on-channel 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 --- tests/hwsim/test_p2p_discovery.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/hwsim/test_p2p_discovery.py b/tests/hwsim/test_p2p_discovery.py index 5f9f6c940..f4353e80f 100644 --- a/tests/hwsim/test_p2p_discovery.py +++ b/tests/hwsim/test_p2p_discovery.py @@ -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")