From 1d5740e70286566803c10b82ed88c69025b3b0b0 Mon Sep 17 00:00:00 2001 From: Baorong Liu <96146196+baorliu@users.noreply.github.com> Date: Mon, 23 Jan 2023 09:43:07 -0800 Subject: [PATCH 1/2] [bfdorch] add local discriminator to state DB add local discriminator to state DB for "show bfd summary/peer" to show it. --- orchagent/bfdorch.cpp | 4 +++- tests/test_bfd.py | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/orchagent/bfdorch.cpp b/orchagent/bfdorch.cpp index 562fbf8c22..f242645b35 100644 --- a/orchagent/bfdorch.cpp +++ b/orchagent/bfdorch.cpp @@ -306,9 +306,11 @@ bool BfdOrch::create_bfd_session(const string& key, const vector Date: Mon, 23 Jan 2023 22:47:17 -0800 Subject: [PATCH 2/2] [bfdorch][vstest] fix local discriminator in test_bfd.py --- tests/test_bfd.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/test_bfd.py b/tests/test_bfd.py index bfb3f6fe17..3a087e2011 100644 --- a/tests/test_bfd.py +++ b/tests/test_bfd.py @@ -192,7 +192,7 @@ def test_addRemoveBfdSession_txrx_interval(self, dvs): # Check STATE_DB entry related to the BFD session expected_sdb_values = {"state": "Down", "type": "async_active", "local_addr" : "10.0.0.1", "tx_interval" :"300", - "rx_interval" : "500", "multiplier" : "10", "multihop": "false", "local_discriminator" : "3"} + "rx_interval" : "500", "multiplier" : "10", "multihop": "false", "local_discriminator" : "4"} self.check_state_bfd_session_value("default|default|10.0.0.2", expected_sdb_values) # Send BFD session state notification to update BFD session state @@ -233,7 +233,7 @@ def test_addRemoveBfdSession_multiplier(self, dvs): # Check STATE_DB entry related to the BFD session expected_sdb_values = {"state": "Down", "type": "async_active", "local_addr" : "10.0.0.1", "tx_interval" :"1000", - "rx_interval" : "1000", "multiplier" : "5", "multihop": "false", "local_discriminator" : "4"} + "rx_interval" : "1000", "multiplier" : "5", "multihop": "false", "local_discriminator" : "5"} self.check_state_bfd_session_value("default|default|10.0.0.2", expected_sdb_values) # Send BFD session state notification to update BFD session state @@ -274,7 +274,7 @@ def test_addRemoveBfdSession_multihop(self, dvs): # Check STATE_DB entry related to the BFD session expected_sdb_values = {"state": "Down", "type": "async_active", "local_addr" : "10.0.0.1", "tx_interval" :"1000", - "rx_interval" : "1000", "multiplier" : "10", "multihop": "true", "local_discriminator" : "5"} + "rx_interval" : "1000", "multiplier" : "10", "multihop": "true", "local_discriminator" : "6"} self.check_state_bfd_session_value("default|default|10.0.0.2", expected_sdb_values) # Send BFD session state notification to update BFD session state @@ -314,7 +314,7 @@ def test_addRemoveBfdSession_type(self, dvs): # Check STATE_DB entry related to the BFD session expected_sdb_values = {"state": "Down", "type": "demand_active", "local_addr" : "10.0.0.1", "tx_interval" :"1000", - "rx_interval" : "1000", "multiplier" : "10", "multihop": "false", "local_discriminator" : "6"} + "rx_interval" : "1000", "multiplier" : "10", "multihop": "false", "local_discriminator" : "7"} self.check_state_bfd_session_value("default|default|10.0.0.2", expected_sdb_values) # Send BFD session state notification to update BFD session state @@ -357,7 +357,7 @@ def test_multipleBfdSessions(self, dvs): # Check STATE_DB entry related to the BFD session 1 key_state_db1 = "default|default|10.0.0.2" expected_sdb_values1 = {"state": "Down", "type": "async_active", "local_addr" : "10.0.0.1", "tx_interval" :"1000", - "rx_interval" : "1000", "multiplier" : "10", "multihop": "false", "local_discriminator" : "7"} + "rx_interval" : "1000", "multiplier" : "10", "multihop": "false", "local_discriminator" : "8"} self.check_state_bfd_session_value(key_state_db1, expected_sdb_values1) # Create BFD session 2 @@ -385,7 +385,7 @@ def test_multipleBfdSessions(self, dvs): # Check STATE_DB entry related to the BFD session 2 key_state_db2 = "default|default|10.0.1.2" expected_sdb_values2 = {"state": "Down", "type": "async_active", "local_addr" : "10.0.0.1", "tx_interval" :"300", - "rx_interval" : "500", "multiplier" : "10", "multihop": "false", "local_discriminator" : "8"} + "rx_interval" : "500", "multiplier" : "10", "multihop": "false", "local_discriminator" : "9"} self.check_state_bfd_session_value(key_state_db2, expected_sdb_values2) # Create BFD session 3 @@ -411,7 +411,7 @@ def test_multipleBfdSessions(self, dvs): # Check STATE_DB entry related to the BFD session 3 key_state_db3 = "default|default|2000::2" expected_sdb_values3 = {"state": "Down", "type": "demand_active", "local_addr" : "2000::1", "tx_interval" :"1000", - "rx_interval" : "1000", "multiplier" : "10", "multihop": "false", "local_discriminator" : "9"} + "rx_interval" : "1000", "multiplier" : "10", "multihop": "false", "local_discriminator" : "10"} self.check_state_bfd_session_value(key_state_db3, expected_sdb_values3) # Create BFD session 4 @@ -437,7 +437,7 @@ def test_multipleBfdSessions(self, dvs): # Check STATE_DB entry related to the BFD session 4 key_state_db4 = "default|default|3000::2" expected_sdb_values4 = {"state": "Down", "type": "async_active", "local_addr" : "3000::1", "tx_interval" :"1000", - "rx_interval" : "1000", "multiplier" : "10", "multihop": "false", "local_discriminator" : "10"} + "rx_interval" : "1000", "multiplier" : "10", "multihop": "false", "local_discriminator" : "11"} self.check_state_bfd_session_value(key_state_db4, expected_sdb_values4) # Update BFD session states