From 6635201aa190c3f8f929d0e2f5a7543134537ba2 Mon Sep 17 00:00:00 2001 From: Jason Zhang Date: Thu, 8 Aug 2024 22:37:57 +0800 Subject: [PATCH] [thread-cert] fix bug that docker network is not removed (#10590) In some cases that `_do_packet_verification` is False (e.g. verify() is not defined), the docker network is not correctly removed. docker network interface should always be removed at the end of the test if it was created at the begin of the test --- tests/scripts/thread-cert/thread_cert.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/scripts/thread-cert/thread_cert.py b/tests/scripts/thread-cert/thread_cert.py index 6da6dc2cc..5de900405 100644 --- a/tests/scripts/thread-cert/thread_cert.py +++ b/tests/scripts/thread-cert/thread_cert.py @@ -296,10 +296,12 @@ class TestCase(NcpSupportMixin, unittest.TestCase): self.simulator.stop() + if self._has_backbone_traffic(): + self._remove_backbone_network() + if self._do_packet_verification: if self._has_backbone_traffic(): - self._remove_backbone_network() pcap_filename = self._merge_thread_backbone_pcaps() else: pcap_filename = self._get_thread_pcap_filename()