Skip to content

Commit

Permalink
Test script update to accomdate the new portorch warm start implement…
Browse files Browse the repository at this point in the history
…ation

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
  • Loading branch information
jipanyang committed Aug 9, 2018
1 parent 53f7803 commit 5a114a3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
12 changes: 9 additions & 3 deletions orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1247,9 +1247,15 @@ bool PortsOrch::bake()
if (m_portCount != keys.size() - 2)
{
// Invalid port table
SWSS_LOG_ERROR("Invalid port table: m_portCount");
cleanPortTable(keys);
return false;
SWSS_LOG_ERROR("Invalid port table: m_portCount, expecting %u, got %lu",
m_portCount, keys.size() - 2);

// Get around https://github.com/Azure/sonic-swss/issues/567 for now
if (!WarmStart::isWarmStart())
{
cleanPortTable(keys);
return false;
}
}

addExistingData(m_portTable.get());
Expand Down
1 change: 1 addition & 0 deletions portsyncd/portsyncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ int main(int argc, char **argv)
/* If PortInitDone already set, clear the init port config buffer */
if(g_init)
{
cout << "portsyncd warm start" << endl;
deque<KeyOpFieldsValuesTuple> vkco;
portCfg.pops(vkco);
}
Expand Down
9 changes: 0 additions & 9 deletions tests/test_warm_reboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
import time
import json

def swss_flushdb(dvs):
# Note, this may be changed if portorch is changed to restore from APPDB completely.
dvs.runcmd("redis-cli -n 0 DEL PORT_TABLE:PortConfigDone")
dvs.runcmd("redis-cli -n 0 DEL PORT_TABLE:PortInitDone")

# Get restart count of all processes supporting warm restart
def swss_get_RestartCount(state_db):
restart_count = {}
Expand Down Expand Up @@ -123,7 +118,6 @@ def test_swss_warm_restore(dvs):
restart_count = swss_get_RestartCount(state_db)
dvs.runcmd("/usr/bin/stop_swss.sh")
time.sleep(5)
swss_flushdb(dvs)
dvs.runcmd("mv /var/log/swss/sairedis.rec /var/log/swss/sairedis.rec.b")
dvs.runcmd("/usr/bin/start_swss.sh")
time.sleep(10)
Expand Down Expand Up @@ -170,7 +164,6 @@ def test_swss_port_state_syncup(dvs):
dvs.servers[2].runcmd("ip link set up dev eth0") == 0

time.sleep(1)
swss_flushdb(dvs)
dvs.runcmd("/usr/bin/start_swss.sh")
time.sleep(10)

Expand Down Expand Up @@ -284,8 +277,6 @@ def test_swss_fdb_syncup_and_crm(dvs):

dvs.runcmd("/usr/bin/stop_swss.sh")

#clean the port configDone and initDone flag.
swss_flushdb(dvs)

# delete the FDB entry in AppDB before swss is started again,
# the orchagent is supposed to sync up the entry from ASIC DB after warm restart
Expand Down

0 comments on commit 5a114a3

Please sign in to comment.