From fda4f80836578aeba22b26572a58f1828a8a273f Mon Sep 17 00:00:00 2001 From: kcudnik Date: Mon, 16 Aug 2021 20:59:13 +0200 Subject: [PATCH] Add rpf group tests --- unittest/vslib/Makefile.am | 1 + .../vslib/test_sai_vs_router_rpfgroup.cpp | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 unittest/vslib/test_sai_vs_router_rpfgroup.cpp diff --git a/unittest/vslib/Makefile.am b/unittest/vslib/Makefile.am index 82144630afca..3e517be31f1a 100644 --- a/unittest/vslib/Makefile.am +++ b/unittest/vslib/Makefile.am @@ -41,6 +41,7 @@ testslibsaivs_SOURCES = main_libsaivs.cpp \ test_sai_vs_queue.cpp \ test_sai_vs_route.cpp \ test_sai_vs_router_interface.cpp \ + test_sai_vs_router_rpfgroup.cpp \ test_sai_vs_vlan.cpp \ test_sai_vs_hostif.cpp \ test_sai_vs_wred.cpp diff --git a/unittest/vslib/test_sai_vs_router_rpfgroup.cpp b/unittest/vslib/test_sai_vs_router_rpfgroup.cpp new file mode 100644 index 000000000000..f7c9a4abfc35 --- /dev/null +++ b/unittest/vslib/test_sai_vs_router_rpfgroup.cpp @@ -0,0 +1,28 @@ +#include + +extern "C" { +#include "sai.h" +} + +#include "swss/logger.h" + +TEST(libsaivs, rpf_group) +{ + sai_rpf_group_api_t *api = nullptr; + + sai_api_query(SAI_API_RPF_GROUP, (void**)&api); + + EXPECT_NE(api, nullptr); + + sai_object_id_t id; + + EXPECT_NE(SAI_STATUS_SUCCESS, api->create_rpf_group(&id,0,0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->remove_rpf_group(0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->set_rpf_group_attribute(0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->get_rpf_group_attribute(0,0,0)); + + EXPECT_NE(SAI_STATUS_SUCCESS, api->create_rpf_group_member(&id,0,0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->remove_rpf_group_member(0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->set_rpf_group_member_attribute(0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->get_rpf_group_member_attribute(0,0,0)); +}