Skip to content

Commit

Permalink
Get agent replay test working with passed in switch state and config
Browse files Browse the repository at this point in the history
Summary:
Disable link state toggler for this test. We don't want to
toggle and start with all ports as UP in this test.

Reviewed By: zechengh09

Differential Revision: D61427089

fbshipit-source-id: e921d2b2af3f044ea1315a219b38082210a2cf0b
  • Loading branch information
Jasmeet Bagga authored and facebook-github-bot committed Aug 18, 2024
1 parent fbc60d5 commit b1521b0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fboss/agent/test/AgentHwTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ DEFINE_bool(
false,
"list production feature needed for every single test");

DEFINE_bool(
disable_link_toggler,
false,
"Used by certain tests where we don't want to bring up ports by toggler");

namespace {
int kArgc;
char** kArgv;
Expand Down Expand Up @@ -44,7 +49,7 @@ void AgentHwTest::SetUp() {
[this](const AgentEnsemble& ensemble) { return initialConfig(ensemble); };
agentEnsemble_ = createAgentEnsemble(
initialConfigFn,
false /*disableLinkStateToggler*/,
FLAGS_disable_link_toggler /*disableLinkStateToggler*/,
platformConfigFn_,
(HwSwitch::FeaturesDesired::PACKET_RX_DESIRED |
HwSwitch::FeaturesDesired::LINKSCAN_DESIRED |
Expand Down
11 changes: 11 additions & 0 deletions fboss/agent/test/agent_hw_tests/AgentSwitchStateReplayTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ DEFINE_string(
replay_switch_state_file,
"",
"File for dumping switch state JSON in on exit");
DECLARE_bool(disable_link_toggler);

using std::string;

namespace facebook::fboss {
Expand Down Expand Up @@ -98,6 +100,15 @@ class AgentSwitchStateReplayTest : public AgentHwTest {
auto verify = [=]() {};
verifyAcrossWarmBoots(setup, verify);
}

private:
void setCmdLineFlagOverrides() const override {
AgentHwTest::setCmdLineFlagOverrides();
// All ports should be visible like in prod
FLAGS_hide_fabric_ports = false;
// Don't start with bringing up all ports via toggler
FLAGS_disable_link_toggler = true;
}
};

TEST_F(AgentSwitchStateReplayTest, test) {
Expand Down

0 comments on commit b1521b0

Please sign in to comment.