From 5a21764994dbf7f8e0bc5a498ca3847f28a414e6 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 3 Aug 2015 18:35:35 +0300 Subject: [PATCH] tests: Avoid exception in dbus_p2p_two_groups Only run peerJoined() steps once to avoid trying to use GetAll() on an already removed group and double-removal of a group. This did not make the test case fail, but the exception is printed out in pretty confusing way to stdout, so better get rid of it. Signed-off-by: Jouni Malinen --- tests/hwsim/test_dbus.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/hwsim/test_dbus.py b/tests/hwsim/test_dbus.py index daba14e64..ff888b78e 100644 --- a/tests/hwsim/test_dbus.py +++ b/tests/hwsim/test_dbus.py @@ -4438,6 +4438,7 @@ def test_dbus_p2p_two_groups(dev, apdev): self.go = None self.group1 = None self.group2 = None + self.groups_removed = False def __enter__(self): gobject.timeout_add(1, self.run_test) @@ -4542,6 +4543,8 @@ def test_dbus_p2p_two_groups(dev, apdev): def peerJoined(self, peer): logger.debug("peerJoined: " + peer) + if self.groups_removed: + return self.check_results() dev2 = WpaSupplicant('wlan2', '/tmp/wpas-wlan2') @@ -4557,6 +4560,7 @@ def test_dbus_p2p_two_groups(dev, apdev): group_p2p = dbus.Interface(self.g1_if_obj, WPAS_DBUS_IFACE_P2PDEVICE) group_p2p.Disconnect() + self.groups_removed = True def check_results(self): logger.info("Check results with two concurrent groups in operation")