Skip to content

[nexus] add test case 5.2.5 Address Query – REED#12396

Open
jwhui wants to merge 1 commit intoopenthread:mainfrom
jwhui:nexus-5-2-5
Open

[nexus] add test case 5.2.5 Address Query – REED#12396
jwhui wants to merge 1 commit intoopenthread:mainfrom
jwhui:nexus-5-2-5

Conversation

@jwhui
Copy link
Member

@jwhui jwhui commented Feb 8, 2026

This commit adds a new Nexus test case 5.2.5 which validates that a Router Eligible End Device (REED) correctly generates Address Notification messages in response to Address Query messages.

The test implementation includes:

  • test_5_2_5.cpp: Sets up a 16-router topology using AllowList constraints and executes the test procedure.
  • verify_5_2_5.py: Verifies the resulting pcap to ensure correct Address Notification format (Target EID, RLOC16, and ML-EID TLVs) and Echo Reply sequence.

Summary of changes:

  • Added tests/nexus/test_5_2_5.cpp and tests/nexus/verify_5_2_5.py.
  • Updated tests/nexus/CMakeLists.txt to include the new test.
  • Updated tests/nexus/run_nexus_tests.sh to add 5_2_5 to default tests.
  • Enabled OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE and OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE in tests/nexus/openthread-core-nexus-config.h to support DHCPv6 prefixes used in the test.

@gemini-code-assist
Copy link

Summary of Changes

Hello @jwhui, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request integrates a crucial new test case, 5.2.5 Address Query – REED, into the Nexus test suite. The primary goal is to rigorously validate the behavior of Router Eligible End Devices (REEDs) within a Thread network, specifically their ability to respond accurately to Address Query messages with correctly formatted Address Notification messages. This enhancement improves the coverage and reliability of network protocol compliance testing.

Highlights

  • New Test Case: Introduces 5.2.5 Address Query – REED to validate the behavior of Router Eligible End Devices (REEDs).
  • Functionality Tested: Verifies that REEDs correctly generate Address Notification messages in response to Address Query messages.
  • Test Setup: Establishes a 16-router topology with specific DHCPv6 server configuration on the Leader and SLAAC server configuration on a Border Router.
  • Verification: Ensures the proper format of Address Notification messages (Target EID, RLOC16, ML-EID TLVs) and the correct sequence of Echo Replies.
  • Configuration Updates: Enables DHCPv6 client and server functionalities in the core configuration for the test environment.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • tests/nexus/CMakeLists.txt
    • Added the new test 5_2_5 to the build system.
  • tests/nexus/openthread-core-nexus-config.h
    • Enabled OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE and OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE to support DHCPv6 prefixes required by the test.
  • tests/nexus/run_nexus_tests.sh
    • Included 5_2_5 in the default list of Nexus tests to be executed.
  • tests/nexus/test_5_2_5.cpp
    • Introduced a new C++ file containing the core logic for the 5.2.5 test, including topology setup, node configuration, and test step execution.
  • tests/nexus/verify_5_2_5.py
    • Added a new Python script responsible for post-processing the pcap output of the 5.2.5 test to verify the correctness of Address Notification messages and Echo Replies.
Activity
  • A new test case 5.2.5 Address Query – REED has been implemented.
  • The test involves C++ code for simulation and a Python script for verification.
  • Necessary build and configuration files have been updated to incorporate the new test.
  • No human activity (comments, reviews, approvals) has been recorded yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

gemini-code-assist[bot]

This comment was marked as outdated.

@github-actions
Copy link

github-actions bot commented Feb 8, 2026

Merging #12396 into main

