diff mbox series

[v5,03/10] auto-t: fix testDPP after Stop() change

Message ID 20231108172155.2129509-4-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series DPP PKEX Changes | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

James Prestwood Nov. 8, 2023, 5:21 p.m. UTC
Stop() will now return NotFound if DPP is not running. This causes
the DPP test to fail since it calls this regardless if the protocol
already stopped. Ignore this exception since tests end in various
states, some stopped and some not.
---
 autotests/testDPP/connection_test.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/autotests/testDPP/connection_test.py b/autotests/testDPP/connection_test.py
index 0cab5ff1..f72a412d 100644
--- a/autotests/testDPP/connection_test.py
+++ b/autotests/testDPP/connection_test.py
@@ -148,8 +148,13 @@  class Test(unittest.TestCase):
         self.rule0.drop = True
 
     def tearDown(self):
-        self.device.disconnect()
-        self.device.dpp_stop()
+        # Tests end in various states, don't fail when tearing down.
+        try:
+            self.device.disconnect()
+            self.device.dpp_stop()
+        except:
+            pass
+
         self.wpas.dpp_configurator_remove()
         self.wpas.clean_up()