|
| 1 | +# Copyright (c) 2022 Project CHIP Authors |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +name: Test Commissioner Node ID |
| 16 | + |
| 17 | +config: |
| 18 | + nodeId: 0x12344321 |
| 19 | + endpoint: 0 |
| 20 | + cluster: "Access Control" |
| 21 | + payload: |
| 22 | + type: char_string |
| 23 | + defaultValue: "MT:-24J0AFN00KA0648G00" # This value needs to be generated automatically |
| 24 | + |
| 25 | +tests: |
| 26 | + - label: "Wait for the commissioned device to be retrieved for alpha" |
| 27 | + cluster: "DelayCommands" |
| 28 | + command: "WaitForCommissionee" |
| 29 | + arguments: |
| 30 | + values: |
| 31 | + - name: "nodeId" |
| 32 | + value: nodeId |
| 33 | + |
| 34 | + - label: "Open Commissioning Window from alpha" |
| 35 | + cluster: "AdministratorCommissioning" |
| 36 | + command: "OpenBasicCommissioningWindow" |
| 37 | + timedInteractionTimeoutMs: 10000 |
| 38 | + arguments: |
| 39 | + values: |
| 40 | + - name: "CommissioningTimeout" |
| 41 | + value: 180 |
| 42 | + |
| 43 | + - label: "Commission from beta" |
| 44 | + identity: "beta" |
| 45 | + cluster: "CommissionerCommands" |
| 46 | + command: "PairWithCode" |
| 47 | + arguments: |
| 48 | + values: |
| 49 | + - name: "nodeId" |
| 50 | + value: nodeId |
| 51 | + - name: "payload" |
| 52 | + value: payload |
| 53 | + |
| 54 | + - label: "Wait for the commissioned device to be retrieved for beta" |
| 55 | + identity: "beta" |
| 56 | + cluster: "DelayCommands" |
| 57 | + command: "WaitForCommissionee" |
| 58 | + arguments: |
| 59 | + values: |
| 60 | + - name: "nodeId" |
| 61 | + value: nodeId |
| 62 | + |
| 63 | + - label: "Open Commissioning Window from alpha" |
| 64 | + cluster: "AdministratorCommissioning" |
| 65 | + command: "OpenBasicCommissioningWindow" |
| 66 | + timedInteractionTimeoutMs: 10000 |
| 67 | + arguments: |
| 68 | + values: |
| 69 | + - name: "CommissioningTimeout" |
| 70 | + value: 180 |
| 71 | + |
| 72 | + - label: "Commission from gamma" |
| 73 | + identity: "gamma" |
| 74 | + cluster: "CommissionerCommands" |
| 75 | + command: "PairWithCode" |
| 76 | + arguments: |
| 77 | + values: |
| 78 | + - name: "nodeId" |
| 79 | + value: nodeId |
| 80 | + - name: "payload" |
| 81 | + value: payload |
| 82 | + |
| 83 | + - label: "Wait for the commissioned device to be retrieved for gamma" |
| 84 | + identity: "gamma" |
| 85 | + cluster: "DelayCommands" |
| 86 | + command: "WaitForCommissionee" |
| 87 | + arguments: |
| 88 | + values: |
| 89 | + - name: "nodeId" |
| 90 | + value: nodeId |
| 91 | + |
| 92 | + - label: "Read the fabric ID from the alpha fabric" |
| 93 | + identity: "alpha" |
| 94 | + cluster: "Operational Credentials" |
| 95 | + command: "readAttribute" |
| 96 | + attribute: "CurrentFabricIndex" |
| 97 | + response: |
| 98 | + saveAs: alphaIndex |
| 99 | + |
| 100 | + - label: "Read the fabric ID from the beta fabric" |
| 101 | + identity: "beta" |
| 102 | + cluster: "Operational Credentials" |
| 103 | + command: "readAttribute" |
| 104 | + attribute: "CurrentFabricIndex" |
| 105 | + response: |
| 106 | + saveAs: betaIndex |
| 107 | + |
| 108 | + - label: "Read the fabric ID from the gamma fabric" |
| 109 | + identity: "gamma" |
| 110 | + cluster: "Operational Credentials" |
| 111 | + command: "readAttribute" |
| 112 | + attribute: "CurrentFabricIndex" |
| 113 | + response: |
| 114 | + saveAs: gammaIndex |
| 115 | + |
| 116 | + - label: "Read the ACL from alpha and check commissioner node id" |
| 117 | + identity: "alpha" |
| 118 | + command: "readAttribute" |
| 119 | + attribute: "ACL" |
| 120 | + response: |
| 121 | + value: [ |
| 122 | + { |
| 123 | + FabricIndex: alphaIndex, |
| 124 | + Privilege: 5, # administer |
| 125 | + AuthMode: 2, # case |
| 126 | + Subjects: [commissionerNodeId], |
| 127 | + Targets: null, |
| 128 | + }, |
| 129 | + ] |
| 130 | + |
| 131 | + - label: "Read the ACL from beta and check commissioner node id" |
| 132 | + identity: "beta" |
| 133 | + command: "readAttribute" |
| 134 | + attribute: "ACL" |
| 135 | + response: |
| 136 | + value: [ |
| 137 | + { |
| 138 | + FabricIndex: betaIndex, |
| 139 | + Privilege: 5, # administer |
| 140 | + AuthMode: 2, # case |
| 141 | + Subjects: [commissionerNodeId], |
| 142 | + Targets: null, |
| 143 | + }, |
| 144 | + ] |
| 145 | + |
| 146 | + - label: "Read the ACL from gamma and check commissioner node id" |
| 147 | + identity: "gamma" |
| 148 | + command: "readAttribute" |
| 149 | + attribute: "ACL" |
| 150 | + response: |
| 151 | + value: [ |
| 152 | + { |
| 153 | + FabricIndex: gammaIndex, |
| 154 | + Privilege: 5, # administer |
| 155 | + AuthMode: 2, # case |
| 156 | + Subjects: [commissionerNodeId], |
| 157 | + Targets: null, |
| 158 | + }, |
| 159 | + ] |
| 160 | + |
| 161 | + - label: "Write the ACL using the commissioner node id value" |
| 162 | + identity: "beta" |
| 163 | + command: "writeAttribute" |
| 164 | + attribute: "ACL" |
| 165 | + arguments: |
| 166 | + value: [ |
| 167 | + { |
| 168 | + FabricIndex: betaIndex, |
| 169 | + Privilege: 5, # administer |
| 170 | + AuthMode: 2, # case |
| 171 | + Subjects: [commissionerNodeId], |
| 172 | + Targets: null, |
| 173 | + }, |
| 174 | + ] |
| 175 | + |
| 176 | + - label: "Write the ACL using the commissioner node id value" |
| 177 | + identity: "gamma" |
| 178 | + command: "writeAttribute" |
| 179 | + attribute: "ACL" |
| 180 | + arguments: |
| 181 | + value: [ |
| 182 | + { |
| 183 | + FabricIndex: gammaIndex, |
| 184 | + Privilege: 5, # administer |
| 185 | + AuthMode: 2, # case |
| 186 | + Subjects: [commissionerNodeId], |
| 187 | + Targets: null, |
| 188 | + }, |
| 189 | + ] |
| 190 | + |
| 191 | + - label: "Read the ACL from beta and check commissioner node id" |
| 192 | + identity: "beta" |
| 193 | + command: "readAttribute" |
| 194 | + attribute: "ACL" |
| 195 | + response: |
| 196 | + value: [ |
| 197 | + { |
| 198 | + FabricIndex: betaIndex, |
| 199 | + Privilege: 5, # administer |
| 200 | + AuthMode: 2, # case |
| 201 | + Subjects: [commissionerNodeId], |
| 202 | + Targets: null, |
| 203 | + }, |
| 204 | + ] |
| 205 | + |
| 206 | + - label: "Read the ACL from gamma and check commissioner node id" |
| 207 | + identity: "gamma" |
| 208 | + command: "readAttribute" |
| 209 | + attribute: "ACL" |
| 210 | + response: |
| 211 | + value: [ |
| 212 | + { |
| 213 | + FabricIndex: gammaIndex, |
| 214 | + Privilege: 5, # administer |
| 215 | + AuthMode: 2, # case |
| 216 | + Subjects: [commissionerNodeId], |
| 217 | + Targets: null, |
| 218 | + }, |
| 219 | + ] |
| 220 | + |
| 221 | + - label: "Remove beta fabric" |
| 222 | + cluster: "Operational Credentials" |
| 223 | + command: "RemoveFabric" |
| 224 | + arguments: |
| 225 | + values: |
| 226 | + - name: "FabricIndex" |
| 227 | + value: betaIndex |
| 228 | + |
| 229 | + - label: "Remove gamma fabric" |
| 230 | + cluster: "Operational Credentials" |
| 231 | + command: "RemoveFabric" |
| 232 | + arguments: |
| 233 | + values: |
| 234 | + - name: "FabricIndex" |
| 235 | + value: gammaIndex |
0 commit comments