name branch text data bss total
ot-cli-ftd 3f11074 482096 860 66564 549520
9f16c77 482096 860 66564 549520
+/- +0 +0 +0 +0
ot-ncp-ftd 3f11074 447900 764 61800 510464
9f16c77 447900 764 61800 510464
+/- +0 +0 +0 +0
ot-cli-mtd 3f11074 373832 764 50996 425592
9f16c77 373832 764 50996 425592
+/- +0 +0 +0 +0
ot-ncp-mtd 3f11074 354892 764 46264 401920
9f16c77 354892 764 46264 401920
+/- +0 +0 +0 +0
ot-cli-ftd-br 3f11074 589616 868 136484 726968
9f16c77 589616 868 136484 726968
+/- +0 +0 +0 +0
ot-rcp 3f11074 63264 568 20804 84636
9f16c77 63264 568 20804 84636
+/- +0 +0 +0 +0
Library files
name branch text data bss total
libopenthread-ftd.a 3f11074 249365 95 40343 289803
9f16c77 249365 95 40343 289803
+/- +0 +0 +0 +0
libopenthread-cli-ftd.a 3f11074 61790 0 8091 69881
9f16c77 61790 0 8091 69881
+/- +0 +0 +0 +0
libopenthread-ncp-ftd.a 3f11074 33581 0 5948 39529
9f16c77 33581 0 5948 39529
+/- +0 +0 +0 +0
libopenthread-mtd.a 3f11074 167275 0 24807 192082
9f16c77 167275 0 24807 192082
+/- +0 +0 +0 +0
libopenthread-cli-mtd.a 3f11074 41422 0 8059 49481
9f16c77 41422 0 8059 49481
+/- +0 +0 +0 +0
libopenthread-ncp-mtd.a 3f11074 25805 0 5948 31753
9f16c77 25805 0 5948 31753
+/- +0 +0 +0 +0
libopenthread-ftd-br.a 3f11074 358535 100 110223 468858
9f16c77 358535 100 110223 468858
+/- +0 +0 +0 +0
libopenthread-cli-ftd-br.a 3f11074 80203 0 8131 88334
9f16c77 80203 0 8131 88334
+/- +0 +0 +0 +0
libopenthread-rcp.a 3f11074 9944 0 5060 15004
9f16c77 9944 0 5060 15004
+/- +0 +0 +0 +0
libopenthread-radio.a 3f11074 19537 0 238 19775
9f16c77 19537 0 238 19775
+/- +0 +0 +0 +0

gemini-code-assist[bot]

This comment was marked as outdated.

This commit adds a new Nexus test case 5.2.5 which validates that
a Router Eligible End Device (REED) correctly generates Address
Notification messages in response to Address Query messages.

The test implementation includes:
- test_5_2_5.cpp: Sets up a 16-router topology using AllowList
  constraints and executes the test procedure.
- verify_5_2_5.py: Verifies the resulting pcap to ensure correct
  Address Notification format (Target EID, RLOC16, and ML-EID TLVs)
  and Echo Reply sequence.

Summary of changes:
- Added tests/nexus/test_5_2_5.cpp and tests/nexus/verify_5_2_5.py.
- Updated tests/nexus/CMakeLists.txt to include the new test.
- Updated tests/nexus/run_nexus_tests.sh to add 5_2_5 to default tests.
- Enabled OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE and
  OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE in
  tests/nexus/openthread-core-nexus-config.h to support DHCPv6
  prefixes used in the test.
@jwhui
Copy link
Member Author

jwhui commented Feb 8, 2026

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new Nexus test case, 5.2.5, to validate Address Query functionality on a Router Eligible End Device (REED). The changes include the C++ test implementation, a Python script for pcap verification, and necessary updates to the build and test execution configurations. The implementation correctly establishes the complex network topology and verifies the DUT's behavior as specified in the test plan. The code is well-structured and clear. I have one suggestion to enhance the debuggability of the C++ test code.

Comment on lines +303 to +309
auto verifyPing = [&](const Ip6::Address &aAddress, const char *aLabel) {
OT_UNUSED_VARIABLE(aLabel);
med1ReceivedEchoReply = false;
SendEchoRequest(med1, aAddress);
nexus.AdvanceTime(kEchoResponseTime);
VerifyOrQuit(med1ReceivedEchoReply, "Echo Reply not received");
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The aLabel parameter in the verifyPing lambda is currently unused. It can be leveraged to provide a more descriptive failure message in VerifyOrQuit, which would improve debuggability if the test fails.

Suggested change
auto verifyPing = [&](const Ip6::Address &aAddress, const char *aLabel) {
OT_UNUSED_VARIABLE(aLabel);
med1ReceivedEchoReply = false;
SendEchoRequest(med1, aAddress);
nexus.AdvanceTime(kEchoResponseTime);
VerifyOrQuit(med1ReceivedEchoReply, "Echo Reply not received");
};
auto verifyPing = [&](const Ip6::Address &aAddress, const char *aLabel) {
med1ReceivedEchoReply = false;
SendEchoRequest(med1, aAddress);
nexus.AdvanceTime(kEchoResponseTime);
char failMessage[128];
snprintf(failMessage, sizeof(failMessage), "Echo Reply not received for %s", aLabel);
VerifyOrQuit(med1ReceivedEchoReply, failMessage);
};

@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.88%. Comparing base (c457b6b) to head (d8f1001).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12396      +/-   ##
==========================================
- Coverage   76.68%   73.88%   -2.80%     
==========================================
  Files         688      687       -1     
  Lines       93519    98916    +5397     
==========================================
+ Hits        71713    73084    +1371     
- Misses      21806    25832    +4026     

see 295 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant