Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,16 @@ class AgentAclTableGroupTrafficTest : public AgentHwTest {

template <typename AddrT>
void addResolvedNeighborWithClassID() {
applyNewState([this](std::shared_ptr<SwitchState> /*in*/) {
auto state1 = addNeighbors<AddrT>(this->getProgrammedState());
applyNewState([this](const std::shared_ptr<SwitchState>& in) {
auto state1 = addNeighbors<AddrT>(in);
auto state2 = resolveNeighbors<AddrT>(state1);
return state2;
});
applyNewState([this](std::shared_ptr<SwitchState> /*in*/) {
return updateClassID<AddrT>(this->getProgrammedState());
// Build on `in`: getProgrammedState() is still the pre batch state, so
// rebuilding from it drops the MAC entry classIDs LookupClassUpdater
// queued for the neighbors resolved above if they coalesce into this batch.
applyNewState([this](const std::shared_ptr<SwitchState>& in) {
return updateClassID<AddrT>(in);
});
}

Expand Down
13 changes: 8 additions & 5 deletions fboss/agent/test/agent_hw_tests/AgentQueuePerHostTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@ class AgentQueuePerHostTest : public AgentHwTest {
* implemented as a state observer which would update resolved neighbors
* with classIDs.
*/
applyNewState([this](std::shared_ptr<SwitchState> /*in*/) {
auto state = this->addNeighbors<folly::IPAddressV4>(getProgrammedState());
applyNewState([this](const std::shared_ptr<SwitchState>& in) {
auto state = this->addNeighbors<folly::IPAddressV4>(in);
state = this->addNeighbors<folly::IPAddressV6>(state);
state = this->resolveNeighbors<folly::IPAddressV4>(state);
state = this->resolveNeighbors<folly::IPAddressV6>(state);
Expand All @@ -390,9 +390,12 @@ class AgentQueuePerHostTest : public AgentHwTest {
if (blockNeighbor) {
setMacAddrsToBlock();
}
applyNewState([this, blockNeighbor](std::shared_ptr<SwitchState> /*in*/) {
auto state = this->updateClassID<folly::IPAddressV4>(
getProgrammedState(), blockNeighbor);
// Build on `in`: getProgrammedState() is still the pre batch state, so
// rebuilding from it drops the MAC entry classIDs LookupClassUpdater
// queued for the neighbors resolved above if they coalesce into this batch.
applyNewState([this,
blockNeighbor](const std::shared_ptr<SwitchState>& in) {
auto state = this->updateClassID<folly::IPAddressV4>(in, blockNeighbor);
state = this->updateClassID<folly::IPAddressV6>(state, blockNeighbor);
return state;
});
Expand Down