From c087041146884eb50f28819dbaadcf9f3296bc78 Mon Sep 17 00:00:00 2001 From: arlakshm <55814491+arlakshm@users.noreply.github.com> Date: Mon, 9 Nov 2020 08:22:33 -0800 Subject: [PATCH] [bgp_facts]: add back the bgpmon checks (#2490) The test code to validate the STATE_DB BGP state was removed inverdently in one of the earlier commit. Adding it back in this PR Signed-off-by: Arvindsrinivasan Lakshminarasimhan --- tests/bgp/test_bgp_fact.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/bgp/test_bgp_fact.py b/tests/bgp/test_bgp_fact.py index 4cd7c9cf5ec..36e370e9897 100644 --- a/tests/bgp/test_bgp_fact.py +++ b/tests/bgp/test_bgp_fact.py @@ -18,6 +18,9 @@ def test_bgp_facts(duthosts, dut_hostname, asic_index): assert v['state'] == 'established' # Verify local ASNs in bgp sessions assert v['local AS'] == int(config_facts['DEVICE_METADATA']['localhost']['bgp_asn'].decode("utf-8")) + # Check bgpmon functionality by validate STATE DB contains this neighbor as well + state_fact = duthost.shell('sonic-db-cli STATE_DB HGET "NEIGH_STATE_TABLE|{}" "state"'.format(k), module_ignore_errors=False)['stdout_lines'] + assert state_fact[0] == "Established" for k, v in config_facts['BGP_NEIGHBOR'].items(): # Compare the bgp neighbors name with config db bgp neighbors name