forked from sonic-net/sonic-sairedis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Chassis] Create fabric ports for switch_type fabric. (sonic-net#1114)
Create fabric ports for switch_type fabric. This is needed to create vs test for fabric on supervisor.
- Loading branch information
1 parent
5582b11
commit c4d6621
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "SwitchStateBase.h" | ||
#include "MACsecAttr.h" | ||
|
||
#include <gtest/gtest.h> | ||
|
||
#include <vector> | ||
|
||
using namespace saivs; | ||
|
||
//Test the following function: | ||
//sai_status_t initialize_voq_switch_objects( | ||
// _In_ uint32_t attr_count, | ||
// _In_ const sai_attribute_t *attr_list); | ||
|
||
TEST(SwitchStateBase, initialize_voq_switch_objects) | ||
{ | ||
auto sc = std::make_shared<SwitchConfig>(0, ""); | ||
auto scc = std::make_shared<SwitchConfigContainer>(); | ||
|
||
SwitchStateBase ss( | ||
0x2100000000, | ||
std::make_shared<RealObjectIdManager>(0, scc), | ||
sc); | ||
|
||
sai_attribute_t attr; | ||
|
||
attr.id = SAI_SWITCH_ATTR_TYPE; | ||
attr.value.u32 = SAI_SWITCH_TYPE_FABRIC; | ||
sc->m_fabricLaneMap = LaneMap::getDefaultLaneMap(0); | ||
// Check the result of the initialize_voq_switch_objects | ||
EXPECT_EQ(SAI_STATUS_SUCCESS, | ||
ss.initialize_voq_switch_objects(1, &attr)); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters