Skip to content

Commit

Permalink
[dash] Fix vnet_out test
Browse files Browse the repository at this point in the history
It require to create switch first
  • Loading branch information
kcudnik committed Sep 13, 2023
1 parent 9f31652 commit 129fcf7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion dash-pipeline/tests/libsai/vnet_out/vnet_out.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ int main(int argc, char **argv)
return 1;
}

sai_switch_api_t *switch_api;
status = sai_api_query((sai_api_t)SAI_API_SWITCH, (void**)&switch_api);
QUERY_STATUS_CHECK(status, SAI_API_SWITCH);

status = switch_api->create_switch(&switch_id, 0, NULL);

if (status != SAI_STATUS_SUCCESS)
{
std::cout << "Failed to create switch" << std::endl;
return 1;
}

sai_dash_direction_lookup_api_t *dash_direction_lookup_api;
status = sai_api_query((sai_api_t)SAI_API_DASH_DIRECTION_LOOKUP, (void**)&dash_direction_lookup_api);
QUERY_STATUS_CHECK(status, SAI_API_DASH_DIRECTION_LOOKUP);
Expand All @@ -48,7 +60,7 @@ int main(int argc, char **argv)
QUERY_STATUS_CHECK(status, SAI_API_DASH_ENI);

sai_direction_lookup_entry_t dle = {};
dle.switch_id = switch_id;
dle.switch_id = 0; // TODO switch_id, it fails when switch id is non zero
dle.vni = 60;

attr.id = SAI_DIRECTION_LOOKUP_ENTRY_ATTR_ACTION;
Expand Down

0 comments on commit 129fcf7

Please sign in to comment.