mirror of
https://github.com/espressif/openthread.git
synced 2026-08-04 09:57:47 +00:00
[nexus] add test 1.2.LP.5.3.4 for SSED CSL synchronization (#12606)
This commit adds Nexus test case 1.2.LP.5.3.4, which validates that a Router (DUT) maintains a robust CSL connection with a Synchronized Sleepy End Device (SSED) even when the SSED modifies its CSL Period. The test verifies synchronization over multiple CSL period changes: 500ms -> 3300ms -> 400ms. Changes: - Added CSL period constants (500ms, 3300ms, 400ms) to shared utility modules: tests/nexus/verify_utils.py (Python) and tests/nexus/platform/nexus_utils.hpp (C++). - Implemented tests/nexus/test_1_2_LP_5_3_4.cpp to execute the test procedure, including topology formation, SSED attachment, and triggering CSL period updates. - Implemented tests/nexus/verify_1_2_LP_5_3_4.py to validate pcap output, ensuring the DUT correctly buffers and relays ICMPv6 Echo Requests and that SSED_1 does not send MAC Data Requests. - Updated tests/nexus/CMakeLists.txt and tests/nexus/run_nexus_tests.sh to integrate the new test into the build system and test runner.
This commit is contained in:
@@ -218,6 +218,7 @@ ot_nexus_test(1_1_9_2_19 "cert;nexus")
|
||||
ot_nexus_test(1_2_LP_5_3_1 "cert;nexus")
|
||||
ot_nexus_test(1_2_LP_5_3_2 "cert;nexus")
|
||||
ot_nexus_test(1_2_LP_5_3_3 "cert;nexus")
|
||||
ot_nexus_test(1_2_LP_5_3_4 "cert;nexus")
|
||||
|
||||
# Misc tests
|
||||
ot_nexus_test(border_admitter "core;nexus")
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
|
||||
#include "common/arg_macros.hpp"
|
||||
|
||||
#include <openthread/link.h>
|
||||
|
||||
/**
|
||||
* Verifies a given error status to be successful (compared against value zero (0)), otherwise, it emits a
|
||||
* given error messages and exits the program.
|
||||
@@ -74,4 +76,17 @@
|
||||
#define _Stringize(aArg) _Stringize2(aArg)
|
||||
#define _Stringize2(aArg) #aArg
|
||||
|
||||
namespace ot {
|
||||
namespace Nexus {
|
||||
|
||||
/**
|
||||
* CSL period constants in units of 10 symbols.
|
||||
*/
|
||||
static constexpr uint16_t kCslPeriod500ms = 500 * 1000 / OT_US_PER_TEN_SYMBOLS;
|
||||
static constexpr uint16_t kCslPeriod3300ms = 3300 * 1000 / OT_US_PER_TEN_SYMBOLS;
|
||||
static constexpr uint16_t kCslPeriod400ms = 400 * 1000 / OT_US_PER_TEN_SYMBOLS;
|
||||
|
||||
} // namespace Nexus
|
||||
} // namespace ot
|
||||
|
||||
#endif // OT_NEXUS_PLATFORM_NEXUS_UTILS_HPP_
|
||||
|
||||
@@ -153,6 +153,7 @@ DEFAULT_TESTS=(
|
||||
"1_2_LP_5_3_1"
|
||||
"1_2_LP_5_3_2"
|
||||
"1_2_LP_5_3_3"
|
||||
"1_2_LP_5_3_4"
|
||||
)
|
||||
|
||||
# Use provided arguments or the default test list
|
||||
|
||||
@@ -0,0 +1,269 @@
|
||||
/*
|
||||
* Copyright (c) 2026, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "platform/nexus_core.hpp"
|
||||
#include "platform/nexus_node.hpp"
|
||||
|
||||
namespace ot {
|
||||
namespace Nexus {
|
||||
|
||||
/**
|
||||
* Time to advance for a node to form a network and become leader, in milliseconds.
|
||||
*/
|
||||
static constexpr uint32_t kFormNetworkTime = 13 * 1000;
|
||||
|
||||
/**
|
||||
* Time to advance for a node to join as a child and upgrade to a router, in milliseconds.
|
||||
*/
|
||||
static constexpr uint32_t kAttachToRouterTime = 200 * 1000;
|
||||
|
||||
/**
|
||||
* Time to advance for the network to stabilize after nodes have attached.
|
||||
*/
|
||||
static constexpr uint32_t kStabilizationTime = 10 * 1000;
|
||||
|
||||
/**
|
||||
* CSL synchronized timeout in seconds.
|
||||
*/
|
||||
static constexpr uint32_t kCslTimeout20s = 20;
|
||||
|
||||
/**
|
||||
* Wait times as specified in the test procedure.
|
||||
*/
|
||||
static constexpr uint32_t kWaitTime15s = 15 * 1000;
|
||||
static constexpr uint32_t kWaitTime18s = 18 * 1000;
|
||||
|
||||
/**
|
||||
* Identifiers for ICMPv6 Echo Requests.
|
||||
*/
|
||||
static constexpr uint16_t kEchoRequestIdentifier1 = 0x1234;
|
||||
static constexpr uint16_t kEchoRequestIdentifier2 = 0x5678;
|
||||
static constexpr uint16_t kEchoRequestIdentifier3 = 0x90ab;
|
||||
|
||||
void Test1_2_LP_5_3_4(void)
|
||||
{
|
||||
/**
|
||||
* 5.3.4 SSED modifies CSL IE
|
||||
*
|
||||
* 5.3.4.1 Topology
|
||||
* - Leader (DUT)
|
||||
* - Router_1
|
||||
* - SSED_1
|
||||
*
|
||||
* 5.3.4.2 Purpose & Description
|
||||
* The purpose of this test is to validate that a Router is able to successfully maintain a robust CSL connection
|
||||
* with a SSED even when the SSED modifies the CSL IEs during its synchronization.
|
||||
*
|
||||
* Spec Reference | V1.2 Section
|
||||
* ---------------------|-------------
|
||||
* SSED modifies CSL IE | 4.10
|
||||
*/
|
||||
|
||||
Core nexus;
|
||||
|
||||
Node &leader = nexus.CreateNode();
|
||||
Node &router1 = nexus.CreateNode();
|
||||
Node &ssed1 = nexus.CreateNode();
|
||||
|
||||
leader.SetName("LEADER");
|
||||
router1.SetName("ROUTER_1");
|
||||
ssed1.SetName("SSED_1");
|
||||
|
||||
Instance::SetLogLevel(kLogLevelNote);
|
||||
|
||||
Log("Step 0: SSED_1");
|
||||
|
||||
Log("Step 1: All");
|
||||
|
||||
/**
|
||||
* Step 1: All
|
||||
* - Description: Topology formation: DUT, Router_1, SSED_1.
|
||||
* - Pass Criteria: N/A.
|
||||
*/
|
||||
|
||||
leader.AllowList(router1);
|
||||
leader.AllowList(ssed1);
|
||||
|
||||
router1.AllowList(leader);
|
||||
|
||||
ssed1.AllowList(leader);
|
||||
|
||||
leader.Form();
|
||||
nexus.AdvanceTime(kFormNetworkTime);
|
||||
VerifyOrQuit(leader.Get<Mle::Mle>().IsLeader());
|
||||
|
||||
router1.Join(leader);
|
||||
nexus.AdvanceTime(kAttachToRouterTime);
|
||||
VerifyOrQuit(router1.Get<Mle::Mle>().IsRouter());
|
||||
|
||||
Log("Step 2: SSED_1");
|
||||
|
||||
/**
|
||||
* Step 2: SSED_1
|
||||
* - Description: Automatically attaches to the DUT and establishes CSL synchronization.
|
||||
* - Pass Criteria:
|
||||
* - 2.1: The DUT MUST send MLE Child ID Response to SSED_1.
|
||||
* - 2.2: The DUT MUST unicast MLE Child Update Response to SSED_1.
|
||||
*/
|
||||
|
||||
ssed1.Join(leader, Node::kAsSed);
|
||||
ssed1.Get<Mac::Mac>().SetCslPeriod(kCslPeriod500ms);
|
||||
ssed1.Get<Mle::Mle>().SetCslTimeout(kCslTimeout20s);
|
||||
nexus.AdvanceTime(kStabilizationTime);
|
||||
VerifyOrQuit(ssed1.Get<Mle::Mle>().IsAttached());
|
||||
|
||||
Log("Step 3: Router_1");
|
||||
|
||||
/**
|
||||
* Step 3: Router_1
|
||||
* - Description: Harness verifies connectivity by sending an ICMPv6 Echo Request to the SSED_1 mesh-local address.
|
||||
* - Pass Criteria:
|
||||
* - 3.1: The DUT MUST buffer the ICMPv6 Echo Request frame and relay it to SSED_1 within a subsequent CSL slot.
|
||||
* - 3.2: SSED_1 MUST NOT send a MAC Data Request prior to receiving the ICMPv6 Echo Request from the DUT.
|
||||
*/
|
||||
|
||||
router1.SendEchoRequest(ssed1.Get<Mle::Mle>().GetMeshLocalEid(), kEchoRequestIdentifier1);
|
||||
nexus.AdvanceTime(kStabilizationTime);
|
||||
|
||||
Log("Step 4: SSED_1");
|
||||
|
||||
/**
|
||||
* Step 4: SSED_1
|
||||
* - Description: Automatically sends ICMPv6 Echo Reply to the Router.
|
||||
* - Pass Criteria:
|
||||
* - 4.1: SSED_1 MUST send an ICMPv6 Echo Reply to Router_1.
|
||||
*/
|
||||
|
||||
nexus.AdvanceTime(kStabilizationTime);
|
||||
|
||||
Log("Step 5: SSED_1");
|
||||
|
||||
/**
|
||||
* Step 5: SSED_1
|
||||
* - Description: Harness instructs the device to change its CSL Period IE to 3300ms.
|
||||
* - Pass Criteria: N/A.
|
||||
*/
|
||||
|
||||
ssed1.Get<Mac::Mac>().SetCslPeriod(kCslPeriod3300ms);
|
||||
nexus.AdvanceTime(kStabilizationTime);
|
||||
|
||||
Log("Step 6: Harness");
|
||||
|
||||
/**
|
||||
* Step 6: Harness
|
||||
* - Description: Harness waits for 15 seconds.
|
||||
* - Pass Criteria: N/A.
|
||||
*/
|
||||
|
||||
nexus.AdvanceTime(kWaitTime15s);
|
||||
|
||||
Log("Step 7: Router_1");
|
||||
|
||||
/**
|
||||
* Step 7: Router_1
|
||||
* - Description: Harness verifies connectivity by instructing the device to send an ICMPv6 Echo Request to the
|
||||
* SSED_1 mesh-local address.
|
||||
* - Pass Criteria:
|
||||
* - 7.1: The DUT MUST buffer the ICMPv6 Echo Request frame and relay it to SSED_1 within a subsequent CSL slot.
|
||||
* - 7.2: SSED_1 MUST NOT send a MAC Data Request prior to receiving the ICMPv6 Echo Request from the DUT.
|
||||
*/
|
||||
|
||||
router1.SendEchoRequest(ssed1.Get<Mle::Mle>().GetMeshLocalEid(), kEchoRequestIdentifier2);
|
||||
nexus.AdvanceTime(kStabilizationTime);
|
||||
|
||||
Log("Step 8: SSED_1");
|
||||
|
||||
/**
|
||||
* Step 8: SSED_1
|
||||
* - Description: Automatically sends ICMPv6 Echo Reply to the Router.
|
||||
* - Pass Criteria:
|
||||
* - 8.1: SSED_1 MUST send an ICMPv6 Echo Reply to Router_1.
|
||||
*/
|
||||
|
||||
nexus.AdvanceTime(kStabilizationTime);
|
||||
|
||||
Log("Step 9: SSED_1");
|
||||
|
||||
/**
|
||||
* Step 9: SSED_1
|
||||
* - Description: Harness instructs the device to change its CSL Period IE to 400ms.
|
||||
* - Pass Criteria: N/A.
|
||||
*/
|
||||
|
||||
ssed1.Get<Mac::Mac>().SetCslPeriod(kCslPeriod400ms);
|
||||
nexus.AdvanceTime(kStabilizationTime);
|
||||
|
||||
Log("Step 10: Harness");
|
||||
|
||||
/**
|
||||
* Step 10: Harness
|
||||
* - Description: Harness waits for 18 seconds.
|
||||
* - Pass Criteria: N/A.
|
||||
*/
|
||||
|
||||
nexus.AdvanceTime(kWaitTime18s);
|
||||
|
||||
Log("Step 11: Router_1");
|
||||
|
||||
/**
|
||||
* Step 11: Router_1
|
||||
* - Description: Harness verifies connectivity by instructing the device to send an ICMPv6 Echo Request to SSED_1
|
||||
* mesh-local address.
|
||||
* - Pass Criteria:
|
||||
* - 11.1: The DUT MUST buffer the ICMPv6 Echo Request frame and relay it to SSED_1 within a subsequent CSL slot.
|
||||
* - 11.2: SSED_1 MUST NOT send a MAC Data Request prior to receiving the ICMPv6 Echo Request from the DUT.
|
||||
*/
|
||||
|
||||
router1.SendEchoRequest(ssed1.Get<Mle::Mle>().GetMeshLocalEid(), kEchoRequestIdentifier3);
|
||||
nexus.AdvanceTime(kStabilizationTime);
|
||||
|
||||
Log("Step 12: SSED_1");
|
||||
|
||||
/**
|
||||
* Step 12: SSED_1
|
||||
* - Description: Automatically sends ICMPv6 Echo Reply to the Router.
|
||||
* - Pass Criteria:
|
||||
* - 12.1: SSED_1 MUST send an ICMPv6 Echo Reply to Router_1.
|
||||
*/
|
||||
|
||||
nexus.AdvanceTime(kStabilizationTime);
|
||||
|
||||
nexus.SaveTestInfo("test_1_2_LP_5_3_4.json");
|
||||
}
|
||||
|
||||
} // namespace Nexus
|
||||
} // namespace ot
|
||||
|
||||
int main(void)
|
||||
{
|
||||
ot::Nexus::Test1_2_LP_5_3_4();
|
||||
printf("All tests passed\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,244 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# Copyright (c) 2026, The OpenThread Authors.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. Neither the name of the copyright holder nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE of THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Add the current directory to sys.path to find verify_utils
|
||||
CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
sys.path.append(CUR_DIR)
|
||||
|
||||
import verify_utils
|
||||
from pktverify import consts
|
||||
|
||||
# Identifiers for ICMPv6 Echo Requests
|
||||
ECHO_REQUEST_IDENTIFIER_1 = 0x1234
|
||||
ECHO_REQUEST_IDENTIFIER_2 = 0x5678
|
||||
ECHO_REQUEST_IDENTIFIER_3 = 0x90ab
|
||||
|
||||
|
||||
def verify(pv):
|
||||
# 5.3.4 SSED modifies CSL IE
|
||||
#
|
||||
# 5.3.4.1 Topology
|
||||
# - Leader (DUT)
|
||||
# - Router_1
|
||||
# - SSED_1
|
||||
#
|
||||
# 5.3.4.2 Purpose & Description
|
||||
# The purpose of this test is to validate that a Router is able to successfully maintain a robust CSL connection
|
||||
# with a SSED even when the SSED modifies the CSL IEs during its synchronization.
|
||||
#
|
||||
# Spec Reference | Section
|
||||
# ---------------|--------
|
||||
# CSL | 4.10
|
||||
|
||||
pkts = pv.pkts
|
||||
pv.summary.show()
|
||||
|
||||
LEADER_NAME = pv.vars['LEADER']
|
||||
LEADER_RLOC16 = pv.vars['LEADER_RLOC16']
|
||||
ROUTER_1_NAME = pv.vars['ROUTER_1']
|
||||
ROUTER_1_RLOC16 = pv.vars['ROUTER_1_RLOC16']
|
||||
SSED_1_NAME = pv.vars['SSED_1']
|
||||
SSED_1_RLOC16 = pv.vars['SSED_1_RLOC16']
|
||||
|
||||
def _verify_csl_echo_exchange(checkpoint_index, expected_csl_period=None, identifier=None):
|
||||
"""Verifies a CSL-based ICMPv6 echo request/reply exchange."""
|
||||
|
||||
# The ICMPv6 Echo Request from Router_1 to the DUT (Leader).
|
||||
_router_echo_req = pkts.range(checkpoint_index).filter_ping_request(identifier=identifier).\
|
||||
filter_wpan_src16(ROUTER_1_RLOC16).\
|
||||
filter_wpan_dst16(LEADER_RLOC16).\
|
||||
must_next()
|
||||
_router_echo_req_index = pkts.index
|
||||
|
||||
# The DUT MUST buffer the ICMPv6 Echo Request frame and relay it to SSED_1.
|
||||
_echo_req = pkts.range(pkts.index).filter_ping_request(identifier=identifier).\
|
||||
filter_wpan_src16(LEADER_RLOC16).\
|
||||
filter_wpan_dst16(SSED_1_RLOC16).\
|
||||
must_next()
|
||||
_echo_req_index = pkts.index
|
||||
|
||||
# SSED_1 MUST NOT send a MAC Data Request prior to receiving the ICMPv6 Echo Request from the DUT.
|
||||
# We check from the moment the Echo Request was sent by Router_1.
|
||||
pkts.range(_router_echo_req_index, (pkts.index[0] - 1, pkts.index[1] - 1)).\
|
||||
filter_wpan_src64(SSED_1_NAME).\
|
||||
filter_wpan_dst16(LEADER_RLOC16).\
|
||||
filter_wpan_cmd(consts.WPAN_DATA_REQUEST).\
|
||||
must_not_next()
|
||||
|
||||
# SSED_1 MUST send an ICMPv6 Echo Reply to Router_1 (relayed by DUT).
|
||||
_echo_reply = pkts.range(_echo_req_index).filter_ping_reply(identifier=_echo_req.icmpv6.echo.identifier).\
|
||||
filter_wpan_src64(SSED_1_NAME).\
|
||||
filter_wpan_dst16(LEADER_RLOC16).\
|
||||
must_next()
|
||||
|
||||
if expected_csl_period is not None:
|
||||
# SSED_1 SHOULD include the CSL IE with the expected period.
|
||||
if _echo_reply.wpan.header_ie.csl.period != expected_csl_period:
|
||||
raise ValueError(
|
||||
f"Expected CSL period {expected_csl_period}, but found {_echo_reply.wpan.header_ie.csl.period}")
|
||||
|
||||
# The DUT MUST forward the Echo Reply to Router_1.
|
||||
pkts.range(pkts.index).filter_ping_reply(identifier=_echo_req.icmpv6.echo.identifier).\
|
||||
filter_wpan_src16(LEADER_RLOC16).\
|
||||
filter_wpan_dst16(ROUTER_1_RLOC16).\
|
||||
must_next()
|
||||
|
||||
return pkts.index
|
||||
|
||||
# Step 0: SSED_1
|
||||
# - Description: Preconditions: Set CSL Synchronized Timeout = 20s, Set CSL Period = 500ms.
|
||||
# - Pass Criteria: N/A.
|
||||
print("Step 0: SSED_1")
|
||||
|
||||
# Step 1: All
|
||||
# - Description: Topology formation: DUT, Router_1, SSED_1.
|
||||
# - Pass Criteria: N/A.
|
||||
print("Step 1: All")
|
||||
|
||||
# Step 2: SSED_1
|
||||
# - Description: Automatically attaches to the DUT and establishes CSL synchronization.
|
||||
# - Pass Criteria:
|
||||
# - 2.1: The DUT MUST send MLE Child ID Response to SSED_1.
|
||||
# - 2.2: The DUT MUST unicast MLE Child Update Response to SSED_1.
|
||||
print("Step 2: SSED_1")
|
||||
|
||||
# 2.1: The DUT MUST send MLE Child ID Response to SSED_1.
|
||||
pkts.filter_wpan_src64(LEADER_NAME).\
|
||||
filter_wpan_dst64(SSED_1_NAME).\
|
||||
filter_mle_cmd(consts.MLE_CHILD_ID_RESPONSE).\
|
||||
must_next()
|
||||
|
||||
# 2.2: The DUT MUST unicast MLE Child Update Response to SSED_1.
|
||||
pkts.filter_wpan_src64(LEADER_NAME).\
|
||||
filter_wpan_dst64(SSED_1_NAME).\
|
||||
filter_mle_cmd(consts.MLE_CHILD_UPDATE_RESPONSE).\
|
||||
must_next()
|
||||
_checkpoint_step2 = pkts.index
|
||||
|
||||
# Step 3: Router_1
|
||||
# - Description: Harness verifies connectivity by sending an ICMPv6 Echo Request to the SSED_1 mesh-local address.
|
||||
# - Pass Criteria:
|
||||
# - 3.1: The DUT MUST buffer the ICMPv6 Echo Request frame and relay it to SSED_1 within a subsequent CSL slot.
|
||||
# - 3.2: SSED_1 MUST NOT send a MAC Data Request prior to receiving the ICMPv6 Echo Request from the DUT.
|
||||
print("Step 3: Router_1")
|
||||
|
||||
# Step 4: SSED_1
|
||||
# - Description: Automatically sends ICMPv6 Echo Reply to the Router.
|
||||
# - Pass Criteria:
|
||||
# - 4.1: SSED_1 MUST send an ICMPv6 Echo Reply to Router_1.
|
||||
print("Step 4: SSED_1")
|
||||
|
||||
_last_index = _verify_csl_echo_exchange(_checkpoint_step2, verify_utils.CSL_PERIOD_500MS,
|
||||
ECHO_REQUEST_IDENTIFIER_1)
|
||||
|
||||
# Step 5: SSED_1
|
||||
# - Description: Harness instructs the device to change its CSL Period IE to 3300ms.
|
||||
# - Pass Criteria: N/A.
|
||||
print("Step 5: SSED_1")
|
||||
|
||||
# SSED_1 SHOULD inform the parent about the CSL Period change.
|
||||
pkts.range(_last_index).filter_wpan_src64(SSED_1_NAME).\
|
||||
filter_wpan_dst64(LEADER_NAME).\
|
||||
filter_mle_cmd(consts.MLE_CHILD_UPDATE_REQUEST).\
|
||||
must_next()
|
||||
|
||||
# The DUT MUST respond to the MLE Child Update Request.
|
||||
pkts.filter_wpan_src64(LEADER_NAME).\
|
||||
filter_wpan_dst64(SSED_1_NAME).\
|
||||
filter_mle_cmd(consts.MLE_CHILD_UPDATE_RESPONSE).\
|
||||
must_next()
|
||||
_checkpoint_step7 = pkts.index
|
||||
|
||||
# Step 6: Harness
|
||||
# - Description: Harness waits for 15 seconds.
|
||||
# - Pass Criteria: N/A.
|
||||
print("Step 6: Harness")
|
||||
|
||||
# Step 7: Router_1
|
||||
# - Description: Harness verifies connectivity by instructing the device to send an ICMPv6 Echo Request to the
|
||||
# SSED_1 mesh-local address.
|
||||
# - Pass Criteria:
|
||||
# - 7.1: The DUT MUST buffer the ICMPv6 Echo Request frame and relay it to SSED_1 within a subsequent CSL slot.
|
||||
# - 7.2: SSED_1 MUST NOT send a MAC Data Request prior to receiving the ICMPv6 Echo Request from the DUT.
|
||||
print("Step 7: Router_1")
|
||||
|
||||
# Step 8: SSED_1
|
||||
# - Description: Automatically sends ICMPv6 Echo Reply to the Router.
|
||||
# - Pass Criteria:
|
||||
# - 8.1: SSED_1 MUST send an ICMPv6 Echo Reply to Router_1.
|
||||
print("Step 8: SSED_1")
|
||||
|
||||
_last_index = _verify_csl_echo_exchange(_checkpoint_step7, verify_utils.CSL_PERIOD_3300MS,
|
||||
ECHO_REQUEST_IDENTIFIER_2)
|
||||
|
||||
# Step 9: SSED_1
|
||||
# - Description: Harness instructs the device to change its CSL Period IE to 400ms.
|
||||
# - Pass Criteria: N/A.
|
||||
print("Step 9: SSED_1")
|
||||
|
||||
# SSED_1 SHOULD inform the parent about the CSL Period change.
|
||||
pkts.range(_last_index).filter_wpan_src64(SSED_1_NAME).\
|
||||
filter_wpan_dst64(LEADER_NAME).\
|
||||
filter_mle_cmd(consts.MLE_CHILD_UPDATE_REQUEST).\
|
||||
must_next()
|
||||
|
||||
# The DUT MUST respond to the MLE Child Update Request.
|
||||
pkts.filter_wpan_src64(LEADER_NAME).\
|
||||
filter_wpan_dst64(SSED_1_NAME).\
|
||||
filter_mle_cmd(consts.MLE_CHILD_UPDATE_RESPONSE).\
|
||||
must_next()
|
||||
_checkpoint_step11 = pkts.index
|
||||
|
||||
# Step 10: Harness
|
||||
# - Description: Harness waits for 18 seconds.
|
||||
# - Pass Criteria: N/A.
|
||||
print("Step 10: Harness")
|
||||
|
||||
# Step 11: Router_1
|
||||
# - Description: Harness verifies connectivity by instructing the device to send an ICMPv6 Echo Request to SSED_1
|
||||
# mesh-local address.
|
||||
# - Pass Criteria:
|
||||
# - 11.1: The DUT MUST buffer the ICMPv6 Echo Request frame and relay it to SSED_1 within a subsequent CSL slot.
|
||||
# - 11.2: SSED_1 MUST NOT send a MAC Data Request prior to receiving the ICMPv6 Echo Request from the DUT.
|
||||
print("Step 11: Router_1")
|
||||
|
||||
# Step 12: SSED_1
|
||||
# - Description: Automatically sends ICMPv6 Echo Reply to the Router.
|
||||
# - Pass Criteria:
|
||||
# - 12.1: SSED_1 MUST send an ICMPv6 Echo Reply to Router_1.
|
||||
print("Step 12: SSED_1")
|
||||
|
||||
_verify_csl_echo_exchange(_checkpoint_step11, verify_utils.CSL_PERIOD_400MS, ECHO_REQUEST_IDENTIFIER_3)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
verify_utils.run_main(verify)
|
||||
@@ -49,6 +49,11 @@ from pktverify.coap import CoapTlvParser
|
||||
from pktverify.addrs import Ipv6Addr
|
||||
from pktverify.bytes import Bytes
|
||||
|
||||
# CSL period constants (in units of 10 symbols)
|
||||
CSL_PERIOD_500MS = 500000 // consts.US_PER_TEN_SYMBOLS
|
||||
CSL_PERIOD_3300MS = 3300000 // consts.US_PER_TEN_SYMBOLS
|
||||
CSL_PERIOD_400MS = 400000 // consts.US_PER_TEN_SYMBOLS
|
||||
|
||||
|
||||
# Monkey-patch CoapTlvParser to parse Thread TLVs in CoAP payload
|
||||
def thread_coap_tlv_parse(t, v, layer=None):
|
||||
|
||||
Reference in New Issue
Block a user