Skip to content

Commit

Permalink
Add specific comparison logic for more objects (sonic-net#360)
Browse files Browse the repository at this point in the history
* Add router interface specific comparison logic

* Add specific policer comparison logic

* Add specific hostif trap group comparison logic

* Add method log entry

* Add unittests for zero asic operations

* Add full testbed config

* Add method enter log
  • Loading branch information
kcudnik authored and lguohan committed Oct 31, 2018
1 parent a6b709a commit c612c5e
Show file tree
Hide file tree
Showing 7 changed files with 26,847 additions and 27 deletions.
23 changes: 20 additions & 3 deletions syncd/syncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ struct cmdOptions
bool useTempView;
int startType;
bool disableExitSleep;
bool enableUnittests;
std::string profileMapFile;
#ifdef SAITHRIFT
bool run_rpc_server;
Expand All @@ -95,6 +96,13 @@ struct cmdOptions

cmdOptions options;

bool enableUnittests()
{
SWSS_LOG_ENTER();

return options.enableUnittests;
}

bool isInitViewMode()
{
SWSS_LOG_ENTER();
Expand Down Expand Up @@ -2912,7 +2920,7 @@ void printUsage()
{
SWSS_LOG_ENTER();

std::cout << "Usage: syncd [-N] [-d] [-p profile] [-i interval] [-t [cold|warm|fast]] [-h] [-u] [-S]" << std::endl;
std::cout << "Usage: syncd [-N] [-U] [-d] [-p profile] [-i interval] [-t [cold|warm|fast]] [-h] [-u] [-S]" << std::endl;
std::cout << " -N --nocounters" << std::endl;
std::cout << " Disable counter thread" << std::endl;
std::cout << " -d --diag" << std::endl;
Expand All @@ -2927,6 +2935,8 @@ void printUsage()
std::cout << " Use temporary view between init and apply" << std::endl;
std::cout << " -S --disableExitSleep" << std::endl;
std::cout << " Disable sleep when syncd crashes" << std::endl;
std::cout << " -U --eableUnittests" << std::endl;
std::cout << " Metadata enable unittests" << std::endl;
#ifdef SAITHRIFT
std::cout << " -r --rpcserver" << std::endl;
std::cout << " Enable rpcserver" << std::endl;
Expand All @@ -2942,12 +2952,13 @@ void handleCmdLine(int argc, char **argv)
SWSS_LOG_ENTER();

options.disableExitSleep = false;
options.enableUnittests = false;

#ifdef SAITHRIFT
options.run_rpc_server = false;
const char* const optstring = "dNt:p:i:rm:huS";
const char* const optstring = "dNUt:p:i:rm:huS";
#else
const char* const optstring = "dNt:p:i:huS";
const char* const optstring = "dNUt:p:i:huS";
#endif // SAITHRIFT

while(true)
Expand All @@ -2960,6 +2971,7 @@ void handleCmdLine(int argc, char **argv)
{ "profile", required_argument, 0, 'p' },
{ "help", no_argument, 0, 'h' },
{ "disableExitSleep", no_argument, 0, 'S' },
{ "enableUnittests", no_argument, 0, 'U' },
#ifdef SAITHRIFT
{ "rpcserver", no_argument, 0, 'r' },
{ "portmap", required_argument, 0, 'm' },
Expand All @@ -2978,6 +2990,11 @@ void handleCmdLine(int argc, char **argv)

switch (c)
{
case 'U':
SWSS_LOG_NOTICE("enable unittests");
options.enableUnittests = true;
break;

case 'u':
SWSS_LOG_NOTICE("enable use temp view");
options.useTempView = true;
Expand Down
2 changes: 2 additions & 0 deletions syncd/syncd.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,6 @@ sai_status_t processBulkEvent(
void set_sai_api_log_min_prio(
_In_ const std::string &prio);

bool enableUnittests();

#endif // __SYNCD_H__
Loading

0 comments on commit c612c5e

Please sign in to comment.