Skip to content

Commit 78e8b68

Browse files
committed
Add fdb tests
1 parent 8af035b commit 78e8b68

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

unittest/vslib/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ testslibsaivs_SOURCES = main_libsaivs.cpp \
1919
test_sai_vs_counter.cpp \
2020
test_sai_vs_debug_counter.cpp \
2121
test_sai_vs_dtel.cpp \
22+
test_sai_vs_fdb.cpp \
2223
test_sai_vs_hash.cpp \
2324
test_sai_vs_vlan.cpp \
2425
test_sai_vs_hostif.cpp \

unittest/vslib/test_sai_vs_fdb.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#include <gtest/gtest.h>
2+
3+
extern "C" {
4+
#include "sai.h"
5+
}
6+
7+
#include "swss/logger.h"
8+
9+
TEST(libsaivs, fdb)
10+
{
11+
sai_fdb_api_t *api = nullptr;
12+
13+
sai_api_query(SAI_API_FDB, (void**)&api);
14+
15+
EXPECT_NE(api, nullptr);
16+
17+
sai_fdb_entry_t id ;
18+
19+
EXPECT_NE(SAI_STATUS_SUCCESS, api->create_fdb_entry(&id,0,0));
20+
EXPECT_NE(SAI_STATUS_SUCCESS, api->remove_fdb_entry(0));
21+
EXPECT_NE(SAI_STATUS_SUCCESS, api->set_fdb_entry_attribute(0,0));
22+
EXPECT_NE(SAI_STATUS_SUCCESS, api->get_fdb_entry_attribute(0,0,0));
23+
24+
EXPECT_NE(SAI_STATUS_SUCCESS, api->flush_fdb_entries(0,0,0));
25+
26+
EXPECT_NE(SAI_STATUS_SUCCESS, api->create_fdb_entries(0,0,0,0,SAI_BULK_OP_ERROR_MODE_IGNORE_ERROR,0));
27+
EXPECT_NE(SAI_STATUS_SUCCESS, api->remove_fdb_entries(0,0,SAI_BULK_OP_ERROR_MODE_IGNORE_ERROR,0));
28+
EXPECT_NE(SAI_STATUS_SUCCESS, api->set_fdb_entries_attribute(0,0,0,SAI_BULK_OP_ERROR_MODE_IGNORE_ERROR,0));
29+
EXPECT_NE(SAI_STATUS_SUCCESS, api->get_fdb_entries_attribute(0,0,0,0,SAI_BULK_OP_ERROR_MODE_IGNORE_ERROR,0));
30+
}

0 commit comments

Comments
 (0)