From 6503deb9aca311f166ad2a34ff7bf0b09dd174e3 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 12 Oct 2014 16:46:24 +0300 Subject: [PATCH] tests: Wi-Fi Display element updates and P2P-DEVICE-FOUND Signed-off-by: Jouni Malinen --- tests/hwsim/test_p2p_wifi_display.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/hwsim/test_p2p_wifi_display.py b/tests/hwsim/test_p2p_wifi_display.py index affb7ea4e..c5dcb0b00 100644 --- a/tests/hwsim/test_p2p_wifi_display.py +++ b/tests/hwsim/test_p2p_wifi_display.py @@ -62,6 +62,8 @@ def test_wifi_display(dev): raise Exception("Device discovery timed out") if "wfd_dev_info=0x" + wfd_devinfo not in ev: raise Exception("Wi-Fi Display Info not in P2P-DEVICE-FOUND event") + if "new=1" not in ev: + raise Exception("new=1 flag missing from P2P-DEVICE-FOUND event") ev = dev[1].wait_global_event(["P2P-SERV-DISC-RESP"], timeout=5) if ev is None: raise Exception("Service discovery timed out") @@ -74,6 +76,25 @@ def test_wifi_display(dev): if audio not in ev: raise Exception("WFD Audio Formats missing from WSD response") + dev[1].dump_monitor() + dev[0].request("WFD_SUBELEM_SET 0 0006" + wfd_devinfo2) + ev = dev[1].wait_global_event(["P2P-DEVICE-FOUND"], timeout=15) + if ev is None: + raise Exception("Peer info update timed out") + if "new=0" not in ev: + raise Exception("new=0 flag missing from P2P-DEVICE-FOUND event") + if "wfd_dev_info=0x" + wfd_devinfo2 not in ev: + raise Exception("Wi-Fi Display Info not in P2P-DEVICE-FOUND event") + dev[1].dump_monitor() + dev[0].request("WFD_SUBELEM_SET 0 0006" + wfd_devinfo) + ev = dev[1].wait_global_event(["P2P-DEVICE-FOUND"], timeout=15) + if ev is None: + raise Exception("Peer info update timed out") + if "new=0" not in ev: + raise Exception("new=0 flag missing from P2P-DEVICE-FOUND event") + if "wfd_dev_info=0x" + wfd_devinfo not in ev: + raise Exception("Wi-Fi Display Info not in P2P-DEVICE-FOUND event") + pin = dev[0].wps_read_pin() dev[0].p2p_go_neg_auth(dev[1].p2p_dev_addr(), pin, 'display') res1 = dev[1].p2p_go_neg_init(dev[0].p2p_dev_addr(), pin, 'enter', timeout=20, go_intent=15)