From 702dff69aed756f1753dad0475cdc9fbd665f54f Mon Sep 17 00:00:00 2001 From: kcudnik Date: Mon, 16 Aug 2021 22:16:24 +0200 Subject: [PATCH] Add scheduler group tests --- unittest/vslib/Makefile.am | 1 + unittest/vslib/test_sai_vs_schedulergroup.cpp | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 unittest/vslib/test_sai_vs_schedulergroup.cpp diff --git a/unittest/vslib/Makefile.am b/unittest/vslib/Makefile.am index 302b97d40d47..7e1e06601d8d 100644 --- a/unittest/vslib/Makefile.am +++ b/unittest/vslib/Makefile.am @@ -43,6 +43,7 @@ testslibsaivs_SOURCES = main_libsaivs.cpp \ test_sai_vs_router_interface.cpp \ test_sai_vs_router_rpfgroup.cpp \ test_sai_vs_router_samplepacket.cpp \ + test_sai_vs_schedulergroup.cpp \ test_sai_vs_vlan.cpp \ test_sai_vs_hostif.cpp \ test_sai_vs_wred.cpp diff --git a/unittest/vslib/test_sai_vs_schedulergroup.cpp b/unittest/vslib/test_sai_vs_schedulergroup.cpp new file mode 100644 index 000000000000..895388e666ea --- /dev/null +++ b/unittest/vslib/test_sai_vs_schedulergroup.cpp @@ -0,0 +1,23 @@ +#include + +extern "C" { +#include "sai.h" +} + +#include "swss/logger.h" + +TEST(libsaivs, scheduler_group) +{ + sai_scheduler_group_api_t *api = nullptr; + + sai_api_query(SAI_API_SCHEDULER_GROUP, (void**)&api); + + EXPECT_NE(api, nullptr); + + sai_object_id_t id; + + EXPECT_NE(SAI_STATUS_SUCCESS, api->create_scheduler_group(&id,0,0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->remove_scheduler_group(0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->set_scheduler_group_attribute(0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->get_scheduler_group_attribute(0,0,0)); +}