# P2P group formation test cases
-# Copyright (c) 2013-2014, Jouni Malinen <j@w1.fi>
+# Copyright (c) 2013-2019, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
dev[2].dump_monitor()
logger.info("Starting p2p_find to change state")
dev[2].p2p_find()
- ev = dev[2].wait_global_event(["P2P-GO-NEG-FAILURE"], timeout=100)
+ for i in range(10):
+ ev = dev[2].wait_global_event(["P2P-GO-NEG-FAILURE"], timeout=10)
+ if ev:
+ break
+ dev[2].dump_monitor(global_mon=False)
if ev is None:
raise Exception("GO Negotiation failure timed out(2)")
dev[2].dump_monitor()
if wpas.p2p_dev_addr() not in ev:
raise Exception("Unexpected device found: " + ev)
dev[2].p2p_stop_find()
+ dev[2].dump_monitor()
wpas.p2p_stop_find()
+ wpas.close_monitor()
+ del wpas
# Finally, verify without p2p_find
ev = dev[0].wait_global_event(["P2P-GO-NEG-FAILURE"], timeout=120)
if "reason=GO_ENDING_SESSION" not in ev:
raise Exception("Unexpected group removal reason")
- def dump_monitor(self):
+ def dump_monitor(self, mon=True, global_mon=True):
count_iface = 0
count_global = 0
- while self.monitor and self.mon.pending():
+ while mon and self.monitor and self.mon.pending():
ev = self.mon.recv()
logger.debug(self.dbg + ": " + ev)
count_iface += 1
- while self.monitor and self.global_mon and self.global_mon.pending():
+ while global_mon and self.monitor and self.global_mon and self.global_mon.pending():
ev = self.global_mon.recv()
logger.debug(self.global_dbg + self.ifname + "(global): " + ev)
count_global += 1