Skip to content

Commit c612c5e

Browse files
kcudniklguohan
authored andcommitted
Add specific comparison logic for more objects (sonic-net#360)
* 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
1 parent a6b709a commit c612c5e

7 files changed

Lines changed: 26847 additions & 27 deletions

File tree

syncd/syncd.cpp

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ struct cmdOptions
8585
bool useTempView;
8686
int startType;
8787
bool disableExitSleep;
88+
bool enableUnittests;
8889
std::string profileMapFile;
8990
#ifdef SAITHRIFT
9091
bool run_rpc_server;
@@ -95,6 +96,13 @@ struct cmdOptions
9596

9697
cmdOptions options;
9798

99+
bool enableUnittests()
100+
{
101+
SWSS_LOG_ENTER();
102+
103+
return options.enableUnittests;
104+
}
105+
98106
bool isInitViewMode()
99107
{
100108
SWSS_LOG_ENTER();
@@ -2912,7 +2920,7 @@ void printUsage()
29122920
{
29132921
SWSS_LOG_ENTER();
29142922

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

29442954
options.disableExitSleep = false;
2955+
options.enableUnittests = false;
29452956

29462957
#ifdef SAITHRIFT
29472958
options.run_rpc_server = false;
2948-
const char* const optstring = "dNt:p:i:rm:huS";
2959+
const char* const optstring = "dNUt:p:i:rm:huS";
29492960
#else
2950-
const char* const optstring = "dNt:p:i:huS";
2961+
const char* const optstring = "dNUt:p:i:huS";
29512962
#endif // SAITHRIFT
29522963

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

29792991
switch (c)
29802992
{
2993+
case 'U':
2994+
SWSS_LOG_NOTICE("enable unittests");
2995+
options.enableUnittests = true;
2996+
break;
2997+
29812998
case 'u':
29822999
SWSS_LOG_NOTICE("enable use temp view");
29833000
options.useTempView = true;

syncd/syncd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,6 @@ sai_status_t processBulkEvent(
120120
void set_sai_api_log_min_prio(
121121
_In_ const std::string &prio);
122122

123+
bool enableUnittests();
124+
123125
#endif // __SYNCD_H__

0 commit comments

Comments
 (0)