From 2615d10db8ca9c6c162d7bdbc3a9ee834ded1dc1 Mon Sep 17 00:00:00 2001 From: Simon Lin Date: Fri, 5 Aug 2022 12:18:19 +0800 Subject: [PATCH] [border-agent] refine meshcop service state bitmap checks (#7950) --- .../border_router/test_publish_meshcop_service.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/scripts/thread-cert/border_router/test_publish_meshcop_service.py b/tests/scripts/thread-cert/border_router/test_publish_meshcop_service.py index 25e5cd4f3..afc8d3349 100755 --- a/tests/scripts/thread-cert/border_router/test_publish_meshcop_service.py +++ b/tests/scripts/thread-cert/border_router/test_publish_meshcop_service.py @@ -157,8 +157,11 @@ class PublishMeshCopService(thread_cert.TestCase): self.assertEqual((state_bitmap >> 3 & 3), 2) # Thread is attached self.assertEqual((state_bitmap >> 5 & 3), 1) # high availability self.assertEqual((state_bitmap >> 7 & 1), + br.get_state() not in ['disabled', 'detached'] and br.get_backbone_router_state() != 'Disabled') # BBR is enabled or not - self.assertEqual((state_bitmap >> 8 & 1), br.get_backbone_router_state() == 'Primary') # BBR is primary or not + self.assertEqual((state_bitmap >> 8 & 1), + br.get_state() not in ['disabled', 'detached'] and + br.get_backbone_router_state() == 'Primary') # BBR is primary or not self.assertEqual(service_data['txt']['nn'], br.get_network_name()) self.assertEqual(service_data['txt']['rv'], '1') self.assertIn(service_data['txt']['tv'], ['1.1.0', '1.1.1', '1.2.0', '1.3.0'])