Skip to content

Commit

Permalink
Add lag tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik committed Aug 23, 2021
1 parent 9f1b54b commit 72cfe42
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions unittest/vslib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ testslibsaivs_SOURCES = main_libsaivs.cpp \
test_sai_vs_ipmc.cpp \
test_sai_vs_l2mc.cpp \
test_sai_vs_l2mcgroup.cpp \
test_sai_vs_lag.cpp \
test_sai_vs_ipmc_group.cpp \
test_sai_vs_isolation_group.cpp \
test_sai_vs_hash.cpp \
Expand Down
31 changes: 31 additions & 0 deletions unittest/vslib/test_sai_vs_lag.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include <gtest/gtest.h>

extern "C" {
#include "sai.h"
}

#include "swss/logger.h"

TEST(libsaivs, lag)
{
sai_lag_api_t *api = nullptr;

sai_api_query(SAI_API_LAG, (void**)&api);

EXPECT_NE(api, nullptr);

sai_object_id_t id;

EXPECT_NE(SAI_STATUS_SUCCESS, api->create_lag(&id,0,0,0));
EXPECT_NE(SAI_STATUS_SUCCESS, api->remove_lag(0));
EXPECT_NE(SAI_STATUS_SUCCESS, api->set_lag_attribute(0,0));
EXPECT_NE(SAI_STATUS_SUCCESS, api->get_lag_attribute(0,0,0));

EXPECT_NE(SAI_STATUS_SUCCESS, api->create_lag_member(&id,0,0,0));
EXPECT_NE(SAI_STATUS_SUCCESS, api->remove_lag_member(0));
EXPECT_NE(SAI_STATUS_SUCCESS, api->set_lag_member_attribute(0,0));
EXPECT_NE(SAI_STATUS_SUCCESS, api->get_lag_member_attribute(0,0,0));

EXPECT_NE(SAI_STATUS_SUCCESS, api->create_lag_members(0,0,0,0,SAI_BULK_OP_ERROR_MODE_IGNORE_ERROR,0,0));
EXPECT_NE(SAI_STATUS_SUCCESS, api->remove_lag_members(0,0,SAI_BULK_OP_ERROR_MODE_IGNORE_ERROR,0));
}

0 comments on commit 72cfe42

Please sign in to comment.