Skip to content

Commit

Permalink
change remove MANDATORY_ON_CREATE for SAI_ROUTE_ATTR_NEXT_HOP_ID (son…
Browse files Browse the repository at this point in the history
  • Loading branch information
lguohan authored Oct 7, 2016
1 parent 47a6c84 commit 6dfda77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions meta/sai_meta_route.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ const sai_attr_metadata_t sai_route_attr_metadata[] = {
.objecttype = SAI_OBJECT_TYPE_ROUTE,
.attrid = SAI_ROUTE_ATTR_NEXT_HOP_ID,
.serializationtype = SAI_SERIALIZATION_TYPE_OBJECT_ID,
.flags = SAI_ATTR_FLAGS_MANDATORY_ON_CREATE | SAI_ATTR_FLAGS_CREATE_AND_SET,
.flags = SAI_ATTR_FLAGS_CREATE_AND_SET,
.allowedobjecttypes = { SAI_OBJECT_TYPE_NEXT_HOP, SAI_OBJECT_TYPE_NEXT_HOP_GROUP, SAI_OBJECT_TYPE_ROUTER_INTERFACE, SAI_OBJECT_TYPE_PORT },
.allownullobjectid = false,
.defaultvaluetype = SAI_DEFAULT_VALUE_TYPE_NONE,
.allownullobjectid = true,
.defaultvaluetype = SAI_DEFAULT_VALUE_TYPE_CONST,
.defaultvalue = { },
.enumtypestr = NULL,
.enumallowedvalues = { },
Expand Down
9 changes: 5 additions & 4 deletions meta/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2000,10 +2000,11 @@ void test_route_entry_create()

SWSS_LOG_NOTICE("create tests");

SWSS_LOG_NOTICE("zero attribute count (but there are mandatory attributes)");
attr.id = SAI_ROUTE_ATTR_NEXT_HOP_ID;
status = meta_sai_create_route_entry(&route_entry, 0, &attr, &dummy_success_sai_create_route_entry);
META_ASSERT_FAIL(status);
// commneted out as there is no mandatory attribute
// SWSS_LOG_NOTICE("zero attribute count (but there are mandatory attributes)");
// attr.id = SAI_ROUTE_ATTR_NEXT_HOP_ID;
// status = meta_sai_create_route_entry(&route_entry, 0, &attr, &dummy_success_sai_create_route_entry);
// META_ASSERT_FAIL(status);

SWSS_LOG_NOTICE("attr is null");
status = meta_sai_create_route_entry(&route_entry, 1, NULL, &dummy_success_sai_create_route_entry);
Expand Down

0 comments on commit 6dfda77

Please sign in to comment.