From adbcfd9fd5c7fcdfc3562a245dcd3fe4fa144472 Mon Sep 17 00:00:00 2001 From: kcudnik Date: Mon, 16 Aug 2021 20:15:18 +0200 Subject: [PATCH] Add mcast fdb tests --- unittest/vslib/Makefile.am | 2 ++ unittest/vslib/test_sai_vs_mcastfdb.cpp | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 unittest/vslib/test_sai_vs_mcastfdb.cpp diff --git a/unittest/vslib/Makefile.am b/unittest/vslib/Makefile.am index d8bd76db0ecc..b43404ee336b 100644 --- a/unittest/vslib/Makefile.am +++ b/unittest/vslib/Makefile.am @@ -25,7 +25,9 @@ testslibsaivs_SOURCES = main_libsaivs.cpp \ test_sai_vs_l2mcgroup.cpp \ test_sai_vs_lag.cpp \ test_sai_vs_ipmc_group.cpp \ + test_sai_vs_macsec.cpp \ test_sai_vs_isolation_group.cpp \ + test_sai_vs_mcastfdb.cpp \ test_sai_vs_hash.cpp \ test_sai_vs_vlan.cpp \ test_sai_vs_hostif.cpp \ diff --git a/unittest/vslib/test_sai_vs_mcastfdb.cpp b/unittest/vslib/test_sai_vs_mcastfdb.cpp new file mode 100644 index 000000000000..19d9e3ab9921 --- /dev/null +++ b/unittest/vslib/test_sai_vs_mcastfdb.cpp @@ -0,0 +1,23 @@ +#include + +extern "C" { +#include "sai.h" +} + +#include "swss/logger.h" + +TEST(libsaivs, mcast_fdb) +{ + sai_mcast_fdb_api_t *api = nullptr; + + sai_api_query(SAI_API_MCAST_FDB, (void**)&api); + + EXPECT_NE(api, nullptr); + + sai_mcast_fdb_entry_t id; + + EXPECT_NE(SAI_STATUS_SUCCESS, api->create_mcast_fdb_entry(&id,0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->remove_mcast_fdb_entry(0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->set_mcast_fdb_entry_attribute(0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->get_mcast_fdb_entry_attribute(0,0,0)); +}