Skip to content

Commit

Permalink
[mock_tests]: Add Sflow Orch UTs
Browse files Browse the repository at this point in the history
Signed-off-by: Andriy Yurkiv <[email protected]>
  • Loading branch information
ayurkiv-nvda committed May 26, 2022
1 parent d7b5ff7 commit 958fed0
Show file tree
Hide file tree
Showing 5 changed files with 394 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/mock_tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tests_SOURCES = aclorch_ut.cpp \
copporch_ut.cpp \
saispy_ut.cpp \
consumer_ut.cpp \
sfloworh_ut.cpp \
ut_saihelper.cpp \
mock_orchagent_main.cpp \
mock_dbconnector.cpp \
Expand Down
1 change: 1 addition & 0 deletions tests/mock_tests/mock_orchagent_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,4 @@ extern sai_queue_api_t *sai_queue_api;
extern sai_udf_api_t* sai_udf_api;
extern sai_mpls_api_t* sai_mpls_api;
extern sai_counter_api_t* sai_counter_api;
extern sai_samplepacket_api_t *sai_samplepacket_api;
19 changes: 19 additions & 0 deletions tests/mock_tests/portal.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "aclorch.h"
#include "crmorch.h"
#include "copporch.h"
#include "sfloworch.h"
#include "directory.h"

#undef protected
Expand Down Expand Up @@ -82,6 +83,24 @@ struct Portal
}
};

struct SflowOrchInternal
{
static bool getSflowStatusEnable(SflowOrch &obj)
{
return obj.m_sflowStatus;
}

static SflowRateSampleMap getSflowSampleMap(SflowOrch &obj)
{
return obj.m_sflowRateSampleMap;
}

static SflowPortInfoMap getSflowPortInfoMap(SflowOrch &obj)
{
return obj.m_sflowPortInfoMap;
}
};

struct DirectoryInternal
{
template <typename T>
Expand Down
Loading

0 comments on commit 958fed0

Please sign in to comment.