Skip to content

Commit 702dff6

Browse files
committed
Add scheduler group tests
1 parent 24e3d92 commit 702dff6

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

unittest/vslib/Makefile.am

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ testslibsaivs_SOURCES = main_libsaivs.cpp \
4343
test_sai_vs_router_interface.cpp \
4444
test_sai_vs_router_rpfgroup.cpp \
4545
test_sai_vs_router_samplepacket.cpp \
46+
test_sai_vs_schedulergroup.cpp \
4647
test_sai_vs_vlan.cpp \
4748
test_sai_vs_hostif.cpp \
4849
test_sai_vs_wred.cpp
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <gtest/gtest.h>
2+
3+
extern "C" {
4+
#include "sai.h"
5+
}
6+
7+
#include "swss/logger.h"
8+
9+
TEST(libsaivs, scheduler_group)
10+
{
11+
sai_scheduler_group_api_t *api = nullptr;
12+
13+
sai_api_query(SAI_API_SCHEDULER_GROUP, (void**)&api);
14+
15+
EXPECT_NE(api, nullptr);
16+
17+
sai_object_id_t id;
18+
19+
EXPECT_NE(SAI_STATUS_SUCCESS, api->create_scheduler_group(&id,0,0,0));
20+
EXPECT_NE(SAI_STATUS_SUCCESS, api->remove_scheduler_group(0));
21+
EXPECT_NE(SAI_STATUS_SUCCESS, api->set_scheduler_group_attribute(0,0));
22+
EXPECT_NE(SAI_STATUS_SUCCESS, api->get_scheduler_group_attribute(0,0,0));
23+
}

0 commit comments

Comments
 (0)