This commit migrates the dataset_updater functional test from the
Python-based thread-cert framework to the Nexus simulation framework.
Nexus provides faster and more scalable network simulations within a
single process using virtual time.
The new test_dataset_updater.cpp covers:
- Network formation and child joining (MED and SED).
- Channel updates initiated by Leader and Router using DatasetUpdater.
- Dataset update overrides between nodes.
The legacy tests/scripts/thread-cert/test_dataset_updater.py is removed
as it is now redundant.
This commit adds a new Nexus test to verify that a Sleepy End Device
(SED) correctly informs its previous parent after reattaching to a new
parent. This replicates the functionality of the now-deleted
test_inform_previous_parent_on_reattach.py script.
The test scenario involves:
- Forming a network with a Leader and a Router.
- Attaching a SED to the Leader.
- Simulating a link failure between the SED and Leader while allowing
communication between the SED and Router.
- Verifying that the SED reattaches to the Router.
- Confirming that the SED sends an empty IPv6 message (Next Header 59)
to the Leader's RLOC to inform it of the change.
- Ensuring the SED is successfully removed from the Leader's child
table.
Migrating this test to Nexus allows for faster execution using virtual
time and single-process simulation.
The following SRP test scripts in tests/scripts/thread-cert are
redundant as their functionality is now covered by the Nexus test
framework certification suite (test_1_3_SRP_TC_*):
- test_srp_register_single_service.py: Covered by Nexus
test_1_3_SRP_TC_1.
- test_srp_lease.py: Covered by Nexus test_1_3_SRP_TC_3 (service
lease) and test_1_3_SRP_TC_4 (key lease).
- test_srp_name_conflicts.py: Covered by Nexus test_1_3_SRP_TC_2.
- test_srp_auto_host_address.py: Covered by Nexus test_1_3_SRP_TC_13.
- test_srp_sub_type.py: Covered by Nexus test_1_3_SRP_TC_15.
Nexus tests are preferred as they run in a single process using
virtual time, making them faster and more reliable than the
multi-process simulation scripts.
This commit adds support for building the Nexus simulator for
WebAssembly (WASM) using the Emscripten toolchain. This enables the
simulator to run in a web browser environment with a JavaScript-based
control interface and visualization.
Key implementation details:
- Introduced `nexus_wasm.cpp` which defines Emscripten bindings (using
Embind) for core simulation controls, including stepping time,
node creation, topology orchestration, and state manipulation.
- Implemented a `WasmObserver` and a global event queue to capture
simulation events (node state changes, link updates, packet events)
and expose them to JavaScript via a polling mechanism (`pollEvent`).
- Updated the CMake build system to support the `EMSCRIPTEN` platform,
configuring specific linker options for ES6 module export,
modularization, and memory growth.
- Enhanced `build.sh` to allow targeting WASM via `emcmake`.
- Guarded file-system-dependent operations in `nexus_pcap.cpp` and
adjusted `nexus_core.cpp` to handle WASM-specific constraints where
standard I/O or multiple observers might not be applicable.
- Added `test_wasm_bindings.mjs`, a Node.js-based smoke test that
verifies the integrity of the WASM bindings and event pipeline.
- Integrated `nexus-wasm-tests` into the GitHub Actions workflow to
ensure continuous verification of the WASM build and functionality.
This commit introduces a mechanism to temporarily override the log
level. The `Instance` class now provides `OverrideLogLevel()` and
`RestoreLogLevel()` methods. When an override is active, the
effective log level is the maximum of the original user-set level and
the override level. If `SetLogLevel()` is called while an override is
active, it updates the original level and the effective level is
recomputed.
This ensures that log messages are generated only when needed,
without permanently losing the user's original log level
configuration.
The feature is controlled by the new configuration macro
`OPENTHREAD_CONFIG_LOG_LEVEL_OVERRIDE_ENABLE`.
A new Nexus unit test `test_log_override.cpp` is added to validate
the behavior of these new feature.
The following test scripts in tests/scripts/thread-cert are now
redundant as their functionality is sufficiently covered by the Nexus
test framework:
- test_detach.py: Covered by Nexus MLE synchronization and parent
selection tests.
- test_router_upgrade.py: Covered by 5.1.x Nexus router attachment
tests.
Nexus tests are preferred for these scenarios as they execute in a
single process using virtual time, providing faster and more reliable
verification than the traditional multi-process simulation scripts.
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 introduces `AnswerBuilder` class to track and manage
Network Diagnostic answer messages. This class is used when the
response to a query requires multiple CoAP answer messages. It
automatically manages the inclusion of the Query ID and the Answer
TLVs(providing message indexing and "more-to-follow" flags) in each
allocated answer message, while maintaining all answer messages in a
queue. The `NetworkDiagnostic::Server` is updated to use the
`AnswerBuilder`, simplifying the logic for preparing and sending
answers.
The `AnswerBuilder` class is added in a new header file
`network_diagnostic_types.hpp` to allow for its reuse by other
modules in the future.
This commit introduces gRPC support to the Nexus simulator, enabling
remote control and monitoring of simulations. This infrastructure allows
external tools and visualizers to interact with the simulated network
in real-time.
Key changes:
- Defined `simulation.proto` providing the `NexusService` definition for
simulation control and event streaming.
- Implemented `GrpcServer` in `nexus_grpc.cpp` which functions as a
Nexus simulation observer, pushing events to connected clients.
- Added RPCs for dynamic node creation, position updates, node state
control, and network orchestration (forming and joining).
- Implemented a real-time event stream that includes node state changes,
link updates, and packet captures (with basic protocol decoding).
- Introduced `nexus_native.cpp` as an entry point for a persistent
simulation server that can be controlled via gRPC.
- Updated `Core` and `Observer` interfaces to support a list of
concurrent observers instead of a single instance.
- Enhanced the CMake build system to optionally find and link against
gRPC and Protobuf, including automatic source generation.
- Updated CI (GitHub Actions) to include build and test steps for the
new gRPC functionality.
- Added comprehensive unit tests in `test_grpc.cpp` to verify all
exposed gRPC service methods.
This commit updates `CslClockAccuracyTlv` to use the `SimpleTlvInfo`
and a separate `CslClockAccuracyTlvValue` class. This change
simplifies how the TLV is appended to and read from messages
by leveraging the `Tlv::Append<TlvType>` and `Tlv::Find<TlvType>`
helper methods (avoiding the use of `FindTlv()`).
This commit removes the redundant `multiple-instance` job from the
`simulation-1.1.yml` workflow. This job was used to run Thread 1.1
certification tests with `OT_MULTIPLE_INSTANCE=ON`.
The job is being removed to streamline the CI process and reduce
redundant test coverage, as multiple-instance configurations are
sufficiently covered in other workflow files. The dependency list
for the coverage collection job is also updated to reflect this
removal.
The previous logic for suppressing CHILD_REMOVED events was flawed. It
checked if the neighbor was not in the child table. However, since the
callback is triggered after the child is removed, it was always false,
leading to false suppression for all removed children.
This caused the parent node to never emit "link removed" events to the
UI when children detached, leading to inconsistent link states (dashed
lines) when only one direction was active.
This fix updates the logic to check if a neighbor entry exists in the
neighbor table with an established link (kStateValid). This ensures we
only suppress the event when the child has successfully transitioned to
a router role and established a valid link.
This commit updates `Mle::SendMulticastAdvertisement()` to verify
that the router role is allowed by calling `IsRouterRoleAllowed()`
before proceeding to send the multicast MLE advertisement.
This commit introduces the `SimulationObserver` interface and integrates
it into the Nexus core simulation logic. This allows external systems to
observe node state changes, link updates, and packet events in real-time.
Key changes:
- Defined `SimulationObserver` interface to handle node state changes,
link updates, packet events, and event clearing.
- Added `SetObserver` and `GetObserver` methods to the `Core` class.
- Implemented `Core::HandleNeighborTableChanged` to notify the observer
of neighbor additions and removals.
- Implemented `Core::HandleStateChanged` to track node role transitions
and parent changes, updating links accordingly.
- Integrated packet event notification in `Core::ProcessRadio`,
including basic destination node ID resolution for unicast frames.
- Added `Core::SetNodeEnabled` to allow enabling or disabling Thread and
MLE on specific nodes at runtime.
- Updated `Core::Reset` to clear events via the observer.
- Increased `OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS` to accommodate
the new nexus state change handler.
- Added `mLastParentId` to `Node` class to correctly manage link updates
during parent switches or detachment.
RFC 8200 states that the Hop-by-Hop Options header MUST be the first
extension header and can only occur once in a packet. This commit
updates HandleExtensionHeaders to enforce this rule.
This fix prevents a potential infinite loop or exponential growth of
messages when multiple Hop-by-Hop headers (each containing an MPL
option) are processed. Previously, each MPL option could trigger its
own retransmission, and if these options were evicted from the MPL
SeedSet, they would be re-processed as new messages upon loopback,
leading to exponential growth and eventually a timeout.
This commit adds a new RadioModel class to simulate wireless propagation
characteristics between Nexus nodes. It implements a simple path-loss
model based on node distance to calculate RSSI.
Key changes include:
- Added RadioModel with CalculateRssi and ShouldDropPacket methods.
- Integrated RSSI calculation into the Core radio processing logic.
- Implemented packet dropping for signals below -100 dBm sensitivity.
- Added nexus_radio_model.cpp to the build system.
This commit introduces a new member variable `mRouterRoleAllowed` in
the `Mle` class to cache the evaluation of whether the device is
currently permitted to operate as a router.
Previously, the `IsRouterEligible()` method evaluated several
conditions (e.g., `IsFullThreadDevice()`, `mRouterEligible` config,
and various fields in `SecurityPolicy`) every time it was called.
Since this method is invoked frequently across different `Mle`
operations, re-evaluating these conditions repeatedly was
inefficient.
The new `mRouterRoleAllowed` variable caches the final computed
result. It is updated via the `UpdateRouterRoleAllowed()` method
whenever any underlying input changes, such as:
- `Mle` starting.
- Configuration parameter updates (e.g., `SetRouterEligible()`).
- Security policy changes from the `KeyManager`.
This change centralizes the logic for handling role permission updates
into a single location (`UpdateRouterRoleAllowed()`). By
consolidating the actions taken when the allowed state changes, the
codebase is cleaner and easier to maintain and update.
It also provides a clearer conceptual distinction between the user's
router configuration (`mRouterEligible`) and the effective state
used by the device.
This commit moves the TREL configuration from the build script to the
nexus-config header file. This ensures that TREL is consistently enabled
for all nexus builds and simplifies the build script.
Specifically:
- Added OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE to
tests/nexus/openthread-core-nexus-config.h.
- Removed OT_TREL from tests/nexus/build.sh and simplified the build
options.
This commit moves the `OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE`
configuration from the build scripts to the nexus-specific core
configuration header file.
Specifically:
- Added `#define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE 1` to
`tests/nexus/openthread-core-nexus-config.h`.
- Removed `-DOT_MULTIPLE_INSTANCE=ON` from `tests/nexus/build.sh`.
- Removed `-DOT_MULTIPLE_INSTANCE=ON` from `tests/fuzz/oss-fuzz-build`.
This change centralizes nexus-specific configurations in the header
file, making the build scripts cleaner and ensuring consistent
configuration across different build environments that use the
nexus core config."
Due to a state retention issue in the unit test platform, TCAT tests were passing in ways they should not.
Now with the new settings/flash clearing per #12875 applied, these tests were failing.
This fixes TCAT unit tests to pass again and better express the expected behavior also.
Issue: state was retained between OT instances in the unit test platform, across tests.
This commit adds settings and flash clearing as part of testInitInstance().
This commit simplifies the Simulation 1.4 workflow by removing the
compiler and architecture matrix. Run-time issues due to compiler
differences or architecture have not been an issue, so testing a single
configuration is sufficient to reduce CI resource usage.
The workflow now uses the default environment instead of explicitly
testing both gcc/clang and m32/m64 architectures.
This commit adds a compile-time check in `time_sync_service.hpp` to
ensure that `OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE` is not
enabled alongside `OPENTHREAD_CONFIG_TIME_SYNC_ENABLE`. The time
synchronization feature is experimental and currently only supports
IEEE 802.15.4 radio links. Attempting to use it over TREL is
unsupported and will now result in a build failure.
This commit introduces the `Context` and `ContextWith<kContextSize>`
helper classes in the `Crypto` namespace to wrap `otCryptoContext`
and manage its storage allocation. `ContextWith<kContextSize>`
handles the buffer allocation based on the configuration
`OPENTHREAD_CONFIG_CRYPTO_PLATFORM_ALLOCS_CONTEXT`, automatically
clearing and setting the buffer.
The `AesEcb`, `HkdfSha256`, `HmacSha256`, and `Sha256` classes are
updated to use the new `ContextWith` template for their `mContext`
members. This simplifies their initialization sequences and
constructors.
This commit introduces the ability to configure whether the CLI
interpreter outputs the prompt string (`> `) at runtime.
- Adds `mPromptEnabled` boolean flag (enabled by default) under the
`OPENTHREAD_CONFIG_CLI_PROMPT_ENABLE` configuration.
- Adds the `Interpreter::SetPromptConfig()` method to toggle this
behavior.
- Updates `Interpreter::OutputPrompt()` to check `mPromptEnabled`
before emitting the prompt string.
This commit removes the following legacy 1.2 certification test scripts:
- tests/scripts/thread-cert/v1_2_router_5_1_1.py
- tests/scripts/thread-cert/v1_2_test_parent_selection.py
It also removes the 'packet-verification-1-1-on-1-4' job from the
Simulation 1.4 workflow as it is no longer required.
Now signed by the correct 'Thread Certification DeviceCA'. A 'test'
target is added in the Makefile to test chaining. The Thread
certification CA certificate is also added in the 'CA' directory,
which was missing. Documentation is updated to clarify that the
'TcatCertCa' private key is not included in this repo; and other
clarifications.
This commit introduces `testResetInstance()` in the unit test platform
layer to finalize an existing `ot::Instance` and re-initialize it
using the same underlying memory buffer, simulating a device reset.
This commit also updates `test_routing_manager.cpp` to use this new
function to streamline the test implementation.
This commit introduces static helper methods `SteeringDataTlv::FindIn()`
and `SteeringDataTlv::AppendTo()` to simplify the handling of steering
data in `Message` objects.
`SteeringDataTlv::FindIn()` encapsulates the pattern of searching for a
`SteeringDataTlv` in a `Message` and reading its value into a
`SteeringData` object. `SteeringDataTlv::AppendTo()` provides a unified
way to append steering data to a `Message`, including a validity check.
These helpers are adopted across core modules (MeshCoP, MLE, Discovery)
and various Nexus tests, replacing manual TLV manipulation with a
cleaner and safer helper methods.
This commit fixes the CLI implementation of `sntp` and `diagnostic`
commands by ensuring they use the public `otMessageInfo` type instead
of the internal `ot::Ip6::MessageInfo` class.
This commit implements the Nexus test specification 1_4_PIC_TC_4
to verify the Border Router (BR) built-in NAT64 translator.
The test verifies that the BR DUT:
- Automatically configures an IPv4 address and NAT64 prefix.
- Offers IPv4 internet connectivity to Thread devices using NAT64.
- Offers IPv4 local network connectivity to Thread devices.
- Operates a DNS recursive resolver to look up IPv4 server addresses.
New files added:
- tests/nexus/test_1_4_PIC_TC_4.cpp: C++ test execution script
- tests/nexus/verify_1_4_PIC_TC_4.py: Python pcap verification script
Integration:
- Updated tests/nexus/CMakeLists.txt to compile the test.
- Added test to default array in tests/nexus/run_nexus_tests.sh.
This commit updates the default value of the
`OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE` configuration
to be enabled automatically when `OPENTHREAD_CONFIG_CRYPTO_LIB` is
set to `OPENTHREAD_CONFIG_CRYPTO_LIB_PSA`. Additionally, it adds a
compile-time check in `crypto_platform_psa.cpp` to enforce this
requirement. This ensures that the platform key references support is
always enabled when the PSA crypto library is selected.
This commit introduces `ActiveInstanceTracker` as the first member
variable of the `Instance` class to manage the global `gActiveInstance`
pointer (when `OPENTHREAD_CONFIG_LOG_INSTANCE_AWARE_API_ENABLE` is
enabled).
By placing it as the very first member, we ensure its constructor
is called before any other member and its destructor is called after
all others. The `Instance` destructor body also explicitly sets
`gActiveInstance = this` at its start to "claim" the context during its
own destruction. This guarantees that logs emitted during both the
initialization and destruction of an `Instance` are always correctly
associated with that instance. Finally, the `ActiveInstanceTracker`
destructor sets `gActiveInstance` to `nullptr` at the very end to
prevent any potential use of a dangling pointer.
This commit introduces an overloaded version of `AppendModeTlv()`
that automatically uses the device's own `GetDeviceMode()`.
The new parameter-less version simplifies the common case where a
node reports its own mode. The parameterized version is
preserved for cases where a specific mode must be provided (e.g.,
parent reporting one of its children's mode).
This commit introduces `TxMessage::AppendSourceAddressAndLeaderDataTlvs()`
to consolidate the appending of `Source Address` and `Leader Data` TLVs.
This combination is frequently used together across various MLE messages
to provide the sender's identity and leader data. Centralizing this
into a single helper method improves code consistency.
Additionally, the `TxMessage` methods in `mle.hpp` and `mle.cpp` are
organized into "Appending single TLV" and "Appending multiple TLVs"
sections for better clarity and maintainability. Existing multi-TLV
methods like `AppendLinkAndMleFrameCounterTlvs()` and
`AppendActiveAndPendingTimestampTlvs()` are moved to the new section.
This commit updates the Nexus platform to use the internal core C++
API `Ip6::SetReceiveCallback()` instead of the public C API
`otIp6SetReceiveCallback()`.
This commit introduces `Mle::ShouldRegisterUnicastAddrWithParent()` to
centralize the logic for determining which unicast addresses should be
registered with the parent.
Previously, the filtering logic for unicast addresses was duplicated
in `HasUnregisteredAddress()` and `AppendAddressRegistrationTlv()`. By
unifying this in a single helper method, the code ensures consistent
behavior between checking for unregistered addresses and actually
appending them to the MLE messages.
Additionally, this change:
- Marks `Mle::HasUnregisteredAddress()` as `const`.
- Updates `Mle::ShouldRegisterMulticastAddrsWithParent()` to improve
readability and follow common coding patterns in the codebase.
This commit improves the address registration behavior in
`Mle::SendChildUpdateResponse()` for non-FTD devices.
Previously, the device would always append only the mesh-local address
and then unconditionally attempt to send a follow-up Child Update
Request. The updated logic now checks if the parent's request
included a Challenge TLV. If not, all addresses are appended directly
to the response, eliminating the extra message exchange. If a
Challenge is present (indicating the parent is restoring its link),
only the mesh-local address is included to prevent message
fragmentation. In this case, if the device is attached and has
unregistered addresses, a follow-up Child Update Request is scheduled
via `mDelayedSender`.
The previous implementation indirectly assumed the parent would only
request the `Address Registration` TLV when restoring its link (the
current behavior of OpenThread parents). However, such behavior on the
parent is not strictly required and could change. This update on the
child side ensures robust address registration regardless of the
parent's specific behavior.
When the Nexus test finishes, it automatically destructs all its allocated
Nodes sequentially. During this destruction phase, the OpenThread instance
attempts to destruct objects like `Nat64::Translator`, which might in turn
call logging mechanisms like `Mapping::Free()` that rely on the static
`Instance::GetActiveInstance()` pointer.
Because `Core::~Core()` did not maintain or update `gActiveInstance` while
iterating through node destructors, this pointer was left dangling, causing
segmentation faults when dereferenced by `ot::Instance::GetLogLevel()`.
This commit fixes `Core::~Core()` to manually loop through and destruct the
`mNodes` list, calling `UpdateActiveInstance(&node->GetInstance())` right
before destroying each node. This ensures that `gActiveInstance` points to
the correct context while node destruction logic runs.
This commit adds a Nexus test case 1_4_PIC_TC_3 to verify the IPv6
default route advertisement behavior of a Border Router (BR) in a
Thread 1.4 network.
The test verifies that:
- The BR correctly advertises a default route (::/0) in Thread Network
Data when it discovers a default route on the infrastructure link.
- The BR maintains the default route advertisement even if the
infrastructure default route is withdrawn, provided a non-ULA prefix
remains active on the infrastructure link.
- The default route advertisement is correctly restored or updated when
the infrastructure default route is re-enabled.
The test implementation includes:
- test_1_4_PIC_TC_3.cpp: C++ test logic using the Nexus simulation
framework, simulating BR, Router, End Device, and Infrastructure
nodes (Eth_1, Eth_2). It uses a custom ICMPv6 receive callback to
simulate "no route to host" conditions.
- verify_1_4_PIC_TC_3.py: Python verification script that analyzes
the captured packets to ensure MLE Data Responses and ICMPv6 traffic
match the expected behavior for each test step.
Integration:
- Updated tests/nexus/CMakeLists.txt and tests/nexus/run_nexus_tests.sh
to include the new test in the automated test suite.
This commit adds a new Nexus test that implements the test
specification in test-1-4-PIC-TC-1.md. The test verifies Border
Router functionality including:
- DHCPv6-PD client to obtain OMR prefix
- Advertising route to OMR prefix on AIL (Stub Router)
- DNS recursive resolver for public internet addresses
- Connectivity (ICMPv6, UDP, TCP/HTTP) to internet and local servers
New files:
- tests/nexus/test_1_4_PIC_TC_1.cpp: C++ test execution
- tests/nexus/verify_1_4_PIC_TC_1.py: Python pcap verification
Nexus platform enhancements:
- Enabled DHCPv6-PD client in openthread-core-nexus-config.h
- Implemented DHCPv6-PD platform APIs in nexus_infra_if.cpp
- Added RDNSS option to RA in nexus_infra_if.cpp
- Improved packet delivery on infrastructure interface in nexus_core.cpp
- Fixed upstream DNS query matching in nexus_dns.cpp
Previously, version checks used `<= 0x03060500` to guard mbedtls v3.x
APIs, incorrectly treating any version above 3.6.5 (e.g. 3.6.6+) as
v4.0. Replace these checks with `< 0x04000000` to properly cover all
v3.x releases.
This commit adds support for the Vendor OUI (`vo`) key in the Border
Agent MeshCoP service TXT data parser.
The `otBorderAgentTxtDataInfo` structure and its internal counterpart
`TxtData::Info` are updated to include a boolean flag `mHasVendorOui`
and a 3-byte array `mVendorOui` to store the 24-bit vendor OUI.
The parsing logic in `TxtData::Info::ProcessTxtEntry()` is updated to
recognize the `vo` key and extract its value. Additionally, the CLI
`Interpreter` is updated to output the vendor OUI in hexadecimal
format when it is present in the parsed information.
This commit updates the Nexus platform `InfraIf` class to inherit from
`InstanceLocator`, aligning it with the standard OpenThread architectural
patterns.
The `mNode` and `mNodeId` member variables are removed as they are now
redundant. Access to the associated `Instance` and other platform-level
components is now managed through `GetInstance()` and the newly added
`Instance::Get<T>` template specializations for `Node`, `InfraIf`,
`Udp`, `Trel`, and `Mdns`.
The `InfraIf::Init()` method is renamed to `AfterInit()` to better
reflect its role in the node initialization lifecycle. All call sites in
`nexus_infra_if.cpp` are updated to use the locator-based accessors.
This commit implements the Nexus test specification 1_4_DNS_TC_5 for
DNS record types and special cases in OpenThread 1.4.
The test verifies that the Border Router:
- Can resolve A and AAAA records from upstream DNS servers.
- Does not perform IPv6 AAAA synthesis from A records when not
specifically requested or configured.
- Can resolve mDNS records on the Adjacent Infrastructure Link (AIL).
- Supports non-typical record types (RRTypes) and "Private Use"
ranges (0xFF00-0xFFFE).
- Correctly blocks and responds with NXDomain for "ipv4only.arpa"
queries, ensuring they are not forwarded upstream.
Test Implementation:
- Created test_1_4_DNS_TC_5.cpp to simulate the network topology and
DNS query/response sequences.
- Created verify_1_4_DNS_TC_5.py to perform packet-level verification
of the DNS interactions and BR behavior.
- Integrated the new test into the Nexus build and test execution
scripts.
This commit implements the Nexus test specification 1_4_DNS_TC_3 for
upstream DNS resolver selection in OpenThread.
Nexus Platform Enhancements:
- Added OPENTHREAD_CONFIG_DNS_UPSTREAM_QUERY_ENABLE and
OPENTHREAD_CONFIG_PLATFORM_DNS_ENABLE to nexus config.
- Implemented platform DNS APIs in nexus_dns.cpp, supporting
upstream server selection based on prefix lifetimes and reachability.
- Added UdpHook to Core to allow tests to intercept and simulate
responses for backbone UDP traffic on port 53.
- Updated InfraIf::Receive to call Core::HandleUdp for generic UDP
interception.
- Added raw buffer delivery overloads for InfraIf::SendUdp.
Test Implementation:
- Created test_1_4_DNS_TC_3.cpp which performs network formation,
RA signaling (PIO/RIO/RDNSS), and DNS resolution triggers.
- Created verify_1_4_DNS_TC_3.py to validate network behavior,
RA contents, and correct upstream query routing using pktverify.
- Integrated the new test into CMakeLists.txt and the default
run_nexus_tests.sh suite.
This commit updates `Mle::HandleTimeTick()` to separate the processing
of role transitions and the checking of the leader's age into two
distinct `switch` statements.
Previously, these two checks were combined in a single `switch`
statement with complex fall-through logic. This structure contained
two issues:
1. For a device in the `kRoleChild` state, if the role transition
timeout expired, the code would execute `ExitNow()`. This
unintentionally skipped the leader age check and the rest of the
operations in `Mle::HandleTimeTick()`, such as updating the
`ChildTable` and `RouterTable`.
2. A non-router-eligible child would incorrectly fall through and
perform the leader age check. The new logic adds an explicit check
using `IsRouterEligible()` to ensure only router-eligible children
monitor the leader's age.
By separating the logic into two blocks, the code is simplified and
we avoid the brittle fall-through behavior and ensure that all time
tick operations are consistently executed regardless of the device's
role or role transition state.
This commit removes redundant calls to `mInfraIf.Init()` and
`mInfraIf.AddAddress()` from various Nexus test cases.
The infrastructure interface (`mInfraIf`) is automatically initialized
and assigned a link-local address by the core framework when a new
`Node` is added. The `InfraIf::Init()` method derives the link-local
address from the MAC address and adds it to the interface. Therefore,
these explicit manual calls in individual test scripts are unnecessary
and can be removed to simplify the test setup.
Removed redundant channel, panid, and extpanid commands. Their
information is now more comprehensively provided by the dataset active
-ns output.
Removed partitionid from the debug command list as it was redundant
with leaderdata.