Skip to content

Commit

Permalink
TBRM Tests scripts consistency with te2 fixes (project-chip#35153)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Update src/app/tests/suites/certification/Test_TC_TBRM_2_2.yaml

Co-authored-by: Karsten Sperling <[email protected]>

* 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 <[email protected]>
Co-authored-by: Karsten Sperling <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
Co-authored-by: Karsten Sperling <[email protected]>
  • Loading branch information
5 people authored and hasty committed Aug 29, 2024
1 parent 1631e3b commit 7d02d7c
Show file tree
Hide file tree
Showing 4 changed files with 170 additions and 11 deletions.
22 changes: 20 additions & 2 deletions src/app/tests/suites/certification/Test_TC_TBRM_2_2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -65,6 +67,7 @@ tests:
response:
error: FAILSAFE_REQUIRED

# Step 4
- label: "TH sends ArmFailSafe command to the DUT"
cluster: General Commissioning
command: ArmFailSafe
Expand All @@ -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:
Expand All @@ -85,19 +93,28 @@ tests:
response:
error: INVALID_COMMAND

# Step 6
- label: "TH sends a valid ActiveDatasetRequest command to the DUT"
command: SetActiveDatasetRequest
arguments:
values:
- 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
Expand All @@ -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:
Expand Down
29 changes: 20 additions & 9 deletions src/app/tests/suites/certification/Test_TC_TBRM_2_3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -94,15 +105,15 @@ tests:
constraints:
type: int64u

# Step 5
# Step 6
- label: "TH sends a SetPendingDatasetRequest command to the DUT"
command: SetPendingDatasetRequest
arguments:
values:
- name: PendingDataset
value: PIXIT.TBRM.THREAD_PENDING_DATASET

# Step 6
# Step 7
- label: "TH sends a GetPendingDatasetRequest command to the DUT"
command: GetPendingDatasetRequest
response:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand Down
86 changes: 86 additions & 0 deletions src/app/tests/suites/certification/Test_TC_TBRM_2_4.yaml
Original file line number Diff line number Diff line change
@@ -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
44 changes: 44 additions & 0 deletions src/app/tests/suites/certification/Test_TC_TBRM_3_1_Simulated.yaml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 7d02d7c

Please sign in to comment.