diff --git a/models/evc.py b/models/evc.py index 84e22929..8b7001aa 100644 --- a/models/evc.py +++ b/models/evc.py @@ -694,6 +694,7 @@ def remove_failover_flows(self, exclude_uni_switches=True, { "cookie": cookie, "cookie_mask": int(0xffffffffffffffff), + "owner": "mef_eline", } ], "delete", @@ -725,7 +726,8 @@ def remove_current_flows(self, force=True, sync=True): switches.add(self.uni_z.interface.switch) match = { "cookie": self.get_cookie(), - "cookie_mask": int(0xffffffffffffffff) + "cookie_mask": int(0xffffffffffffffff), + "owner": "mef_eline", } for switch in switches: @@ -766,6 +768,7 @@ def remove_path_flows( dpid_flows_match[dpid].append({ "cookie": flow["cookie"], "match": flow["match"], + "owner": "mef_eline", "cookie_mask": int(0xffffffffffffffff) }) @@ -783,6 +786,7 @@ def remove_path_flows( dpid_flows_match[dpid].append({ "cookie": flow["cookie"], "match": flow["match"], + "owner": "mef_eline", "cookie_mask": int(0xffffffffffffffff) }) diff --git a/tests/unit/models/test_evc_deploy.py b/tests/unit/models/test_evc_deploy.py index 6691e7b2..0d478464 100644 --- a/tests/unit/models/test_evc_deploy.py +++ b/tests/unit/models/test_evc_deploy.py @@ -1008,7 +1008,8 @@ def test_remove_current_flows(self, *args): assert send_flow_mods_mocked.call_count == 5 assert evc.is_active() is False flows = [ - {"cookie": evc.get_cookie(), "cookie_mask": 18446744073709551615} + {"cookie": evc.get_cookie(), "cookie_mask": 18446744073709551615, + "owner": "mef_eline"} ] switch_1 = evc.primary_links[0].endpoint_a.switch switch_2 = evc.primary_links[0].endpoint_b.switch @@ -1076,7 +1077,8 @@ def test_remove_failover_flows_exclude_uni_switches(self, *args): assert send_flow_mods_mocked.call_count == 1 flows = [ {"cookie": evc.get_cookie(), - "cookie_mask": int(0xffffffffffffffff)} + "cookie_mask": int(0xffffffffffffffff), + "owner": "mef_eline"} ] send_flow_mods_mocked.assert_any_call(switch_b.id, flows, 'delete', force=True) @@ -1140,7 +1142,8 @@ def test_remove_failover_flows_include_all(self, *args): assert send_flow_mods_mocked.call_count == 3 flows = [ {"cookie": evc.get_cookie(), - "cookie_mask": int(0xffffffffffffffff)} + "cookie_mask": int(0xffffffffffffffff), + "owner": "mef_eline"} ] send_flow_mods_mocked.assert_any_call(switch_a.id, flows, 'delete', force=True) @@ -1367,6 +1370,7 @@ def test_remove_path_flows(self, *args): { 'cookie': 12249790986447749121, 'cookie_mask': 18446744073709551615, + "owner": "mef_eline", 'match': {'in_port': 9, 'dl_vlan': 5} }, ] @@ -1374,11 +1378,13 @@ def test_remove_path_flows(self, *args): { 'cookie': 12249790986447749121, 'cookie_mask': 18446744073709551615, + "owner": "mef_eline", 'match': {'in_port': 10, 'dl_vlan': 5} }, { 'cookie': 12249790986447749121, 'cookie_mask': 18446744073709551615, + "owner": "mef_eline", 'match': {'in_port': 11, 'dl_vlan': 6} }, ] @@ -1386,6 +1392,7 @@ def test_remove_path_flows(self, *args): { 'cookie': 12249790986447749121, 'cookie_mask': 18446744073709551615, + "owner": "mef_eline", 'match': {'in_port': 12, 'dl_vlan': 6} }, ] diff --git a/utils.py b/utils.py index ccd440b2..32db4cbc 100644 --- a/utils.py +++ b/utils.py @@ -192,6 +192,7 @@ def prepare_delete_flow(evc_flows: dict[str, list[dict]]): dpid_flows[dpid].append({ "cookie": flow["cookie"], "match": flow["match"], + "owner": "mef_eline", "cookie_mask": int(0xffffffffffffffff) }) return dpid_flows