[nexus] add mechanism to emulate node reset (#11662)

This commit adds a new mechanism to emulate a node reset on
`Nexus::Node`. This is realized by resetting all platform components
while ensuring the non-volatile `mSettings` remains unchanged, then
reinitializing the `ot::Instance` by invoking its constructor.

This is used to add a new `test_full_network_reset` test, which
emulates a full simultaneous reset of all nodes in a large network,
tracking how long it takes for the network to stabilize after the
reset event.
This commit is contained in:
Abtin Keshavarzian
2025-07-08 15:10:30 -07:00
committed by GitHub
parent 64bc9f7ff6
commit a2fb36cd0b
11 changed files with 239 additions and 5 deletions
+20
View File
@@ -32,6 +32,26 @@
namespace ot {
namespace Nexus {
void Node::Reset(void)
{
Instance *instance = &GetInstance();
uint32_t id = GetId();
mRadio.Reset();
mAlarm.Reset();
mMdns.Reset();
mPendingTasklet = false;
#if OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE
mTrel.Reset();
#endif
instance->~Instance();
instance = new (instance) Instance();
instance->SetId(id);
instance->AfterInit();
}
void Node::Form(void)
{
MeshCoP::Dataset::Info datasetInfo;