]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Wi-Fi Display element updates and P2P-DEVICE-FOUND
authorJouni Malinen <j@w1.fi>
Sun, 12 Oct 2014 13:46:24 +0000 (16:46 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 12 Oct 2014 13:46:24 +0000 (16:46 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_p2p_wifi_display.py

index affb7ea4ea6881fdcb3a5a68e77172b17a16ee36..c5dcb0b0069ac01cede7746fd34a2166db51276e 100644 (file)
@@ -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)