[nexus] add helper to allow link between nodes in nexus (#12906)

Added `Core::AllowLinkBetween()` and `Core::UnallowLinkBetween()`
helper methods to the Nexus test platform. These methods simplify
establishing bidirectional links between nodes in simulation tests by
handling the reciprocal `AllowList()` calls in a single step.

Updated various Nexus test cases to utilize these new helpers,
replacing manual bidirectional `AllowList()` calls. This change
reduces verbosity and ensures consistency in how links are established
in the test topology.
This commit is contained in:
Abtin Keshavarzian
2026-04-17 13:22:27 -05:00
committed by GitHub
parent 7eb59f71da
commit 064529cbfc
142 changed files with 463 additions and 1172 deletions
+12
View File
@@ -251,5 +251,17 @@ bool Node::Matches(const Ip6::Address &aAddress, AddressNetif aNetif) const
return matches;
}
void AllowLinkBetween(Node &aFirstNode, Node &aSecondNode)
{
aFirstNode.AllowList(aSecondNode);
aSecondNode.AllowList(aFirstNode);
}
void UnallowLinkBetween(Node &aFirstNode, Node &aSecondNode)
{
aFirstNode.UnallowList(aSecondNode);
aSecondNode.UnallowList(aFirstNode);
}
} // namespace Nexus
} // namespace ot