diff --git a/tests/nexus/test_9_2_7.cpp b/tests/nexus/test_9_2_7.cpp index 65d64ba60..a3c327154 100644 --- a/tests/nexus/test_9_2_7.cpp +++ b/tests/nexus/test_9_2_7.cpp @@ -323,7 +323,7 @@ void Test9_2_7(void) * - Leader Data TLV * - Data Version field incremented * - Stable Version field incremented - * - Active Timestamp TLV: 15s + * - Active Timestamp TLV: 20s * - Network Data TLV: * - Commissioner Data TLV: * - Stable flag set to 0 @@ -382,11 +382,11 @@ void Test9_2_7(void) nexus.AdvanceTime(kResponseTime); Log("---------------------------------------------------------------------------------------"); - Log("Step 11: Commissioner"); + Log("Step 11: Router"); /** - * Step 11: Commissioner - * - Description: Harness instructs the Commissioner to send a MGMT_PENDING_SET.req to the DUT’s Anycast or Routing + * Step 11: Router + * - Description: Harness instructs the Router to send a MGMT_PENDING_SET.req to the DUT’s Anycast or Routing * Locator: * - CoAP Request URI: coap://[]:MM/c/ps * - CoAP Payload: < Commissioner Session ID TLV not present>, Pending Timestamp TLV: 30s, Active Timestamp TLV: @@ -395,28 +395,29 @@ void Test9_2_7(void) */ { - Tmf::Agent &agent = commissioner.Get(); - Coap::Message *message = agent.NewPriorityConfirmablePostMessage(ot::kUriPendingSet); + Tmf::Agent &agent = router.Get(); + Coap::Message *message; + MeshCoP::Dataset dataset; + MeshCoP::Timestamp timestamp; + message = agent.NewPriorityConfirmablePostMessage(ot::kUriPendingSet); VerifyOrQuit(message != nullptr); - { - MeshCoP::Timestamp timestamp; - timestamp.SetSeconds(kPendingTimestampRouter); - timestamp.SetTicks(0); - SuccessOrQuit(Tlv::Append(*message, timestamp)); - } + SuccessOrQuit(router.Get().Read(dataset)); - { - MeshCoP::Timestamp timestamp; - timestamp.SetSeconds(kActiveTimestampRouter); - timestamp.SetTicks(0); - SuccessOrQuit(Tlv::Append(*message, timestamp)); - } + timestamp.SetSeconds(kActiveTimestampRouter); + timestamp.SetTicks(0); + SuccessOrQuit(dataset.Write(timestamp)); - SuccessOrQuit(Tlv::Append(*message, kDelayTimerStep11 * 1000)); + timestamp.SetSeconds(kPendingTimestampRouter); + timestamp.SetTicks(0); + SuccessOrQuit(dataset.Write(timestamp)); - Tmf::MessageInfo messageInfo(commissioner.GetInstance()); + SuccessOrQuit(dataset.Write(kDelayTimerStep11 * 1000)); + + SuccessOrQuit(message->AppendBytes(dataset.GetBytes(), dataset.GetLength())); + + Tmf::MessageInfo messageInfo(router.GetInstance()); messageInfo.SetSockAddrToRlocPeerAddrToLeaderAloc(); SuccessOrQuit(agent.SendMessage(*message, messageInfo)); } @@ -424,13 +425,6 @@ void Test9_2_7(void) // Wait for acceptance and retransmissions if needed nexus.AdvanceTime(2 * kResponseTime); - { - MeshCoP::Timestamp timestamp; - timestamp = leader.Get().GetTimestamp(); - Log("Pending Timestamp: %s, seconds: %llu", timestamp.IsValid() ? "valid" : "invalid", - (unsigned long long)timestamp.GetSeconds()); - } - Log("---------------------------------------------------------------------------------------"); Log("Step 12: Leader (DUT)"); @@ -514,7 +508,7 @@ void Test9_2_7(void) * - PSKc TLV * - Security Policy TLV * - Active Timestamp TLV: 20s - * - Pending Timestamp TLV: 100s + * - Pending Timestamp TLV: 30s */ nexus.AdvanceTime(kResponseTime); @@ -605,7 +599,7 @@ void Test9_2_7(void) * - Description: Automatically sends a unicast MLE Data Request to the DUT with the new active timestamp and * pending timestamp: * - Active Timestamp TLV: 20s - * - Pending Timestamp TLV: 100s + * - Pending Timestamp TLV: 40s * - Pass Criteria: N/A */ diff --git a/tests/nexus/verify_9_2_7.py b/tests/nexus/verify_9_2_7.py index 3a373819d..124187557 100644 --- a/tests/nexus/verify_9_2_7.py +++ b/tests/nexus/verify_9_2_7.py @@ -238,6 +238,8 @@ def verify(pv): print("Step 13: Leader (DUT) multicasts a MLE Data Response.") pkts.filter_LLANMA().\ filter_mle_cmd(consts.MLE_DATA_RESPONSE).\ + filter(lambda p: p.mle.tlv.active_tstamp == ACTIVE_TIMESTAMP_STEP_5 and\ + p.mle.tlv.pending_tstamp == PENDING_TIMESTAMP_ROUTER).\ must_next() # Step 15: Router @@ -268,7 +270,7 @@ def verify(pv): pkts.filter_mle_cmd(consts.MLE_DATA_RESPONSE).\ filter(lambda p: p.mle.tlv.active_tstamp == ACTIVE_TIMESTAMP_STEP_5 and\ p.mle.tlv.pending_tstamp == PENDING_TIMESTAMP_ROUTER and\ - DELAY_TIMER_STEP_11 * 1000 - 10000 <= p.thread_meshcop.tlv.delay_timer <= DELAY_TIMER_STEP_11 * 1000).\ + DELAY_TIMER_STEP_11 * 1000 - 120000 <= p.thread_meshcop.tlv.delay_timer <= DELAY_TIMER_STEP_11 * 1000).\ must_next() # Steps 17-21 can be interleaved @@ -299,13 +301,15 @@ def verify(pv): print("Step 19: Leader (DUT) sends a multicast MLE Data Response.") pkts.filter_LLANMA().\ filter_mle_cmd(consts.MLE_DATA_RESPONSE).\ + filter(lambda p: p.mle.tlv.active_tstamp == ACTIVE_TIMESTAMP_STEP_5 and\ + p.mle.tlv.pending_tstamp == PENDING_TIMESTAMP_COMMISSIONER).\ must_next() # Step 20: Router # - Description: Automatically sends a unicast MLE Data Request to the DUT with the new active timestamp and # pending timestamp: # - Active Timestamp TLV: 20s - # - Pending Timestamp TLV: 100s + # - Pending Timestamp TLV: 40s # - Pass Criteria: N/A print("Step 20: Router sends a unicast MLE Data Request to the DUT.") @@ -314,7 +318,7 @@ def verify(pv): pkts.filter_mle_cmd(consts.MLE_DATA_RESPONSE).\ filter(lambda p: p.mle.tlv.active_tstamp == ACTIVE_TIMESTAMP_STEP_5 and\ p.mle.tlv.pending_tstamp == PENDING_TIMESTAMP_COMMISSIONER and\ - DELAY_TIMER_STEP_17 * 1000 - 10000 <= p.thread_meshcop.tlv.delay_timer <= DELAY_TIMER_STEP_17 * 1000).\ + 0 <= p.thread_meshcop.tlv.delay_timer <= DELAY_TIMER_STEP_17 * 1000).\ must_next() # Step 22: All