Skip to content

Commit

Permalink
Add mcast fdb tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik committed Aug 23, 2021
1 parent d624231 commit adbcfd9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions unittest/vslib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
23 changes: 23 additions & 0 deletions unittest/vslib/test_sai_vs_mcastfdb.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <gtest/gtest.h>

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));
}

0 comments on commit adbcfd9

Please sign in to comment.