Skip to content

Commit

Permalink
add UT
Browse files Browse the repository at this point in the history
  • Loading branch information
arlakshm committed May 22, 2024
1 parent 837509e commit ce244a4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
9 changes: 2 additions & 7 deletions orchagent/intfsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1740,13 +1740,8 @@ void IntfsOrch::voqSyncIntfState(string &alias, bool isUp)
}
port_alias = port.m_system_port_info.alias;
}
}
else
{
SWSS_LOG_ERROR("Port does not exist for %s!", port_alias.c_str());
return;
SWSS_LOG_NOTICE("Syncing system interface state %s for port %s", isUp ? "up" : "down", port_alias.c_str());
m_tableVoqSystemInterfaceTable->hset(port_alias, "oper_status", isUp ? "up" : "down");
}

SWSS_LOG_NOTICE("Syncing system interface state %s for port %s", isUp ? "up" : "down", port_alias.c_str());
m_tableVoqSystemInterfaceTable->hset(port_alias, "oper_status", isUp ? "up" : "down");
}
11 changes: 0 additions & 11 deletions orchagent/neighorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1917,8 +1917,6 @@ bool NeighOrch::ifChangeInformRemoteNextHop(const string &alias, bool if_up)
bool rc = true;
Port inbp;
gPortsOrch->getInbandPort(inbp);
SWSS_LOG_INFO("Inband port %s", inbp.m_alias.c_str());

for (auto nbr = m_syncdNeighbors.begin(); nbr != m_syncdNeighbors.end(); ++nbr)
{
if (nbr->first.alias != alias)
Expand All @@ -1936,15 +1934,6 @@ bool NeighOrch::ifChangeInformRemoteNextHop(const string &alias, bool if_up)
{
rc = setNextHopFlag(nhop, NHFLAGS_IFDOWN);
}

if (rc == true)
{
continue;
}
else
{
break;
}
}
return rc;
}
15 changes: 14 additions & 1 deletion tests/test_virtual_chassis.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,20 @@ def test_chassis_wred_profile_on_system_ports(self, vct):

# Total number of logs = (No of system ports * No of lossless priorities) - No of lossless priorities for CPU ports
assert logSeen.strip() == str(len(system_ports)*2 - 2)


def test_chassis_system_intf_status(self, vct):
dvss = vct.dvss
for name in dvss.keys():
dvs = dvss[name]
if name.startswith("supervisor"):
chassis_app_db = DVSDatabase(swsscommon.CHASSIS_APP_DB, dvs.redis_chassis_sock)
keys = chassis_app_db.get_keys("SYSTEM_INTERFACE")
assert len(keys) > 0, "No system interface entries in chassis app db"
# Get the first system interface
intf = chassis_app_db.get_entry("SYSTEM_INTERFACE", keys[0])
# Get the oper_status
oper_status = intf.get("oper_status", "unknown")
assert oper_status != "unknown", "System interface oper status is unknown"
# 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 ce244a4

Please sign in to comment.