From f42c51a0f036a8bb47692e42260b5b14832c6d38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 29 Mar 2026 03:35:14 +0200 Subject: [PATCH] tests: fix failure handling in test_031_firewall_dynamic_block If the test fails early, client1 and/or client2 may be not set yet. Handle that case, to not fail in the 'finally' section. --- qubes/tests/integ/network.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qubes/tests/integ/network.py b/qubes/tests/integ/network.py index 9fbb267d8..d6e950c6a 100644 --- a/qubes/tests/integ/network.py +++ b/qubes/tests/integ/network.py @@ -807,6 +807,8 @@ def test_031_firewall_dynamic_block(self): ) ) + client1 = None + client2 = None try: self.assertEqual( self.run_cmd(self.testvm1, self.ping_ip), 0, "Ping by IP failed" @@ -871,10 +873,10 @@ def test_031_firewall_dynamic_block(self): if server2.returncode is None: server2.terminate() self.loop.run_until_complete(server2.wait()) - if client1.returncode is None: + if client1 and client1.returncode is None: client1.terminate() self.loop.run_until_complete(client1.wait()) - if client2.returncode is None: + if client2 and client2.returncode is None: client2.terminate() self.loop.run_until_complete(client2.wait())