Skip to content

Commit

Permalink
[Thinkit] gNMI port breakout tests, Make const parameters const or st…
Browse files Browse the repository at this point in the history
…ring_view & gNMI port interface tests.

PiperOrigin-RevId: 424183653
  • Loading branch information
kishanps authored and divyagayathri-hcl committed Nov 26, 2024
1 parent ec57f25 commit 3fcd9fc
Show file tree
Hide file tree
Showing 5 changed files with 575 additions and 141 deletions.
16 changes: 0 additions & 16 deletions tests/forwarding/smoke_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,6 @@ TEST_P(SmokeTestFixture, DISABLED_ModifyWorks) {
ASSERT_OK(pdpi::ClearTableEntries(SutP4RuntimeSession()));
}

TEST_P(SmokeTestFixture, InstallDefaultRouteForEmptyStringVrfShouldSucceed) {
GetMirrorTestbed().Environment().SetTestCaseID(
"2d67413c-9b6e-4187-84d4-c9313b84cab3");
const sai::TableEntry pd_entry = gutil::ParseProtoOrDie<sai::TableEntry>(
R"pb(
ipv4_table_entry {
match { vrf_id: "" }
action { drop {} }
}
)pb");

ASSERT_OK_AND_ASSIGN(const p4::v1::TableEntry pi_entry,
pdpi::PartialPdTableEntryToPiTableEntry(IrP4Info(), pd_entry));
ASSERT_OK(pdpi::InstallPiTableEntry(SutP4RuntimeSession(), pi_entry));
}

// TODO: Enable once the bug is fixed.
TEST_P(SmokeTestFixture, DISABLED_Bug181149419) {
GetMirrorTestbed().Environment().SetTestCaseID(
Expand Down
7 changes: 5 additions & 2 deletions tests/thinkit_gnmi_interface_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@ void BreakoutDuringPortInUse(thinkit::Switch& sut,
grpc::ClientContext context;
ASSERT_OK_AND_ASSIGN(auto port_index, GetPortIndex(platform_json_contents,
port_info.port_name));
ASSERT_OK(GetBreakoutModeConfigFromString(req, port_index,
ASSERT_OK(GetBreakoutModeConfigFromString(req, sut_gnmi_stub, port_index,
port_info.port_name,
port_info.supported_breakout_mode));

// Apply breakout config on port. Expect the set operation to fail
Expand Down Expand Up @@ -454,8 +455,10 @@ void BreakoutDuringPortInUse(thinkit::Switch& sut,
non_existing_port_list));

// Restore original port breakout config on port under test.
ASSERT_OK(GetBreakoutModeConfigFromString(req, port_index,
ASSERT_OK(GetBreakoutModeConfigFromString(req, sut_gnmi_stub, port_index,
port_info.port_name,
port_info.curr_breakout_mode));

LOG(INFO) << "Restoring original breakout mode "
<< port_info.curr_breakout_mode << " on port "
<< port_info.port_name << " on DUT";
Expand Down
Loading

0 comments on commit 3fcd9fc

Please sign in to comment.