From 500e2e9ba164a69a62bfdb8621645852fe29fe6f Mon Sep 17 00:00:00 2001 From: vganesan-nokia <67648637+vganesan-nokia@users.noreply.github.com> Date: Mon, 19 Apr 2021 22:10:15 -0400 Subject: [PATCH] [voq/inbandif] Voq inbandif port (#1602) What I did Changes to support inband interface configuration Why I did it The VOQ chassis needs inband interface in the kernel for cpu to cpu communication across different asic instance and remote neighbor programming in the kernel. This PR adds support for configuring inband interface so that kernel interface can be created via sonic configuration. How I verified it swss vs test (test_virtual_chassis.py) to verify the remote neigh programming. --- cfgmgr/nbrmgr.cpp | 43 +++- cfgmgr/nbrmgr.h | 3 +- orchagent/neighorch.cpp | 128 +++++++++++- orchagent/portsorch.cpp | 21 +- orchagent/routeorch.cpp | 9 + portsyncd/linksync.cpp | 4 +- tests/conftest.py | 2 +- tests/test_virtual_chassis.py | 213 +++++++++++++++++++- tests/virtual_chassis/1/default_config.json | 128 ++++++------ tests/virtual_chassis/2/default_config.json | 128 ++++++------ tests/virtual_chassis/3/default_config.json | 128 ++++++------ 11 files changed, 586 insertions(+), 221 deletions(-) diff --git a/cfgmgr/nbrmgr.cpp b/cfgmgr/nbrmgr.cpp index d5d644652ee4..ad10fef9f4a8 100644 --- a/cfgmgr/nbrmgr.cpp +++ b/cfgmgr/nbrmgr.cpp @@ -348,7 +348,8 @@ void NbrMgr::doStateSystemNeighTask(Consumer &consumer) //Get the name of the device on which the neigh and route are //going to be programmed. string nbr_odev; - if(!getVoqInbandInterfaceName(nbr_odev)) + string ibif_type; + if(!getVoqInbandInterfaceName(nbr_odev, ibif_type)) { //The inband interface is not available yet return; @@ -380,9 +381,9 @@ void NbrMgr::doStateSystemNeighTask(Consumer &consumer) mac_address = MacAddress(fvValue(*i)); } - if (!isIntfStateOk(nbr_odev)) + if (ibif_type == "port" && !isIntfOperUp(nbr_odev)) { - SWSS_LOG_DEBUG("Interface %s is not ready, skipping system neigh %s'", nbr_odev.c_str(), kfvKey(t).c_str()); + SWSS_LOG_DEBUG("Device %s is not oper up, skipping system neigh %s'", nbr_odev.c_str(), kfvKey(t).c_str()); it++; continue; } @@ -390,6 +391,9 @@ void NbrMgr::doStateSystemNeighTask(Consumer &consumer) if (!addKernelNeigh(nbr_odev, ip_address, mac_address)) { SWSS_LOG_ERROR("Neigh entry add on dev %s failed for '%s'", nbr_odev.c_str(), kfvKey(t).c_str()); + // Delete neigh to take care of deletion of exiting nbr for mac change. This makes sure that + // re-try will be successful and route addtion (below) will be attempted and be successful + delKernelNeigh(nbr_odev, ip_address); it++; continue; } @@ -402,6 +406,8 @@ void NbrMgr::doStateSystemNeighTask(Consumer &consumer) { SWSS_LOG_ERROR("Route entry add on dev %s failed for '%s'", nbr_odev.c_str(), kfvKey(t).c_str()); delKernelNeigh(nbr_odev, ip_address); + // Delete route to take care of deletion of exiting route of nbr for mac change. + delKernelRoute(ip_address); it++; continue; } @@ -437,9 +443,24 @@ void NbrMgr::doStateSystemNeighTask(Consumer &consumer) } } -bool NbrMgr::getVoqInbandInterfaceName(string &ibif) +bool NbrMgr::isIntfOperUp(const string &alias) { + string oper; + + if (m_statePortTable.hget(alias, "netdev_oper_status", oper)) + { + if (oper == "up") + { + SWSS_LOG_DEBUG("NetDev %s is oper up", alias.c_str()); + return true; + } + } + return false; +} + +bool NbrMgr::getVoqInbandInterfaceName(string &ibif, string &type) +{ vector keys; m_cfgVoqInbandInterfaceTable->getKeys(keys); @@ -448,9 +469,21 @@ bool NbrMgr::getVoqInbandInterfaceName(string &ibif) SWSS_LOG_NOTICE("Voq Inband interface is not configured!"); return false; } - //key:"alias" = inband interface name + + // key:"alias" = inband interface name + vector if_keys = tokenize(keys[0], config_db_key_delimiter); + ibif = if_keys[0]; + + // Get the type of the inband interface + + if (!m_cfgVoqInbandInterfaceTable->hget(ibif, "inband_type", type)) + { + SWSS_LOG_ERROR("Getting Voq Inband interface type failed for %s", ibif.c_str()); + return false; + } + return true; } diff --git a/cfgmgr/nbrmgr.h b/cfgmgr/nbrmgr.h index 73ed6b411e83..9861b749821e 100644 --- a/cfgmgr/nbrmgr.h +++ b/cfgmgr/nbrmgr.h @@ -32,11 +32,12 @@ class NbrMgr : public Orch void doSetNeighTask(Consumer &consumer); void doTask(Consumer &consumer); void doStateSystemNeighTask(Consumer &consumer); - bool getVoqInbandInterfaceName(string &nbr_odev); + bool getVoqInbandInterfaceName(string &nbr_odev, string &ibiftype); bool addKernelRoute(string odev, IpAddress ip_addr); bool delKernelRoute(IpAddress ip_addr); bool addKernelNeigh(string odev, IpAddress ip_addr, MacAddress mac_addr); bool delKernelNeigh(string odev, IpAddress ip_addr); + bool isIntfOperUp(const std::string &alias); unique_ptr m_cfgVoqInbandInterfaceTable; Table m_statePortTable, m_stateLagTable, m_stateVlanTable, m_stateIntfTable, m_stateNeighRestoreTable; diff --git a/orchagent/neighorch.cpp b/orchagent/neighorch.cpp index ccbab68c8b2a..9a2f76f571e5 100644 --- a/orchagent/neighorch.cpp +++ b/orchagent/neighorch.cpp @@ -1028,6 +1028,16 @@ void NeighOrch::doVoqSystemNeighTask(Consumer &consumer) return; } + // For "port" type inband interface, wait till the Inband interface is both admin up and oper up + if (ibif.m_type != Port::VLAN) + { + if (ibif.m_admin_state_up != true || ibif.m_oper_status != SAI_PORT_OPER_STATUS_UP) + { + // Inband port is not operational yet + return; + } + } + auto it = consumer.m_toSync.begin(); while (it != consumer.m_toSync.end()) { @@ -1161,20 +1171,126 @@ void NeighOrch::doVoqSystemNeighTask(Consumer &consumer) bool NeighOrch::addInbandNeighbor(string alias, IpAddress ip_address) { - //For "port" type inband, the inband reachability info syncing can be done through static - //configureation or CHASSIS_APP_DB sync (this function) + //Add neighbor record in SAI without adding host route for local inband to avoid route + //looping for packets destined to the Inband interface if the Inband is port type + + if(gIntfsOrch->isRemoteSystemPortIntf(alias)) + { + //Remote Inband interface. Skip + return true; + } + + sai_status_t status; + MacAddress inband_mac = gMacAddress; + + sai_object_id_t rif_id = gIntfsOrch->getRouterIntfsId(alias); + if (rif_id == SAI_NULL_OBJECT_ID) + { + SWSS_LOG_INFO("Failed to get rif_id for %s", alias.c_str()); + return false; + } + + //Make the object key + sai_neighbor_entry_t neighbor_entry; + neighbor_entry.rif_id = rif_id; + neighbor_entry.switch_id = gSwitchId; + copy(neighbor_entry.ip_address, ip_address); + + vector neighbor_attrs; + sai_attribute_t attr; + attr.id = SAI_NEIGHBOR_ENTRY_ATTR_DST_MAC_ADDRESS; + memcpy(attr.value.mac, inband_mac.getMac(), 6); + neighbor_attrs.push_back(attr); + + //No host route for neighbor of the Inband IP address + attr.id = SAI_NEIGHBOR_ENTRY_ATTR_NO_HOST_ROUTE; + attr.value.booldata = true; + neighbor_attrs.push_back(attr); + + status = sai_neighbor_api->create_neighbor_entry(&neighbor_entry, static_cast(neighbor_attrs.size()), neighbor_attrs.data()); + if (status != SAI_STATUS_SUCCESS) + { + if (status == SAI_STATUS_ITEM_ALREADY_EXISTS) + { + SWSS_LOG_ERROR("Entry exists: neighbor %s on %s, rv:%d", inband_mac.to_string().c_str(), alias.c_str(), status); + return true; + } + else + { + SWSS_LOG_ERROR("Failed to create neighbor %s on %s, rv:%d", inband_mac.to_string().c_str(), alias.c_str(), status); + return false; + } + } + + SWSS_LOG_NOTICE("Created inband neighbor %s on %s", inband_mac.to_string().c_str(), alias.c_str()); - //For "vlan" type inband, the inband reachability info syncinng can be ARP learning of other - //asics inband or static configuration or through CHASSIS_APP_DB sync (this function) + gIntfsOrch->increaseRouterIntfsRefCount(alias); - //May implement inband rechability info syncing through CHASSIS_APP_DB sync here + if (neighbor_entry.ip_address.addr_family == SAI_IP_ADDR_FAMILY_IPV4) + { + gCrmOrch->incCrmResUsedCounter(CrmResourceType::CRM_IPV4_NEIGHBOR); + } + else + { + gCrmOrch->incCrmResUsedCounter(CrmResourceType::CRM_IPV6_NEIGHBOR); + } + + //Sync the neighbor to add to the CHASSIS_APP_DB + voqSyncAddNeigh(alias, ip_address, inband_mac, neighbor_entry); return true; } bool NeighOrch::delInbandNeighbor(string alias, IpAddress ip_address) { - //Remove inband rechability info sync + // Remove local inband neighbor from SAI + + if(gIntfsOrch->isRemoteSystemPortIntf(alias)) + { + //Remote Inband interface. Skip + return true; + } + + MacAddress inband_mac = gMacAddress; + + sai_object_id_t rif_id = gIntfsOrch->getRouterIntfsId(alias); + + sai_neighbor_entry_t neighbor_entry; + neighbor_entry.rif_id = rif_id; + neighbor_entry.switch_id = gSwitchId; + copy(neighbor_entry.ip_address, ip_address); + + sai_status_t status; + status = sai_neighbor_api->remove_neighbor_entry(&neighbor_entry); + if (status != SAI_STATUS_SUCCESS) + { + if (status == SAI_STATUS_ITEM_NOT_FOUND) + { + SWSS_LOG_ERROR("Failed to locate neigbor %s on %s, rv:%d", inband_mac.to_string().c_str(), alias.c_str(), status); + return true; + } + else + { + SWSS_LOG_ERROR("Failed to remove neighbor %s on %s, rv:%d", inband_mac.to_string().c_str(), alias.c_str(), status); + return false; + } + } + + if (neighbor_entry.ip_address.addr_family == SAI_IP_ADDR_FAMILY_IPV4) + { + gCrmOrch->decCrmResUsedCounter(CrmResourceType::CRM_IPV4_NEIGHBOR); + } + else + { + gCrmOrch->decCrmResUsedCounter(CrmResourceType::CRM_IPV6_NEIGHBOR); + } + + SWSS_LOG_NOTICE("Removed neighbor %s on %s", inband_mac.to_string().c_str(), alias.c_str()); + + gIntfsOrch->decreaseRouterIntfsRefCount(alias); + + //Sync the neighbor to delete from the CHASSIS_APP_DB + voqSyncDelNeigh(alias, ip_address); return true; } diff --git a/orchagent/portsorch.cpp b/orchagent/portsorch.cpp index b8198628a8e9..b3f7ceeb0d0c 100755 --- a/orchagent/portsorch.cpp +++ b/orchagent/portsorch.cpp @@ -52,6 +52,7 @@ extern int32_t gVoqMySwitchId; extern string gMyHostName; extern string gMyAsicName; +#define DEFAULT_SYSTEM_PORT_MTU 9100 #define VLAN_PREFIX "Vlan" #define DEFAULT_VLAN_ID 1 #define MAX_VALID_VLAN_ID 4094 @@ -5462,6 +5463,7 @@ bool PortsOrch::addSystemPorts() port.m_admin_state_up = true; port.m_oper_status = SAI_PORT_OPER_STATUS_UP; port.m_speed = attrs[1].value.sysportconfig.speed; + port.m_mtu = DEFAULT_SYSTEM_PORT_MTU; if (attrs[0].value.s32 == SAI_SYSTEM_PORT_TYPE_LOCAL) { //Get the local port oid @@ -5543,21 +5545,20 @@ bool PortsOrch::setVoqInbandIntf(string &alias, string &type) return true; } + //Make sure port and host if exists for the configured inband interface Port port; - if(type == "port") + if (!getPort(alias, port)) { - if (!getPort(alias, port)) - { - SWSS_LOG_NOTICE("Port configured for inband intf %s is not ready!", alias.c_str()); - return false; - } + SWSS_LOG_ERROR("Port/Vlan configured for inband intf %s is not ready!", alias.c_str()); + return false; } - // Check for existence of host interface. If does not exist, may create - // host if for the inband here + if(type == "port" && !port.m_hif_id) + { + SWSS_LOG_ERROR("Host interface is not available for port %s", alias.c_str()); + return false; + } - // May do the processing for other inband type like type=vlan here - //Store the name of the local inband port m_inbandPortName = alias; diff --git a/orchagent/routeorch.cpp b/orchagent/routeorch.cpp index 7415c33dd48f..ca3feec9c3bd 100644 --- a/orchagent/routeorch.cpp +++ b/orchagent/routeorch.cpp @@ -1392,6 +1392,15 @@ bool RouteOrch::addRoute(RouteBulkContext& ctx, const NextHopGroupKey &nextHops) if (nexthop.ip_address.isZero()) { + if(gPortsOrch->isInbandPort(nexthop.alias)) + { + //This routes is the static route added for the remote system neighbors + //We do not need this route in the ASIC since the static neighbor creation + //in ASIC adds the same full mask route (host route) in ASIC automatically + //So skip. + return true; + } + next_hop_id = m_intfsOrch->getRouterIntfsId(nexthop.alias); /* rif is not created yet */ if (next_hop_id == SAI_NULL_OBJECT_ID) diff --git a/portsyncd/linksync.cpp b/portsyncd/linksync.cpp index 820da0ce60d4..08df3ff9ec6f 100644 --- a/portsyncd/linksync.cpp +++ b/portsyncd/linksync.cpp @@ -253,8 +253,10 @@ void LinkSync::onMsg(int nlmsg_type, struct nl_object *obj) FieldValueTuple tuple("state", "ok"); vector vector; vector.push_back(tuple); + FieldValueTuple op("netdev_oper_status", oper ? "up" : "down"); + vector.push_back(op); m_statePortTable.set(key, vector); - SWSS_LOG_NOTICE("Publish %s(ok) to state db", key.c_str()); + SWSS_LOG_NOTICE("Publish %s(ok:%s) to state db", key.c_str(), oper ? "up" : "down"); } else { diff --git a/tests/conftest.py b/tests/conftest.py index 79c0e6c96845..2e858df468d3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1446,7 +1446,7 @@ def handle_neighconn(self): def get_chassis_instance_port_statuses(self): instance_to_port_status_map = {} if "neighbor_connections" not in self.virt_topo: - return instance_to_neighbor_map + return instance_to_port_status_map working_dir = os.getcwd() for conn, endpoints in self.virt_topo["neighbor_connections"].items(): diff --git a/tests/test_virtual_chassis.py b/tests/test_virtual_chassis.py index 30c4f1af5019..e4f98c960c10 100644 --- a/tests/test_virtual_chassis.py +++ b/tests/test_virtual_chassis.py @@ -25,6 +25,39 @@ def set_lag_id_boundaries(self, vct): chassis_app_db.db_connection.set("SYSTEM_LAG_ID_END", "2") break + def config_inbandif_port(self, vct, ibport): + """This function configures port type inband interface in each linecard""" + + dvss = vct.dvss + for name in dvss.keys(): + dvs = dvss[name] + # Get the config info + config_db = dvs.get_config_db() + metatbl = config_db.get_entry("DEVICE_METADATA", "localhost") + + cfg_switch_type = metatbl.get("switch_type") + + # Configure only for line cards + if cfg_switch_type == "voq": + dvs.runcmd(f"config interface startup {ibport}") + config_db.create_entry("VOQ_INBAND_INTERFACE", f"{ibport}", {"inband_type": "port"}) + + def del_inbandif_port(self, vct, ibport): + """This function deletes existing port type inband interface""" + + dvss = vct.dvss + for name in dvss.keys(): + dvs = dvss[name] + # Get the config info + config_db = dvs.get_config_db() + metatbl = config_db.get_entry("DEVICE_METADATA", "localhost") + + cfg_switch_type = metatbl.get("switch_type") + + # Applicable only for line cards + if cfg_switch_type == "voq": + config_db.delete_entry("VOQ_INBAND_INTERFACE", f"{ibport}") + def test_connectivity(self, vct): if vct is None: return @@ -180,17 +213,35 @@ def test_chassis_system_interface(self, vct): assert spcfginfo["attached_switch_id"] != lc_switch_id, "RIF system port with wrong switch_id" def test_chassis_system_neigh(self, vct): - """Test neigh record creation and syncing to chassis app db. + """Test neigh record create/delete and syncing to chassis app db. This test validates that: (i) Local neighbor entry is created with encap index (ii) Local neighbor is synced to chassis ap db with assigned encap index - TODO: (iii) Remote neighbor entry is created in ASIC_DB with received encap index + (iii) Remote neighbor entry is created in ASIC_DB with received encap index + (iv) Local neighbor entry is deleted when neighbor is deleted + (v) Local neighbor delete is synced to chassis ap db + (vi) Remote neighbor entry is cleared in ASIC_DB """ if vct is None: return + # We use Ethernet0 as inband port in each line card. In real hardware, this will be a + # special port used for inband. For testing purpose, we need port record and rif record + # for the inband interface and valid kernel interface. Since Ethernet0 is already + # setup, the port record, rif record and kernel interface already exist. So we use it + # for testing + inband_port = "Ethernet0" + + # Configure port type inband interface + self.config_inbandif_port(vct, inband_port) + + # Test neighbor on Ethernet4 since Ethernet0 is used as Inband port + test_neigh_dev = "Ethernet4" + test_neigh_ip = "10.8.104.3" + test_neigh_mac = "00:01:02:03:04:05" + dvss = vct.dvss print("name {}".format(dvss.keys())) for name in dvss.keys(): @@ -209,7 +260,7 @@ def test_chassis_system_neigh(self, vct): # Add a static neighbor _, res = dvs.runcmd(['sh', "-c", "ip neigh show"]) - _, res = dvs.runcmd(['sh', "-c", "ip neigh add 10.8.101.2 lladdr 00:01:02:03:04:05 dev Ethernet0"]) + _, res = dvs.runcmd(['sh', "-c", f"ip neigh add {test_neigh_ip} lladdr {test_neigh_mac} dev {test_neigh_dev}"]) assert res == "", "Error configuring static neigh" asic_db = dvs.get_asic_db() @@ -221,12 +272,15 @@ def test_chassis_system_neigh(self, vct): test_neigh = "" for nkey in neighkeys: ne = ast.literal_eval(nkey) - if ne['ip'] == '10.8.101.2': + if ne['ip'] == test_neigh_ip: test_neigh = nkey break assert test_neigh != "", "Neigh not found in ASIC_DB" + # Preserve test neigh asic db key for delete verification later + test_neigh_asic_db_key = test_neigh + # Check for presence of encap index, retrieve and store it for sync verification test_neigh_entry = asic_db.wait_for_entry("ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY", test_neigh) test_neigh_entry_attrs = asic_db.wait_for_fields("ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY", test_neigh, ["SAI_NEIGHBOR_ENTRY_ATTR_ENCAP_INDEX"]) @@ -251,12 +305,15 @@ def test_chassis_system_neigh(self, vct): for sysnk in sysneighkeys: sysnk_tok = sysnk.split("|") assert len(sysnk_tok) == 3, "Invalid system neigh key in chassis app db" - if sysnk_tok[2] == "10.8.101.2": + if sysnk_tok[2] == test_neigh_ip: test_sysneigh = sysnk break assert test_sysneigh != "", "Neigh is not sync-ed to chassis app db" + # Preserve test sys neigh chassis app db key for delete verification later + test_sysneigh_chassis_app_db_key = test_sysneigh + test_sysneigh_entry = chassis_app_db.get_entry("SYSTEM_NEIGH", test_sysneigh) sys_neigh_encap_index = test_sysneigh_entry.get("encap_index") assert sys_neigh_encap_index != "", "System neigh in chassis app db does not have encap index" @@ -264,6 +321,152 @@ def test_chassis_system_neigh(self, vct): assert encap_index == sys_neigh_encap_index, "Encap index not sync-ed correctly" break + + # Verify programming of remote neighbor in asic db and programming of static route and static + # neigh in the kernel for the remote neighbor. The neighbor created in linecard 1 will be a + # remote neighbor in other linecards. Verity existence of the test neighbor in linecards other + # than linecard 1 + for name in dvss.keys(): + dvs = dvss[name] + + config_db = dvs.get_config_db() + metatbl = config_db.get_entry("DEVICE_METADATA", "localhost") + + cfg_switch_type = metatbl.get("switch_type") + + # Neighbor record verifiation done in line card + if cfg_switch_type == "voq": + lc_switch_id = metatbl.get("switch_id") + assert lc_switch_id != "", "Got error in getting switch_id from CONFIG_DB DEVICE_METADATA" + if lc_switch_id != "0": + # Linecard other than linecard 1 + asic_db = dvs.get_asic_db() + asic_db.wait_for_n_keys("ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY", 1) + neighkeys = asic_db.get_keys("ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY") + assert len(neighkeys), "No neigh entries in ASIC_DB" + + # Check for presence of the remote neighbor in ASIC_DB + remote_neigh = "" + for nkey in neighkeys: + ne = ast.literal_eval(nkey) + if ne['ip'] == test_neigh_ip: + remote_neigh = nkey + break + + assert remote_neigh != "", "Remote neigh not found in ASIC_DB" + + # Preserve remote neigh asic db neigh key for delete verification later + test_remote_neigh_asic_db_key = remote_neigh + + # Check for kernel entries + + _, output = dvs.runcmd("ip neigh show") + assert f"{test_neigh_ip} dev {inband_port}" in output, "Kernel neigh not found for remote neighbor" + + _, output = dvs.runcmd("ip route show") + assert f"{test_neigh_ip} dev {inband_port} scope link" in output, "Kernel route not found for remote neighbor" + + # Check for ASIC_DB entries. + + # Check for presence of encap index, retrieve and store it for sync verification + remote_neigh_entry = asic_db.get_entry("ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY", remote_neigh) + + # Validate encap index + remote_encap_index = remote_neigh_entry.get("SAI_NEIGHBOR_ENTRY_ATTR_ENCAP_INDEX") + assert remote_encap_index != "", "VOQ encap index is not programmed for remote neigh in ASIC_DB" + assert remote_encap_index == encap_index, "Encap index of remote neigh mismatch with allocated encap index" + + # Validate MAC + mac = remote_neigh_entry.get("SAI_NEIGHBOR_ENTRY_ATTR_DST_MAC_ADDRESS") + assert mac != "", "MAC address is not programmed for remote neigh in ASIC_DB" + assert mac == test_neigh_mac, "Encap index of remote neigh mismatch with allocated encap index" + + # Check for other mandatory attributes + # For remote neighbor, encap index must be imposed. So impose_index must be "true" + impose_index = remote_neigh_entry.get("SAI_NEIGHBOR_ENTRY_ATTR_ENCAP_IMPOSE_INDEX") + assert impose_index != "", "Impose index attribute is not programmed for remote neigh in ASIC_DB" + assert impose_index == "true", "Impose index attribute is false for remote neigh" + + # For remote neighbors, is_local must be "false" + is_local = remote_neigh_entry.get("SAI_NEIGHBOR_ENTRY_ATTR_IS_LOCAL") + assert is_local != "", "is_local attribute is not programmed for remote neigh in ASIC_DB" + assert is_local == "false", "is_local attribute is true for remote neigh" + + break + + # Verify system neighbor delete and clearing + for name in dvss.keys(): + dvs = dvss[name] + + config_db = dvs.get_config_db() + metatbl = config_db.get_entry("DEVICE_METADATA", "localhost") + + cfg_switch_type = metatbl.get("switch_type") + + # Neighbor record verifiation done in line card + if cfg_switch_type == "voq": + lc_switch_id = metatbl.get("switch_id") + assert lc_switch_id != "", "Got error in getting switch_id from CONFIG_DB DEVICE_METADATA" + if lc_switch_id == "0": + + # Delete the static neighbor neighbor + _, res = dvs.runcmd(['sh', "-c", f"ip neigh del {test_neigh_ip} dev {test_neigh_dev}"]) + assert res == "", "Error deleting static neigh" + + # Check for presence of the neighbor in ASIC_DB. The deleted neighbor should + # not be present in the asic db + asic_db = dvs.get_asic_db() + neighkeys = asic_db.wait_for_deleted_entry("ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY", test_neigh_asic_db_key) + assert len(neighkeys) == 0, "Stale neigh entry found in ASIC_DB" + + break + + # Verify syncing of neighbor record delete in chassis app db + dvss = vct.dvss + for name in dvss.keys(): + if name.startswith("supervisor"): + dvs = dvss[name] + chassis_app_db = DVSDatabase(swsscommon.CHASSIS_APP_DB, dvs.redis_chassis_sock) + sysneighkeys = chassis_app_db.wait_for_deleted_entry("SYSTEM_NEIGH", test_sysneigh_chassis_app_db_key) + assert len(sysneighkeys) == 0, "Stale neigh entry in chassis app db" + + break + + # Verify clearing of remote neighbor in non-owner linecard + dvss = vct.dvss + for name in dvss.keys(): + dvs = dvss[name] + + config_db = dvs.get_config_db() + metatbl = config_db.get_entry("DEVICE_METADATA", "localhost") + + cfg_switch_type = metatbl.get("switch_type") + + # Neighbor record verifiation done in line card + if cfg_switch_type == "voq": + lc_switch_id = metatbl.get("switch_id") + assert lc_switch_id != "", "Got error in getting switch_id from CONFIG_DB DEVICE_METADATA" + if lc_switch_id != "0": + # Linecard other than linecard 1 + + # Check for presence of the remote neighbor in ASIC_DB. The remote neighbor corresponding + # to the deleted static neigbor should not be present + asic_db = dvs.get_asic_db() + neighkeys = asic_db.wait_for_deleted_entry("ASIC_STATE:SAI_OBJECT_TYPE_NEIGHBOR_ENTRY", test_remote_neigh_asic_db_key) + assert len(neighkeys) == 0, "Stale remote neigh in ASIC_DB" + + # Check for kernel entries. Kernel entries (neigh and route) should have been removed + + _, output = dvs.runcmd("ip neigh show") + assert f"{test_neigh_ip} dev {inband_port}" not in output, "Kernel neigh of remote neighbor not removed" + + _, output = dvs.runcmd("ip route show") + assert f"{test_neigh_ip} dev {inband_port} scope link" not in output, "Kernel route of remote neighbor not removed" + + break + + # Cleanup inband if configuration + self.del_inbandif_port(vct, inband_port) def test_chassis_system_lag(self, vct): """Test PortChannel in VOQ based chassis systems. diff --git a/tests/virtual_chassis/1/default_config.json b/tests/virtual_chassis/1/default_config.json index 100d6561c4c0..3e0c3fce72ff 100644 --- a/tests/virtual_chassis/1/default_config.json +++ b/tests/virtual_chassis/1/default_config.json @@ -254,448 +254,448 @@ "Linecard2|Ethernet0": { "speed": "40000", "system_port_id": "33", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "1" }, "Linecard2|Ethernet4": { "speed": "40000", "system_port_id": "34", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "2" }, "Linecard2|Ethernet8": { "speed": "40000", "system_port_id": "35", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "3" }, "Linecard2|Ethernet12": { "speed": "40000", "system_port_id": "36", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "4" }, "Linecard2|Ethernet16": { "speed": "40000", "system_port_id": "37", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "5" }, "Linecard2|Ethernet20": { "speed": "40000", "system_port_id": "38", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "6" }, "Linecard2|Ethernet24": { "speed": "40000", "system_port_id": "39", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "7" }, "Linecard2|Ethernet28": { "speed": "40000", "system_port_id": "40", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "8" }, "Linecard2|Ethernet32": { "speed": "40000", "system_port_id": "41", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "9" }, "Linecard2|Ethernet36": { "speed": "40000", "system_port_id": "42", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "10" }, "Linecard2|Ethernet40": { "speed": "40000", "system_port_id": "43", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "11" }, "Linecard2|Ethernet44": { "speed": "40000", "system_port_id": "44", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "12" }, "Linecard2|Ethernet48": { "speed": "40000", "system_port_id": "45", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "13" }, "Linecard2|Ethernet52": { "speed": "40000", "system_port_id": "46", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "14" }, "Linecard2|Ethernet56": { "speed": "40000", "system_port_id": "47", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "15" }, "Linecard2|Ethernet60": { "speed": "40000", "system_port_id": "48", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "16" }, "Linecard2|Ethernet64": { "speed": "40000", "system_port_id": "49", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "1" }, "Linecard2|Ethernet68": { "speed": "40000", "system_port_id": "50", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "2" }, "Linecard2|Ethernet72": { "speed": "40000", "system_port_id": "51", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "3" }, "Linecard2|Ethernet76": { "speed": "40000", "system_port_id": "52", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "4" }, "Linecard2|Ethernet80": { "speed": "40000", "system_port_id": "53", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "5" }, "Linecard2|Ethernet84": { "speed": "40000", "system_port_id": "54", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "6" }, "Linecard2|Ethernet88": { "speed": "40000", "system_port_id": "55", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "7" }, "Linecard2|Ethernet92": { "speed": "40000", "system_port_id": "56", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "8" }, "Linecard2|Ethernet96": { "speed": "40000", "system_port_id": "57", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "9" }, "Linecard2|Ethernet100": { "speed": "40000", "system_port_id": "58", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "10" }, "Linecard2|Ethernet104": { "speed": "40000", "system_port_id": "59", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "11" }, "Linecard2|Ethernet108": { "speed": "40000", "system_port_id": "60", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "12" }, "Linecard2|Ethernet112": { "speed": "40000", "system_port_id": "61", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "13" }, "Linecard2|Ethernet116": { "speed": "40000", "system_port_id": "62", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "14" }, "Linecard2|Ethernet120": { "speed": "40000", "system_port_id": "63", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "15" }, "Linecard2|Ethernet124": { "speed": "40000", "system_port_id": "64", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "16" }, "Linecard3|Ethernet0": { "speed": "40000", "system_port_id": "65", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "1" }, "Linecard3|Ethernet4": { "speed": "40000", "system_port_id": "66", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "2" }, "Linecard3|Ethernet8": { "speed": "40000", "system_port_id": "67", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "3" }, "Linecard3|Ethernet12": { "speed": "40000", "system_port_id": "68", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "4" }, "Linecard3|Ethernet16": { "speed": "40000", "system_port_id": "69", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "5" }, "Linecard3|Ethernet20": { "speed": "40000", "system_port_id": "70", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "6" }, "Linecard3|Ethernet24": { "speed": "40000", "system_port_id": "71", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "7" }, "Linecard3|Ethernet28": { "speed": "40000", "system_port_id": "72", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "8" }, "Linecard3|Ethernet32": { "speed": "40000", "system_port_id": "73", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "9" }, "Linecard3|Ethernet36": { "speed": "40000", "system_port_id": "74", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "10" }, "Linecard3|Ethernet40": { "speed": "40000", "system_port_id": "75", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "11" }, "Linecard3|Ethernet44": { "speed": "40000", "system_port_id": "76", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "12" }, "Linecard3|Ethernet48": { "speed": "40000", "system_port_id": "77", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "13" }, "Linecard3|Ethernet52": { "speed": "40000", "system_port_id": "78", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "14" }, "Linecard3|Ethernet56": { "speed": "40000", "system_port_id": "79", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "15" }, "Linecard3|Ethernet60": { "speed": "40000", "system_port_id": "80", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "16" }, "Linecard3|Ethernet64": { "speed": "40000", "system_port_id": "81", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "1" }, "Linecard3|Ethernet68": { "speed": "40000", "system_port_id": "82", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "2" }, "Linecard3|Ethernet72": { "speed": "40000", "system_port_id": "83", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "3" }, "Linecard3|Ethernet76": { "speed": "40000", "system_port_id": "84", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "4" }, "Linecard3|Ethernet80": { "speed": "40000", "system_port_id": "85", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "5" }, "Linecard3|Ethernet84": { "speed": "40000", "system_port_id": "86", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "6" }, "Linecard3|Ethernet88": { "speed": "40000", "system_port_id": "87", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "7" }, "Linecard3|Ethernet92": { "speed": "40000", "system_port_id": "88", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "8" }, "Linecard3|Ethernet96": { "speed": "40000", "system_port_id": "89", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "9" }, "Linecard3|Ethernet100": { "speed": "40000", "system_port_id": "90", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "10" }, "Linecard3|Ethernet104": { "speed": "40000", "system_port_id": "91", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "11" }, "Linecard3|Ethernet108": { "speed": "40000", "system_port_id": "92", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "12" }, "Linecard3|Ethernet112": { "speed": "40000", "system_port_id": "93", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "13" }, "Linecard3|Ethernet116": { "speed": "40000", "system_port_id": "94", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "14" }, "Linecard3|Ethernet120": { "speed": "40000", "system_port_id": "95", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "15" }, "Linecard3|Ethernet124": { "speed": "40000", "system_port_id": "96", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "16" } diff --git a/tests/virtual_chassis/2/default_config.json b/tests/virtual_chassis/2/default_config.json index b4a1776cf380..d306c30ea37f 100644 --- a/tests/virtual_chassis/2/default_config.json +++ b/tests/virtual_chassis/2/default_config.json @@ -249,448 +249,448 @@ "Linecard2|Ethernet0": { "speed": "40000", "system_port_id": "33", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "1" }, "Linecard2|Ethernet4": { "speed": "40000", "system_port_id": "34", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "2" }, "Linecard2|Ethernet8": { "speed": "40000", "system_port_id": "35", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "3" }, "Linecard2|Ethernet12": { "speed": "40000", "system_port_id": "36", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "4" }, "Linecard2|Ethernet16": { "speed": "40000", "system_port_id": "37", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "5" }, "Linecard2|Ethernet20": { "speed": "40000", "system_port_id": "38", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "6" }, "Linecard2|Ethernet24": { "speed": "40000", "system_port_id": "39", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "7" }, "Linecard2|Ethernet28": { "speed": "40000", "system_port_id": "40", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "8" }, "Linecard2|Ethernet32": { "speed": "40000", "system_port_id": "41", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "9" }, "Linecard2|Ethernet36": { "speed": "40000", "system_port_id": "42", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "10" }, "Linecard2|Ethernet40": { "speed": "40000", "system_port_id": "43", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "11" }, "Linecard2|Ethernet44": { "speed": "40000", "system_port_id": "44", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "12" }, "Linecard2|Ethernet48": { "speed": "40000", "system_port_id": "45", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "13" }, "Linecard2|Ethernet52": { "speed": "40000", "system_port_id": "46", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "14" }, "Linecard2|Ethernet56": { "speed": "40000", "system_port_id": "47", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "15" }, "Linecard2|Ethernet60": { "speed": "40000", "system_port_id": "48", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "16" }, "Linecard2|Ethernet64": { "speed": "40000", "system_port_id": "49", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "1" }, "Linecard2|Ethernet68": { "speed": "40000", "system_port_id": "50", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "2" }, "Linecard2|Ethernet72": { "speed": "40000", "system_port_id": "51", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "3" }, "Linecard2|Ethernet76": { "speed": "40000", "system_port_id": "52", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "4" }, "Linecard2|Ethernet80": { "speed": "40000", "system_port_id": "53", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "5" }, "Linecard2|Ethernet84": { "speed": "40000", "system_port_id": "54", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "6" }, "Linecard2|Ethernet88": { "speed": "40000", "system_port_id": "55", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "7" }, "Linecard2|Ethernet92": { "speed": "40000", "system_port_id": "56", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "8" }, "Linecard2|Ethernet96": { "speed": "40000", "system_port_id": "57", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "9" }, "Linecard2|Ethernet100": { "speed": "40000", "system_port_id": "58", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "10" }, "Linecard2|Ethernet104": { "speed": "40000", "system_port_id": "59", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "11" }, "Linecard2|Ethernet108": { "speed": "40000", "system_port_id": "60", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "12" }, "Linecard2|Ethernet112": { "speed": "40000", "system_port_id": "61", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "13" }, "Linecard2|Ethernet116": { "speed": "40000", "system_port_id": "62", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "14" }, "Linecard2|Ethernet120": { "speed": "40000", "system_port_id": "63", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "15" }, "Linecard2|Ethernet124": { "speed": "40000", "system_port_id": "64", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "16" }, "Linecard3|Ethernet0": { "speed": "40000", "system_port_id": "65", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "1" }, "Linecard3|Ethernet4": { "speed": "40000", "system_port_id": "66", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "2" }, "Linecard3|Ethernet8": { "speed": "40000", "system_port_id": "67", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "3" }, "Linecard3|Ethernet12": { "speed": "40000", "system_port_id": "68", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "4" }, "Linecard3|Ethernet16": { "speed": "40000", "system_port_id": "69", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "5" }, "Linecard3|Ethernet20": { "speed": "40000", "system_port_id": "70", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "6" }, "Linecard3|Ethernet24": { "speed": "40000", "system_port_id": "71", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "7" }, "Linecard3|Ethernet28": { "speed": "40000", "system_port_id": "72", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "8" }, "Linecard3|Ethernet32": { "speed": "40000", "system_port_id": "73", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "9" }, "Linecard3|Ethernet36": { "speed": "40000", "system_port_id": "74", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "10" }, "Linecard3|Ethernet40": { "speed": "40000", "system_port_id": "75", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "11" }, "Linecard3|Ethernet44": { "speed": "40000", "system_port_id": "76", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "12" }, "Linecard3|Ethernet48": { "speed": "40000", "system_port_id": "77", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "13" }, "Linecard3|Ethernet52": { "speed": "40000", "system_port_id": "78", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "14" }, "Linecard3|Ethernet56": { "speed": "40000", "system_port_id": "79", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "15" }, "Linecard3|Ethernet60": { "speed": "40000", "system_port_id": "80", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "16" }, "Linecard3|Ethernet64": { "speed": "40000", "system_port_id": "81", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "1" }, "Linecard3|Ethernet68": { "speed": "40000", "system_port_id": "82", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "2" }, "Linecard3|Ethernet72": { "speed": "40000", "system_port_id": "83", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "3" }, "Linecard3|Ethernet76": { "speed": "40000", "system_port_id": "84", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "4" }, "Linecard3|Ethernet80": { "speed": "40000", "system_port_id": "85", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "5" }, "Linecard3|Ethernet84": { "speed": "40000", "system_port_id": "86", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "6" }, "Linecard3|Ethernet88": { "speed": "40000", "system_port_id": "87", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "7" }, "Linecard3|Ethernet92": { "speed": "40000", "system_port_id": "88", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "8" }, "Linecard3|Ethernet96": { "speed": "40000", "system_port_id": "89", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "9" }, "Linecard3|Ethernet100": { "speed": "40000", "system_port_id": "90", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "10" }, "Linecard3|Ethernet104": { "speed": "40000", "system_port_id": "91", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "11" }, "Linecard3|Ethernet108": { "speed": "40000", "system_port_id": "92", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "12" }, "Linecard3|Ethernet112": { "speed": "40000", "system_port_id": "93", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "13" }, "Linecard3|Ethernet116": { "speed": "40000", "system_port_id": "94", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "14" }, "Linecard3|Ethernet120": { "speed": "40000", "system_port_id": "95", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "15" }, "Linecard3|Ethernet124": { "speed": "40000", "system_port_id": "96", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "16" } diff --git a/tests/virtual_chassis/3/default_config.json b/tests/virtual_chassis/3/default_config.json index 6ac0bbd17684..4579733d3532 100644 --- a/tests/virtual_chassis/3/default_config.json +++ b/tests/virtual_chassis/3/default_config.json @@ -249,448 +249,448 @@ "Linecard2|Ethernet0": { "speed": "40000", "system_port_id": "33", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "1" }, "Linecard2|Ethernet4": { "speed": "40000", "system_port_id": "34", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "2" }, "Linecard2|Ethernet8": { "speed": "40000", "system_port_id": "35", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "3" }, "Linecard2|Ethernet12": { "speed": "40000", "system_port_id": "36", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "4" }, "Linecard2|Ethernet16": { "speed": "40000", "system_port_id": "37", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "5" }, "Linecard2|Ethernet20": { "speed": "40000", "system_port_id": "38", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "6" }, "Linecard2|Ethernet24": { "speed": "40000", "system_port_id": "39", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "7" }, "Linecard2|Ethernet28": { "speed": "40000", "system_port_id": "40", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "8" }, "Linecard2|Ethernet32": { "speed": "40000", "system_port_id": "41", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "9" }, "Linecard2|Ethernet36": { "speed": "40000", "system_port_id": "42", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "10" }, "Linecard2|Ethernet40": { "speed": "40000", "system_port_id": "43", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "11" }, "Linecard2|Ethernet44": { "speed": "40000", "system_port_id": "44", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "12" }, "Linecard2|Ethernet48": { "speed": "40000", "system_port_id": "45", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "13" }, "Linecard2|Ethernet52": { "speed": "40000", "system_port_id": "46", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "14" }, "Linecard2|Ethernet56": { "speed": "40000", "system_port_id": "47", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "15" }, "Linecard2|Ethernet60": { "speed": "40000", "system_port_id": "48", - "switch_id": "1", + "switch_id": "2", "core_index": "0", "core_port_index": "16" }, "Linecard2|Ethernet64": { "speed": "40000", "system_port_id": "49", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "1" }, "Linecard2|Ethernet68": { "speed": "40000", "system_port_id": "50", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "2" }, "Linecard2|Ethernet72": { "speed": "40000", "system_port_id": "51", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "3" }, "Linecard2|Ethernet76": { "speed": "40000", "system_port_id": "52", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "4" }, "Linecard2|Ethernet80": { "speed": "40000", "system_port_id": "53", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "5" }, "Linecard2|Ethernet84": { "speed": "40000", "system_port_id": "54", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "6" }, "Linecard2|Ethernet88": { "speed": "40000", "system_port_id": "55", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "7" }, "Linecard2|Ethernet92": { "speed": "40000", "system_port_id": "56", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "8" }, "Linecard2|Ethernet96": { "speed": "40000", "system_port_id": "57", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "9" }, "Linecard2|Ethernet100": { "speed": "40000", "system_port_id": "58", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "10" }, "Linecard2|Ethernet104": { "speed": "40000", "system_port_id": "59", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "11" }, "Linecard2|Ethernet108": { "speed": "40000", "system_port_id": "60", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "12" }, "Linecard2|Ethernet112": { "speed": "40000", "system_port_id": "61", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "13" }, "Linecard2|Ethernet116": { "speed": "40000", "system_port_id": "62", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "14" }, "Linecard2|Ethernet120": { "speed": "40000", "system_port_id": "63", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "15" }, "Linecard2|Ethernet124": { "speed": "40000", "system_port_id": "64", - "switch_id": "1", + "switch_id": "2", "core_index": "1", "core_port_index": "16" }, "Linecard3|Ethernet0": { "speed": "40000", "system_port_id": "65", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "1" }, "Linecard3|Ethernet4": { "speed": "40000", "system_port_id": "66", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "2" }, "Linecard3|Ethernet8": { "speed": "40000", "system_port_id": "67", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "3" }, "Linecard3|Ethernet12": { "speed": "40000", "system_port_id": "68", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "4" }, "Linecard3|Ethernet16": { "speed": "40000", "system_port_id": "69", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "5" }, "Linecard3|Ethernet20": { "speed": "40000", "system_port_id": "70", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "6" }, "Linecard3|Ethernet24": { "speed": "40000", "system_port_id": "71", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "7" }, "Linecard3|Ethernet28": { "speed": "40000", "system_port_id": "72", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "8" }, "Linecard3|Ethernet32": { "speed": "40000", "system_port_id": "73", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "9" }, "Linecard3|Ethernet36": { "speed": "40000", "system_port_id": "74", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "10" }, "Linecard3|Ethernet40": { "speed": "40000", "system_port_id": "75", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "11" }, "Linecard3|Ethernet44": { "speed": "40000", "system_port_id": "76", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "12" }, "Linecard3|Ethernet48": { "speed": "40000", "system_port_id": "77", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "13" }, "Linecard3|Ethernet52": { "speed": "40000", "system_port_id": "78", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "14" }, "Linecard3|Ethernet56": { "speed": "40000", "system_port_id": "79", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "15" }, "Linecard3|Ethernet60": { "speed": "40000", "system_port_id": "80", - "switch_id": "2", + "switch_id": "4", "core_index": "0", "core_port_index": "16" }, "Linecard3|Ethernet64": { "speed": "40000", "system_port_id": "81", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "1" }, "Linecard3|Ethernet68": { "speed": "40000", "system_port_id": "82", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "2" }, "Linecard3|Ethernet72": { "speed": "40000", "system_port_id": "83", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "3" }, "Linecard3|Ethernet76": { "speed": "40000", "system_port_id": "84", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "4" }, "Linecard3|Ethernet80": { "speed": "40000", "system_port_id": "85", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "5" }, "Linecard3|Ethernet84": { "speed": "40000", "system_port_id": "86", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "6" }, "Linecard3|Ethernet88": { "speed": "40000", "system_port_id": "87", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "7" }, "Linecard3|Ethernet92": { "speed": "40000", "system_port_id": "88", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "8" }, "Linecard3|Ethernet96": { "speed": "40000", "system_port_id": "89", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "9" }, "Linecard3|Ethernet100": { "speed": "40000", "system_port_id": "90", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "10" }, "Linecard3|Ethernet104": { "speed": "40000", "system_port_id": "91", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "11" }, "Linecard3|Ethernet108": { "speed": "40000", "system_port_id": "92", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "12" }, "Linecard3|Ethernet112": { "speed": "40000", "system_port_id": "93", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "13" }, "Linecard3|Ethernet116": { "speed": "40000", "system_port_id": "94", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "14" }, "Linecard3|Ethernet120": { "speed": "40000", "system_port_id": "95", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "15" }, "Linecard3|Ethernet124": { "speed": "40000", "system_port_id": "96", - "switch_id": "2", + "switch_id": "4", "core_index": "1", "core_port_index": "16" }