From: Benjamin Berg <bberg@xxxxxxxxxx> This tests an error, where the p2p_long_listen information from the wrong device was used internally in wpa_supplicant. Note that to test the hwsim option support_p2p_device needs to be enabled. Signed-off-by: Benjamin Berg <bberg@xxxxxxxxxx> --- tests/hwsim/start.sh | 2 +- tests/hwsim/test_p2p_discovery.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/start.sh b/tests/hwsim/start.sh index 7a26d2825..e3a1a4a19 100755 --- a/tests/hwsim/start.sh +++ b/tests/hwsim/start.sh @@ -110,7 +110,7 @@ else NUM_CH=1 fi -test -f /proc/modules && sudo modprobe mac80211_hwsim radios=7 channels=$NUM_CH support_p2p_device=0 dyndbg=+p +test -f /proc/modules && sudo modprobe mac80211_hwsim radios=7 channels=$NUM_CH support_p2p_device=1 dyndbg=+p sudo ifconfig hwsim0 up sudo $WLANTEST -i hwsim0 -n $LOGDIR/hwsim0.pcapng -c -dtN -L $LOGDIR/hwsim0 & diff --git a/tests/hwsim/test_p2p_discovery.py b/tests/hwsim/test_p2p_discovery.py index 5f9f6c940..b26e28390 100644 --- a/tests/hwsim/test_p2p_discovery.py +++ b/tests/hwsim/test_p2p_discovery.py @@ -654,6 +654,18 @@ 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""" + addr0 = dev[0].p2p_dev_addr() + dev[0].request("P2P_LISTEN 15") + + # Wait for remain maximum remain-on-channel time to pass + time.sleep(7) + + if not dev[1].discover_peer(addr0): + raise Exception("Device discovery timed out") + dev[1].p2p_stop_find() + def pd_test(dev, addr): if not dev.discover_peer(addr, freq=2412): raise Exception("Device discovery timed out") -- 2.24.1 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap