diff --git a/unittest/vslib/Makefile.am b/unittest/vslib/Makefile.am index 956bfcb9683e..c15d1ca9a1d0 100644 --- a/unittest/vslib/Makefile.am +++ b/unittest/vslib/Makefile.am @@ -13,6 +13,7 @@ tests_LDADD = $(LDADD_GTEST) $(top_srcdir)/vslib/libSaiVS.a -lhiredis -lswsscomm testslibsaivs_SOURCES = main_libsaivs.cpp \ test_sai_vs_acl.cpp \ test_sai_vs_bfd.cpp \ + test_sai_vs_bmtor.cpp \ test_sai_vs_hash.cpp \ test_sai_vs_vlan.cpp \ test_sai_vs_hostif.cpp \ diff --git a/unittest/vslib/test_sai_vs_bmtor.cpp b/unittest/vslib/test_sai_vs_bmtor.cpp new file mode 100644 index 000000000000..31ac349f28ae --- /dev/null +++ b/unittest/vslib/test_sai_vs_bmtor.cpp @@ -0,0 +1,46 @@ +#include + +extern "C" { +#include "sai.h" +#include "saiextensions.h" +} + +#include "swss/logger.h" + +TEST(libsaivs, bmtor) +{ + sai_bmtor_api_t *api = nullptr; + + sai_api_query((sai_api_t)SAI_API_BMTOR, (void**)&api); + + EXPECT_NE(api, nullptr); + + sai_object_id_t id; + + EXPECT_NE(SAI_STATUS_SUCCESS, api->create_table_bitmap_classification_entry(&id,0,0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->remove_table_bitmap_classification_entry(0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->set_table_bitmap_classification_entry_attribute(0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->get_table_bitmap_classification_entry_attribute(0,0,0)); + + EXPECT_NE(SAI_STATUS_SUCCESS, api->get_table_bitmap_classification_entry_stats(0,0,0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->get_table_bitmap_classification_entry_stats_ext(0,0,0,SAI_STATS_MODE_READ,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->clear_table_bitmap_classification_entry_stats(0,0,0)); + + EXPECT_NE(SAI_STATUS_SUCCESS, api->create_table_bitmap_router_entry(&id,0,0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->remove_table_bitmap_router_entry(0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->set_table_bitmap_router_entry_attribute(0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->get_table_bitmap_router_entry_attribute(0,0,0)); + + EXPECT_NE(SAI_STATUS_SUCCESS, api->get_table_bitmap_router_entry_stats(0,0,0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->get_table_bitmap_router_entry_stats_ext(0,0,0,SAI_STATS_MODE_READ,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->clear_table_bitmap_router_entry_stats(0,0,0)); + + EXPECT_NE(SAI_STATUS_SUCCESS, api->create_table_meta_tunnel_entry(&id,0,0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->remove_table_meta_tunnel_entry(0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->set_table_meta_tunnel_entry_attribute(0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->get_table_meta_tunnel_entry_attribute(0,0,0)); + + EXPECT_NE(SAI_STATUS_SUCCESS, api->get_table_meta_tunnel_entry_stats(0,0,0,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->get_table_meta_tunnel_entry_stats_ext(0,0,0,SAI_STATS_MODE_READ,0)); + EXPECT_NE(SAI_STATUS_SUCCESS, api->clear_table_meta_tunnel_entry_stats(0,0,0)); +}