fboss/agent/test/MultiNodeTest.cpp
// Construct a config file by combining the hw config passed
// and sw configs from test utility and set config flag to
// point to the test config
Construct a config file by combining the hw config passed
and sw configs from test utility and set config flag to
point to the test config
Construct a config file by combining the hw config passed and sw configs from test utility and set config flag to point to the test config
void MultiNodeTest::setupConfigFlag() {
  cfg::AgentConfig testConfig;
  utility::setPortToDefaultProfileIDMap(
      std::make_shared<PortMap>(), platform());
  *testConfig.sw_ref() = initialConfig();
  const auto& baseConfig = platform()->config();
  *testConfig.platform_ref() = *baseConfig->thrift.platform_ref();
  auto newcfg = AgentConfig(
      testConfig,
      apache::thrift::SimpleJSONSerializer::serialize<std::string>(testConfig));
  auto testConfigDir = platform()->getPersistentStateDir() + "/multinode_test/";
  auto newCfgFile = testConfigDir + "/agent_multinode_test.conf";
  utilCreateDir(testConfigDir);
  newcfg.dumpConfig(newCfgFile);
  FLAGS_config = newCfgFile;
  platform()->reloadConfig();
}
void MultiNodeTest :: setupConfigFlag ( ) { cfg :: AgentConfig testConfig ; utility :: setPortToDefaultProfileIDMap ( std :: make_shared < PortMap > ( ) , platform ( ) ) ; * testConfig . sw_ref ( ) = initialConfig ( ) ; const auto & baseConfig = platform ( ) -> config ( ) ; * testConfig . platform_ref ( ) = * baseConfig -> thrift . platform_ref ( ) ; auto newcfg = AgentConfig ( testConfig , apache :: thrift :: SimpleJSONSerializer :: serialize < std :: string > ( testConfig ) ) ; auto testConfigDir = platform ( ) -> getPersistentStateDir ( ) + " " ; auto newCfgFile = testConfigDir + " " ; utilCreateDir ( testConfigDir ) ; newcfg . dumpConfig ( newCfgFile ) ; FLAGS_config = newCfgFile ; platform ( ) -> reloadConfig ( ) ; }
Construct a config file by combining the hw config passed
and sw configs from test utility and set config flag to
point to the test config
Construct a config file by combining the hw config passed and sw configs from test utility and set config flag to point to the test config
// reload config so that test config is loaded