Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VRF]Fixing vrf orch to update state_db when evpn nvo arrives late #41

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading