-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Add a test for successful OTA transfer (#18344)
- Loading branch information
1 parent
9327eae
commit 2454088
Showing
21 changed files
with
1,206 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
# Copyright (c) 2022 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: Test OTA Software Update Successful Transfer | ||
|
||
config: | ||
endpoint: 0 | ||
requestorNodeId: | ||
type: NODE_ID | ||
defaultValue: 0x12344321 | ||
providerNodeId: | ||
type: NODE_ID | ||
defaultValue: 0xC0FFEE | ||
providerPayload: | ||
type: CHAR_STRING | ||
defaultValue: "MT:-24J0IX4122-.548G00" # This value needs to be generated | ||
providerDiscriminator: | ||
type: INT16U | ||
defaultValue: 50 | ||
providerPort: | ||
type: INT16U | ||
defaultValue: 5560 | ||
providerKvs: | ||
type: CHAR_STRING | ||
defaultValue: "/tmp/chip_kvs_provider" | ||
otaImageFilePath: | ||
type: CHAR_STRING | ||
defaultValue: "/tmp/otaImage" | ||
rawImageFilePath: | ||
type: CHAR_STRING | ||
defaultValue: "/tmp/rawImage" | ||
rawImageContent: | ||
type: CHAR_STRING | ||
defaultValue: "Have a hootenanny!" | ||
downloadImageFilePath: | ||
type: CHAR_STRING | ||
defaultValue: "/tmp/downloadedImage" | ||
|
||
tests: | ||
- label: "Create OTA image" | ||
cluster: "SystemCommands" | ||
command: "CreateOtaImage" | ||
arguments: | ||
values: | ||
- name: "otaImageFilePath" | ||
value: otaImageFilePath | ||
- name: "rawImageFilePath" | ||
value: rawImageFilePath | ||
- name: "rawImageContent" | ||
value: rawImageContent | ||
|
||
- label: "Start the provider with an image" | ||
cluster: "SystemCommands" | ||
command: "Start" | ||
arguments: | ||
values: | ||
- name: "registerKey" | ||
value: "chip-ota-provider-app" | ||
- name: "discriminator" | ||
value: providerDiscriminator | ||
- name: "port" | ||
value: providerPort | ||
- name: "kvs" | ||
value: providerKvs | ||
- name: "filepath" | ||
value: otaImageFilePath | ||
|
||
- label: "Commission the provider from alpha" | ||
identity: "alpha" | ||
cluster: "CommissionerCommands" | ||
command: "PairWithQRCode" | ||
arguments: | ||
values: | ||
- name: "nodeId" | ||
value: providerNodeId | ||
- name: "payload" | ||
value: providerPayload | ||
|
||
- label: "Wait for the commissioned provider to be retrieved for alpha" | ||
identity: "alpha" | ||
cluster: "DelayCommands" | ||
command: "WaitForCommissionee" | ||
arguments: | ||
values: | ||
- name: "nodeId" | ||
value: providerNodeId | ||
|
||
- label: "Install ACL for QueryImage" | ||
cluster: "Access Control" | ||
command: "writeAttribute" | ||
attribute: "ACL" | ||
arguments: | ||
value: [ | ||
# Grant administer privilege to the default controller node ID 112233 | ||
{ | ||
FabricIndex: 1, | ||
Privilege: 5, | ||
AuthMode: 2, | ||
Subjects: [112233], | ||
Targets: null, | ||
}, | ||
# Grant operate privileges to all nodes for the OTA Provider cluster on every endpoint | ||
{ | ||
FabricIndex: 1, | ||
Privilege: 3, | ||
AuthMode: 2, | ||
Subjects: null, | ||
Targets: null, | ||
[{ Cluster: 41, Endpoint: null, DeviceType: null }], | ||
}, | ||
] | ||
|
||
- label: "Stop the requestor" | ||
cluster: "SystemCommands" | ||
command: "Stop" | ||
|
||
- label: "Start the requestor with an OTA download path" | ||
cluster: "SystemCommands" | ||
command: "Start" | ||
arguments: | ||
values: | ||
- name: "otaDownloadPath" | ||
value: downloadImageFilePath | ||
|
||
- label: "Wait for the commissioned requestor to be retrieved for alpha" | ||
identity: "alpha" | ||
cluster: "DelayCommands" | ||
command: "WaitForCommissionee" | ||
arguments: | ||
values: | ||
- name: "nodeId" | ||
value: requestorNodeId | ||
|
||
- label: "Send an announce OTA provider command to the requestor" | ||
cluster: "OTA Software Update Requestor" | ||
command: "AnnounceOtaProvider" | ||
arguments: | ||
values: | ||
- name: "providerNodeId" | ||
value: providerNodeId | ||
- name: "vendorId" | ||
value: 0 | ||
- name: "announcementReason" | ||
value: 0 | ||
- name: "endpoint" | ||
value: endpoint | ||
|
||
- label: "Wait for transfer complete message" | ||
cluster: "DelayCommands" | ||
command: "WaitForMessage" | ||
arguments: | ||
values: | ||
- name: "registerKey" | ||
value: "default" | ||
- name: "message" | ||
value: "OTA image downloaded" | ||
|
||
- label: "Compare original file to downloaded file" | ||
cluster: "SystemCommands" | ||
command: "CompareFiles" | ||
arguments: | ||
values: | ||
- name: "file1" | ||
value: rawImageFilePath | ||
- name: "file2" | ||
value: downloadImageFilePath |
Oops, something went wrong.