     return;   }    auto setup = [this]() {     auto newCfg = initialConfig();     for (auto portId : initialConfiguredPorts()) {       auto portCfg = utility::findCfgPort(newCfg, portId);       portCfg->loopbackMode_ref() = cfg::PortLoopbackMode::MAC;       utility::updatePortSpeed(           *getHwSwitch(), newCfg, portId, cfg::PortSpeed::FORTYG);     }     applyNewConfig(newCfg);   };   auto verify = [this]() {     for (auto portId : initialConfiguredPorts()) {       utility::assertPortLoopbackMode(           getHwSwitch(), portId, BCM_PORT_LOOPBACK_MAC);       utility::assertPort(getHwSwitch(), portId, true, cfg::PortSpeed::FORTYG);     }   };   verifyAcrossWarmBoots(setup, verify); }  TEST_F(BcmPortTest, PortLoopbackModePHY00G) {   if (!isFlexModeSupported(getPlatform(), FlexPortMode::ONEX00G)) {     return;   }    auto setup = [this]() {     auto newCfg = initialConfig();     for (auto portId : initialConfiguredPorts()) {       auto portCfg = utility::findCfgPort(newCfg, portId);       portCfg->loopbackMode_ref() = cfg::PortLoopbackMode::PHY;       utility::updatePortSpeed(           *getHwSwitch(), newCfg, portId, cfg::PortSpeed::FORTYG);     }     applyNewConfig(newCfg);   };   auto verify = [this]() {     for (auto portId : initialConfiguredPorts()) {       utility::assertPortLoopbackMode(           getHwSwitch(), portId, BCM_PORT_LOOPBACK_PHY);       utility::assertPort(getHwSwitch(), portId, true, cfg::PortSpeed::FORTYG);     }   };   verifyAcrossWarmBoots(setup, verify); }  TEST_F(BcmPortTest, PortLoopbackModeMAC000G) {   if (!isFlexModeSupported(getPlatform(), FlexPortMode::ONEX000G)) {     return;   }    auto setup = [this]() {     auto newCfg = initialConfig();     for (auto portId : initialConfiguredPorts()) {       auto portCfg = utility::findCfgPort(newCfg, portId);       portCfg->loopbackMode_ref() = cfg::PortLoopbackMode::MAC;       utility::updatePortSpeed(           *getHwSwitch(), newCfg, portId, cfg::PortSpeed::HUNDREDG);     }     applyNewConfig(newCfg);   };   auto verify = [this]() {     for (auto portId : initialConfiguredPorts()) {       utility::assertPortLoopbackMode(           getHwSwitch(), portId, BCM_PORT_LOOPBACK_MAC);       utility::assertPort(           getHwSwitch(), portId, true, cfg::PortSpeed::HUNDREDG);     }   };   verifyAcrossWarmBoots(setup, verify); }  TEST_F(BcmPortTest, PortLoopbackModePHY000G) {   if (!isFlexModeSupported(getPlatform(), FlexPortMode::ONEX000G)) {     return;   }    auto setup = [this]() {     auto newCfg = initialConfig();     for (auto portId : initialConfiguredPorts()) {       auto portCfg = utility::findCfgPort(newCfg, portId);       portCfg->loopbackMode_ref() = cfg::PortLoopbackMode::PHY;       utility::updatePortSpeed(           *getHwSwitch(), newCfg, portId, cfg::PortSpeed::HUNDREDG);     }     applyNewConfig(newCfg);   };   auto verify = [this]() {     for (auto portId : initialConfiguredPorts()) {       utility::assertPortLoopbackMode(           getHwSwitch(), portId, BCM_PORT_LOOPBACK_PHY);       utility::assertPort(           getHwSwitch(), portId, true, cfg::PortSpeed::HUNDREDG);     }   };   verifyAcrossWarmBoots(setup, verify); }  TEST_F(BcmPortTest, SampleDestination) {   // sample destination can't be configured if sflow sampling isn't supported   if (!getPlatform()->sflowSamplingSupported()) {     return;   }   auto setup = [=]() {     auto newCfg = initialConfig();     std::vector<cfg::