Skip to content

Commit

Permalink
Move error to throw on sai unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik committed Aug 23, 2021
1 parent 3c3b369 commit 0fd06c9
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions vslib/SaiUnittests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ void Sai::handleUnittestChannelOp(
{
MUTEX();

// at this point api are initialized since unit test thread
// is started if initialization will be successful

SWSS_LOG_ENTER();

/*
Expand All @@ -281,12 +284,6 @@ void Sai::handleUnittestChannelOp(
SWSS_LOG_NOTICE("attr: %s: %s", fvField(v).c_str(), fvValue(v).c_str());
}

if (!m_apiInitialized)
{
SWSS_LOG_ERROR("api not initialized but received unittests requsts: op: %s, key: %s", op.c_str(), key.c_str());
return;
}

if (op == SAI_VS_UNITTEST_ENABLE_UNITTESTS)
{
channelOpEnableUnittest(key, values);
Expand All @@ -301,7 +298,7 @@ void Sai::handleUnittestChannelOp(
}
else
{
SWSS_LOG_ERROR("unknown unittest operation: %s", op.c_str());
SWSS_LOG_THROW("unknown unittest operation: %s", op.c_str());
}
}

Expand Down

0 comments on commit 0fd06c9

Please sign in to comment.