From fb9b07551137657df6682dcee65d9f564ac29fb9 Mon Sep 17 00:00:00 2001 From: Vadym Hlushko Date: Tue, 26 Oct 2021 11:55:34 +0000 Subject: [PATCH] Removed check_nvgre_tunnel() Signed-off-by: Vadym Hlushko --- tests/test_nvgre_tunnel.py | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/tests/test_nvgre_tunnel.py b/tests/test_nvgre_tunnel.py index bf7be0288f8..58c64285324 100644 --- a/tests/test_nvgre_tunnel.py +++ b/tests/test_nvgre_tunnel.py @@ -103,7 +103,7 @@ def check_object(db, table, key, expected_attributes): (value, name, expected_attributes[name]) -def create_nvgre_tunnel(dvs, tunnel_name, src_ip, tunnel_ids, tunnel_map_ids): +def create_nvgre_tunnel(dvs, tunnel_name, src_ip, tunnel_ids, tunnel_map_ids, loopback_id): asic_db = swsscommon.DBConnector(swsscommon.ASIC_DB, dvs.redis_sock, 0) conf_db = swsscommon.DBConnector(swsscommon.CONFIG_DB, dvs.redis_sock, 0) @@ -116,19 +116,6 @@ def create_nvgre_tunnel(dvs, tunnel_name, src_ip, tunnel_ids, tunnel_map_ids): create_entry_tbl(conf_db, NVGRE_TUNNEL, '|', tunnel_name, attrs) - -def remove_nvgre_tunnel(dvs, tunnel_name, tunnel_ids, tunnel_map_ids): - conf_db = swsscommon.DBConnector(swsscommon.CONFIG_DB, dvs.redis_sock, 0) - - delete_entry_tbl(conf_db, NVGRE_TUNNEL, tunnel_name) - time.sleep(1) - tunnel_ids = get_exist_entries(dvs, SAI_OBJECT_TYPE_TUNNEL) - tunnel_map_ids = get_exist_entries(dvs, SAI_OBJECT_TYPE_TUNNEL_MAP) - - -def check_nvgre_tunnel(dvs, src_ip, tunnel_ids, tunnel_map_ids, loopback_id): - asic_db = swsscommon.DBConnector(swsscommon.ASIC_DB, dvs.redis_sock, 0) - tunnel_id = get_created_entry(asic_db, SAI_OBJECT_TYPE_TUNNEL, tunnel_ids) tunnel_map_id = get_created_entry_mapid(asic_db, SAI_OBJECT_TYPE_TUNNEL_MAP, tunnel_map_ids) @@ -155,6 +142,15 @@ def check_nvgre_tunnel(dvs, src_ip, tunnel_ids, tunnel_map_ids, loopback_id): tunnel_ids.add(tunnel_id) +def remove_nvgre_tunnel(dvs, tunnel_name, tunnel_ids, tunnel_map_ids): + conf_db = swsscommon.DBConnector(swsscommon.CONFIG_DB, dvs.redis_sock, 0) + + delete_entry_tbl(conf_db, NVGRE_TUNNEL, tunnel_name) + time.sleep(1) + tunnel_ids = get_exist_entries(dvs, SAI_OBJECT_TYPE_TUNNEL) + tunnel_map_ids = get_exist_entries(dvs, SAI_OBJECT_TYPE_TUNNEL_MAP) + + def create_nvgre_tunnel_entry(dvs, tunnel_name, tunnel_map_entry_name, vlan_id, vsid, tunnel_map_ids, tunnel_map_entry_ids): asic_db = swsscommon.DBConnector(swsscommon.ASIC_DB, dvs.redis_sock, 0) conf_db = swsscommon.DBConnector(swsscommon.CONFIG_DB, dvs.redis_sock, 0) @@ -202,8 +198,7 @@ def test_nvgre_create_tunnel(self, dvs, testlog): tunnel_map_ids = set() loopback_id = get_lo(dvs) - create_nvgre_tunnel(dvs, NVGRE_TUNNEL_NAME, VALID_IP_ADDR, tunnel_ids, tunnel_map_ids) - check_nvgre_tunnel(dvs, VALID_IP_ADDR, tunnel_ids, tunnel_map_ids, loopback_id) + create_nvgre_tunnel(dvs, NVGRE_TUNNEL_NAME, VALID_IP_ADDR, tunnel_ids, tunnel_map_ids, loopback_id) finally: remove_nvgre_tunnel(dvs, NVGRE_TUNNEL_NAME, tunnel_ids, tunnel_map_ids) @@ -216,7 +211,7 @@ def test_nvgre_create_tunnel_map_entry(self, dvs, testlog): loopback_id = get_lo(dvs) self.dvs_vlan.create_vlan(VLAN_ID) - create_nvgre_tunnel(dvs, NVGRE_TUNNEL_NAME, VALID_IP_ADDR, tunnel_ids, tunnel_map_ids) + create_nvgre_tunnel(dvs, NVGRE_TUNNEL_NAME, VALID_IP_ADDR, tunnel_ids, tunnel_map_ids, loopback_id) create_nvgre_tunnel_entry(dvs, NVGRE_TUNNEL_NAME, NVGRE_TUNNEL_MAP_ENTRY_NAME, VLAN_ID, NVGRE_VSID, tunnel_map_ids, tunnel_map_entry_ids) finally: remove_nvgre_tunnel_map_entry(dvs, NVGRE_TUNNEL_NAME, NVGRE_TUNNEL_MAP_ENTRY_NAME, tunnel_map_entry_ids)