Skip to content

Commit

Permalink
[VRF]Fixing vrf orch to update state_db when evpn nvo arrives late
Browse files Browse the repository at this point in the history
  • Loading branch information
dgsudharsan committed May 7, 2024
1 parent 2e6c5b2 commit eac2d08
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions orchagent/vrforch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ bool VRFOrch::addOperation(const Request& request)
return false;
}

m_stateVrfObjectTable.hset(vrf_name, "state", "ok");
SWSS_LOG_NOTICE("VRF '%s' was updated", vrf_name.c_str());
}

Expand Down
29 changes: 29 additions & 0 deletions tests/test_evpn_l3_vxlan.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def setup_db(self, dvs):
self.pdb = swsscommon.DBConnector(0, dvs.redis_sock, 0)
self.adb = swsscommon.DBConnector(1, dvs.redis_sock, 0)
self.cdb = swsscommon.DBConnector(4, dvs.redis_sock, 0)
self.sdb = swsscommon.DBConnector(6, dvs.redis_sock, 0)

# Test 1 - Create and Delete SIP Tunnel and VRF VNI Map entries
# @pytest.mark.skip(reason="Starting Route Orch, VRF Orch to be merged")
Expand Down Expand Up @@ -597,6 +598,34 @@ def test_tunnel_ipv6_routes(self, dvs, testlog):
vxlan_obj.remove_vlan(dvs, "100")


def test_vrf_state_db_update(self, dvs, testlog):
vxlan_obj = self.get_vxlan_obj()
helper = self.get_vxlan_helper()

self.setup_db(dvs)
tunnel_name = 'tunnel_2'
map_name = 'map_1000_100'
vrf_map_name = 'evpn_map_1000_Vrf-RED'

vxlan_obj.fetch_exist_entries(dvs)


vxlan_obj.create_vrf(dvs, "Vrf-RED")
vxlan_obj.create_vxlan_vrf_tunnel_map(dvs, 'Vrf-RED', '1000')

time.sleep(2)
#adding nvo after
vxlan_obj.create_vxlan_tunnel(dvs, tunnel_name, '6.6.6.6')
vxlan_obj.create_evpn_nvo(dvs, 'nvo1', tunnel_name)
exp_attr = [
("state", "ok"),
]
helper.check_object(self.sdb, "VRF_OBJECT_TABLE", 'Vrf-RED', exp_attr)
vxlan_obj.remove_vxlan_vrf_tunnel_map(dvs, 'Vrf-RED')
vxlan_obj.remove_vrf(dvs, "Vrf-RED")
vxlan_obj.remove_vxlan_tunnel(dvs, tunnel_name)
vxlan_obj.remove_evpn_nvo(dvs, 'nvo1')

# Add Dummy always-pass test at end as workaroud
# for issue when Flaky fail on final test it invokes module tear-down before retrying
def test_nonflaky_dummy():
Expand Down

0 comments on commit eac2d08

Please sign in to comment.