From 7d02d7cd416cb683ca46b328943157b87e0197cd Mon Sep 17 00:00:00 2001 From: marchemi <56955785+marchemi@users.noreply.github.com> Date: Thu, 29 Aug 2024 01:04:02 +0200 Subject: [PATCH] TBRM Tests scripts consistency with te2 fixes (#35153) * Add files via upload Add yaml test script for TBRM * Update TEST_TC_TBRM_2.2.yaml * Update TEST_TC_TBRM_2.3.yaml * Update TEST_TC_TBRM_2.4.yaml * Test script consitancy wit test plan after TE2 * Test script consitancy wit test plan after TE2 * Update src/app/tests/suites/certification/Test_TC_TBRM_2_3.yaml Co-authored-by: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> * Update src/app/tests/suites/certification/Test_TC_TBRM_2_2.yaml Co-authored-by: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> * Restyled by whitespace * Restyled by prettier-yaml * Test_TC_TBRM_2_4. synchronisation with TC-THNETDIR-2.3 according test Plan * Restyled by whitespace * Test tweaks to get CI to pass - Use pairing payload matching the other parameters - Check response of ArmFailSafe commands - Fix bad merge in commissioner_commands.py * Restyled by prettier-yaml --------- Co-authored-by: StephaneGUELEC <94045077+StephaneGUELEC@users.noreply.github.com> Co-authored-by: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Co-authored-by: Restyled.io Co-authored-by: Karsten Sperling --- .../certification/Test_TC_TBRM_2_2.yaml | 22 ++++- .../certification/Test_TC_TBRM_2_3.yaml | 29 +++++-- .../certification/Test_TC_TBRM_2_4.yaml | 86 +++++++++++++++++++ .../Test_TC_TBRM_3_1_Simulated.yaml | 44 ++++++++++ 4 files changed, 170 insertions(+), 11 deletions(-) create mode 100644 src/app/tests/suites/certification/Test_TC_TBRM_2_4.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_TBRM_3_1_Simulated.yaml diff --git a/src/app/tests/suites/certification/Test_TC_TBRM_2_2.yaml b/src/app/tests/suites/certification/Test_TC_TBRM_2_2.yaml index 852e18a73adc8a..a6b54026729c8f 100644 --- a/src/app/tests/suites/certification/Test_TC_TBRM_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_TBRM_2_2.yaml @@ -41,19 +41,21 @@ tests: values: - name: nodeId value: nodeId - + # Step 1 - label: "TH reads the ActiveDatasetTimestamp attribute from the DUT" command: readAttribute attribute: ActiveDatasetTimestamp response: value: null + # Step 2 - label: "TH reads the PendingDatasetTimestamp attribute from the DUT" command: readAttribute attribute: PendingDatasetTimestamp response: value: null + # Step 3 - label: "TH sends a valid ActiveDatasetRequest command to the DUT without having armed the fail-safe" @@ -65,6 +67,7 @@ tests: response: error: FAILSAFE_REQUIRED + # Step 4 - label: "TH sends ArmFailSafe command to the DUT" cluster: General Commissioning command: ArmFailSafe @@ -75,7 +78,12 @@ tests: value: 60 - name: Breadcrumb value: 1 + response: + values: + - name: ErrorCode + value: CommissioningErrorEnum.OK + # Step 5 - label: "TH sends an invalid ActiveDatasetRequest command to the DUT" command: SetActiveDatasetRequest arguments: @@ -85,6 +93,7 @@ tests: response: error: INVALID_COMMAND + # Step 6 - label: "TH sends a valid ActiveDatasetRequest command to the DUT" command: SetActiveDatasetRequest arguments: @@ -92,12 +101,20 @@ tests: - name: ActiveDataset value: PIXIT.TBRM.THREAD_ACTIVE_DATASET + # Step 7 + - label: "TH sends CommissioningComplete command to the DUT" + cluster: General Commissioning + command: CommissioningComplete + endpoint: 0 + + # Step 8 - label: "TH reads the InterfaceEnabled attribute from the DUT" command: readAttribute attribute: InterfaceEnabled response: value: true + # Step 9 - label: "TH reads the ActiveDatasetTimestamp attribute from the DUT" command: readAttribute attribute: ActiveDatasetTimestamp @@ -106,7 +123,8 @@ tests: constraints: type: int64u - - label: "TH sends a valid GetActiveDatasetRequest command to the DUT" + # Step 10 + - label: "TH send a GetActiveDatasetRequest command to the DUT" command: GetActiveDatasetRequest response: values: diff --git a/src/app/tests/suites/certification/Test_TC_TBRM_2_3.yaml b/src/app/tests/suites/certification/Test_TC_TBRM_2_3.yaml index 7a55191f471f0b..a0ecd11693ef8d 100644 --- a/src/app/tests/suites/certification/Test_TC_TBRM_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_TBRM_2_3.yaml @@ -49,7 +49,7 @@ tests: constraints: type: int64u - - label: "If the ActiveDatasetTimestamp attribute not null, go to step 4" + - label: "If the ActiveDatasetTimestamp attribute not null, go to step 5" cluster: EqualityCommands command: UnsignedNumberEquals arguments: @@ -75,6 +75,10 @@ tests: value: 60 - name: Breadcrumb value: 1 + response: + values: + - name: ErrorCode + value: CommissioningErrorEnum.OK # Step 3 - label: "TH sends a valid ActiveDatasetRequest command to the DUT" @@ -86,6 +90,13 @@ tests: value: PIXIT.TBRM.THREAD_ACTIVE_DATASET # Step 4 + - label: "TH sends CommissioningComplete command to the DUT" + runIf: noActiveDataset + cluster: General Commissioning + command: CommissioningComplete + endpoint: 0 + + # Step 5 - label: "TH reads the PendingDatasetTimestamp attribute from the DUT" command: readAttribute attribute: PendingDatasetTimestamp @@ -94,7 +105,7 @@ tests: constraints: type: int64u - # Step 5 + # Step 6 - label: "TH sends a SetPendingDatasetRequest command to the DUT" command: SetPendingDatasetRequest arguments: @@ -102,7 +113,7 @@ tests: - name: PendingDataset value: PIXIT.TBRM.THREAD_PENDING_DATASET - # Step 6 + # Step 7 - label: "TH sends a GetPendingDatasetRequest command to the DUT" command: GetPendingDatasetRequest response: @@ -112,7 +123,7 @@ tests: type: octet_string # TODO: This should be PIXIT.TBRM.THREAD_PENDING_DATASET but ignoring the Delay Timer element if present - # Step 7 + # Step 8 - label: "TH reads the PendingDatasetTimestamp attribute from the DUT" command: readAttribute attribute: PendingDatasetTimestamp @@ -121,7 +132,7 @@ tests: type: int64u notValue: initialPendingTimestamp - # Step 8 + # Step 9 - label: "TH subscribes to the ActiveDatasetTimestamp attribute from the DUT" command: subscribeAttribute @@ -141,15 +152,15 @@ tests: constraints: hasValue: true - # Step 9 + # Step 10 - label: "TH reads the PendingDatasetTimestamp attribute from the DUT" command: readAttribute attribute: PendingDatasetTimestamp response: value: null - # Step 10 - - label: "TH sends a valid GetActiveDatasetRequest command to the DUT" + # Step 11 + - label: "TH sends a GetActiveDatasetRequest command to the DUT" command: GetActiveDatasetRequest response: values: @@ -158,7 +169,7 @@ tests: constraints: type: octet_string - # Step 11 + # Step 12 - label: "TH reads the InterfaceEnabled attribute from the DUT" command: readAttribute attribute: InterfaceEnabled diff --git a/src/app/tests/suites/certification/Test_TC_TBRM_2_4.yaml b/src/app/tests/suites/certification/Test_TC_TBRM_2_4.yaml new file mode 100644 index 00000000000000..d1483c1c5a930a --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_TBRM_2_4.yaml @@ -0,0 +1,86 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: + "[TC-TBRM-2.4] Verify that getting Active or Pending Dataset in the PASE + session results in unsupported access" + +PICS: + - TBRM.S + +config: + nodeId: 0x12344321 + + payload: "MT:-24J0AFN00KA0648G00" + discriminator: 3840 + PakeVerifier: + type: octet_string + defaultValue: "hex:b96170aae803346884724fe9a3b287c30330c2a660375d17bb205a8cf1aecb350457f8ab79ee253ab6a8e46bb09e543ae422736de501e3db37d441fe344920d09548e4c18240630c4ff4913c53513839b7c07fcc0627a1b8573a149fcd1fa466cf" + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: DelayCommands + command: WaitForCommissionee + arguments: + values: + - name: nodeId + value: nodeId + + - label: "Open Commissioning Window" + endpoint: 0 + cluster: Administrator Commissioning + command: OpenCommissioningWindow + timedInteractionTimeoutMs: 2000 + arguments: + values: + - name: CommissioningTimeout + value: 180 + - name: PAKEPasscodeVerifier + value: PakeVerifier + - name: Discriminator + value: discriminator + - name: Iterations + value: 1000 + - name: Salt + value: "SPAKE2P Key Salt" + + - label: "TH2 establishes a PASE session with the DUT" + identity: beta + cluster: CommissionerCommands + endpoint: 0 + command: EstablishPASESession + arguments: + values: + - name: nodeId + value: nodeId + - name: payload + value: payload + + - label: + "TH2 send GetActiveDatasetRequest command to the DUT in PASE session" + identity: beta + cluster: Thread Border Router Management + endpoint: 1 + command: GetActiveDatasetRequest + response: + error: UNSUPPORTED_ACCESS + + - label: + "TH2 send GetPendingDatasetRequest command to the DUT in PASE session" + identity: beta + cluster: Thread Border Router Management + endpoint: 1 + command: GetPendingDatasetRequest + response: + error: UNSUPPORTED_ACCESS diff --git a/src/app/tests/suites/certification/Test_TC_TBRM_3_1_Simulated.yaml b/src/app/tests/suites/certification/Test_TC_TBRM_3_1_Simulated.yaml new file mode 100644 index 00000000000000..095711a0fcee95 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_TBRM_3_1_Simulated.yaml @@ -0,0 +1,44 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: "[TC-TBRM-3.1] Functionality with client as DUT" + +PICS: + - TBRM.C + +config: + nodeId: 0x12344321 + cluster: Thread Border Router Management + endpoint: 1 + +tests: + # Step 1 + - label: "DUT send SetActiveDatasetRequest to TH" + PICS: TBRM.C.C03.Tx + wait: "SetActiveDatasetRequest" + + # Step 2 + - label: "DUT send SetPendingDatasetRequest to TH" + PICS: TBRM.C.C04.Tx + wait: "SetPendingDatasetRequest" + + # Step 3 + - label: "DUT send GetActiveDatasetRequest to TH" + PICS: TBRM.C.C00.Tx + wait: "GetActiveDatasetRequest" + + # Step 4 + - label: "DUT send GetPendingDatasetRequest to TH" + PICS: TBRM.C.C01.Tx + wait: "GetPendingDatasetRequest"