From fbc60d5521af795da881d135c765ed9366068cb5 Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Sun, 18 Aug 2024 00:57:48 -0700 Subject: [PATCH] When switch state replay file is provided, just use the passed in config Summary: The idea behind this test is to get to the same state as was on the switch we pulled the state (and config) from. So use the passed in config and not the onePortPerInterfaceConfig Reviewed By: zechengh09 Differential Revision: D61426941 fbshipit-source-id: a04831f2971ecb5f76971326d6acf09377e7dab8 --- .../test/agent_hw_tests/AgentSwitchStateReplayTest.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fboss/agent/test/agent_hw_tests/AgentSwitchStateReplayTest.cpp b/fboss/agent/test/agent_hw_tests/AgentSwitchStateReplayTest.cpp index 6933019243fe2..8d48ece8a96ba 100644 --- a/fboss/agent/test/agent_hw_tests/AgentSwitchStateReplayTest.cpp +++ b/fboss/agent/test/agent_hw_tests/AgentSwitchStateReplayTest.cpp @@ -31,6 +31,12 @@ class AgentSwitchStateReplayTest : public AgentHwTest { public: cfg::SwitchConfig initialConfig( const AgentEnsemble& ensemble) const override { + if (FLAGS_replay_switch_state_file.size()) { + // Config must be from the same switch that switch + // state was pulled from. + return *AgentConfig::fromDefaultFile()->thrift.sw(); + ; + } return utility::onePortPerInterfaceConfig( ensemble.getSw(), ensemble.masterLogicalPortIds()); }