diff --git a/examples/darwin-framework-tool/templates/tests/ciTests.json b/examples/darwin-framework-tool/templates/tests/ciTests.json index bf7fcca70ce307..db8f7f38dd88fb 100644 --- a/examples/darwin-framework-tool/templates/tests/ciTests.json +++ b/examples/darwin-framework-tool/templates/tests/ciTests.json @@ -1,7 +1,7 @@ { "include": "../../../../src/app/tests/suites/ciTests.json", "disable": [ - "Test_TC_SC_4_2", + "Test_TC_SC_4_1", "Test_TC_SC_5_2", "TestClusterComplexTypes", "TestEvents", @@ -33,8 +33,11 @@ "DL_LockUnlock", "Disabled due to using ICD Management (ICDManagement) cluster, which is provisional on Darwin for now:", "TestIcdManagementCluster", + "Test_TC_ICDM_1_1", + "Test_TC_ICDM_2_1", "Disabled due to using Time Synchronization (TimeSynchronization) cluster, which is provisional on Darwin for now:", "Test_TC_TIMESYNC_1_1", + "Test_TC_TIMESYNC_2_3", "TestTimeSynchronization", "Disabled due to using provisional Ceramic Filter Monitoring (CeramicFilterMonitoring) cluster:", "Test_TC_CFREMON_1_1", diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index b493c4c9d56371..1f824e9e29a2eb 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -134,6 +134,7 @@ def _GetInDevelopmentTests() -> Set[str]: "TestEqualities.yaml", # chip-repl does not support pseudo-cluster commands that return a value "TestExampleCluster.yaml", # chip-repl does not load custom pseudo clusters "Test_TC_TIMESYNC_1_1.yaml", # Time sync SDK is not yet ready + "Test_TC_TIMESYNC_2_3.yaml", # Time sync SDK is not yet ready "TestAttributesById.yaml", # chip-repl does not support AnyCommands (06/06/2023) "TestCommandsById.yaml", # chip-repl does not support AnyCommands (06/06/2023) "TestEventsById.yaml", # chip-repl does not support AnyCommands (06/06/2023) diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index c7948d14eb96b3..82d7d55a1ff0ea 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -9463,3 +9463,76 @@ PICS: # - label: "Does the device implement receiving the Step command?" id: FAN.S.C00.Rsp + + #ICD Management + # + # Server Attribute + # + - label: "Does the device implement the IdleModeInterval attribute?" + id: ICDM.S.A0000 + + - label: "Does the device implement the ActiveModeInterval attribute?" + id: ICDM.S.A0001 + + - label: "Does the device implement the ActiveModeThreshold attribute?" + id: ICDM.S.A0002 + + - label: "Does the device implement the RegisteredClients attribute?" + id: ICDM.S.A0003 + + - label: "Does the device implement the IcdCounter attribute?" + id: ICDM.S.A0004 + + - label: + "Does the device implement the ClientsSupportedPerFabric attribute?" + id: ICDM.S.A0005 + + # + # Features + # + - label: "Does the device support this specific cluster feature?" + id: ICDM.S.F00 + + # + #Commands: + # + - label: + "Does the device implement receiving the StayActiveRequest command?" + id: ICDM.S.C03.Rsp + + # + #RVC Clean Mode Select + # + #Feature + - label: + "Does the device support depending on an On/Off cluster implemented on + the same DUT?" + id: RVCCLEANMS.S.F00 + + - label: "Does the device support the extended status feature?" + id: RVCCLEANMS.S.F01 + + - label: + "Does the device implementation deprecate the ChangeToMode command?" + id: RVCCLEANMS.S.F02 + + #Server Attributes + - label: "Does the device implement the StartUpMode attribute?" + id: RVCCLEANMS.S.A0004 + + - label: "Does the device implement the OnMode attribute?" + id: RVCCLEANMS.S.A0005 + + #Server Commands recived + - label: "Does the device implement receiving the ChangeToMode command?" + id: RVCCLEANMS.S.C00.Rsp + + - label: + "Does the device implement receiving the ChangeToModeWithStatus + command?" + id: RVCCLEANMS.S.C01.Rsp + + #server commands generated + - label: + "Does the device implement sending the ChangeToModeResponse command?" + id: RVCCLEANMS.S.C03.Tx diff --git a/src/app/tests/suites/certification/Test_TC_ACE_1_6.yaml b/src/app/tests/suites/certification/Test_TC_ACE_1_6.yaml index d241d40ab6f720..833d95d3750509 100644 --- a/src/app/tests/suites/certification/Test_TC_ACE_1_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACE_1_6.yaml @@ -219,10 +219,10 @@ tests: Manage privileges for group 0x0103 and maintain the current administrative privileges for the TH on the Access Control cluster. The following access control list shall be used: List item 1 (TH - admin): Privilege: Administer (5) AuthMode: CASE (2) Subjects: [N1] - Targets: [{Cluster: AccessControl (0x001f), Endpoint: 0}] List item 2 - (group Manage access): Privilege: Manage (4) AuthMode: Group (3) - Subjects: group 0x0103 ([0x0103]) Targets: {Cluster: Groups (0x001d), + admin): Privilege: Administer (5), AuthMode: CASE (2), Subjects: [N1], + Targets: [{Cluster: AccessControl (0x001f), Endpoint: 0}]. List item 2 + (group Manage access): Privilege: Manage (4), AuthMode: Group (3), + Subjects: group 0x0103 ([0x0103]), Targets: {Cluster: Groups (0x0004), Endpoint: PIXIT.G.ENDPOINT}" verification: | ./chip-tool accesscontrol write acl '[{ "privilege": 5, "authMode": 2, "subjects": [112233], "targets": [{ "cluster": 31, "endpoint": 0, "deviceType": null }]},{ "privilege": 4, "authMode": 3, "subjects": [259], "targets": [{ "cluster": 4, "endpoint": 0, "deviceType": null }]}]' 1 0 diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_1.yaml index d4840d4a7d47d4..0da5eb815e658a 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_6_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_6_1.yaml @@ -23,6 +23,9 @@ config: nodeId: 0x12344321 cluster: "Color Control" endpoint: 1 + ConfigWait: + type: int16u + defaultValue: 5000 tests: - label: "Wait for the commissioned device to be retrieved" @@ -215,6 +218,14 @@ tests: cluster: "On/Off" command: "Off" + - label: "Wait to turn Off light" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: ConfigWait + - label: "Check on/off attribute value is false after off command" cluster: "On/Off" command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml index b4367c0b104d45..6cd718241c1607 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_6_2.yaml @@ -22,6 +22,9 @@ config: nodeId: 0x12344321 cluster: "Color Control" endpoint: 1 + ConfigWait: + type: int16u + defaultValue: 5000 tests: - label: "Wait for the commissioned device to be retrieved" @@ -367,6 +370,14 @@ tests: cluster: "On/Off" command: "Off" + - label: "Wait to turn Off light" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: ConfigWait + - label: "Check on/off attribute value is false after off command" cluster: "On/Off" command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml index 64f22a5932f413..967f44230e2714 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_6_3.yaml @@ -22,6 +22,9 @@ config: nodeId: 0x12344321 cluster: "Color Control" endpoint: 1 + ConfigWait: + type: int16u + defaultValue: 5000 tests: - label: "Wait for the commissioned device to be retrieved" @@ -289,6 +292,14 @@ tests: cluster: "On/Off" command: "Off" + - label: "Wait to turn Off light" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: ConfigWait + - label: "Check on/off attribute value is false after off command" cluster: "On/Off" command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_CC_6_5.yaml b/src/app/tests/suites/certification/Test_TC_CC_6_5.yaml index 438cb1312a07c4..951d77b28d7d86 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_6_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_6_5.yaml @@ -23,6 +23,9 @@ config: nodeId: 0x12344321 cluster: "Color Control" endpoint: 1 + ConfigWait: + type: int16u + defaultValue: 5000 tests: - label: "Wait for the commissioned device to be retrieved" @@ -91,6 +94,8 @@ tests: verification: | ./chip-tool colorcontrol write start-up-color-temperature-mireds 32639 1 1 + Verify DUT responds with a successful (value 0x00) status response On TH(chip-tool) Log and below is the sample log provided for the raspi platform + [1684869285516] [29746:343264] [DMG] WriteResponseMessage = [1684869285516] [29746:343264] [DMG] { [1684869285516] [29746:343264] [DMG] AttributeStatusIBs = @@ -211,3 +216,24 @@ tests: constraints: minValue: 0 maxValue: 3 + + - label: "Turn Off light that we turned on" + PICS: OO.S.C00.Rsp + cluster: "On/Off" + command: "Off" + + - label: "Wait to turn Off light" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: ConfigWait + + - label: "Check on/off attribute value is false after off command" + cluster: "On/Off" + command: "readAttribute" + attribute: "OnOff" + PICS: OO.S.A0000 + response: + value: 0 diff --git a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_3.yaml b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_3.yaml index 99920cfb23a99c..2932c6c0f0084e 100644 --- a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_3.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -11,47 +11,136 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 3.12.2. [TC-CONTENTLAUNCHER-10.3] Launch Content Verification +name: 19.12.2. [TC-CONTENTLAUNCHER-10.3] Launch Content Verification PICS: - CONTENTLAUNCHER.S config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Content Launcher" + endpoint: 1 + data: + type: char_string + defaultValue: "exampleData" + SearchValue: + type: char_string + defaultValue: "exampleValue" + ExternalIdName: + type: char_string + defaultValue: "name" + ExternalIdValue: + type: char_string + defaultValue: "value" tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + - label: "TH sends a LaunchContent command to the DUT with a search parameter and string, and AutoPlay flag set to false" PICS: CONTENTLAUNCHER.S.C00.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 0, "value": "exampleString", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 0, "value": "exampleString", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - - On TH verify the success response (value 0) received from DUT - [1651062794.114531][157317:157322] CHIP:TOO: LaunchResponse: { - [1651062794.114546][157317:157322] CHIP:TOO: status: 0 - [1651062794.114553][157317:157322] CHIP:TOO: data: exampleData - [1651062794.114560][157317:157322] CHIP:TOO: } - disabled: true + command: "LaunchContent" + arguments: + values: + - name: "AutoPlay" + value: false + - name: "Data" + value: data + - name: "Search" + value: + { + ParameterList: + [ + { + Type: 0, + Value: SearchValue, + ExternalIDList: + [ + { + Name: ExternalIdName, + Value: ExternalIdValue, + }, + ], + }, + ], + } + response: + values: + - name: "Data" + value: data + - name: "Status" + value: 0 + + - label: + "Verify that DUT present via its user interface a list of matches + based on the provided search criteria." + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp + arguments: + values: + - name: "message" + value: + "Please enter 'y' if DUT present via its user interface a + list of matches based on the provided search criteria." + - name: "expectedValue" + value: "y" - label: "TH sends a LaunchContent command to the DUT with a search parameter and string, and AutoPlay flag set to true" PICS: CONTENTLAUNCHER.S.C00.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 0, "value": "exampleString", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 1 1 1 - ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 0, "value": "exampleString", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 1 1 1 - - On TH verify the success response (value 0) received from DUT - [1651062895.695667][157343:157348] CHIP:TOO: LaunchResponse: { - [1651062895.695703][157343:157348] CHIP:TOO: status: 0 - [1651062895.695724][157343:157348] CHIP:TOO: data: exampleData - [1651062895.695746][157343:157348] CHIP:TOO: } - disabled: true + command: "LaunchContent" + arguments: + values: + - name: "AutoPlay" + value: true + - name: "Data" + value: data + - name: "Search" + value: + { + ParameterList: + [ + { + Type: 0, + Value: SearchValue, + ExternalIDList: + [ + { + Name: ExternalIdName, + Value: ExternalIdValue, + }, + ], + }, + ], + } + response: + values: + - name: "Data" + value: data + - name: "Status" + value: 0 + + - label: + "Verify that DUT should also begin playing content that best matched + the given search criteria" + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp + arguments: + values: + - name: "message" + value: + "Please enter 'y' if DUT begin playing content that best + matched the given search criteria" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_5.yaml b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_5.yaml index f5d728caa08758..3faa520e477f5f 100644 --- a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_5.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -11,146 +11,166 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 3.12.4. [TC-CONTENTLAUNCHER-10.5] Launch URL Verification +name: 19.12.4. [TC-CONTENTLAUNCHER-10.5] Launch URL Verification PICS: - CONTENTLAUNCHER.S config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Content Launcher" + endpoint: 1 + GoodURL: + type: char_string + defaultValue: "https://csa-iot.org/" + BadURL: + type: char_string + defaultValue: "https://badurl" + UnauthorizedURL: + type: char_string + defaultValue: "https://csa-iot.org/badauth" + DisplayContent: + type: char_string + defaultValue: "exampleData" + providerNameString: + type: char_string + defaultValue: "exampleName" tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + - label: "TH sends a LaunchURL command to the DUT with a known good content URL string" PICS: CONTENTLAUNCHER.S.C01.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool contentlauncher launch-url "exampleUrl" '{"providerName": "exampleName", "background": { "color": "blue", "size" : {"width": 1.0, "height": 1.0, "metric": 0} }}' 1 1 - ./chip-tv-casting-app contentlauncher launch-url "exampleUrl" '{"providerName": "exampleName", "background": { "color": "blue", "size" : {"width": 1.0, "height": 1.0, "metric": 0} }}' 1 1 - - On TH verify the success response (value 0) received from DUT - - [1678789736.472050][327646:327648] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_050A Command=0x0000_0002 - [1678789736.472076][327646:327648] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002 - [1678789736.472108][327646:327648] CHIP:TOO: LauncherResponse: { - [1678789736.472137][327646:327648] CHIP:TOO: status: 0 - [1678789736.472147][327646:327648] CHIP:TOO: data: exampleData - [1678789736.472156][327646:327648] CHIP:TOO: } - [1678789736.472184][327646:327648] CHIP:DMG: ICR moving to [AwaitingDe] - - - Example tv-app log file shows receipt of launchurl command: - [1678789736.471351][324821:324821] CHIP:ZCL: ContentLauncherManager::HandleLaunchUrl TEST CASE ContentURL=exampleUrl DisplayString= BrandingInformation.ProviderName=exampleName - disabled: true + command: "LaunchURL" + arguments: + values: + - name: "ContentURL" + value: GoodURL + - name: "BrandingInformation" + value: { ProviderName: providerNameString } + response: + values: + - name: "Status" + value: 0 + + - label: "Verify that DUT launched the content at the given URL" + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp + arguments: + values: + - name: "message" + value: + "Please enter 'y' if DUT launched the content at the given + URL" + - name: "expectedValue" + value: "y" - label: "TH sends a LaunchURL command to the DUT with a known good content URL string and a display string" PICS: CONTENTLAUNCHER.S.C01.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool contentlauncher launch-url "https://csa-iot.org/" '{"providerName": "exampleName", "background": {"color": "blue", "size" : {"width": 1.0, "height": 1.0, "metric": 0} }}' 1 1 --DisplayString "Custom Display String" - ./chip-tv-casting-app contentlauncher launch-url "https://csa-iot.org/" '{"providerName": "exampleName", "background": {"color": "blue", "size" : {"width": 1.0, "height": 1.0, "metric": 0} }}' 1 1 --DisplayString "Custom Display String" + command: "LaunchURL" + arguments: + values: + - name: "ContentURL" + value: GoodURL + - name: "DisplayString" + value: DisplayContent + - name: "BrandingInformation" + value: { ProviderName: providerNameString } + response: + values: + - name: "Data" + value: DisplayContent + - name: "Status" + value: 0 - On TH verify the success response (value 0) received from DUT - [1678789892.544748][327789:327791] CHIP:DMG: }, - [1678789892.544778][327789:327791] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_050A Command=0x0000_0002 - [1678789892.544785][327789:327791] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002 - [1678789892.544800][327789:327791] CHIP:TOO: LauncherResponse: { - [1678789892.544806][327789:327791] CHIP:TOO: status: 0 - [1678789892.544809][327789:327791] CHIP:TOO: data: exampleData - [1678789892.544811][327789:327791] CHIP:TOO: } - [1678789892.544816][327789:327791] CHIP:DMG: ICR moving to [AwaitingDe] - [1678789892.544827][327789:327791] CHIP:EM: <<< [E:5462i S:11532 M:235261867 (Ack:223833241)] (S) Msg TX to 1:0000000000000001 [67DC] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1678789892.544831][327789:327791] CHIP:IN: (S) Sending msg 235261867 on secure session with LSID: 11532 - - - - Example tv-app log file shows receipt of launchurl command: - [1678789892.544284][324821:324821] CHIP:ZCL: ContentLauncherManager::HandleLaunchUrl TEST CASE ContentURL=https://csa-iot.org/ DisplayString=Custom Display String BrandingInformation.ProviderName=exampleName - disabled: true + - label: + "Verify that DUT launched the content at the given URL with the given + display string in the application-specific description area" + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp + arguments: + values: + - name: "message" + value: + "Please enter 'y' if DUT launched the content at the given + URL with the given display string in the + application-specific description area" + - name: "expectedValue" + value: "y" - label: "TH sends a LaunchURL command to the DUT with a known good content URL string and a brand information object." PICS: CONTENTLAUNCHER.S.C01.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool contentlauncher launch-url "https://csa-iot.org/" '{"providerName": "exampleName", "background": {"color": "blue", "size" : {"width": 1.0, "height": 1.0, "metric": 0} }}' 1 1 - ./chip-tv-casting-app contentlauncher launch-url "https://csa-iot.org/" '{"providerName": "exampleName", "background": { "color": "blue", "size" : {"width": 1.0, "height": 1.0, "metric": 0} }}' 1 1 + command: "LaunchURL" + arguments: + values: + - name: "ContentURL" + value: GoodURL + - name: "BrandingInformation" + value: { ProviderName: providerNameString } + response: + values: + - name: "Status" + value: 0 - On TH verify the success response (value 0) received from DUT - [1678789976.395074][327809:327811] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_050A Command=0x0000_0002 - [1678789976.395083][327809:327811] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002 - [1678789976.395095][327809:327811] CHIP:TOO: LauncherResponse: { - [1678789976.395106][327809:327811] CHIP:TOO: status: 0 - [1678789976.395109][327809:327811] CHIP:TOO: data: exampleData - [1678789976.395112][327809:327811] CHIP:TOO: } - [1678789976.395120][327809:327811] CHIP:DMG: ICR moving to [AwaitingDe] - - - - Example tv-app log file shows receipt of launchurl command: - [1678789976.394509][324821:324821] CHIP:ZCL: ContentLauncherManager::HandleLaunchUrl TEST CASE ContentURL=https://csa-iot.org/ DisplayString= BrandingInformation.ProviderName=exampleName - disabled: true + - label: + "Verify that DUT launched the content at the given URL with the player + interface updated as per the provided branding information" + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp + arguments: + values: + - name: "message" + value: + "Please enter 'y' if DUT launched the content at the given + URL with the player interface updated as per the provided + branding information" + - name: "expectedValue" + value: "y" - label: "TH sends a LaunchURL command to the DUT with a known unreachable content URL string." PICS: CONTENTLAUNCHER.S.C01.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool contentlauncher launch-url "https://badurl" '{"providerName": "exampleName", "background": { "color": "blue", "size" : {"width": 1.0, "height": 1.0, "metric": 0} }}' 1 1 - ./chip-tv-casting-app contentlauncher launch-url "https://badurl" '{"providerName": "exampleName", "background": {"color": "blue", "size" : {"width": 1.0, "height": 1.0, "metric": 0} }}' 1 1 - - On TH verify the success response (value 0) received from DUT - [1678790057.261934][327869:327871] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_050A Command=0x0000_0002 - [1678790057.261963][327869:327871] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002 - [1678790057.261997][327869:327871] CHIP:TOO: LauncherResponse: { - [1678790057.262025][327869:327871] CHIP:TOO: status: 1 - [1678790057.262035][327869:327871] CHIP:TOO: data: exampleData - [1678790057.262045][327869:327871] CHIP:TOO: } - [1678790057.262072][327869:327871] CHIP:DMG: ICR moving to [AwaitingDe] - [1678790057.262115][327869:327871] CHIP:EM: <<< [E:61104i S:23930 M:82030218 (Ack:133196816)] (S) Msg TX to 1:0000000000000001 [67DC] --- Type 0000:10 (SecureChannel:StandaloneAck) - - Example tv-app log file shows receipt of launchurl command: - [1678790092.751184][324821:324821] CHIP:ZCL: Content Launcher NOT returning ContentApp delegate for endpoint:1 - [1678790092.751199][324821:324821] CHIP:ZCL: ContentLauncherManager::HandleLaunchUrl - [1678790092.751206][324821:324821] CHIP:ZCL: ContentLauncherManager::HandleLaunchUrl TEST CASE ContentURL=https://badurl DisplayString= BrandingInformation.ProviderName=exampleName - [1678790092.751223][324821:324821] CHIP:DMG: Command handler moving to [ Preparing] - disabled: true + command: "LaunchURL" + arguments: + values: + - name: "ContentURL" + value: BadURL + - name: "BrandingInformation" + value: { ProviderName: providerNameString } + response: + values: + - name: "Status" + value: 1 #URL_NOT_AVAILABLE - label: "TH sends a LaunchURL command to the DUT with a known un-authorized content URL string." PICS: CONTENTLAUNCHER.S.C01.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool contentlauncher launch-url "https://csa-iot.org/badauth" '{"providerName": "exampleName", "background": {"color": "blue", "size" : {"width": 1.0, "height": 1.0, "metric": 0} }}' 1 1 - ./chip-tv-casting-app contentlauncher launch-url "https://csa-iot.org/badauth" '{"providerName": "exampleName", "background": { "color": "blue", "size" : {"width": 1.0, "height": 1.0, "metric": 0} }}' 1 1 - - On TH verify the success response (value 0) received from DUT - [1678790163.014868][327910:327912] CHIP:DMG: }, - [1678790163.014878][327910:327912] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_050A Command=0x0000_0002 - [1678790163.014885][327910:327912] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002 - [1678790163.014894][327910:327912] CHIP:TOO: LauncherResponse: { - [1678790163.014903][327910:327912] CHIP:TOO: status: 2 - [1678790163.014905][327910:327912] CHIP:TOO: data: exampleData - [1678790163.014908][327910:327912] CHIP:TOO: } - [1678790163.014912][327910:327912] CHIP:DMG: ICR moving to [AwaitingDe] - [1678790163.014926][327910:327912] CHIP:EM: <<< [E:6864i S:36983 M:190033825 (Ack:105150405)] (S) Msg TX to 1:0000000000000001 [67DC] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1678790163.014930][327910:327912] CHIP:IN: (S) Sending msg 190033825 on secure session with LSID: 36983 - - - Example tv-app log file shows receipt of launchurl command: - [1678790163.014705][324821:324821] CHIP:DL: GetContentAppByEndpointId() - endpoint 1 not found - [1678790163.014707][324821:324821] CHIP:ZCL: Content Launcher NOT returning ContentApp delegate for endpoint:1 - [1678790163.014711][324821:324821] CHIP:ZCL: ContentLauncherManager::HandleLaunchUrl - [1678790163.014713][324821:324821] CHIP:ZCL: ContentLauncherManager::HandleLaunchUrl TEST CASE ContentURL=https://csa-iot.org/badauth DisplayString= BrandingInformation.ProviderName=exampleName - [1678790163.014719][324821:324821] CHIP:DMG: Command handler moving to [ Preparing] - disabled: true + command: "LaunchURL" + arguments: + values: + - name: "ContentURL" + value: UnauthorizedURL + - name: "BrandingInformation" + value: { ProviderName: providerNameString } + response: + values: + - name: "Status" + value: 2 #AUTH_FAILED diff --git a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_7.yaml b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_7.yaml index 7c4aa59c6f86a6..eff9299eff511f 100644 --- a/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_CONTENTLAUNCHER_10_7.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -11,303 +11,401 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 3.12.6. [TC-CONTENTLAUNCHER-10.7] Content Search Verification +name: 19.12.6. [TC-CONTENTLAUNCHER-10.7] Content Search Verification PICS: - CONTENTLAUNCHER.S config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Content Launcher" + endpoint: 1 + PopularityName: + type: char_string + defaultValue: "popular content" tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + - label: "TH sends a LaunchContent command to the DUT with search parameter - consisting of Type As 'Actor' and Value as An Actors name, for - example, Gaby sHoffman" + consisting of Type As Actor and Value as An Actor’s name, for example, + Gaby sHoffman" PICS: CONTENTLAUNCHER.S.C00.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 0, "value": "Gaby sHoffman", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 0, "value": "Gaby sHoffman", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - - On TH verify the success response (value 0) received from DUT - [1651225059.893636][4190:4195] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002 - [1651225059.893741][4190:4195] CHIP:TOO: LaunchResponse: { - [1651225059.893814][4190:4195] CHIP:TOO: status: 0 - [1651225059.893869][4190:4195] CHIP:TOO: data: exampleData - [1651225059.893924][4190:4195] CHIP:TOO: } - - tv-app DUT shows matches via console: - - [1653236823721] [74577:2234439] CHIP: [ZCL] TEST CASE found match=TV Show Example type=0 - disabled: true + command: "LaunchContent" + arguments: + values: + - name: "AutoPlay" + value: true + - name: "Search" + value: { ParameterList: [{ Type: 0, Value: "Gaby sHoffman" }] } + response: + values: + - name: "Status" + value: 0 + + - label: "Verify that DUT should play or display the search result." + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp + arguments: + values: + - name: "message" + value: + "Please enter 'y' if DUT play or display the search result." + - name: "expectedValue" + value: "y" - label: "TH sends a LaunchContent command to the DUT with search parameter - consisting of Type As 'Channel' and Value as Channel Name name, for - example, 'PBS'" + consisting of Type As Channel and Value as Channel Name name, for + example, PBS" PICS: CONTENTLAUNCHER.S.C00.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 1, "value": "PBS", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 1, "value": "PBS", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - - On TH verify the success response (value 0) received from DUT - [1651225141.737648][4203:4209] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002 - [1651225141.737778][4203:4209] CHIP:TOO: LaunchResponse: { - [1651225141.737854][4203:4209] CHIP:TOO: status: 0 - [1651225141.737936][4203:4209] CHIP:TOO: data: exampleData - [1651225141.737994][4203:4209] CHIP:TOO: } - - tv-app DUT shows matches via console: - - [1653236823721] [74577:2234439] CHIP: [ZCL] TEST CASE found match=TV Show Example type=1 - disabled: true + command: "LaunchContent" + arguments: + values: + - name: "AutoPlay" + value: true + - name: "Search" + value: { ParameterList: [{ Type: 1, Value: "PBS" }] } + response: + values: + - name: "Status" + value: 0 + + - label: "Verify that DUT should play or display the search result." + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp + arguments: + values: + - name: "message" + value: + "Please enter 'y' if DUT play or display the search result." + - name: "expectedValue" + value: "y" - label: "TH sends a LaunchContent command to the DUT with search parameter - consisting of Type As 'Character' and Value as Characters name,for - example, Snow White" + consisting of Type As Character and Value as Character’s name,for + example,Snow White" PICS: CONTENTLAUNCHER.S.C00.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 2, "value": "Snow White", "externalIDList": [ { "name": "foo", "value": "2"} ] } ] }' 0 1 1 - ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 2, "value": "Snow White", "externalIDList": [ { "name": "foo", "value": "2"} ] } ] }' 0 1 1 - - On TH verify the success response (value 0) received from DUT - [1651578539.231066][9699:9704] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002 - [1651578539.231135][9699:9704] CHIP:TOO: LaunchResponse: { - [1651578539.231184][9699:9704] CHIP:TOO: status: 0 - [1651578539.231214][9699:9704] CHIP:TOO: data: exampleData - [1651578539.231247][9699:9704] CHIP:TOO: } - - tv-app DUT shows matches via console: - - [1653236823721] [74577:2234439] CHIP: [ZCL] TEST CASE found match=TV Show Example type=2 - disabled: true + command: "LaunchContent" + arguments: + values: + - name: "AutoPlay" + value: false + - name: "Search" + value: { ParameterList: [{ Type: 2, Value: "Snow White" }] } + response: + values: + - name: "Status" + value: 0 + + - label: "Verify that DUT should play or display the search result." + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp + arguments: + values: + - name: "message" + value: + "Please enter 'y' if DUT play or display the search result." + - name: "expectedValue" + value: "y" - label: "TH sends a LaunchContent command to the DUT with search parameter - consisting of Type As 'Director' and Value as Directors name, for + consisting of Type As Director and Value as Director’s name, for example, Spike Lee" PICS: CONTENTLAUNCHER.S.C00.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 3, "value": "Spike Lee", "externalIDList": [ { "name": "Spike Lee", "value": "3"} ] } ] }' 0 1 1 - ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 3, "value": "Spike Lee", "externalIDList": [ { "name": "Spike Lee", "value": "3"} ] } ] }' 0 1 1 - - On TH verify the success response (value 0) received from DUT - [1651578561.129609][9706:9711] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002 - [1651578561.129678][9706:9711] CHIP:TOO: LaunchResponse: { - [1651578561.129725][9706:9711] CHIP:TOO: status: 0 - [1651578561.129760][9706:9711] CHIP:TOO: data: exampleData - [1651578561.129796][9706:9711] CHIP:TOO: } - - tv-app DUT shows matches via console: - - [1653236823721] [74577:2234439] CHIP: [ZCL] TEST CASE found match=TV Show Example type=3 - disabled: true + command: "LaunchContent" + arguments: + values: + - name: "AutoPlay" + value: true + - name: "Search" + value: { ParameterList: [{ Type: 3, Value: "Spike Lee" }] } + response: + values: + - name: "Status" + value: 0 + + - label: "Verify that DUT should play or display the search result." + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp + arguments: + values: + - name: "message" + value: + "Please enter 'y' if DUT play or display the search result." + - name: "expectedValue" + value: "y" - label: "TH sends a LaunchContent command to the DUT with search parameter - consisting of Type As 'Event' and Value as An Events name , for - example 'Football games'" + consisting of Type As Event and Value as An Event’s name , for example + Football games" PICS: CONTENTLAUNCHER.S.C00.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 4, "value": "Football games", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 4, "value": "Football games", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - - On TH verify the success response (value 0) received from DUT - [1651578612.348295][9717:9722] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002 - [1651578612.348350][9717:9722] CHIP:TOO: LaunchResponse: { - [1651578612.348388][9717:9722] CHIP:TOO: status: 0 - [1651578612.348413][9717:9722] CHIP:TOO: data: exampleData - [1651578612.348437][9717:9722] CHIP:TOO: } - - tv-app DUT shows matches via console: - - [1653236636669] [74577:2229859] CHIP: [ZCL] TEST CASE found match=Sports Example type=4 - disabled: true + command: "LaunchContent" + arguments: + values: + - name: "AutoPlay" + value: true + - name: "Search" + value: { ParameterList: [{ Type: 4, Value: "Football games" }] } + response: + values: + - name: "Status" + value: 0 + + - label: "Verify that DUT should play or display the search result." + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp + arguments: + values: + - name: "message" + value: + "Please enter 'y' if DUT play or display the search result." + - name: "expectedValue" + value: "y" - label: "TH sends a LaunchContent command to the DUT with search parameter - consisting of Type As 'Franchise' and Value as Franchises name,for - example 'Star Wars'" + consisting of Type As Franchise and Value as Franchise’s name,for + example Star Wars" PICS: CONTENTLAUNCHER.S.C00.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 5, "value": "Star Wars", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 5, "value": "Star Wars", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - - On TH verify the success response (value 0) received from DUT - - [1651578634.392516][9725:9730] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002 - [1651578634.392581][9725:9730] CHIP:TOO: LaunchResponse: { - [1651578634.392629][9725:9730] CHIP:TOO: status: 0 - [1651578634.392662][9725:9730] CHIP:TOO: data: exampleData - [1651578634.392694][9725:9730] CHIP:TOO: } - - tv-app DUT shows matches via console: - - [1653236823721] [74577:2234439] CHIP: [ZCL] TEST CASE found match=TV Show Example type=5 - disabled: true + command: "LaunchContent" + arguments: + values: + - name: "AutoPlay" + value: true + - name: "Search" + value: { ParameterList: [{ Type: 5, Value: "Star Wars" }] } + response: + values: + - name: "Status" + value: 0 + + - label: "Verify that DUT should play or display the search result." + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp + arguments: + values: + - name: "message" + value: + "Please enter 'y' if DUT play or display the search result." + - name: "expectedValue" + value: "y" - label: "TH sends a LaunchContent command to the DUT with search parameter - consisting of Type As 'Genre' and Value as Genres name, for example - 'Horror'" + consisting of Type As Genre and Value as Genre’s name, for example + Horror" PICS: CONTENTLAUNCHER.S.C00.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 6, "value": "Horror", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 6, "value": "Horror", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - - On TH verify the success response (value 0) received from DUT - [1652091775.613303][9916:9922] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_050A Command=0x0000_0002 - [1652091775.613395][9916:9922] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002 - [1652091775.613490][9916:9922] CHIP:TOO: LaunchResponse: { - [1652091775.613578][9916:9922] CHIP:TOO: status: 0 - [1652091775.613620][9916:9922] CHIP:TOO: data: exampleData - [1652091775.613661][9916:9922] CHIP:TOO: } - - tv-app DUT shows matches via console: - - [1653236823721] [74577:2234439] CHIP: [ZCL] TEST CASE found match=TV Show Example type=6 - disabled: true + command: "LaunchContent" + arguments: + values: + - name: "AutoPlay" + value: true + - name: "Search" + value: { ParameterList: [{ Type: 6, Value: "Horror" }] } + response: + values: + - name: "Status" + value: 0 + + - label: "Verify that DUT should play or display the search result." + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp + arguments: + values: + - name: "message" + value: + "Please enter 'y' if DUT play or display the search result." + - name: "expectedValue" + value: "y" - label: "TH sends a LaunchContent command to the DUT with search parameter - consisting of Type As 'League' and Value as Leagues name, for example - 'NCAA'" + consisting of Type As League and Value as League’s name, for example + NCAA" PICS: CONTENTLAUNCHER.S.C00.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 7, "value": "NCAA", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 7, "value": "NCAA", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - - On TH verify the success response (value 0) received from DUT - - [1651578662.336318][9733:9738] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002 - [1651578662.336370][9733:9738] CHIP:TOO: LaunchResponse: { - [1651578662.336479][9733:9738] CHIP:TOO: status: 0 - [1651578662.336505][9733:9738] CHIP:TOO: data: exampleData - [1651578662.336526][9733:9738] CHIP:TOO: } - - tv-app DUT shows matches via console: - - [1653236636669] [74577:2229859] CHIP: [ZCL] TEST CASE found match=Sports Example type=7 - disabled: true + command: "LaunchContent" + arguments: + values: + - name: "AutoPlay" + value: true + - name: "Search" + value: { ParameterList: [{ Type: 7, Value: "NCAA" }] } + response: + values: + - name: "Status" + value: 0 + + - label: "Verify that DUT should play or display the search result." + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp + arguments: + values: + - name: "message" + value: + "Please enter 'y' if DUT play or display the search result." + - name: "expectedValue" + value: "y" - label: "TH sends a LaunchContent command to the DUT with search parameter - consisting of Type As 'Popularity' and Value as Popularitys name" + consisting of Type As Popularity and Value as Popularity’s name" PICS: CONTENTLAUNCHER.S.C00.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 8, "value": "Popularity", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 8, "value": "Popularity", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - - On TH verify the success response (value 0) received from DUT - [1651578680.236952][9740:9745] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002 - [1651578680.237036][9740:9745] CHIP:TOO: LaunchResponse: { - [1651578680.237093][9740:9745] CHIP:TOO: status: 0 - [1651578680.237135][9740:9745] CHIP:TOO: data: exampleData - [1651578680.237176][9740:9745] CHIP:TOO: } - - tv-app DUT shows matches via console: - - [1653236823721] [74577:2234439] CHIP: [ZCL] TEST CASE found match=TV Show Example type=8 - disabled: true + command: "LaunchContent" + arguments: + values: + - name: "AutoPlay" + value: true + - name: "Search" + value: { ParameterList: [{ Type: 8, Value: PopularityName }] } + response: + values: + - name: "Status" + value: 0 + + - label: "Verify that DUT should play or display the search result." + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp + arguments: + values: + - name: "message" + value: + "Please enter 'y' if DUT play or display the search result." + - name: "expectedValue" + value: "y" - label: "TH sends a LaunchContent command to the DUT with search parameter - consisting of Type As 'Provider' and Value as Providers name, for - example 'Netflix'" + consisting of Type As Provider and Value as Provider’s name, for + example Netflix" PICS: CONTENTLAUNCHER.S.C00.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 9, "value": "Netflix", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 9, "value": "Netflix", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - - On TH verify the success response (value 0) received from DUT - [1651578697.912544][9750:9755] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002 - [1651578697.912620][9750:9755] CHIP:TOO: LaunchResponse: { - [1651578697.912673][9750:9755] CHIP:TOO: status: 0 - [1651578697.912715][9750:9755] CHIP:TOO: data: exampleData - [1651578697.912753][9750:9755] CHIP:TOO: } - - tv-app DUT shows matches via console: - - [1653236823721] [74577:2234439] CHIP: [ZCL] TEST CASE found match=TV Show Example type=9 - disabled: true + command: "LaunchContent" + arguments: + values: + - name: "AutoPlay" + value: true + - name: "Search" + value: { ParameterList: [{ Type: 9, Value: "Netflix" }] } + response: + values: + - name: "Status" + value: 0 + + - label: "Verify that DUT should play or display the search result." + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp + arguments: + values: + - name: "message" + value: + "Please enter 'y' if DUT play or display the search result." + - name: "expectedValue" + value: "y" - label: "TH sends a LaunchContent command to the DUT with search parameter - consisting of Type As 'Sport' and Value as Sports name, for example, + consisting of Type As Sport and Value as Sport’s name, for example, football" PICS: CONTENTLAUNCHER.S.C00.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 10, "value": "football", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 10, "value": "football", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - - On TH verify the success response (value 0) received from DUT - [1651578716.145536][9757:9762] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002 - [1651578716.145622][9757:9762] CHIP:TOO: LaunchResponse: { - [1651578716.145682][9757:9762] CHIP:TOO: status: 0 - [1651578716.145725][9757:9762] CHIP:TOO: data: exampleData - [1651578716.145767][9757:9762] CHIP:TOO: } - - tv-app DUT shows matches via console: - - [1653236636669] [74577:2229859] CHIP: [ZCL] TEST CASE found match=Sports Example type=10 - disabled: true + command: "LaunchContent" + arguments: + values: + - name: "AutoPlay" + value: true + - name: "Search" + value: { ParameterList: [{ Type: 10, Value: "football" }] } + response: + values: + - name: "Status" + value: 0 + + - label: "Verify that DUT should play or display the search result." + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp + arguments: + values: + - name: "message" + value: + "Please enter 'y' if DUT play or display the search result." + - name: "expectedValue" + value: "y" - label: "TH sends a LaunchContent command to the DUT with search parameter - consisting of Type As 'SportsTeam' and Value as SportTeams name , for - example 'Arsenel'" + consisting of Type As SportsTeam and Value as SportTeam’s name , for + example Arsenel" PICS: CONTENTLAUNCHER.S.C00.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 11, "value": "Arsenel", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 11, "value": "Arsenel", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - - On TH verify the success response (value 0) received from DUT - [1651578735.341387][9764:9769] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002 - [1651578735.341498][9764:9769] CHIP:TOO: LaunchResponse: { - [1651578735.341574][9764:9769] CHIP:TOO: status: 0 - [1651578735.341630][9764:9769] CHIP:TOO: data: exampleData - [1651578735.341686][9764:9769] CHIP:TOO: } - - tv-app DUT shows matches via console: - - [1653236636669] [74577:2229859] CHIP: [ZCL] TEST CASE found match=Sports Example type=11 - disabled: true + command: "LaunchContent" + arguments: + values: + - name: "AutoPlay" + value: true + - name: "Search" + value: { ParameterList: [{ Type: 11, Value: "Arsenel" }] } + response: + values: + - name: "Status" + value: 0 + + - label: "Verify that DUT should play or display the search result." + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp + arguments: + values: + - name: "message" + value: + "Please enter 'y' if DUT play or display the search result." + - name: "expectedValue" + value: "y" - label: "TH sends a LaunchContent command to the DUT with search parameter - consisting of Type As 'Type' and Value as Types name, for example - 'TVSeries'" + consisting of Type As Type and Value as Type’s name, for example + TVSeries" PICS: CONTENTLAUNCHER.S.C00.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool contentlauncher launch-content '{"parameterList": [ { "type": 12, "value": "TVSeries", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - ./chip-tv-casting-app contentlauncher launch-content '{"parameterList": [ { "type": 12, "value": "TVSeries", "externalIDList": [ { "name": "exampleName", "value": "exampleValue"} ] } ] }' 0 1 1 - - On TH verify the success response (value 0) received from DUT - [1651578755.904379][9773:9778] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_050A Command 0x0000_0002 - [1651578755.904459][9773:9778] CHIP:TOO: LaunchResponse: { - [1651578755.904517][9773:9778] CHIP:TOO: status: 0 - [1651578755.904560][9773:9778] CHIP:TOO: data: exampleData - [1651578755.904604][9773:9778] CHIP:TOO: } - - tv-app DUT shows matches via console: - - [1653236823721] [74577:2234439] CHIP: [ZCL] TEST CASE found match=Sports Example type=12 - disabled: true + command: "LaunchContent" + arguments: + values: + - name: "AutoPlay" + value: true + - name: "Search" + value: { ParameterList: [{ Type: 12, Value: "TVSeries" }] } + response: + values: + - name: "Status" + value: 0 + + - label: "Verify that DUT should play or display the search result." + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp + arguments: + values: + - name: "message" + value: + "Please enter 'y' if DUT play or display the search result." + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_FLW_2_1.yaml b/src/app/tests/suites/certification/Test_TC_FLW_2_1.yaml index dce6dbb1058c22..51dbc0c5c4d011 100644 --- a/src/app/tests/suites/certification/Test_TC_FLW_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_FLW_2_1.yaml @@ -36,6 +36,7 @@ tests: command: "readAttribute" attribute: "MinMeasuredValue" response: + saveAs: MinMeasuredVariable constraints: type: int16u minValue: 0 @@ -46,9 +47,10 @@ tests: command: "readAttribute" attribute: "MaxMeasuredValue" response: + saveAs: MaxMeasuredVariable constraints: type: int16u - minValue: 0 + minValue: MinMeasuredVariable maxValue: 65534 - label: "Read the mandatory attribute: MeasuredValue" @@ -58,8 +60,8 @@ tests: response: constraints: type: int16u - minValue: 0 - maxValue: 65535 + minValue: MinMeasuredVariable + maxValue: MaxMeasuredVariable - label: "TH reads from the DUT the Tolerance attribute" PICS: FLW.S.A0003 diff --git a/src/app/tests/suites/certification/Test_TC_ICDM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ICDM_1_1.yaml new file mode 100644 index 00000000000000..aac4c654209f18 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_ICDM_1_1.yaml @@ -0,0 +1,138 @@ +# Copyright (c) 2023 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: 312.1.1. [TC-ICDM-1.1] Global attributes with DUT as Server + +PICS: + - ICDM.S + +config: + nodeId: 0x12344321 + cluster: "ICD Management" + endpoint: 0 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + type: int16u + + - label: "Read the global attribute: FeatureMap" + PICS: ICDM.S.F00 + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 1 + constraints: + type: bitmap32 + + - label: "Read the global attribute: FeatureMap" + PICS: " !ICDM.S.F00 " + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + constraints: + type: bitmap32 + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1, 2, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Read the optional attribute(RegisteredClients) in AttributeList" + PICS: ICDM.S.A0003 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] + + - label: "Read the optional attribute(IcdCounter) in AttributeList" + PICS: ICDM.S.A0004 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [4] + + - label: + "Read the optional attribute(ClientsSupportedPerFabric) in + AttributeList" + PICS: ICDM.S.A0005 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [5] + + - label: "Read the global attribute: EventList" + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: AcceptedCommandList" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0, 2] + + - label: "Read the optional command (StayActiveRequest) in AttributeList" + PICS: ICDM.S.C03.Rsp + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [3] + + - label: "Read the global attribute: GeneratedCommandList" + PICS: " !ICDM.S.F00 " + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + + - label: "Read the global attribute: GeneratedCommandList" + PICS: ICDM.S.F00 + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + constraints: + type: list + contains: [1] diff --git a/src/app/tests/suites/certification/Test_TC_ICDM_2_1.yaml b/src/app/tests/suites/certification/Test_TC_ICDM_2_1.yaml new file mode 100644 index 00000000000000..00e9d687346425 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_ICDM_2_1.yaml @@ -0,0 +1,87 @@ +# Copyright (c) 2023 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: 312.2.1. [TC-ICDM-2.1] Attributes with DUT as Server + +PICS: + - ICDM.S + +config: + nodeId: 0x12344321 + cluster: "ICD Management" + endpoint: 0 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "TH reads from the DUT the IdleModeInterval attribute" + PICS: ICDM.S.A0000 + command: "readAttribute" + attribute: "IdleModeInterval" + response: + saveAs: IdleModeIntervalValue + constraints: + type: int32u + minValue: 500 + maxValue: 64800000 + + - label: "TH reads from the DUT the ActiveModeInterval attribute" + PICS: ICDM.S.A0001 + command: "readAttribute" + attribute: "ActiveModeInterval" + response: + constraints: + type: int32u + minValue: 300 + maxValue: IdleModeIntervalValue + + - label: "TH reads from the DUT the ActiveModeThreshold attribute" + PICS: ICDM.S.A0002 + command: "readAttribute" + attribute: "ActiveModeThreshold" + response: + constraints: + type: int16u + minValue: 300 + + - label: "TH reads from the DUT the RegisteredClients attribute" + PICS: ICDM.S.A0003 + command: "readAttribute" + attribute: "RegisteredClients" + response: + constraints: + type: list + + - label: "TH reads from the DUT the IcdCounter attribute" + PICS: ICDM.S.A0004 + command: "readAttribute" + attribute: "ICDCounter" + response: + constraints: + type: int32u + + - label: "TH reads from the DUT the ClientsSupportedPerFabric attribute" + PICS: ICDM.S.A0005 + command: "readAttribute" + attribute: "ClientsSupportedPerFabric" + response: + constraints: + type: int16u + minValue: 1 diff --git a/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_6_4.yaml b/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_6_4.yaml index 17ba4d8cbb7334..f28781ceaa9025 100644 --- a/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_6_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_6_4.yaml @@ -142,20 +142,11 @@ tests: #Issue 19800 - label: "Reads the PlaybackSpeed attribute from the DUT" - verification: | - ./chip-tool mediaplayback read playback-speed 1 3 - [1655114487.018204][41855:41860] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0506 Attribute 0x0000_0004 DataVersion: 4174921750 - [1655114487.018302][41855:41860] CHIP:TOO: PlaybackSpeed: -1.000000 - [1655114487.018421][41855:41860] CHIP:EM: Sending Standalone Ack for MessageCounter:163883813 on exchange 24959 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp - arguments: - values: - - name: "message" - value: "Please enter 'y' if PlaybackSpeed value is -1" - - name: "expectedValue" - value: "y" + PICS: MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp + command: "readAttribute" + attribute: "PlaybackSpeed" + response: + value: -1 - label: "Sends a Rewind command to the DUT" PICS: MEDIAPLAYBACK.S.C06.Rsp @@ -182,20 +173,11 @@ tests: #Issue 19800 - label: "Reads the PlaybackSpeed attribute from the DUT" - verification: | - ./chip-tool mediaplayback read playback-speed 1 3 - [1655114711.400529][41871:41876] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0506 Attribute 0x0000_0004 DataVersion: 4174921750 - [1655114711.400683][41871:41876] CHIP:TOO: PlaybackSpeed: -2.000000 - [1655114711.400853][41871:41876] CHIP:EM: Sending Standalone Ack for MessageCounter:17386470 on exchange 38376 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp - arguments: - values: - - name: "message" - value: "Please enter 'y' if PlaybackSpeed value is -2" - - name: "expectedValue" - value: "y" + PICS: MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp + command: "readAttribute" + attribute: "PlaybackSpeed" + response: + value: -2 - label: "Sends a Play command" PICS: MEDIAPLAYBACK.S.C00.Rsp diff --git a/src/app/tests/suites/certification/Test_TC_PRS_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PRS_2_1.yaml index 3bc25e6fae7f58..cf302ecf0a9b99 100644 --- a/src/app/tests/suites/certification/Test_TC_PRS_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_PRS_2_1.yaml @@ -39,8 +39,8 @@ tests: saveAs: MinMeasuredValue constraints: type: int16s - minValue: -32768 - maxValue: 32767 + minValue: -32767 + maxValue: 32766 - label: "Read the mandatory attribute constraints: MaxMeasuredValue" PICS: PRS.S.A0002 @@ -50,7 +50,7 @@ tests: saveAs: MaxMeasuredValue constraints: type: int16s - minValue: -32768 + minValue: MinMeasuredValue maxValue: 32767 - label: "Read the mandatory attribute constraints: MeasuredValue" @@ -81,8 +81,8 @@ tests: saveAs: MinScaledValue constraints: type: int16s - minValue: -32768 - maxValue: 32767 + minValue: -32767 + maxValue: 32766 - label: "Read the optional attribute: MaxScaledValue" PICS: PRS.S.A0012 @@ -92,7 +92,7 @@ tests: saveAs: MaxScaledValue constraints: type: int16s - minValue: -32768 + minValue: MinScaledValue maxValue: 32767 - label: "Read the optional attribute: ScaledValue" diff --git a/src/app/tests/suites/certification/Test_TC_RH_2_1.yaml b/src/app/tests/suites/certification/Test_TC_RH_2_1.yaml index 44504a58830017..eaa7c15e80663f 100644 --- a/src/app/tests/suites/certification/Test_TC_RH_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_RH_2_1.yaml @@ -36,6 +36,7 @@ tests: command: "readAttribute" attribute: "MinMeasuredValue" response: + saveAs: CurrentMinMeasured constraints: type: int16u minValue: 0 @@ -46,9 +47,10 @@ tests: command: "readAttribute" attribute: "MaxMeasuredValue" response: + saveAs: CurrentMaxMeasured constraints: type: int16u - minValue: 1 + minValue: CurrentMinMeasured maxValue: 10000 - label: "TH reads the MeasuredValue attribute from the DUT" @@ -58,8 +60,8 @@ tests: response: constraints: type: int16u - minValue: 0 - maxValue: 10000 + minValue: CurrentMinMeasured + maxValue: CurrentMaxMeasured - label: "TH reads the Tolerance attribute from the DUT" PICS: RH.S.A0003 diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_1.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_1.yaml index bd04f242522dc4..7ae1cdacc5f419 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_4_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_4_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2023 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. @@ -13,69 +13,81 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 15.4.1. [TC-SC-4.1] Commissionable Node Discovery [DUT as Commissionee] +name: 22.4.1. [TC-SC-4.1] Commissionable Node Discovery [DUT as Commissionee] PICS: - MCORE.ROLE.COMMISSIONEE config: nodeId: 0x12344321 - cluster: "Basic Information" endpoint: 0 + discriminator: + type: int16u + defaultValue: 3840 + shortDiscriminator: + type: int16u + defaultValue: 15 + vendorId: + type: int16u + defaultValue: 65521 + productId: + type: int16u + defaultValue: 32769 + deviceType: + type: int16u + defaultValue: 65535 + PakeVerifier: + type: octet_string + defaultValue: "hex:b96170aae803346884724fe9a3b287c30330c2a660375d17bb205a8cf1aecb350457f8ab79ee253ab6a8e46bb09e543ae422736de501e3db37d441fe344920d09548e4c18240630c4ff4913c53513839b7c07fcc0627a1b8573a149fcd1fa466cf" + timeout: 900 + waitAfterCommissioning: + type: int16u + defaultValue: 5000 tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + - label: - "DUT is Commissioned and put in Commissioning Mode using Open Basic - Commissioning Window command and starts advertising Commissionable - Node Discovery service using DNS-SD" - PICS: CADMIN.S.C01.Rsp - verification: | - ./chip-tool administratorcommissioning open-basic-commissioning-window 200 1 0 --timedInteractionTimeoutMs 1000 - - verify success on TH (Chip-tool) Logs: - - [1652340903.034346][2874:2879] CHIP:DMG: InvokeResponseMessage = - [1652340903.034398][2874:2879] CHIP:DMG: { - [1652340903.034447][2874:2879] CHIP:DMG: suppressResponse = false, - [1652340903.034499][2874:2879] CHIP:DMG: InvokeResponseIBs = - [1652340903.034565][2874:2879] CHIP:DMG: [ - [1652340903.034615][2874:2879] CHIP:DMG: InvokeResponseIB = - [1652340903.034748][2874:2879] CHIP:DMG: { - [1652340903.034806][2874:2879] CHIP:DMG: CommandStatusIB = - [1652340903.034873][2874:2879] CHIP:DMG: { - [1652340903.034936][2874:2879] CHIP:DMG: CommandPathIB = - [1652340903.035006][2874:2879] CHIP:DMG: { - [1652340903.035078][2874:2879] CHIP:DMG: EndpointId = 0x0, - [1652340903.035159][2874:2879] CHIP:DMG: ClusterId = 0x3c, - [1652340903.035223][2874:2879] CHIP:DMG: CommandId = 0x1, - [1652340903.035291][2874:2879] CHIP:DMG: }, - [1652340903.035362][2874:2879] CHIP:DMG: - [1652340903.035423][2874:2879] CHIP:DMG: StatusIB = - [1652340903.035495][2874:2879] CHIP:DMG: { - [1652340903.035566][2874:2879] CHIP:DMG: status = 0x00 (SUCCESS), - [1652340903.035634][2874:2879] CHIP:DMG: }, - [1652340903.035704][2874:2879] CHIP:DMG: - [1652340903.035763][2874:2879] CHIP:DMG: }, - [1652340903.035841][2874:2879] CHIP:DMG: - [1652340903.035898][2874:2879] CHIP:DMG: }, - [1652340903.035965][2874:2879] CHIP:DMG: - [1652340903.036014][2874:2879] CHIP:DMG: ], - [1652340903.036077][2874:2879] CHIP:DMG: - [1652340903.036126][2874:2879] CHIP:DMG: InteractionModelRevision = 1 - [1652340903.036175][2874:2879] CHIP:DMG: }, - [1652340903.036294][2874:2879] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0001 Status=0x0 - [1652340903.036375][2874:2879] CHIP:DMG: ICR moving to [AwaitingDe] - - The delay timer is given 200 as an example , use whatever works for your product - disabled: true - - - label: "Check DNS-SD subtypes used by DUT" - PICS: - " MCORE.COM.WIFI && MCORE.COM.ETH && MCORE.COM.THR && - MCORE.SC.VENDOR_SUBTYPE && MCORE.SC.DEVTYPE_SUBTYPE && MCORE.SC.VP_KEY - && MCORE.SC.SII_OP_DISCOVERY_KEY && MCORE.SC.SAI_OP_DISCOVERY_KEY && - MCORE.SC.DT_KEY && MCORE.SC.DN_KEY && MCORE.SC.RI_KEY && - MCORE.SC.PH_KEY && MCORE.SC.PI_KEY " + "DUT is put in Commissioning Mode using Open Basic Commissioning + Window command " + cluster: "Administrator Commissioning" + command: "OpenBasicCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + + - label: "Waiting after opening commissioning window" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: waitAfterCommissioning + + - label: + "Check DNS-SD instance name must be 64-bit randomly selected ID + expressed as a sixteen-char hex string with capital letters" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "instanceName" + saveAs: deviceInstanceNameBeforeReboot + constraints: + minLength: 16 + maxLength: 16 + isUpperCase: true + isHexString: true + + - label: "Service type must be _matterc._udp" verification: | Run the below commands within the mentioned time interval used in open-commissioning-window in step-1. Run the below avahi browse command in the TH terminal @@ -91,17 +103,15 @@ tests: + wlan0 IPv6 5A4E867284D08B13 _matterc._udp local + eth0 IPv6 5A4E867284D08B13 _matterc._udp local = eth0 IPv6 5A4E867284D08B13 _matterc._udp local - hostname = [E45F010F1A010000.local] - address = [fe80::e65f:1ff:fe0f:1a01] - port = [5540] - txt = ["PI=" "PH=36" "CM=1" "D=3840" "T=1" "VP=65521+32769"] + hostname = [E45F010F1A010000.local] + address = [fe80::e65f:1ff:fe0f:1a01] + port = [5540] + txt = ["PI=" "PH=36" "CM=1" "D=3840" "T=1" "VP=65521+32769"] = wlan0 IPv6 5A4E867284D08B13 _matterc._udp local - hostname = [E45F010F1A010000.local] - address = [fe80::e65f:1ff:fe0f:1a01] - port = [5540] - txt = ["PI=" "PH=36" "CM=1" "D=3840" "T=1" "VP=65521+32769"] - - + hostname = [E45F010F1A010000.local] + address = [fe80::e65f:1ff:fe0f:1a01] + port = [5540] + txt = ["PI=" "PH=36" "CM=1" "D=3840" "T=1" "VP=65521+32769"] If we use Thread setup, then the Service Domain will be 422F10CDC290A406.local @@ -114,85 +124,323 @@ tests: +;eth0;IPv6;_S15;_sub._matterc._udp;local +;eth0;IPv6;_L3840;_sub._matterc._udp;local +;eth0;IPv6;_CM;_sub._matterc._udp;local - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + + #validate the service type and the service domain not implemented in CI - label: - "DUT is rebooted, then put in Commissioning Mode using Open Basic - Commissioning Window command, starting advertising Commissionable Node - Discovery service using DNS-SD" - PICS: CADMIN.S.C01.Rsp + "Check target hostname is derived from the 48bit or 64bit MAC address + expressed as a twelve or sixteen capital letter hex string" + PICS: "( MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "hostName" + constraints: + minLength: 12 + maxLength: 16 + isUpperCase: true + isHexString: true + + - label: + "Check target hostname is derived from the 48bit or 64bit MAC address + expressed as a twelve or sixteen capital letter hex string" + PICS: "(!MCORE.COM.WIFI && !MCORE.COM.WIFI) && MCORE.COM.THR" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "hostName" + constraints: + minLength: 12 + maxLength: 16 + isUpperCase: true + isHexString: true + + #subtype + - label: "Check Long Discriminator _L" + cluster: "DiscoveryCommands" + command: "FindCommissionableByLongDiscriminator" + arguments: + values: + - name: "value" + value: discriminator + + - label: "Check Short Discriminator (_S)" + cluster: "DiscoveryCommands" + command: "FindCommissionableByShortDiscriminator" + arguments: + values: + - name: "value" + value: shortDiscriminator + + - label: + "If (MCORE.SC.VENDOR_SUBTYPE) present, subtype _V is present + must be 16-bit vendor id, encoded as a variable-length decimal number + in ASCII text, omitting any leading zeros" + PICS: MCORE.SC.VENDOR_SUBTYPE + cluster: "DiscoveryCommands" + command: "FindCommissionableByVendorId" + arguments: + values: + - name: "value" + value: vendorId + + - label: + "if (MCORE.SC.DEVTYPE_SUBTYPE) present, subtype _T is present, + represents device type from Data Model and must be represented + as a variable length decimal number in ASCII without leading zeros" + PICS: MCORE.SC.DEVTYPE_SUBTYPE + cluster: "DiscoveryCommands" + command: "FindCommissionableByDeviceType" + arguments: + values: + - name: "value" + value: deviceType + + - label: "Check Commissioning Mode (_CM) subtype _CM must be present" + cluster: "DiscoveryCommands" + command: "FindCommissionableByCommissioningMode" + + - label: + "key D must be present and represents the discriminator which must be + encoded as a variable-length decimal value with up to 4 digits + omitting any leading zeros" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "longDiscriminator" + value: discriminator + constraints: + minValue: 0 + maxValue: 4096 + + - label: + "If (MCORE.SC.VP_KEY) present, VP key must contain at least Vendor ID + is present" + PICS: MCORE.SC.VP_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "vendorId" + value: vendorId + + - label: + "If (MCORE.SC.VP_KEY) present, VP key must contain at least Product ID + is present" + PICS: MCORE.SC.VP_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "productId" + value: productId + + - label: + "If (MCORE.SC.SII_OP_DISCOVERY_KEY) present, SII key must be an + unsigned integer with units of milliseconds and shall be encoded as a + variable length decimal number in ASCII, omitting leading zeros. Shall + not exceed 3600000" + PICS: MCORE.SC.SII_OP_DISCOVERY_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "mrpRetryIntervalIdle" + constraints: + maxValue: 3600000 + + - label: + "If (MCORE.SC.SAI_OP_DISCOVERY_KEY ) present, SAI key must be an + unsigned integer with units of milliseconds and shall be encoded as a + variable length decimal number in ASCII, omitting leading zeros. Shall + not exceed 3600000." + PICS: MCORE.SC.SAI_OP_DISCOVERY_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "mrpRetryIntervalActive" + constraints: + maxValue: 3600000 + + - label: "TXT key for commissioning mode (CM) CM=1 must be present" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "commissioningMode" + value: 1 + + - label: + "If (MCORE.SC.DT_KEY) present, DT key must contain the device type + identifier from Data Model Device Types and must be encoded as a + variable length decimal ASCII number without leading zeros" + PICS: MCORE.SC.DT_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "deviceType" + value: deviceType + + - label: + "If (MCORE.SC.DN_KEY) present, DN key must be a UTF-8 encoded string + with a maximum length of 32B" + PICS: MCORE.SC.DN_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "deviceName" + constraints: + maxLength: 32 + + - label: + "If (MCORE.SC.RI_KEY ) present, key RI must include the Rotating + Device Identifier encoded as a uppercase string with a maximum length + of 100 chars" + PICS: MCORE.SC.RI_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "rotatingIdLen" + constraints: + maxValue: 100 + + - label: + "If (MCORE.SC.PH_KEY) present, key PH must be encoded as a + variable-length decimal number in ASCII text, omitting any leading + zeros. If present value must be different of 0" + PICS: MCORE.SC.PH_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "pairingHint" + constraints: + notValue: 0 + + - label: + "If (MCORE.SC.PI_KEY) present, key PI must be encoded as a valid UTF-8 + string with a maximum length of 128 bytes" + PICS: MCORE.SC.PI_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "pairingInstruction" + constraints: + maxLength: 128 + + - label: + "DUT must publish AAAA records for each IPv6 address upon which they + are willing to accept Matter messages." + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "numIPs" + constraints: + minValue: 1 + + ### DUT TurnOff + - label: "Reboot/restart the DUT" + PICS: PICS_SDK_CI_ONLY + cluster: "SystemCommands" + endpoint: 0 + command: "Reboot" + + - label: "Reboot target device(DUT)" verification: | - Reboot the device and commission the DUT again. Open the commissioning window using the below command in the TH (Chip-tool) terminal + Did the DUT successfully reboot? + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP + arguments: + values: + - name: "message" + value: "Please reboot the DUT and enter 'y' after DUT starts" + - name: "expectedValue" + value: "y" - ./chip-tool administratorcommissioning open-basic-commissioning-window 200 1 0 --timedInteractionTimeoutMs 1000 + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - verify success on TH (Chip-tool) logs: + - label: + "DUT put in Commissioning Mode using Open Basic Commissioning Window + command, starting advertising Commissionable Node Discovery service + using DNS-SD" + PICS: CADMIN.S.C01.Rsp + cluster: "Administrator Commissioning" + command: "OpenBasicCommissioningWindow" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "CommissioningTimeout" + value: 180 - [1652341174.803430][2893:2898] CHIP:DMG: InvokeResponseMessage = - [1652341174.803488][2893:2898] CHIP:DMG: { - [1652341174.803560][2893:2898] CHIP:DMG: suppressResponse = false, - [1652341174.803622][2893:2898] CHIP:DMG: InvokeResponseIBs = - [1652341174.803698][2893:2898] CHIP:DMG: [ - [1652341174.803757][2893:2898] CHIP:DMG: InvokeResponseIB = - [1652341174.803835][2893:2898] CHIP:DMG: { - [1652341174.803897][2893:2898] CHIP:DMG: CommandStatusIB = - [1652341174.803975][2893:2898] CHIP:DMG: { - [1652341174.804047][2893:2898] CHIP:DMG: CommandPathIB = - [1652341174.804128][2893:2898] CHIP:DMG: { - [1652341174.804213][2893:2898] CHIP:DMG: EndpointId = 0x0, - [1652341174.804292][2893:2898] CHIP:DMG: ClusterId = 0x3c, - [1652341174.804377][2893:2898] CHIP:DMG: CommandId = 0x1, - [1652341174.804450][2893:2898] CHIP:DMG: }, - [1652341174.804539][2893:2898] CHIP:DMG: - [1652341174.804654][2893:2898] CHIP:DMG: StatusIB = - [1652341174.804738][2893:2898] CHIP:DMG: { - [1652341174.804821][2893:2898] CHIP:DMG: status = 0x00 (SUCCESS), - [1652341174.804911][2893:2898] CHIP:DMG: }, - [1652341174.804993][2893:2898] CHIP:DMG: - [1652341174.805067][2893:2898] CHIP:DMG: }, - [1652341174.805152][2893:2898] CHIP:DMG: - [1652341174.805220][2893:2898] CHIP:DMG: }, - [1652341174.805307][2893:2898] CHIP:DMG: - [1652341174.805365][2893:2898] CHIP:DMG: ], - [1652341174.805439][2893:2898] CHIP:DMG: - [1652341174.805497][2893:2898] CHIP:DMG: InteractionModelRevision = 1 - [1652341174.805555][2893:2898] CHIP:DMG: }, - [1652341174.805690][2893:2898] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0001 Status=0x0 - [1652341174.805786][2893:2898] CHIP:DMG: ICR moving to [AwaitingDe] - - The delay timer is given 200 as an example , use whatever works for your product - disabled: true - - - label: "Check DNS-SD subtypes used by DUT" - PICS: - " MCORE.COM.WIFI && MCORE.COM.ETH && MCORE.COM.THR && - MCORE.SC.VENDOR_SUBTYPE && MCORE.SC.DEVTYPE_SUBTYPE && MCORE.SC.VP_KEY - && MCORE.SC.SII_OP_DISCOVERY_KEY && MCORE.SC.SAI_OP_DISCOVERY_KEY && - MCORE.SC.DT_KEY && MCORE.SC.DN_KEY && MCORE.SC.RI_KEY && - MCORE.SC.PH_KEY && MCORE.SC.PI_KEY " + - label: "Waiting after opening commissioning window" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: waitAfterCommissioning + + - label: + "Check DNS-SD instance name must be 64-bit randomly selected ID + expressed as a sixteen-char hex string with capital letters and must + be different from the one at step 2" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "instanceName" + constraints: + minLength: 16 + maxLength: 16 + isUpperCase: true + isHexString: true + notValue: deviceInstanceNameBeforeReboot + + - label: "service type must be _matterc._udp" verification: | Run the below avahi browse command in TH terminal - avahi-browse -rt _matterc._udp + avahi-browse -rt _matterc._udp - Verify on the below output in TH terminal Log: + Verify the device is advertising _matterc._udp service like below output in TH terminal Log: (Verify for the DUT's actual values (like vendor ID, PID ..etc) as mentioned in the expected outcome of the test plan, The below log contains the data from the reference raspi accessory) + wlan0 IPv6 F6385CBB29F7CE93 _matterc._udp local + eth0 IPv6 F6385CBB29F7CE93 _matterc._udp local = eth0 IPv6 F6385CBB29F7CE93 _matterc._udp local - hostname = [E45F010F1A010000.local] - address = [fe80::e65f:1ff:fe0f:1a01] - port = [5540] - txt = ["PI=" "PH=36" "CM=1" "D=3840" "T=1" "VP=65521+32769"] + hostname = [E45F010F1A010000.local] + address = [fe80::e65f:1ff:fe0f:1a01] + port = [5540] + txt = ["PI=" "PH=36" "CM=1" "D=3840" "T=1" "VP=65521+32769"] = wlan0 IPv6 F6385CBB29F7CE93 _matterc._udp local - hostname = [E45F010F1A010000.local] - address = [fe80::e65f:1ff:fe0f:1a01] - port = [5540] - txt = ["PI=" "PH=36" "CM=1" "D=3840" "T=1" "VP=65521+32769"] - - - - + hostname = [E45F010F1A010000.local] + address = [fe80::e65f:1ff:fe0f:1a01] + port = [5540] + txt = ["PI=" "PH=36" "CM=1" "D=3840" "T=1" "VP=65521+32769"] Service Domain 422F10CDC290A406.local @@ -205,17 +453,271 @@ tests: +;eth0;IPv6;_S15;_sub._matterc._udp;local +;eth0;IPv6;_L3840;_sub._matterc._udp;local +;eth0;IPv6;_CM;_sub._matterc._udp;local - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - - label: "Wait for OBCW timeout to expire" - verification: | - Wait until open-basic-commissioning-window time to expire. - disabled: true + #validate the service type and the service domain not implemented in CI + - label: + "Check Hostname. If (MCORE.COM.WIFI) OR (MCORE.COM.ETH) target + hostname is derived from the 48bit or 64bit MAC address expressed as a + twelve or sixteen capital letter hex string" + PICS: "(MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "hostName" + constraints: + minLength: 12 + maxLength: 16 + isUpperCase: true + isHexString: true + + - label: + "Check Hostname. If (MCORE.COM.THR) target hostname is derived from + the 48bit or 64bit MAC address expressed as a twelve or sixteen + capital letter hex string" + PICS: "(!MCORE.COM.WIFI && !MCORE.COM.ETH) && MCORE.COM.THR" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "hostName" + constraints: + minLength: 12 + maxLength: 16 + isUpperCase: true + isHexString: true + + - label: "Check Long Discriminator _L" + cluster: "DiscoveryCommands" + command: "FindCommissionableByLongDiscriminator" + arguments: + values: + - name: "value" + value: discriminator + + - label: "Check Short Discriminator (_S)" + cluster: "DiscoveryCommands" + command: "FindCommissionableByShortDiscriminator" + arguments: + values: + - name: "value" + value: shortDiscriminator + + - label: + "If (MCORE.SC.VENDOR_SUBTYPE ) present, subtype _V is present + must be 16-bit vendor id, encoded as a variable-length decimal number + in ASCII text, omitting any leading zeros" + PICS: MCORE.SC.VENDOR_SUBTYPE + cluster: "DiscoveryCommands" + command: "FindCommissionableByVendorId" + arguments: + values: + - name: "value" + value: vendorId + + - label: + "If (MCORE.SC.DEVTYPE_SUBTYPE) present, subtype _T is present, + represents device type from Data Model and must be represented + as a variable length decimal number in ASCII without leading zeros" + # The device type is not broadcasted by the accessory under CI. + PICS: MCORE.SC.DEVTYPE_SUBTYPE + cluster: "DiscoveryCommands" + command: "FindCommissionableByDeviceType" + arguments: + values: + - name: "value" + value: deviceType + + - label: "Check Commissioning Mode (_CM) subtype _CM is present" + cluster: "DiscoveryCommands" + command: "FindCommissionableByCommissioningMode" + + - label: + "key D must be present and represents the discriminator which must be + encoded as a variable-length decimal value with up to 4 digits + omitting any leading zeros" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "longDiscriminator" + value: discriminator + constraints: + minValue: 0 + maxValue: 4096 + + - label: + "If (MCORE.SC.VP_KEY) present, VP key must contain at least Vendor ID + is present." + PICS: MCORE.SC.VP_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "vendorId" + value: vendorId + + - label: + "If (MCORE.SC.VP_KEY) present, VP key must contain at least Product ID + is present." + PICS: MCORE.SC.VP_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "productId" + value: productId + + - label: + "If (MCORE.SC.SII_OP_DISCOVERY_KEY ) present, SII key must be an + unsigned integer with units of milliseconds and shall be encoded as a + variable length decimal number in ASCII, omitting leading zeros. Shall + not exceed 3600000" + PICS: MCORE.SC.SII_OP_DISCOVERY_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "mrpRetryIntervalIdle" + constraints: + maxValue: 3600000 + + - label: + "If (MCORE.SC.SAI_OP_DISCOVERY_KEY) present, SAI key must be an + unsigned integer with units of milliseconds and shall be encoded as a + variable length decimal number in ASCII, omitting leading zeros. Shall + not exceed 3600000." + PICS: MCORE.SC.SAI_OP_DISCOVERY_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "mrpRetryIntervalActive" + constraints: + maxValue: 3600000 + + - label: "TXT key for commissioning mode (CM) key CM=1 must be present" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "commissioningMode" + value: 1 + + - label: + "If (MCORE.SC.DT_KEY) present, DT key must contain the device type + identifier from Data Model Device Types and must be encoded as a + variable length decimal ASCII number without leading zeros" + PICS: MCORE.SC.DT_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "deviceType" + value: deviceType + + - label: + "If (MCORE.SC.DN_KEY) present, DN key must be a UTF-8 encoded string + with a maximum length of 32B" + PICS: MCORE.SC.DN_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "deviceName" + constraints: + maxLength: 32 + + - label: + "If (MCORE.SC.RI_KEY) present, key RI must include the Rotating Device + Identifier encoded as a uppercase string with a maximum length of 100 + chars" + PICS: MCORE.SC.RI_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "rotatingIdLen" + constraints: + maxValue: 100 + + - label: + "If (MCORE.SC.PH_KEY) present, key PH must be encoded as a + variable-length decimal number in ASCII text, omitting any leading + zeros. If present value must be different of 0" + PICS: MCORE.SC.PH_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "pairingHint" + constraints: + notValue: 0 + - label: + "If (MCORE.SC.PI_KEY) present, key PI must be encoded as a valid UTF-8 + string with a maximum length of 128 bytes" + PICS: MCORE.SC.PI_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "pairingInstruction" + constraints: + maxLength: 128 + + - label: + "DUT must publish AAAA records for each IPv6 address upon which they + are willing to accept Matter messages." + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "numIPs" + constraints: + minValue: 1 + + - label: "Wait for OpenBasicCommissioningWindow timeout to expire" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 180000 + + - label: + "DUT is Commissioned and instructed to enter in commissioning mode + using Open Commissioning Window command" + cluster: "Administrator Commissioning" + command: "OpenCommissioningWindow" + timedInteractionTimeoutMs: 10000 + PICS: CADMIN.S.C00.Rsp && PICS_SDK_CI_ONLY + arguments: + values: + - name: "CommissioningTimeout" + value: 180 + - name: "PAKEPasscodeVerifier" + value: PakeVerifier + - name: "Discriminator" + value: discriminator + - name: "Iterations" + value: 1000 + - name: "Salt" + value: "SPAKE2P Key Salt" + + #Issue https://github.com/project-chip/connectedhomeip/issues/26127 - label: "DUT is Commissioned and instructed to enter in commissioning mode using Open Commissioning Window command" - PICS: CADMIN.S.C00.Rsp verification: | Run the below open-commissioning-window in TH Terminal @@ -254,71 +756,538 @@ tests: [1652341411.385662][2929:2934] CHIP:DMG: }, [1652341411.385794][2929:2934] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_003C Command=0x0000_0000 Status=0x0 [1652341411.385860][2929:2934] CHIP:CTL: Successfully opened pairing window on the device - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP && CADMIN.S.C00.Rsp + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - - label: "Check DNS-SD subtypes used by DUT" - PICS: - " MCORE.COM.WIFI && MCORE.COM.ETH && MCORE.COM.THR && - MCORE.SC.VENDOR_SUBTYPE && MCORE.SC.DEVTYPE_SUBTYPE && MCORE.SC.VP_KEY - && MCORE.SC.SII_OP_DISCOVERY_KEY && MCORE.SC.SAI_OP_DISCOVERY_KEY && - MCORE.SC.DT_KEY && MCORE.SC.DN_KEY && MCORE.SC.RI_KEY && - MCORE.SC.PH_KEY && MCORE.SC.PI_KEY " - verification: | - Same verification steps as Step 3, Except Verify CM flag value to be 2 + - label: "Waiting after opening commissioning window" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: waitAfterCommissioning + - label: + "DNS-SD instance name must be 64-bit randomly selected ID expressed as + a sixteen-char hex string with capital letters" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "instanceName" + constraints: + minLength: 16 + maxLength: 16 + isUpperCase: true + isHexString: true - ubuntu@ubuntu:~$ avahi-browse -rt _matterc._udp + #validate the service type and the service domain not implemented in CI - Verify on the below output in TH terminal Log: + - label: + "Check Hostname.If (MCORE.COM.WIFI) OR (MCORE.COM.ETH) target hostname + is derived from the 48bit or 64bit MAC address expressed as a twelve + or sixteen capital letter hex string." + # On macOS the hostname is the device name and because of it this test is disabled for now. + PICS: "(MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "hostName" + constraints: + minLength: 12 + maxLength: 16 + isUpperCase: true + isHexString: true + + - label: + "Check Hostname. If (MCORE.COM.THR) target hostname is derived from + the 48bit or 64bit MAC extended address expressed as a twelve or + sixteen capital letter hex string." + # On macOS the hostname is the device name and because of it this test is disabled for now. + PICS: "(!MCORE.COM.WIFI && !MCORE.COM.ETH) && MCORE.COM.THR" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "hostName" + constraints: + minLength: 12 + maxLength: 16 + isUpperCase: true + isHexString: true + - label: "Check Long Discriminator _L" + cluster: "DiscoveryCommands" + command: "FindCommissionableByLongDiscriminator" + arguments: + values: + - name: "value" + value: discriminator + - label: "Check Short Discriminator (_S)" + cluster: "DiscoveryCommands" + command: "FindCommissionableByShortDiscriminator" + arguments: + values: + - name: "value" + value: shortDiscriminator - + wlan0 IPv6 71DED0325CF9AB38 _matterc._udp local - + eth0 IPv6 71DED0325CF9AB38 _matterc._udp local - = eth0 IPv6 71DED0325CF9AB38 _matterc._udp local - hostname = [E45F010F1A010000.local] - address = [fe80::e65f:1ff:fe0f:1a01] - port = [5540] - txt = ["PI=" "PH=36" "CM=2" "D=3840" "T=1" "VP=65521+32769"] - = wlan0 IPv6 71DED0325CF9AB38 _matterc._udp local - hostname = [E45F010F1A010000.local] - address = [fe80::e65f:1ff:fe0f:1a01] - port = [5540] - txt = ["PI=" "PH=36" "CM=2" "D=3840" "T=1" "VP=65521+32769"] - disabled: true + - label: + "If (MCORE.SC.VENDOR_SUBTYPE) present, subtype _V is present + must be 16-bit vendor id, encoded as a variable-length decimal number + in ASCII text, omitting any leading zeros" + PICS: MCORE.SC.VENDOR_SUBTYPE + cluster: "DiscoveryCommands" + command: "FindCommissionableByVendorId" + arguments: + values: + - name: "value" + value: vendorId + + - label: + "If (MCORE.SC.DEVTYPE_SUBTYPE) present, subtype _T is present, + represents device type from Data Model and must be represented + as a variable length decimal number in ASCII without leading zeros" + # The device type is not broadcasted by the accessory under CI. + PICS: MCORE.SC.VENDOR_SUBTYPE + cluster: "DiscoveryCommands" + command: "FindCommissionableByDeviceType" + arguments: + values: + - name: "value" + value: deviceType + + - label: "Check Commissioning Mode (_CM) subtype _CM is present" + cluster: "DiscoveryCommands" + command: "FindCommissionableByCommissioningMode" + + - label: + "If (MCORE.SC.VP_KEY ) present, VP key must contain at least Vendor ID + is present." + PICS: MCORE.SC.VP_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "vendorId" + value: vendorId + + - label: + "If (MCORE.SC.VP_KEY ) present, VP key must contain at least Product + ID is present" + PICS: MCORE.SC.VP_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "productId" + value: productId + + - label: + "Optional TXT key for MRP Retry Interval Idle. if + (MCORE.SC.SII_OP_DISCOVERY_KEY) present, SII key must be an unsigned + integer with units of milliseconds and shall be encoded as a variable + length decimal number in ASCII, omitting leading zeros. Shall not + exceed 3600000" + PICS: MCORE.SC.SII_OP_DISCOVERY_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "mrpRetryIntervalIdle" + constraints: + maxValue: 3600000 + + - label: + "Optional TXT key for MRP Retry Interval Active. if + (MCORE.SC.SAI_OP_DISCOVERY_KEY) present, SAI key must be an unsigned + integer with units of milliseconds and shall be encoded as a variable + length decimal number in ASCII, omitting leading zeros. Shall not + exceed 3600000." + PICS: MCORE.SC.SAI_OP_DISCOVERY_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "mrpRetryIntervalActive" + constraints: + maxValue: 3600000 + + - label: "TXT key for commissioning mode. CM=2 must be present" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "commissioningMode" + value: 2 + + - label: + "If (MCORE.SC.DT_KEY) present, DT key must contain the device type + identifier from Data Model Device Types and must be encoded as a + variable length decimal ASCII number without leading zeros" + PICS: MCORE.SC.DT_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "deviceType" + value: deviceType + + - label: + "If (MCORE.SC.DN_KEY) present, DN key must be a UTF-8 encoded string + with a maximum length of 32B" + PICS: MCORE.SC.DN_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "deviceName" + constraints: + maxLength: 32 + + - label: + "If (MCORE.SC.RI_KEY) present, key RI must include the Rotating Device + Identifier encoded as a uppercase string with a maximum length of 100 + chars" + PICS: MCORE.SC.RI_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "rotatingIdLen" + constraints: + maxValue: 100 + + - label: + "If (MCORE.SC.PH_KEY) present, key PH must be encoded as a + variable-length decimal number in ASCII text, omitting any leading + zeros. If present value must be different of 0" + PICS: MCORE.SC.PH_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "pairingHint" + constraints: + notValue: 0 + + - label: + "If (MCORE.SC.PI_KEY) present, key PI must be encoded as a valid UTF-8 + string with a maximum length of 128 bytes" + PICS: MCORE.SC.PI_KEY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "pairingInstruction" + constraints: + maxLength: 128 + + - label: + "DUT must publish AAAA records for each IPv6 address upon which they + are willing to accept Matter messages" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "numIPs" + constraints: + minValue: 1 - label: "Wait for OCW timeout to expire" - verification: | - Wait until open-commissioning-window time to expire. - disabled: true + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 180000 - - label: "If (MCORE.SC.EXTENDED_DISCOVERY ) enable Extended Discovery" - PICS: MCORE.SC.EXTENDED_DISCOVERY + - label: + "If (MCORE.SC.EXTENDED_DISCOVERY ) enable Extended Discovery. DUT + should start to send Commissionable Node Discovery DNS-SD + advertisements" verification: | If the device supports Discovery for an extended period of time, the Device should continue to advertise. Use the avahi-browse command and you should see the _matterc._udp advertisement - Reference Raspberrypi device is not supporting extended discovery. - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP && MCORE.SC.EXTENDED_DISCOVERY + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: - "If (MCORE.SC.EXTENDED_DISCOVERY ) check DNS-SD subtypes used by DUT" - PICS: - " MCORE.SC.EXTENDED_DISCOVERY && MCORE.COM.WIFI && MCORE.COM.ETH && - MCORE.COM.THR && MCORE.SC.VENDOR_SUBTYPE && MCORE.SC.DEVTYPE_SUBTYPE - && MCORE.SC.VP_KEY && MCORE.SC.SII_OP_DISCOVERY_KEY && - MCORE.SC.SAI_OP_DISCOVERY_KEY && MCORE.SC.DT_KEY && MCORE.SC.DN_KEY && - MCORE.SC.RI_KEY && MCORE.SC.PH_KEY && MCORE.SC.PI_KEY " + "Check DNS-SD instance name must be 64-bit randomly selected ID + expressed as a sixteen-char hex string with capital letters" + PICS: MCORE.SC.EXTENDED_DISCOVERY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "instanceName" + constraints: + minLength: 16 + maxLength: 16 + isUpperCase: true + isHexString: true + + - label: "service type must be _matterc._udp" verification: | Run and Verify on the below output in TH terminal Log: (Below is the sample log , as RPI doesn't support the extended discovery) Verify the CM flag value is 0 avahi-browse -rt _matterc._udp + Verify the device is advertising _matterc._udp service like below output in TH terminal Log: (Verify for the DUT's actual values (like vendor ID, PID ..etc) as mentioned in the expected outcome of the test plan, The below log contains the data from the reference raspi accessory) + wlp0s20f3 IPv6 FD37FE5156C56632 _matterc._udp local = wlp0s20f3 IPv6 FD37FE5156C56632 _matterc._udp local - hostname = [8C1D96786A130000.local] - address = [fe80::e9f6:2c08:2794:357d] - port = [5540] - txt = ["PI=" "PH=36" "CM=2" "D=3840" "T=1" "DT=65535" "VP=65521+32769"] - disabled: true + hostname = [8C1D96786A130000.local] + address = [fe80::e9f6:2c08:2794:357d] + port = [5540] + txt = ["PI=" "PH=36" "CM=2" "D=3840" "T=1" "DT=65535" "VP=65521+32769"] + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP && MCORE.SC.EXTENDED_DISCOVERY + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + + #validate the service type and the service domain + + - label: + "Check Hostname. If (MCORE.COM.WIFI) OR (MCORE.COM.ETH) target + hostname is derived from the 48bit or 64bit MAC address expressed as a + twelve or sixteen capital letter hex string" + # On macOS the hostname is the device name and because of it this test is disabled for now. + PICS: + "(MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR && + MCORE.SC.EXTENDED_DISCOVERY" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "hostName" + constraints: + minLength: 12 + maxLength: 16 + isUpperCase: true + isHexString: true + + - label: + "Check Hostname. If (MCORE.COM.THR) target hostname is derived from + the 48bit or 64bit MAC extended address expressed as a twelve or + sixteen capital letter hex string." + # On macOS the hostname is the device name and because of it this test is disabled for now. + PICS: + "(!MCORE.COM.WIFI && !MCORE.COM.ETH) && MCORE.COM.THR && + MCORE.SC.EXTENDED_DISCOVERY" + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "hostName" + constraints: + minLength: 12 + maxLength: 16 + isUpperCase: true + isHexString: true + + # Commissioning Subtypes + + - label: "Check Long Discriminator _L" + PICS: MCORE.SC.EXTENDED_DISCOVERY + cluster: "DiscoveryCommands" + command: "FindCommissionableByLongDiscriminator" + arguments: + values: + - name: "value" + value: discriminator + + - label: "Check Short Discriminator (_S)" + PICS: MCORE.SC.EXTENDED_DISCOVERY + cluster: "DiscoveryCommands" + command: "FindCommissionableByShortDiscriminator" + arguments: + values: + - name: "value" + value: shortDiscriminator + + - label: + "If (MCORE.SC.VENDOR_SUBTYPE ) present, subtype _V is present + must be 16-bit vendor id, encoded as a variable-length decimal number + in ASCII text, omitting any leading zeros" + PICS: MCORE.SC.VENDOR_SUBTYPE && MCORE.SC.EXTENDED_DISCOVERY + cluster: "DiscoveryCommands" + command: "FindCommissionableByVendorId" + arguments: + values: + - name: "value" + value: vendorId + + - label: + "If (MCORE.SC.DEVTYPE_SUBTYPE) present, subtype _T is present, + represents device type from Data Model and must be represented + as a variable length decimal number in ASCII without leading zeros" + # The device type is not broadcasted by the accessory under CI. + PICS: MCORE.SC.DEVTYPE_SUBTYPE && MCORE.SC.EXTENDED_DISCOVERY + cluster: "DiscoveryCommands" + command: "FindCommissionableByDeviceType" + arguments: + values: + - name: "value" + value: deviceType + + - label: "Check Commissioning Mode (_CM)" + PICS: MCORE.SC.EXTENDED_DISCOVERY + cluster: "DiscoveryCommands" + command: "FindCommissionableByCommissioningMode" + + # TXT Records + + - label: "TXT key for discriminator (D)" + PICS: MCORE.SC.EXTENDED_DISCOVERY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "longDiscriminator" + value: discriminator + constraints: + minValue: 0 + maxValue: 4096 + + - label: + "If (MCORE.SC.VP_KEY) present, VP key must contain at least Vendor ID + is present" + PICS: MCORE.SC.VP_KEY && MCORE.SC.EXTENDED_DISCOVERY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "vendorId" + value: vendorId + + - label: + "If (MCORE.SC.VP_KEY) present, VP key must contain at least Product ID + is present" + PICS: MCORE.SC.VP_KEY && MCORE.SC.EXTENDED_DISCOVERY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "productId" + value: productId + + - label: + "If (MCORE.SC.SII_OP_DISCOVERY_KEY) present, SII key must be an + unsigned integer with units of milliseconds and shall be encoded as a + variable length decimal number in ASCII, omitting leading zeros. Shall + not exceed 3600000." + PICS: MCORE.SC.SII_OP_DISCOVERY_KEY && MCORE.SC.EXTENDED_DISCOVERY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "mrpRetryIntervalIdle" + constraints: + maxValue: 3600000 + + - label: + "If (MCORE.SC.SAI_OP_DISCOVERY_KEY) present, SAI key must be an + unsigned integer with units of milliseconds and shall be encoded as a + variable length decimal number in ASCII, omitting leading zeros. Shall + not exceed 3600000." + PICS: MCORE.SC.SAI_OP_DISCOVERY_KEY && MCORE.SC.EXTENDED_DISCOVERY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "mrpRetryIntervalActive" + constraints: + maxValue: 3600000 + + - label: "TXT key for commissioning mode (CM), CM=0 may be present" + PICS: MCORE.SC.EXTENDED_DISCOVERY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "commissioningMode" + value: 0 + + - label: + "If (MCORE.SC.DT_KEY) present, DT key must contain the device type + identifier from Data Model Device Types and must be encoded as a + variable length decimal ASCII number without leading zeros" + PICS: MCORE.SC.DT_KEY && MCORE.SC.EXTENDED_DISCOVERY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "deviceType" + value: deviceType + + - label: + "If (MCORE.SC.DN_KEY) present, DN key must be a UTF-8 encoded string + with a maximum length of 32B" + PICS: MCORE.SC.DN_KEY && MCORE.SC.EXTENDED_DISCOVERY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "deviceName" + constraints: + maxLength: 32 + + - label: + "If (MCORE.SC.RI_KEY) present, key RI must include the Rotating Device + Identifier encoded as a uppercase string with a maximum length of 100 + chars" + PICS: MCORE.SC.RI_KEY && MCORE.SC.EXTENDED_DISCOVERY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "rotatingIdLen" + constraints: + maxValue: 100 + + - label: + "If (MCORE.SC.PH_KEY) present, key PH must be encoded as a + variable-length decimal number in ASCII text, omitting any leading + zeros. If present value must be different of 0" + PICS: MCORE.SC.PH_KEY && MCORE.SC.EXTENDED_DISCOVERY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "pairingHint" + constraints: + notValue: 0 + + - label: + "If (MCORE.SC.PI_KEY) present, key PI must be encoded as a valid UTF-8 + string with a maximum length of 128 bytes" + PICS: MCORE.SC.PI_KEY && MCORE.SC.EXTENDED_DISCOVERY + cluster: "DiscoveryCommands" + command: "FindCommissionable" + response: + values: + - name: "pairingInstruction" + constraints: + maxLength: 128 diff --git a/src/app/tests/suites/certification/Test_TC_TIMESYNC_2_3.yaml b/src/app/tests/suites/certification/Test_TC_TIMESYNC_2_3.yaml new file mode 100644 index 00000000000000..8e4821ddc1b311 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_TIMESYNC_2_3.yaml @@ -0,0 +1,85 @@ +# Copyright (c) 2023 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: 142.2.3. [TC-TIMESYNC-2.3] SetTrustedTimeSource command with DUT as Server + +PICS: + - TIMESYNC.S + - TIMESYNC.S.F03 + - TIMESYNC.S.C01.Rsp + - TIMESYNC.S.C00.Rsp + - TIMESYNC.S.A0001 + - TIMESYNC.S.A0000 + +config: + nodeId: 0x12344321 + cluster: "Time Synchronization" + endpoint: 0 + +tests: + - label: "Step 0: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read commissioner nodeID and saves as th_node_id" + cluster: "CommissionerCommands" + command: "GetCommissionerNodeId" + response: + values: + - name: "nodeId" + saveAs: th_node_id + + - label: + "Step 1: TH sends the SetTrustedTimeSource command to the DUT with the + TrustedTimeSource fields set as follows: NodeID: th_node_id, Endpoint: + 0" + command: "SetTrustedTimeSource" + arguments: + values: + - name: "TrustedTimeSource" + value: { NodeID: th_node_id, Endpoint: 0 } + + - label: + "Step 2: TH reads from the DUT the CurrentFabricIndex attribute from + the Node Operational Credentials Cluster and saves as th_fabric_idx" + command: "readAttribute" + attribute: "CurrentFabricIndex" + cluster: "Operational Credentials" + response: + saveAs: th_fabric_idx + + - label: "Step 3: TH reads from the DUT the TrustedTimeSource attribute." + command: "readAttribute" + attribute: "TrustedTimeSource" + response: + value: { FabricIndex: th_fabric_idx, NodeID: th_node_id, Endpoint: 0 } + + - label: + "Step 4: TH sends the SetTrustedTimeSource command to the DUT with the + TrustedTimeSource set to null." + command: "SetTrustedTimeSource" + arguments: + values: + - name: "TrustedTimeSource" + value: null + + - label: "Step 5: TH reads from the DUT the TrustedTimeSource attribute." + command: "readAttribute" + attribute: "TrustedTimeSource" + response: + value: null diff --git a/src/app/tests/suites/certification/Test_TC_TMP_2_1.yaml b/src/app/tests/suites/certification/Test_TC_TMP_2_1.yaml index 6e854e88e0c719..01c6a6b86684f3 100644 --- a/src/app/tests/suites/certification/Test_TC_TMP_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TMP_2_1.yaml @@ -36,21 +36,21 @@ tests: command: "readAttribute" attribute: "MinMeasuredValue" response: - saveAs: MinMeasuredValue + saveAs: CurrentMinMeasured constraints: type: int16s minValue: -27315 - maxValue: 32767 + maxValue: 32766 - label: "Read the mandatory attribute: MaxMeasuredValue" PICS: TMP.S.A0002 command: "readAttribute" attribute: "MaxMeasuredValue" response: - saveAs: MaxMeasuredValue + saveAs: CurrentMaxMeasured constraints: type: int16s - minValue: -27314 + minValue: CurrentMinMeasured maxValue: 32767 - label: "Read the mandatory attribute: MeasuredValue" @@ -60,8 +60,8 @@ tests: response: constraints: type: int16s - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: CurrentMinMeasured + maxValue: CurrentMaxMeasured - label: "Read the optional attribute: Tolerance" PICS: TMP.S.A0003 diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 1feac1732e6522..0264ad8fe3be8d 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -1061,9 +1061,9 @@ MCORE.DD.SCAN_NFC=1 MCORE.DD.SCAN_QR_CODE=1 MCORE.COM.WIRELESS=1 MCORE.COM.BLE=1 -MCORE.COM.WIFI=1 +MCORE.COM.WIFI=0 MCORE.COM.ETH=1 -MCORE.COM.THR=1 +MCORE.COM.THR=0 MCORE.DD.TXT_KEY_VP=1 MCORE.DD.TXT_KEY_DT=1 MCORE.DD.DISCOVERY_BLE=1 @@ -1998,7 +1998,7 @@ MCORE.SC.DN_KEY=1 MCORE.SC.RI_KEY=0 MCORE.SC.PH_KEY=1 MCORE.SC.PI_KEY=1 -MCORE.SC.EXTENDED_DISCOVERY=1 +MCORE.SC.EXTENDED_DISCOVERY=0 MCORE.SC.SED=1 MCORE.SC.ADV=1 MCORE.ROLE.COMMISSIONEE=1 @@ -2608,3 +2608,33 @@ FAN.S.A000B=1 #Server commands FAN.S.C00.Rsp=1 + +#ICD Management + +#Server Attribute +ICDM.S.A0000=1 +ICDM.S.A0001=1 +ICDM.S.A0002=1 +ICDM.S.A0003=1 +ICDM.S.A0004=1 +ICDM.S.A0005=1 + +#Features +ICDM.S.F00=1 + +#Commands +ICDM.S.C03.Rsp=1 + +#RVC Clean Mode Select +RVCCLEANMS.S.F00=1 +RVCCLEANMS.S.F01=0 +RVCCLEANMS.S.F02=0 + +#Attributes: +RVCCLEANMS.S.A0004=1 +RVCCLEANMS.S.A0005=1 + +#Commands: +RVCCLEANMS.S.C00.Rsp=1 +RVCCLEANMS.S.C01.Rsp=1 +RVCCLEANMS.S.C03.Tx=1 \ No newline at end of file diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index 818a91722600f6..30188793e63fc4 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -71,6 +71,7 @@ ], "GeneralCommissioning": ["Test_TC_CGEN_1_1", "Test_TC_CGEN_2_1"], "GeneralDiagnostics": ["Test_TC_DGGEN_1_1", "Test_TC_DGGEN_2_1"], + "IcdManagement": ["Test_TC_ICDM_1_1", "Test_TC_ICDM_2_1"], "Identify": [ "Test_TC_I_1_1", "Test_TC_I_2_1", @@ -145,7 +146,10 @@ "Test_TC_APBSC_9_1", "Test_TC_CONTENTLAUNCHER_10_1", "Test_TC_WAKEONLAN_4_1", - "Test_TC_ALOGIN_12_1" + "Test_TC_ALOGIN_12_1", + "Test_TC_CONTENTLAUNCHER_10_3", + "Test_TC_CONTENTLAUNCHER_10_5", + "Test_TC_CONTENTLAUNCHER_10_7" ], "ModeSelect": ["Test_TC_MOD_1_1"], "MultipleFabrics": [], @@ -187,7 +191,7 @@ "Test_TC_DGTHREAD_2_3", "Test_TC_DGTHREAD_2_4" ], - "TimeSynchronization": ["Test_TC_TIMESYNC_1_1"], + "TimeSynchronization": ["Test_TC_TIMESYNC_1_1", "Test_TC_TIMESYNC_2_3"], "WiFiNetworkDiagnostics": [ "Test_TC_DGWIFI_1_1", "Test_TC_DGWIFI_2_1", @@ -352,6 +356,7 @@ "FanControl", "GeneralCommissioning", "GeneralDiagnostics", + "IcdManagement", "Identify", "IlluminanceMeasurement", "LevelControl", diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index ab02c78ba99c73..5fd2b511e5caa1 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -145,10 +145,7 @@ "Test_TC_MEDIAPLAYBACK_6_7", "Test_TC_AUDIOOUTPUT_7_3", "Test_TC_AUDIOOUTPUT_7_4", - "Test_TC_CONTENTLAUNCHER_10_3", "Test_TC_CONTENTLAUNCHER_10_4", - "Test_TC_CONTENTLAUNCHER_10_5", - "Test_TC_CONTENTLAUNCHER_10_7", "Test_TC_MC_11_1", "Test_TC_MC_11_2", "Test_TC_ALOGIN_12_2", diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 4b025cfcd7d3fd..c9aeac70f7797e 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -123,6 +123,8 @@ class TestList : public Command printf("Test_TC_CGEN_2_1\n"); printf("Test_TC_DGGEN_1_1\n"); printf("Test_TC_DGGEN_2_1\n"); + printf("Test_TC_ICDM_1_1\n"); + printf("Test_TC_ICDM_2_1\n"); printf("Test_TC_I_1_1\n"); printf("Test_TC_I_2_1\n"); printf("Test_TC_I_2_2\n"); @@ -180,6 +182,9 @@ class TestList : public Command printf("Test_TC_CONTENTLAUNCHER_10_1\n"); printf("Test_TC_WAKEONLAN_4_1\n"); printf("Test_TC_ALOGIN_12_1\n"); + printf("Test_TC_CONTENTLAUNCHER_10_3\n"); + printf("Test_TC_CONTENTLAUNCHER_10_5\n"); + printf("Test_TC_CONTENTLAUNCHER_10_7\n"); printf("Test_TC_MOD_1_1\n"); printf("OTA_SuccessfulTransfer\n"); printf("Test_TC_OCC_1_1\n"); @@ -220,6 +225,7 @@ class TestList : public Command printf("Test_TC_DGTHREAD_2_3\n"); printf("Test_TC_DGTHREAD_2_4\n"); printf("Test_TC_TIMESYNC_1_1\n"); + printf("Test_TC_TIMESYNC_2_3\n"); printf("Test_TC_ULABEL_1_1\n"); printf("Test_TC_ULABEL_2_1\n"); printf("Test_TC_ULABEL_2_2\n"); @@ -472,10 +478,7 @@ class ManualTestList : public Command printf("Test_TC_MEDIAPLAYBACK_6_7\n"); printf("Test_TC_AUDIOOUTPUT_7_3\n"); printf("Test_TC_AUDIOOUTPUT_7_4\n"); - printf("Test_TC_CONTENTLAUNCHER_10_3\n"); printf("Test_TC_CONTENTLAUNCHER_10_4\n"); - printf("Test_TC_CONTENTLAUNCHER_10_5\n"); - printf("Test_TC_CONTENTLAUNCHER_10_7\n"); printf("Test_TC_MC_11_1\n"); printf("Test_TC_MC_11_2\n"); printf("Test_TC_ALOGIN_12_2\n"); @@ -18207,11 +18210,12 @@ class Test_TC_CC_5_3Suite : public TestCommand class Test_TC_CC_6_1Suite : public TestCommand { public: - Test_TC_CC_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_1", 21, credsIssuerConfig) + Test_TC_CC_6_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_1", 22, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("ConfigWait", 0, UINT16_MAX, &mConfigWait); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } @@ -18226,6 +18230,7 @@ class Test_TC_CC_6_1Suite : public TestCommand chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mConfigWait; chip::Optional mTimeout; uint16_t ColorTempPhysicalMinMiredsValue; @@ -18371,6 +18376,10 @@ class Test_TC_CC_6_1Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -18553,7 +18562,14 @@ class Test_TC_CC_6_1Suite : public TestCommand ); } case 20: { - LogStep(20, "Check on/off attribute value is false after off command"); + LogStep(20, "Wait to turn Off light"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mConfigWait.HasValue() ? mConfigWait.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 21: { + LogStep(21, "Check on/off attribute value is false after off command"); VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); } @@ -18565,11 +18581,12 @@ class Test_TC_CC_6_1Suite : public TestCommand class Test_TC_CC_6_2Suite : public TestCommand { public: - Test_TC_CC_6_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_2", 32, credsIssuerConfig) + Test_TC_CC_6_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_2", 33, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("ConfigWait", 0, UINT16_MAX, &mConfigWait); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } @@ -18584,6 +18601,7 @@ class Test_TC_CC_6_2Suite : public TestCommand chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mConfigWait; chip::Optional mTimeout; uint16_t ColorTempPhysicalMinMiredsValue; @@ -18792,6 +18810,10 @@ class Test_TC_CC_6_2Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 32: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -19088,7 +19110,14 @@ class Test_TC_CC_6_2Suite : public TestCommand ); } case 31: { - LogStep(31, "Check on/off attribute value is false after off command"); + LogStep(31, "Wait to turn Off light"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mConfigWait.HasValue() ? mConfigWait.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 32: { + LogStep(32, "Check on/off attribute value is false after off command"); VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); } @@ -19100,11 +19129,12 @@ class Test_TC_CC_6_2Suite : public TestCommand class Test_TC_CC_6_3Suite : public TestCommand { public: - Test_TC_CC_6_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_3", 26, credsIssuerConfig) + Test_TC_CC_6_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_3", 27, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("ConfigWait", 0, UINT16_MAX, &mConfigWait); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } @@ -19119,6 +19149,7 @@ class Test_TC_CC_6_3Suite : public TestCommand chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mConfigWait; chip::Optional mTimeout; uint16_t ColorTempPhysicalMinMiredsValue; @@ -19294,6 +19325,10 @@ class Test_TC_CC_6_3Suite : public TestCommand VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 26: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -19529,7 +19564,14 @@ class Test_TC_CC_6_3Suite : public TestCommand ); } case 25: { - LogStep(25, "Check on/off attribute value is false after off command"); + LogStep(25, "Wait to turn Off light"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mConfigWait.HasValue() ? mConfigWait.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 26: { + LogStep(26, "Check on/off attribute value is false after off command"); VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); } @@ -19541,11 +19583,12 @@ class Test_TC_CC_6_3Suite : public TestCommand class Test_TC_CC_6_5Suite : public TestCommand { public: - Test_TC_CC_6_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_5", 17, credsIssuerConfig) + Test_TC_CC_6_5Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CC_6_5", 20, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("ConfigWait", 0, UINT16_MAX, &mConfigWait); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } @@ -19560,6 +19603,7 @@ class Test_TC_CC_6_5Suite : public TestCommand chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mConfigWait; chip::Optional mTimeout; chip::app::DataModel::Nullable StartUpColorTemperatureMiredsValue; @@ -19702,6 +19746,21 @@ class Test_TC_CC_6_5Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 3U)); } break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -19845,6 +19904,27 @@ class Test_TC_CC_6_5Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ColorControl::Id, ColorControl::Attributes::EnhancedColorMode::Id, true, chip::NullOptional); } + case 17: { + LogStep(17, "Turn Off light that we turned on"); + VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::OnOff::Commands::Off::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Commands::Off::Id, value, chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Wait to turn Off light"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mConfigWait.HasValue() ? mConfigWait.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "Check on/off attribute value is false after off command"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); + } } return CHIP_NO_ERROR; } @@ -35448,6 +35528,9 @@ class Test_TC_FLW_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; + chip::app::DataModel::Nullable MinMeasuredVariable; + chip::app::DataModel::Nullable MaxMeasuredVariable; + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } // @@ -35472,6 +35555,7 @@ class Test_TC_FLW_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); VerifyOrReturn(CheckConstraintMaxValue("value", value, 65533U)); + MinMeasuredVariable = value; } break; case 2: @@ -35480,8 +35564,9 @@ class Test_TC_FLW_2_1Suite : public TestCommand chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredVariable)); VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); + MaxMeasuredVariable = value; } break; case 3: @@ -35490,8 +35575,8 @@ class Test_TC_FLW_2_1Suite : public TestCommand chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredVariable)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredVariable)); } break; case 4: @@ -38180,10 +38265,10 @@ class Test_TC_DGGEN_2_1Suite : public TestCommand } }; -class Test_TC_I_1_1Suite : public TestCommand +class Test_TC_ICDM_1_1Suite : public TestCommand { public: - Test_TC_I_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_1_1", 8, credsIssuerConfig) + Test_TC_ICDM_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ICDM_1_1", 13, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -38191,7 +38276,7 @@ class Test_TC_I_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_I_1_1Suite() {} + ~Test_TC_ICDM_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -38225,7 +38310,7 @@ class Test_TC_I_1_1Suite : public TestCommand { uint16_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("clusterRevision", value, 4U)); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); } break; @@ -38234,11 +38319,20 @@ class Test_TC_I_1_1Suite : public TestCommand { uint32_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckValue("featureMap", value, 1UL)); VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); } break; case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -38246,6 +38340,7 @@ class Test_TC_I_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "list", "list")); VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); @@ -38254,168 +38349,578 @@ class Test_TC_I_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); } break; - case 4: + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "list", "list")); - VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); } break; - case 5: + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "list", "list")); - VerifyOrReturn(CheckConstraintContains("value", value, 64UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); } break; - case 6: + case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); { auto iter_0 = value.begin(); - VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); } VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 7: + case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } break; - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - case 0: { - LogStep(0, "Wait for the commissioned device to be retrieved"); - ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee(kIdentityAlpha, value); - } - case 1: { - LogStep(1, "TH reads the ClusterRevision attribute from the DUT"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::ClusterRevision::Id, true, - chip::NullOptional); - } - case 2: { - LogStep(2, "TH reads the FeatureMap attribute from the DUT"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::FeatureMap::Id, true, - chip::NullOptional); - } - case 3: { - LogStep(3, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AttributeList::Id, true, - chip::NullOptional); - } - case 4: { - LogStep(4, "Read the global attribute: AcceptedCommandList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AcceptedCommandList::Id, true, - chip::NullOptional); - } - case 5: { - LogStep(5, "Read the optional command(TriggerEffect) in AcceptedCommandList"); - VerifyOrDo(!ShouldSkip("I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AcceptedCommandList::Id, true, - chip::NullOptional); - } - case 6: { - LogStep(6, "Read the global attribute: GeneratedCommandList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::GeneratedCommandList::Id, true, - chip::NullOptional); - } - case 7: { - LogStep(7, - "Read EventList attribute from the DUT. For this cluster the list is usually empty but it can contain " - "manufacturer specific event IDs."); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); - } - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_I_2_1Suite : public TestCommand -{ -public: - Test_TC_I_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_2_1", 3, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_I_2_1Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - case 0: + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } break; - case 1: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint16_t value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 2: + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::Clusters::Identify::IdentifyTypeEnum value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 5U)); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::ClusterRevision::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip("ICDM.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !ICDM.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read the optional attribute(RegisteredClients) in AttributeList"); + VerifyOrDo(!ShouldSkip("ICDM.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 6: { + LogStep(6, "Read the optional attribute(IcdCounter) in AttributeList"); + VerifyOrDo(!ShouldSkip("ICDM.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "Read the optional attribute(ClientsSupportedPerFabric) in AttributeList"); + VerifyOrDo(!ShouldSkip("ICDM.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Read the global attribute: EventList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::EventList::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Read the optional command (StayActiveRequest) in AttributeList"); + VerifyOrDo(!ShouldSkip("ICDM.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip(" !ICDM.S.F00 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("ICDM.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ICDM_2_1Suite : public TestCommand +{ +public: + Test_TC_ICDM_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ICDM_2_1", 7, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ICDM_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint32_t IdleModeIntervalValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 500UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 64800000UL)); + IdleModeIntervalValue = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 300UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, IdleModeIntervalValue)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 300U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList< + chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int32u", "int32u")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads from the DUT the IdleModeInterval attribute"); + VerifyOrDo(!ShouldSkip("ICDM.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::IdleModeInterval::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads from the DUT the ActiveModeInterval attribute"); + VerifyOrDo(!ShouldSkip("ICDM.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::ActiveModeInterval::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads from the DUT the ActiveModeThreshold attribute"); + VerifyOrDo(!ShouldSkip("ICDM.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::ActiveModeThreshold::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the RegisteredClients attribute"); + VerifyOrDo(!ShouldSkip("ICDM.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::RegisteredClients::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the IcdCounter attribute"); + VerifyOrDo(!ShouldSkip("ICDM.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, IcdManagement::Attributes::ICDCounter::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the ClientsSupportedPerFabric attribute"); + VerifyOrDo(!ShouldSkip("ICDM.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), IcdManagement::Id, + IcdManagement::Attributes::ClientsSupportedPerFabric::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_I_1_1Suite : public TestCommand +{ +public: + Test_TC_I_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_1_1", 8, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_I_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 4U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 64UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads the ClusterRevision attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::ClusterRevision::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads the FeatureMap attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AttributeList::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 5: { + LogStep(5, "Read the optional command(TriggerEffect) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("I.S.C40.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::AcceptedCommandList::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Identify::Id, Identify::Attributes::GeneratedCommandList::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, + "Read EventList attribute from the DUT. For this cluster the list is usually empty but it can contain " + "manufacturer specific event IDs."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_I_2_1Suite : public TestCommand +{ +public: + Test_TC_I_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_I_2_1", 3, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_I_2_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65535U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::Identify::IdentifyTypeEnum value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 5U)); } break; default: @@ -49010,7 +49515,11 @@ class Test_TC_MEDIAPLAYBACK_6_4Suite : public TestCommand break; case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + float value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("playbackSpeed", value, -1.0f)); + } break; case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -49026,7 +49535,11 @@ class Test_TC_MEDIAPLAYBACK_6_4Suite : public TestCommand break; case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + float value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("playbackSpeed", value, -2.0f)); + } break; case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -49195,15 +49708,10 @@ class Test_TC_MEDIAPLAYBACK_6_4Suite : public TestCommand } case 14: { LogStep(14, "Reads the PlaybackSpeed attribute from the DUT"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp"), + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = - chip::Span("Please enter 'y' if PlaybackSpeed value is -1garbage: not in length on purpose", 45); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::PlaybackSpeed::Id, + true, chip::NullOptional); } case 15: { LogStep(15, "Sends a Rewind command to the DUT"); @@ -49228,15 +49736,10 @@ class Test_TC_MEDIAPLAYBACK_6_4Suite : public TestCommand } case 17: { LogStep(17, "Reads the PlaybackSpeed attribute from the DUT"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp"), + VerifyOrDo(!ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = - chip::Span("Please enter 'y' if PlaybackSpeed value is -2garbage: not in length on purpose", 45); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaPlayback::Id, MediaPlayback::Attributes::PlaybackSpeed::Id, + true, chip::NullOptional); } case 18: { LogStep(18, "Sends a Play command"); @@ -50217,18 +50720,23 @@ class Test_TC_ALOGIN_12_1Suite : public TestCommand } }; -class Test_TC_MOD_1_1Suite : public TestCommand +class Test_TC_CONTENTLAUNCHER_10_3Suite : public TestCommand { public: - Test_TC_MOD_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MOD_1_1", 10, credsIssuerConfig) + Test_TC_CONTENTLAUNCHER_10_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CONTENTLAUNCHER_10_3", 5, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("data", &mData); + AddArgument("SearchValue", &mSearchValue); + AddArgument("ExternalIdName", &mExternalIdName); + AddArgument("ExternalIdValue", &mExternalIdValue); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MOD_1_1Suite() {} + ~Test_TC_CONTENTLAUNCHER_10_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -50239,6 +50747,10 @@ class Test_TC_MOD_1_1Suite : public TestCommand chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mData; + chip::Optional mSearchValue; + chip::Optional mExternalIdName; + chip::Optional mExternalIdValue; chip::Optional mTimeout; chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } @@ -50260,97 +50772,1293 @@ class Test_TC_MOD_1_1Suite : public TestCommand case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint16_t value; + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); - VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), + mData.HasValue() ? mData.Value() : chip::Span("exampleData", 11))); } break; case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint32_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("featureMap", value, 1UL)); - VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); - } + shouldContinue = true; break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint32_t value; + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("featureMap", value, 0UL)); - VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), + mData.HasValue() ? mData.Value() : chip::Span("exampleData", 11))); } break; case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep( + 1, + "TH sends a LaunchContent command to the DUT with a search parameter and string, and AutoPlay flag set to false"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + { - chip::app::DataModel::DecodableList value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "list", "list")); - VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(0); + listHolder_1->mList[0].value = + mSearchValue.HasValue() ? mSearchValue.Value() : chip::Span("exampleValue", 12); + listHolder_1->mList[0].externalIDList.Emplace(); + + { + auto * listHolder_4 = + new ListHolder(1); + listFreer.add(listHolder_4); + + listHolder_4->mList[0].name = + mExternalIdName.HasValue() ? mExternalIdName.Value() : chip::Span("name", 4); + listHolder_4->mList[0].value = + mExternalIdValue.HasValue() ? mExternalIdValue.Value() : chip::Span("value", 5); + + listHolder_1->mList[0].externalIDList.Value() = + chip::app::DataModel::List( + listHolder_4->mList, 1); + } + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); } + + value.autoPlay = false; + value.data.Emplace(); + value.data.Value() = mData.HasValue() ? mData.Value() : chip::Span("exampleData", 11); + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Verify that DUT present via its user interface a list of matches based on the provided search criteria."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' if DUT present via its user interface a list of matches based " + "on the provided search criteria.garbage: not in length on purpose", + 111); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 3: { + LogStep( + 3, "TH sends a LaunchContent command to the DUT with a search parameter and string, and AutoPlay flag set to true"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(0); + listHolder_1->mList[0].value = + mSearchValue.HasValue() ? mSearchValue.Value() : chip::Span("exampleValue", 12); + listHolder_1->mList[0].externalIDList.Emplace(); + + { + auto * listHolder_4 = + new ListHolder(1); + listFreer.add(listHolder_4); + + listHolder_4->mList[0].name = + mExternalIdName.HasValue() ? mExternalIdName.Value() : chip::Span("name", 4); + listHolder_4->mList[0].value = + mExternalIdValue.HasValue() ? mExternalIdValue.Value() : chip::Span("value", 5); + + listHolder_1->mList[0].externalIDList.Value() = + chip::app::DataModel::List( + listHolder_4->mList, 1); + } + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + value.data.Emplace(); + value.data.Value() = mData.HasValue() ? mData.Value() : chip::Span("exampleData", 11); + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Verify that DUT should also begin playing content that best matched the given search criteria"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' if DUT begin playing content that best matched the given " + "search criteriagarbage: not in length on purpose", + 89); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CONTENTLAUNCHER_10_5Suite : public TestCommand +{ +public: + Test_TC_CONTENTLAUNCHER_10_5Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CONTENTLAUNCHER_10_5", 9, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("GoodURL", &mGoodURL); + AddArgument("BadURL", &mBadURL); + AddArgument("UnauthorizedURL", &mUnauthorizedURL); + AddArgument("DisplayContent", &mDisplayContent); + AddArgument("providerNameString", &mProviderNameString); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CONTENTLAUNCHER_10_5Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mGoodURL; + chip::Optional mBadURL; + chip::Optional mUnauthorizedURL; + chip::Optional mDisplayContent; + chip::Optional mProviderNameString; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; - case 5: + case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "list", "list")); - VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); } break; - case 6: + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "list", "list")); - VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("data", value.data)); + VerifyOrReturn(CheckValueAsString("data.Value()", value.data.Value(), + mDisplayContent.HasValue() ? mDisplayContent.Value() + : chip::Span("exampleData", 11))); } break; - case 7: + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); - } - VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckValue("status", value.status, 0U)); } break; - case 8: + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "list", "list")); - VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckValue("status", value.status, 1U)); } break; - case 9: + case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - { - auto iter_0 = value.begin(); - VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); - } - VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckValue("status", value.status, 2U)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH sends a LaunchURL command to the DUT with a known good content URL string"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type value; + value.contentURL = mGoodURL.HasValue() ? mGoodURL.Value() : chip::Span("https://csa-iot.org/", 20); + value.brandingInformation.Emplace(); + + value.brandingInformation.Value().providerName = + mProviderNameString.HasValue() ? mProviderNameString.Value() : chip::Span("exampleName", 11); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchURL::Id, value, + chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Verify that DUT launched the content at the given URL"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT launched the content at the given URLgarbage: not in length on purpose", 61); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 3: { + LogStep(3, "TH sends a LaunchURL command to the DUT with a known good content URL string and a display string"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type value; + value.contentURL = mGoodURL.HasValue() ? mGoodURL.Value() : chip::Span("https://csa-iot.org/", 20); + value.displayString.Emplace(); + value.displayString.Value() = + mDisplayContent.HasValue() ? mDisplayContent.Value() : chip::Span("exampleData", 11); + value.brandingInformation.Emplace(); + + value.brandingInformation.Value().providerName = + mProviderNameString.HasValue() ? mProviderNameString.Value() : chip::Span("exampleName", 11); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchURL::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, + "Verify that DUT launched the content at the given URL with the given display string in the " + "application-specific description area"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please enter 'y' if DUT launched the content at the given URL with the given display " + "string in the application-specific description areagarbage: not in length on purpose", + 136); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 5: { + LogStep(5, + "TH sends a LaunchURL command to the DUT with a known good content URL string and a brand information object."); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type value; + value.contentURL = mGoodURL.HasValue() ? mGoodURL.Value() : chip::Span("https://csa-iot.org/", 20); + value.brandingInformation.Emplace(); + + value.brandingInformation.Value().providerName = + mProviderNameString.HasValue() ? mProviderNameString.Value() : chip::Span("exampleName", 11); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchURL::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, + "Verify that DUT launched the content at the given URL with the player interface updated as per the provided " + "branding information"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please enter 'y' if DUT launched the content at the given URL with the player interface " + "updated as per the provided branding informationgarbage: not in length on purpose", + 136); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "TH sends a LaunchURL command to the DUT with a known unreachable content URL string."); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type value; + value.contentURL = mBadURL.HasValue() ? mBadURL.Value() : chip::Span("https://badurl", 14); + value.brandingInformation.Emplace(); + + value.brandingInformation.Value().providerName = + mProviderNameString.HasValue() ? mProviderNameString.Value() : chip::Span("exampleName", 11); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchURL::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "TH sends a LaunchURL command to the DUT with a known un-authorized content URL string."); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchURL::Type value; + value.contentURL = + mUnauthorizedURL.HasValue() ? mUnauthorizedURL.Value() : chip::Span("https://csa-iot.org/badauth", 27); + value.brandingInformation.Emplace(); + + value.brandingInformation.Value().providerName = + mProviderNameString.HasValue() ? mProviderNameString.Value() : chip::Span("exampleName", 11); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchURL::Id, value, + chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CONTENTLAUNCHER_10_7Suite : public TestCommand +{ +public: + Test_TC_CONTENTLAUNCHER_10_7Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CONTENTLAUNCHER_10_7", 27, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("PopularityName", &mPopularityName); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_CONTENTLAUNCHER_10_7Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mPopularityName; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, + "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Actor and Value as An " + "Actor’s name, for example, Gaby sHoffman"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(0); + listHolder_1->mList[0].value = chip::Span("Gaby sHoffmangarbage: not in length on purpose", 13); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 3: { + LogStep(3, + "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Channel and Value as " + "Channel Name name, for example, PBS"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(1); + listHolder_1->mList[0].value = chip::Span("PBSgarbage: not in length on purpose", 3); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 5: { + LogStep(5, + "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Character and Value " + "as Character’s name,for example,Snow White"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(2); + listHolder_1->mList[0].value = chip::Span("Snow Whitegarbage: not in length on purpose", 10); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = false; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 7: { + LogStep(7, + "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Director and Value as " + "Director’s name, for example, Spike Lee"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(3); + listHolder_1->mList[0].value = chip::Span("Spike Leegarbage: not in length on purpose", 9); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 9: { + LogStep(9, + "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Event and Value as An " + "Event’s name , for example Football games"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(4); + listHolder_1->mList[0].value = chip::Span("Football gamesgarbage: not in length on purpose", 14); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 10: { + LogStep(10, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 11: { + LogStep(11, + "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Franchise and Value " + "as Franchise’s name,for example Star Wars"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(5); + listHolder_1->mList[0].value = chip::Span("Star Warsgarbage: not in length on purpose", 9); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 12: { + LogStep(12, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 13: { + LogStep(13, + "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Genre and Value as " + "Genre’s name, for example Horror"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(6); + listHolder_1->mList[0].value = chip::Span("Horrorgarbage: not in length on purpose", 6); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 14: { + LogStep(14, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 15: { + LogStep(15, + "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As League and Value as " + "League’s name, for example NCAA"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(7); + listHolder_1->mList[0].value = chip::Span("NCAAgarbage: not in length on purpose", 4); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 17: { + LogStep(17, + "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Popularity and Value " + "as Popularity’s name"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(8); + listHolder_1->mList[0].value = + mPopularityName.HasValue() ? mPopularityName.Value() : chip::Span("popular content", 15); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 18: { + LogStep(18, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 19: { + LogStep(19, + "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Provider and Value as " + "Provider’s name, for example Netflix"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(9); + listHolder_1->mList[0].value = chip::Span("Netflixgarbage: not in length on purpose", 7); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 20: { + LogStep(20, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 21: { + LogStep(21, + "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Sport and Value as " + "Sport’s name, for example, football"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(10); + listHolder_1->mList[0].value = chip::Span("footballgarbage: not in length on purpose", 8); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 22: { + LogStep(22, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 23: { + LogStep(23, + "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As SportsTeam and Value " + "as SportTeam’s name , for example Arsenel"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(11); + listHolder_1->mList[0].value = chip::Span("Arsenelgarbage: not in length on purpose", 7); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 24: { + LogStep(24, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 25: { + LogStep(25, + "TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Type and Value as " + "Type’s name, for example TVSeries"); + VerifyOrDo(!ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ContentLauncher::Commands::LaunchContent::Type value; + + { + auto * listHolder_1 = new ListHolder(1); + listFreer.add(listHolder_1); + + listHolder_1->mList[0].type = static_cast(12); + listHolder_1->mList[0].value = chip::Span("TVSeriesgarbage: not in length on purpose", 8); + + value.search.parameterList = + chip::app::DataModel::List( + listHolder_1->mList, 1); + } + + value.autoPlay = true; + return SendCommand(kIdentityAlpha, GetEndpoint(1), ContentLauncher::Id, ContentLauncher::Commands::LaunchContent::Id, + value, chip::NullOptional + + ); + } + case 26: { + LogStep(26, "Verify that DUT should play or display the search result."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MOD_1_1Suite : public TestCommand +{ +public: + Test_TC_MOD_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MOD_1_1", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MOD_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 1UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("eventList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; default: @@ -53641,8 +55349,8 @@ class Test_TC_PRS_2_1Suite : public TestCommand chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); - VerifyOrReturn(CheckConstraintMinValue("value", value, -32768)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + VerifyOrReturn(CheckConstraintMinValue("value", value, -32767)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32766)); MinMeasuredValue = value; } break; @@ -53652,7 +55360,7 @@ class Test_TC_PRS_2_1Suite : public TestCommand chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); - VerifyOrReturn(CheckConstraintMinValue("value", value, -32768)); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); MaxMeasuredValue = value; } @@ -53683,8 +55391,8 @@ class Test_TC_PRS_2_1Suite : public TestCommand chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); - VerifyOrReturn(CheckConstraintMinValue("value", value, -32768)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); + VerifyOrReturn(CheckConstraintMinValue("value", value, -32767)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32766)); MinScaledValue = value; } break; @@ -53694,7 +55402,7 @@ class Test_TC_PRS_2_1Suite : public TestCommand chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); - VerifyOrReturn(CheckConstraintMinValue("value", value, -32768)); + VerifyOrReturn(CheckConstraintMinValue("value", value, MinScaledValue)); VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); MaxScaledValue = value; } @@ -56315,6 +58023,9 @@ class Test_TC_RH_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; + chip::app::DataModel::Nullable CurrentMinMeasured; + chip::app::DataModel::Nullable CurrentMaxMeasured; + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } // @@ -56339,6 +58050,7 @@ class Test_TC_RH_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); VerifyOrReturn(CheckConstraintMaxValue("value", value, 9999U)); + CurrentMinMeasured = value; } break; case 2: @@ -56347,8 +58059,9 @@ class Test_TC_RH_2_1Suite : public TestCommand chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, CurrentMinMeasured)); VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + CurrentMaxMeasured = value; } break; case 3: @@ -56357,8 +58070,8 @@ class Test_TC_RH_2_1Suite : public TestCommand chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 10000U)); + VerifyOrReturn(CheckConstraintMinValue("value", value, CurrentMinMeasured)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, CurrentMaxMeasured)); } break; case 4: @@ -58260,8 +59973,8 @@ class Test_TC_TMP_2_1Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - chip::app::DataModel::Nullable MinMeasuredValue; - chip::app::DataModel::Nullable MaxMeasuredValue; + chip::app::DataModel::Nullable CurrentMinMeasured; + chip::app::DataModel::Nullable CurrentMaxMeasured; chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } @@ -58286,8 +59999,8 @@ class Test_TC_TMP_2_1Suite : public TestCommand VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); VerifyOrReturn(CheckConstraintMinValue("value", value, -27315)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); - MinMeasuredValue = value; + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32766)); + CurrentMinMeasured = value; } break; case 2: @@ -58296,9 +60009,9 @@ class Test_TC_TMP_2_1Suite : public TestCommand chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); - VerifyOrReturn(CheckConstraintMinValue("value", value, -27314)); + VerifyOrReturn(CheckConstraintMinValue("value", value, CurrentMinMeasured)); VerifyOrReturn(CheckConstraintMaxValue("value", value, 32767)); - MaxMeasuredValue = value; + CurrentMaxMeasured = value; } break; case 3: @@ -58307,8 +60020,8 @@ class Test_TC_TMP_2_1Suite : public TestCommand chip::app::DataModel::Nullable value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "int16s", "int16s")); - VerifyOrReturn(CheckConstraintMinValue("value", value, MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("value", value, CurrentMinMeasured)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, CurrentMaxMeasured)); } break; case 4: @@ -63183,6 +64896,172 @@ class Test_TC_TIMESYNC_1_1Suite : public TestCommand } }; +class Test_TC_TIMESYNC_2_3Suite : public TestCommand +{ +public: + Test_TC_TIMESYNC_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_TIMESYNC_2_3", 7, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_TIMESYNC_2_3Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::NodeId th_node_id; + uint8_t th_fabric_idx; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeIdResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + th_node_id = value.nodeId; + } + shouldContinue = true; + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + th_fabric_idx = value; + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable< + chip::app::Clusters::TimeSynchronization::Structs::TrustedTimeSourceStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("trustedTimeSource", value)); + VerifyOrReturn(CheckValue("trustedTimeSource.Value().fabricIndex", value.Value().fabricIndex, th_fabric_idx)); + VerifyOrReturn(CheckValue("trustedTimeSource.Value().nodeID", value.Value().nodeID, th_node_id)); + VerifyOrReturn(CheckValue("trustedTimeSource.Value().endpoint", value.Value().endpoint, 0U)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable< + chip::app::Clusters::TimeSynchronization::Structs::TrustedTimeSourceStruct::DecodableType> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNull("trustedTimeSource", value)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Step 0: Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read commissioner nodeID and saves as th_node_id"); + ListFreer listFreer; + chip::app::Clusters::CommissionerCommands::Commands::GetCommissionerNodeId::Type value; + return GetCommissionerNodeId(kIdentityAlpha, value); + } + case 2: { + LogStep(2, + "Step 1: TH sends the SetTrustedTimeSource command to the DUT with the TrustedTimeSource fields set as " + "follows: NodeID: th_node_id, Endpoint: 0"); + ListFreer listFreer; + chip::app::Clusters::TimeSynchronization::Commands::SetTrustedTimeSource::Type value; + value.trustedTimeSource.SetNonNull(); + + value.trustedTimeSource.Value().nodeID = th_node_id; + value.trustedTimeSource.Value().endpoint = 0U; + + return SendCommand(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Commands::SetTrustedTimeSource::Id, value, chip::NullOptional + + ); + } + case 3: { + LogStep(3, + "Step 2: TH reads from the DUT the CurrentFabricIndex attribute from the Node Operational Credentials Cluster " + "and saves as th_fabric_idx"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Step 3: TH reads from the DUT the TrustedTimeSource attribute."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::TrustedTimeSource::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Step 4: TH sends the SetTrustedTimeSource command to the DUT with the TrustedTimeSource set to null."); + ListFreer listFreer; + chip::app::Clusters::TimeSynchronization::Commands::SetTrustedTimeSource::Type value; + value.trustedTimeSource.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Commands::SetTrustedTimeSource::Id, value, chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Step 5: TH reads from the DUT the TrustedTimeSource attribute."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), TimeSynchronization::Id, + TimeSynchronization::Attributes::TrustedTimeSource::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + class Test_TC_ULABEL_1_1Suite : public TestCommand { public: @@ -117916,62 +119795,6 @@ class Test_TC_AUDIOOUTPUT_7_4Suite : public TestCommand } }; -class Test_TC_CONTENTLAUNCHER_10_3Suite : public TestCommand -{ -public: - Test_TC_CONTENTLAUNCHER_10_3Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_CONTENTLAUNCHER_10_3", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_CONTENTLAUNCHER_10_3Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - {} - return CHIP_NO_ERROR; - } -}; - class Test_TC_CONTENTLAUNCHER_10_4Suite : public TestCommand { public: @@ -118028,11 +119851,10 @@ class Test_TC_CONTENTLAUNCHER_10_4Suite : public TestCommand } }; -class Test_TC_CONTENTLAUNCHER_10_5Suite : public TestCommand +class Test_TC_MC_11_1Suite : public TestCommand { public: - Test_TC_CONTENTLAUNCHER_10_5Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_CONTENTLAUNCHER_10_5", 0, credsIssuerConfig) + Test_TC_MC_11_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_11_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -118040,7 +119862,7 @@ class Test_TC_CONTENTLAUNCHER_10_5Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_CONTENTLAUNCHER_10_5Suite() {} + ~Test_TC_MC_11_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -118084,11 +119906,10 @@ class Test_TC_CONTENTLAUNCHER_10_5Suite : public TestCommand } }; -class Test_TC_CONTENTLAUNCHER_10_7Suite : public TestCommand +class Test_TC_MC_11_2Suite : public TestCommand { public: - Test_TC_CONTENTLAUNCHER_10_7Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_CONTENTLAUNCHER_10_7", 0, credsIssuerConfig) + Test_TC_MC_11_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_11_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -118096,7 +119917,7 @@ class Test_TC_CONTENTLAUNCHER_10_7Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_CONTENTLAUNCHER_10_7Suite() {} + ~Test_TC_MC_11_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -118140,10 +119961,11 @@ class Test_TC_CONTENTLAUNCHER_10_7Suite : public TestCommand } }; -class Test_TC_MC_11_1Suite : public TestCommand +class Test_TC_ALOGIN_12_2Suite : public TestCommand { public: - Test_TC_MC_11_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_11_1", 0, credsIssuerConfig) + Test_TC_ALOGIN_12_2Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_ALOGIN_12_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -118151,7 +119973,7 @@ class Test_TC_MC_11_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_11_1Suite() {} + ~Test_TC_ALOGIN_12_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -118195,10 +120017,10 @@ class Test_TC_MC_11_1Suite : public TestCommand } }; -class Test_TC_MC_11_2Suite : public TestCommand +class Test_TC_TGTNAV_8_2Suite : public TestCommand { public: - Test_TC_MC_11_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_11_2", 0, credsIssuerConfig) + Test_TC_TGTNAV_8_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TGTNAV_8_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -118206,7 +120028,7 @@ class Test_TC_MC_11_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_11_2Suite() {} + ~Test_TC_TGTNAV_8_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -118250,11 +120072,10 @@ class Test_TC_MC_11_2Suite : public TestCommand } }; -class Test_TC_ALOGIN_12_2Suite : public TestCommand +class Test_TC_CADMIN_1_1Suite : public TestCommand { public: - Test_TC_ALOGIN_12_2Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_ALOGIN_12_2", 0, credsIssuerConfig) + Test_TC_CADMIN_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CADMIN_1_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -118262,7 +120083,7 @@ class Test_TC_ALOGIN_12_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_ALOGIN_12_2Suite() {} + ~Test_TC_CADMIN_1_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -118306,10 +120127,10 @@ class Test_TC_ALOGIN_12_2Suite : public TestCommand } }; -class Test_TC_TGTNAV_8_2Suite : public TestCommand +class Test_TC_CADMIN_1_2Suite : public TestCommand { public: - Test_TC_TGTNAV_8_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TGTNAV_8_2", 0, credsIssuerConfig) + Test_TC_CADMIN_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CADMIN_1_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -118317,7 +120138,7 @@ class Test_TC_TGTNAV_8_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_TGTNAV_8_2Suite() {} + ~Test_TC_CADMIN_1_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -118361,10 +120182,10 @@ class Test_TC_TGTNAV_8_2Suite : public TestCommand } }; -class Test_TC_CADMIN_1_1Suite : public TestCommand +class Test_TC_CADMIN_1_7Suite : public TestCommand { public: - Test_TC_CADMIN_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CADMIN_1_1", 0, credsIssuerConfig) + Test_TC_CADMIN_1_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CADMIN_1_7", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -118372,7 +120193,7 @@ class Test_TC_CADMIN_1_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_CADMIN_1_1Suite() {} + ~Test_TC_CADMIN_1_7Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -118416,10 +120237,10 @@ class Test_TC_CADMIN_1_1Suite : public TestCommand } }; -class Test_TC_CADMIN_1_2Suite : public TestCommand +class Test_TC_CADMIN_1_8Suite : public TestCommand { public: - Test_TC_CADMIN_1_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CADMIN_1_2", 0, credsIssuerConfig) + Test_TC_CADMIN_1_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CADMIN_1_8", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -118427,117 +120248,7 @@ class Test_TC_CADMIN_1_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_CADMIN_1_2Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - {} - return CHIP_NO_ERROR; - } -}; - -class Test_TC_CADMIN_1_7Suite : public TestCommand -{ -public: - Test_TC_CADMIN_1_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CADMIN_1_7", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_CADMIN_1_7Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - {} - return CHIP_NO_ERROR; - } -}; - -class Test_TC_CADMIN_1_8Suite : public TestCommand -{ -public: - Test_TC_CADMIN_1_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CADMIN_1_8", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_CADMIN_1_8Suite() {} + ~Test_TC_CADMIN_1_8Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -123660,26 +125371,45 @@ class Test_TC_SC_3_4Suite : public TestCommand class Test_TC_SC_4_1Suite : public TestCommand { public: - Test_TC_SC_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_1", 0, credsIssuerConfig) + Test_TC_SC_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_SC_4_1", 95, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("discriminator", 0, UINT16_MAX, &mDiscriminator); + AddArgument("shortDiscriminator", 0, UINT16_MAX, &mShortDiscriminator); + AddArgument("vendorId", 0, UINT16_MAX, &mVendorId); + AddArgument("productId", 0, UINT16_MAX, &mProductId); + AddArgument("deviceType", 0, UINT16_MAX, &mDeviceType); + AddArgument("PakeVerifier", &mPakeVerifier); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + AddArgument("waitAfterCommissioning", 0, UINT16_MAX, &mWaitAfterCommissioning); } - ~Test_TC_SC_4_1Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override + ~Test_TC_SC_4_1Suite() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + if (deviceInstanceNameBeforeRebootBuffer != nullptr) + { + chip::Platform::MemoryFree(deviceInstanceNameBeforeRebootBuffer); + deviceInstanceNameBeforeRebootBuffer = nullptr; + } } + chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(mTimeout.ValueOr(900)); } + private: chip::Optional mNodeId; - chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mDiscriminator; + chip::Optional mShortDiscriminator; + chip::Optional mVendorId; + chip::Optional mProductId; + chip::Optional mDeviceType; + chip::Optional mPakeVerifier; chip::Optional mTimeout; + chip::Optional mWaitAfterCommissioning; + + char * deviceInstanceNameBeforeRebootBuffer = nullptr; + chip::CharSpan deviceInstanceNameBeforeReboot; chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } @@ -123693,6 +125423,838 @@ class Test_TC_SC_4_1Suite : public TestCommand switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.instanceName", value.instanceName, 16)); + VerifyOrReturn(CheckConstraintMaxLength("value.instanceName", value.instanceName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.instanceName", value.instanceName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.instanceName", value.instanceName, true)); + if (deviceInstanceNameBeforeRebootBuffer != nullptr) + { + chip::Platform::MemoryFree(deviceInstanceNameBeforeRebootBuffer); + } + deviceInstanceNameBeforeRebootBuffer = static_cast(chip::Platform::MemoryAlloc(value.instanceName.size())); + memcpy(deviceInstanceNameBeforeRebootBuffer, value.instanceName.data(), value.instanceName.size()); + deviceInstanceNameBeforeReboot = chip::CharSpan(deviceInstanceNameBeforeRebootBuffer, value.instanceName.size()); + } + shouldContinue = true; + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12)); + VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true)); + } + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12)); + VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true)); + } + shouldContinue = true; + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("longDiscriminator", value.longDiscriminator, + mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U)); + VerifyOrReturn(CheckConstraintMinValue("value.longDiscriminator", value.longDiscriminator, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value.longDiscriminator", value.longDiscriminator, 4096U)); + } + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("vendorId", value.vendorId, mVendorId.HasValue() ? mVendorId.Value() : 65521U)); + } + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("productId", value.productId, mProductId.HasValue() ? mProductId.Value() : 32769U)); + } + shouldContinue = true; + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (value.mrpRetryIntervalIdle.HasValue()) + { + VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalIdle.Value()", value.mrpRetryIntervalIdle.Value(), + 3600000UL)); + } + } + shouldContinue = true; + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (value.mrpRetryIntervalActive.HasValue()) + { + VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalActive.Value()", + value.mrpRetryIntervalActive.Value(), 3600000UL)); + } + } + shouldContinue = true; + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("commissioningMode", value.commissioningMode, 1U)); + } + shouldContinue = true; + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceType", value.deviceType, mDeviceType.HasValue() ? mDeviceType.Value() : 65535UL)); + } + shouldContinue = true; + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value.deviceName", value.deviceName, 32)); + } + shouldContinue = true; + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxValue("value.rotatingIdLen", value.rotatingIdLen, 100ULL)); + } + shouldContinue = true; + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value.pairingHint", value.pairingHint, 0U)); + } + shouldContinue = true; + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value.pairingInstruction", value.pairingInstruction, 128)); + } + shouldContinue = true; + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value.numIPs", value.numIPs, 1U)); + } + shouldContinue = true; + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.instanceName", value.instanceName, 16)); + VerifyOrReturn(CheckConstraintMaxLength("value.instanceName", value.instanceName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.instanceName", value.instanceName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.instanceName", value.instanceName, true)); + VerifyOrReturn(CheckConstraintNotValue("value.instanceName", value.instanceName, deviceInstanceNameBeforeReboot)); + } + shouldContinue = true; + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12)); + VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true)); + } + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12)); + VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true)); + } + shouldContinue = true; + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("longDiscriminator", value.longDiscriminator, + mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U)); + VerifyOrReturn(CheckConstraintMinValue("value.longDiscriminator", value.longDiscriminator, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value.longDiscriminator", value.longDiscriminator, 4096U)); + } + shouldContinue = true; + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("vendorId", value.vendorId, mVendorId.HasValue() ? mVendorId.Value() : 65521U)); + } + shouldContinue = true; + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("productId", value.productId, mProductId.HasValue() ? mProductId.Value() : 32769U)); + } + shouldContinue = true; + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (value.mrpRetryIntervalIdle.HasValue()) + { + VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalIdle.Value()", value.mrpRetryIntervalIdle.Value(), + 3600000UL)); + } + } + shouldContinue = true; + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (value.mrpRetryIntervalActive.HasValue()) + { + VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalActive.Value()", + value.mrpRetryIntervalActive.Value(), 3600000UL)); + } + } + shouldContinue = true; + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("commissioningMode", value.commissioningMode, 1U)); + } + shouldContinue = true; + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceType", value.deviceType, mDeviceType.HasValue() ? mDeviceType.Value() : 65535UL)); + } + shouldContinue = true; + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value.deviceName", value.deviceName, 32)); + } + shouldContinue = true; + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxValue("value.rotatingIdLen", value.rotatingIdLen, 100ULL)); + } + shouldContinue = true; + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value.pairingHint", value.pairingHint, 0U)); + } + shouldContinue = true; + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value.pairingInstruction", value.pairingInstruction, 128)); + } + shouldContinue = true; + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value.numIPs", value.numIPs, 1U)); + } + shouldContinue = true; + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 51: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 52: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 53: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 54: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.instanceName", value.instanceName, 16)); + VerifyOrReturn(CheckConstraintMaxLength("value.instanceName", value.instanceName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.instanceName", value.instanceName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.instanceName", value.instanceName, true)); + } + shouldContinue = true; + break; + case 55: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12)); + VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true)); + } + shouldContinue = true; + break; + case 56: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12)); + VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true)); + } + shouldContinue = true; + break; + case 57: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 58: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 59: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 60: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 61: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 62: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("vendorId", value.vendorId, mVendorId.HasValue() ? mVendorId.Value() : 65521U)); + } + shouldContinue = true; + break; + case 63: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("productId", value.productId, mProductId.HasValue() ? mProductId.Value() : 32769U)); + } + shouldContinue = true; + break; + case 64: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (value.mrpRetryIntervalIdle.HasValue()) + { + VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalIdle.Value()", value.mrpRetryIntervalIdle.Value(), + 3600000UL)); + } + } + shouldContinue = true; + break; + case 65: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (value.mrpRetryIntervalActive.HasValue()) + { + VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalActive.Value()", + value.mrpRetryIntervalActive.Value(), 3600000UL)); + } + } + shouldContinue = true; + break; + case 66: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("commissioningMode", value.commissioningMode, 2U)); + } + shouldContinue = true; + break; + case 67: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceType", value.deviceType, mDeviceType.HasValue() ? mDeviceType.Value() : 65535UL)); + } + shouldContinue = true; + break; + case 68: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value.deviceName", value.deviceName, 32)); + } + shouldContinue = true; + break; + case 69: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxValue("value.rotatingIdLen", value.rotatingIdLen, 100ULL)); + } + shouldContinue = true; + break; + case 70: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value.pairingHint", value.pairingHint, 0U)); + } + shouldContinue = true; + break; + case 71: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value.pairingInstruction", value.pairingInstruction, 128)); + } + shouldContinue = true; + break; + case 72: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value.numIPs", value.numIPs, 1U)); + } + shouldContinue = true; + break; + case 73: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 74: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 75: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.instanceName", value.instanceName, 16)); + VerifyOrReturn(CheckConstraintMaxLength("value.instanceName", value.instanceName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.instanceName", value.instanceName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.instanceName", value.instanceName, true)); + } + shouldContinue = true; + break; + case 76: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 77: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12)); + VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true)); + } + shouldContinue = true; + break; + case 78: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12)); + VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true)); + } + shouldContinue = true; + break; + case 79: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 80: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 81: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 82: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 83: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 84: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("longDiscriminator", value.longDiscriminator, + mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U)); + VerifyOrReturn(CheckConstraintMinValue("value.longDiscriminator", value.longDiscriminator, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value.longDiscriminator", value.longDiscriminator, 4096U)); + } + shouldContinue = true; + break; + case 85: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("vendorId", value.vendorId, mVendorId.HasValue() ? mVendorId.Value() : 65521U)); + } + shouldContinue = true; + break; + case 86: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("productId", value.productId, mProductId.HasValue() ? mProductId.Value() : 32769U)); + } + shouldContinue = true; + break; + case 87: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (value.mrpRetryIntervalIdle.HasValue()) + { + VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalIdle.Value()", value.mrpRetryIntervalIdle.Value(), + 3600000UL)); + } + } + shouldContinue = true; + break; + case 88: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (value.mrpRetryIntervalActive.HasValue()) + { + VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalActive.Value()", + value.mrpRetryIntervalActive.Value(), 3600000UL)); + } + } + shouldContinue = true; + break; + case 89: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("commissioningMode", value.commissioningMode, 0U)); + } + shouldContinue = true; + break; + case 90: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceType", value.deviceType, mDeviceType.HasValue() ? mDeviceType.Value() : 65535UL)); + } + shouldContinue = true; + break; + case 91: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value.deviceName", value.deviceName, 32)); + } + shouldContinue = true; + break; + case 92: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxValue("value.rotatingIdLen", value.rotatingIdLen, 100ULL)); + } + shouldContinue = true; + break; + case 93: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintNotValue("value.pairingHint", value.pairingHint, 0U)); + } + shouldContinue = true; + break; + case 94: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMaxLength("value.pairingInstruction", value.pairingInstruction, 128)); + } + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -123707,7 +126269,844 @@ class Test_TC_SC_4_1Suite : public TestCommand { using namespace chip::app::Clusters; switch (testIndex) - {} + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "DUT is put in Commissioning Mode using Open Basic Commissioning Window command "); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Waiting after opening commissioning window"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 3: { + LogStep(3, + "Check DNS-SD instance name must be 64-bit randomly selected ID expressed as a sixteen-char hex string with " + "capital letters"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 4: { + LogStep(4, "Service type must be _matterc._udp"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 5: { + LogStep(5, + "Check target hostname is derived from the 48bit or 64bit MAC address expressed as a twelve or sixteen capital " + "letter hex string"); + VerifyOrDo(!ShouldSkip("( MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 6: { + LogStep(6, + "Check target hostname is derived from the 48bit or 64bit MAC address expressed as a twelve or sixteen capital " + "letter hex string"); + VerifyOrDo(!ShouldSkip("(!MCORE.COM.WIFI && !MCORE.COM.WIFI) && MCORE.COM.THR"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "Check Long Discriminator _L"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByLongDiscriminator::Type value; + value.value = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840ULL; + return FindCommissionableByLongDiscriminator(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Check Short Discriminator (_S)"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByShortDiscriminator::Type value; + value.value = mShortDiscriminator.HasValue() ? mShortDiscriminator.Value() : 15ULL; + return FindCommissionableByShortDiscriminator(kIdentityAlpha, value); + } + case 9: { + LogStep(9, + "If (MCORE.SC.VENDOR_SUBTYPE) present, subtype _V is present must be 16-bit vendor id, encoded as a " + "variable-length decimal number in ASCII text, omitting any leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VENDOR_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByVendorId::Type value; + value.value = mVendorId.HasValue() ? mVendorId.Value() : 65521ULL; + return FindCommissionableByVendorId(kIdentityAlpha, value); + } + case 10: { + LogStep(10, + "if (MCORE.SC.DEVTYPE_SUBTYPE) present, subtype _T is present, represents device type from Data " + "Model and must be represented as a variable length decimal number in ASCII without leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DEVTYPE_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByDeviceType::Type value; + value.value = mDeviceType.HasValue() ? mDeviceType.Value() : 65535ULL; + return FindCommissionableByDeviceType(kIdentityAlpha, value); + } + case 11: { + LogStep(11, "Check Commissioning Mode (_CM) subtype _CM must be present"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByCommissioningMode::Type value; + return FindCommissionableByCommissioningMode(kIdentityAlpha, value); + } + case 12: { + LogStep(12, + "key D must be present and represents the discriminator which must be encoded as a variable-length decimal " + "value with up to 4 digits omitting any leading zeros"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "If (MCORE.SC.VP_KEY) present, VP key must contain at least Vendor ID is present"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "If (MCORE.SC.VP_KEY) present, VP key must contain at least Product ID is present"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 15: { + LogStep( + 15, + "If (MCORE.SC.SII_OP_DISCOVERY_KEY) present, SII key must be an unsigned integer with units of milliseconds and " + "shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall not exceed 3600000"); + VerifyOrDo(!ShouldSkip("MCORE.SC.SII_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 16: { + LogStep( + 16, + "If (MCORE.SC.SAI_OP_DISCOVERY_KEY ) present, SAI key must be an unsigned integer with units of milliseconds and " + "shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall not exceed 3600000."); + VerifyOrDo(!ShouldSkip("MCORE.SC.SAI_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 17: { + LogStep(17, "TXT key for commissioning mode (CM) CM=1 must be present"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 18: { + LogStep(18, + "If (MCORE.SC.DT_KEY) present, DT key must contain the device type identifier from Data Model Device Types and " + "must be encoded as a variable length decimal ASCII number without leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DT_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 19: { + LogStep(19, "If (MCORE.SC.DN_KEY) present, DN key must be a UTF-8 encoded string with a maximum length of 32B"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DN_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 20: { + LogStep(20, + "If (MCORE.SC.RI_KEY ) present, key RI must include the Rotating Device Identifier encoded as a uppercase " + "string with a maximum length of 100 chars"); + VerifyOrDo(!ShouldSkip("MCORE.SC.RI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 21: { + LogStep(21, + "If (MCORE.SC.PH_KEY) present, key PH must be encoded as a variable-length decimal number in ASCII text, " + "omitting any leading zeros. If present value must be different of 0"); + VerifyOrDo(!ShouldSkip("MCORE.SC.PH_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 22: { + LogStep( + 22, + "If (MCORE.SC.PI_KEY) present, key PI must be encoded as a valid UTF-8 string with a maximum length of 128 bytes"); + VerifyOrDo(!ShouldSkip("MCORE.SC.PI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 23: { + LogStep(23, + "DUT must publish AAAA records for each IPv6 address upon which they are willing to accept Matter messages."); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 24: { + LogStep(24, "Reboot/restart the DUT"); + VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot(kIdentityAlpha, value); + } + case 25: { + LogStep(25, "Reboot target device(DUT)"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = + chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 26: { + LogStep(26, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 27: { + LogStep(27, + "DUT put in Commissioning Mode using Open Basic Commissioning Window command, starting advertising " + "Commissionable Node Discovery service using DNS-SD"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 28: { + LogStep(28, "Waiting after opening commissioning window"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 29: { + LogStep(29, + "Check DNS-SD instance name must be 64-bit randomly selected ID expressed as a sixteen-char hex string with " + "capital letters and must be different from the one at step 2"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 30: { + LogStep(30, "service type must be _matterc._udp"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 31: { + LogStep(31, + "Check Hostname. If (MCORE.COM.WIFI) OR (MCORE.COM.ETH) target hostname is derived from the 48bit or 64bit MAC " + "address expressed as a twelve or sixteen capital letter hex string"); + VerifyOrDo(!ShouldSkip("(MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 32: { + LogStep(32, + "Check Hostname. If (MCORE.COM.THR) target hostname is derived from the 48bit or 64bit MAC address expressed " + "as a twelve or sixteen capital letter hex string"); + VerifyOrDo(!ShouldSkip("(!MCORE.COM.WIFI && !MCORE.COM.ETH) && MCORE.COM.THR"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 33: { + LogStep(33, "Check Long Discriminator _L"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByLongDiscriminator::Type value; + value.value = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840ULL; + return FindCommissionableByLongDiscriminator(kIdentityAlpha, value); + } + case 34: { + LogStep(34, "Check Short Discriminator (_S)"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByShortDiscriminator::Type value; + value.value = mShortDiscriminator.HasValue() ? mShortDiscriminator.Value() : 15ULL; + return FindCommissionableByShortDiscriminator(kIdentityAlpha, value); + } + case 35: { + LogStep(35, + "If (MCORE.SC.VENDOR_SUBTYPE ) present, subtype _V is present must be 16-bit vendor id, encoded as a " + "variable-length decimal number in ASCII text, omitting any leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VENDOR_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByVendorId::Type value; + value.value = mVendorId.HasValue() ? mVendorId.Value() : 65521ULL; + return FindCommissionableByVendorId(kIdentityAlpha, value); + } + case 36: { + LogStep(36, + "If (MCORE.SC.DEVTYPE_SUBTYPE) present, subtype _T is present, represents device type from Data " + "Model and must be represented as a variable length decimal number in ASCII without leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DEVTYPE_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByDeviceType::Type value; + value.value = mDeviceType.HasValue() ? mDeviceType.Value() : 65535ULL; + return FindCommissionableByDeviceType(kIdentityAlpha, value); + } + case 37: { + LogStep(37, "Check Commissioning Mode (_CM) subtype _CM is present"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByCommissioningMode::Type value; + return FindCommissionableByCommissioningMode(kIdentityAlpha, value); + } + case 38: { + LogStep(38, + "key D must be present and represents the discriminator which must be encoded as a variable-length decimal " + "value with up to 4 digits omitting any leading zeros"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 39: { + LogStep(39, "If (MCORE.SC.VP_KEY) present, VP key must contain at least Vendor ID is present."); + VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 40: { + LogStep(40, "If (MCORE.SC.VP_KEY) present, VP key must contain at least Product ID is present."); + VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 41: { + LogStep( + 41, + "If (MCORE.SC.SII_OP_DISCOVERY_KEY ) present, SII key must be an unsigned integer with units of milliseconds and " + "shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall not exceed 3600000"); + VerifyOrDo(!ShouldSkip("MCORE.SC.SII_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 42: { + LogStep( + 42, + "If (MCORE.SC.SAI_OP_DISCOVERY_KEY) present, SAI key must be an unsigned integer with units of milliseconds and " + "shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall not exceed 3600000."); + VerifyOrDo(!ShouldSkip("MCORE.SC.SAI_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 43: { + LogStep(43, "TXT key for commissioning mode (CM) key CM=1 must be present"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 44: { + LogStep(44, + "If (MCORE.SC.DT_KEY) present, DT key must contain the device type identifier from Data Model Device Types and " + "must be encoded as a variable length decimal ASCII number without leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DT_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 45: { + LogStep(45, "If (MCORE.SC.DN_KEY) present, DN key must be a UTF-8 encoded string with a maximum length of 32B"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DN_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 46: { + LogStep(46, + "If (MCORE.SC.RI_KEY) present, key RI must include the Rotating Device Identifier encoded as a uppercase " + "string with a maximum length of 100 chars"); + VerifyOrDo(!ShouldSkip("MCORE.SC.RI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 47: { + LogStep(47, + "If (MCORE.SC.PH_KEY) present, key PH must be encoded as a variable-length decimal number in ASCII text, " + "omitting any leading zeros. If present value must be different of 0"); + VerifyOrDo(!ShouldSkip("MCORE.SC.PH_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 48: { + LogStep( + 48, + "If (MCORE.SC.PI_KEY) present, key PI must be encoded as a valid UTF-8 string with a maximum length of 128 bytes"); + VerifyOrDo(!ShouldSkip("MCORE.SC.PI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 49: { + LogStep(49, + "DUT must publish AAAA records for each IPv6 address upon which they are willing to accept Matter messages."); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 50: { + LogStep(50, "Wait for OpenBasicCommissioningWindow timeout to expire"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 180000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 51: { + LogStep(51, + "DUT is Commissioned and instructed to enter in commissioning mode using Open Commissioning Window command"); + VerifyOrDo(!ShouldSkip("CADMIN.S.C00.Rsp && PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Type value; + value.commissioningTimeout = 180U; + value.PAKEPasscodeVerifier = mPakeVerifier.HasValue() + ? mPakeVerifier.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\xb9\x61\x70\xaa\xe8\x03\x34\x68\x84\x72\x4f\xe9\xa3\xb2\x87\xc3\x03\x30\xc2\xa6\x60\x37\x5d\x17\xbb\x20" + "\x5a\x8c\xf1\xae\xcb\x35\x04\x57\xf8\xab\x79\xee\x25\x3a\xb6\xa8\xe4\x6b\xb0\x9e\x54\x3a\xe4\x22\x73\x6d" + "\xe5\x01\xe3\xdb\x37\xd4\x41\xfe\x34\x49\x20\xd0\x95\x48\xe4\xc1\x82\x40\x63\x0c\x4f\xf4\x91\x3c\x53\x51" + "\x38\x39\xb7\xc0\x7f\xcc\x06\x27\xa1\xb8\x57\x3a\x14\x9f\xcd\x1f\xa4\x66\xcf"), + 97); + value.discriminator = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U; + value.iterations = 1000UL; + value.salt = chip::ByteSpan(chip::Uint8::from_const_char("SPAKE2P Key Saltgarbage: not in length on purpose"), 16); + return SendCommand(kIdentityAlpha, GetEndpoint(0), AdministratorCommissioning::Id, + AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 52: { + LogStep(52, + "DUT is Commissioned and instructed to enter in commissioning mode using Open Commissioning Window command"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && CADMIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 53: { + LogStep(53, "Waiting after opening commissioning window"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mWaitAfterCommissioning.HasValue() ? mWaitAfterCommissioning.Value() : 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 54: { + LogStep(54, + "DNS-SD instance name must be 64-bit randomly selected ID expressed as a sixteen-char hex string with capital " + "letters"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 55: { + LogStep(55, + "Check Hostname.If (MCORE.COM.WIFI) OR (MCORE.COM.ETH) target hostname is derived from the 48bit or 64bit MAC " + "address expressed as a twelve or sixteen capital letter hex string."); + VerifyOrDo(!ShouldSkip("(MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 56: { + LogStep(56, + "Check Hostname. If (MCORE.COM.THR) target hostname is derived from the 48bit or 64bit MAC extended address " + "expressed as a twelve or sixteen capital letter hex string."); + VerifyOrDo(!ShouldSkip("(!MCORE.COM.WIFI && !MCORE.COM.ETH) && MCORE.COM.THR"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 57: { + LogStep(57, "Check Long Discriminator _L"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByLongDiscriminator::Type value; + value.value = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840ULL; + return FindCommissionableByLongDiscriminator(kIdentityAlpha, value); + } + case 58: { + LogStep(58, "Check Short Discriminator (_S)"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByShortDiscriminator::Type value; + value.value = mShortDiscriminator.HasValue() ? mShortDiscriminator.Value() : 15ULL; + return FindCommissionableByShortDiscriminator(kIdentityAlpha, value); + } + case 59: { + LogStep(59, + "If (MCORE.SC.VENDOR_SUBTYPE) present, subtype _V is present must be 16-bit vendor id, encoded as a " + "variable-length decimal number in ASCII text, omitting any leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VENDOR_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByVendorId::Type value; + value.value = mVendorId.HasValue() ? mVendorId.Value() : 65521ULL; + return FindCommissionableByVendorId(kIdentityAlpha, value); + } + case 60: { + LogStep(60, + "If (MCORE.SC.DEVTYPE_SUBTYPE) present, subtype _T is present, represents device type from Data " + "Model and must be represented as a variable length decimal number in ASCII without leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VENDOR_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByDeviceType::Type value; + value.value = mDeviceType.HasValue() ? mDeviceType.Value() : 65535ULL; + return FindCommissionableByDeviceType(kIdentityAlpha, value); + } + case 61: { + LogStep(61, "Check Commissioning Mode (_CM) subtype _CM is present"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByCommissioningMode::Type value; + return FindCommissionableByCommissioningMode(kIdentityAlpha, value); + } + case 62: { + LogStep(62, "If (MCORE.SC.VP_KEY ) present, VP key must contain at least Vendor ID is present."); + VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 63: { + LogStep(63, "If (MCORE.SC.VP_KEY ) present, VP key must contain at least Product ID is present"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 64: { + LogStep(64, + "Optional TXT key for MRP Retry Interval Idle. if (MCORE.SC.SII_OP_DISCOVERY_KEY) present, SII key must be an " + "unsigned integer with units of milliseconds and shall be encoded as a variable length decimal number in " + "ASCII, omitting leading zeros. Shall not exceed 3600000"); + VerifyOrDo(!ShouldSkip("MCORE.SC.SII_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 65: { + LogStep(65, + "Optional TXT key for MRP Retry Interval Active. if (MCORE.SC.SAI_OP_DISCOVERY_KEY) present, SAI key must be " + "an unsigned integer with units of milliseconds and shall be encoded as a variable length decimal number in " + "ASCII, omitting leading zeros. Shall not exceed 3600000."); + VerifyOrDo(!ShouldSkip("MCORE.SC.SAI_OP_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 66: { + LogStep(66, "TXT key for commissioning mode. CM=2 must be present"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 67: { + LogStep(67, + "If (MCORE.SC.DT_KEY) present, DT key must contain the device type identifier from Data Model Device Types and " + "must be encoded as a variable length decimal ASCII number without leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DT_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 68: { + LogStep(68, "If (MCORE.SC.DN_KEY) present, DN key must be a UTF-8 encoded string with a maximum length of 32B"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DN_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 69: { + LogStep(69, + "If (MCORE.SC.RI_KEY) present, key RI must include the Rotating Device Identifier encoded as a uppercase " + "string with a maximum length of 100 chars"); + VerifyOrDo(!ShouldSkip("MCORE.SC.RI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 70: { + LogStep(70, + "If (MCORE.SC.PH_KEY) present, key PH must be encoded as a variable-length decimal number in ASCII text, " + "omitting any leading zeros. If present value must be different of 0"); + VerifyOrDo(!ShouldSkip("MCORE.SC.PH_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 71: { + LogStep( + 71, + "If (MCORE.SC.PI_KEY) present, key PI must be encoded as a valid UTF-8 string with a maximum length of 128 bytes"); + VerifyOrDo(!ShouldSkip("MCORE.SC.PI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 72: { + LogStep(72, + "DUT must publish AAAA records for each IPv6 address upon which they are willing to accept Matter messages"); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 73: { + LogStep(73, "Wait for OCW timeout to expire"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 180000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 74: { + LogStep(74, + "If (MCORE.SC.EXTENDED_DISCOVERY ) enable Extended Discovery. DUT should start to send Commissionable Node " + "Discovery DNS-SD advertisements"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 75: { + LogStep(75, + "Check DNS-SD instance name must be 64-bit randomly selected ID expressed as a sixteen-char hex string with " + "capital letters"); + VerifyOrDo(!ShouldSkip("MCORE.SC.EXTENDED_DISCOVERY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 76: { + LogStep(76, "service type must be _matterc._udp"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 77: { + LogStep(77, + "Check Hostname. If (MCORE.COM.WIFI) OR (MCORE.COM.ETH) target hostname is derived from the 48bit or 64bit MAC " + "address expressed as a twelve or sixteen capital letter hex string"); + VerifyOrDo(!ShouldSkip("(MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 78: { + LogStep(78, + "Check Hostname. If (MCORE.COM.THR) target hostname is derived from the 48bit or 64bit MAC extended address " + "expressed as a twelve or sixteen capital letter hex string."); + VerifyOrDo(!ShouldSkip("(!MCORE.COM.WIFI && !MCORE.COM.ETH) && MCORE.COM.THR && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 79: { + LogStep(79, "Check Long Discriminator _L"); + VerifyOrDo(!ShouldSkip("MCORE.SC.EXTENDED_DISCOVERY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByLongDiscriminator::Type value; + value.value = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840ULL; + return FindCommissionableByLongDiscriminator(kIdentityAlpha, value); + } + case 80: { + LogStep(80, "Check Short Discriminator (_S)"); + VerifyOrDo(!ShouldSkip("MCORE.SC.EXTENDED_DISCOVERY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByShortDiscriminator::Type value; + value.value = mShortDiscriminator.HasValue() ? mShortDiscriminator.Value() : 15ULL; + return FindCommissionableByShortDiscriminator(kIdentityAlpha, value); + } + case 81: { + LogStep(81, + "If (MCORE.SC.VENDOR_SUBTYPE ) present, subtype _V is present must be 16-bit vendor id, encoded as a " + "variable-length decimal number in ASCII text, omitting any leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VENDOR_SUBTYPE && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByVendorId::Type value; + value.value = mVendorId.HasValue() ? mVendorId.Value() : 65521ULL; + return FindCommissionableByVendorId(kIdentityAlpha, value); + } + case 82: { + LogStep(82, + "If (MCORE.SC.DEVTYPE_SUBTYPE) present, subtype _T is present, represents device type from Data " + "Model and must be represented as a variable length decimal number in ASCII without leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DEVTYPE_SUBTYPE && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByDeviceType::Type value; + value.value = mDeviceType.HasValue() ? mDeviceType.Value() : 65535ULL; + return FindCommissionableByDeviceType(kIdentityAlpha, value); + } + case 83: { + LogStep(83, "Check Commissioning Mode (_CM)"); + VerifyOrDo(!ShouldSkip("MCORE.SC.EXTENDED_DISCOVERY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByCommissioningMode::Type value; + return FindCommissionableByCommissioningMode(kIdentityAlpha, value); + } + case 84: { + LogStep(84, "TXT key for discriminator (D)"); + VerifyOrDo(!ShouldSkip("MCORE.SC.EXTENDED_DISCOVERY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 85: { + LogStep(85, "If (MCORE.SC.VP_KEY) present, VP key must contain at least Vendor ID is present"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 86: { + LogStep(86, "If (MCORE.SC.VP_KEY) present, VP key must contain at least Product ID is present"); + VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 87: { + LogStep( + 87, + "If (MCORE.SC.SII_OP_DISCOVERY_KEY) present, SII key must be an unsigned integer with units of milliseconds and " + "shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall not exceed 3600000."); + VerifyOrDo(!ShouldSkip("MCORE.SC.SII_OP_DISCOVERY_KEY && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 88: { + LogStep( + 88, + "If (MCORE.SC.SAI_OP_DISCOVERY_KEY) present, SAI key must be an unsigned integer with units of milliseconds and " + "shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall not exceed 3600000."); + VerifyOrDo(!ShouldSkip("MCORE.SC.SAI_OP_DISCOVERY_KEY && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 89: { + LogStep(89, "TXT key for commissioning mode (CM), CM=0 may be present"); + VerifyOrDo(!ShouldSkip("MCORE.SC.EXTENDED_DISCOVERY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 90: { + LogStep(90, + "If (MCORE.SC.DT_KEY) present, DT key must contain the device type identifier from Data Model Device Types and " + "must be encoded as a variable length decimal ASCII number without leading zeros"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DT_KEY && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 91: { + LogStep(91, "If (MCORE.SC.DN_KEY) present, DN key must be a UTF-8 encoded string with a maximum length of 32B"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DN_KEY && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 92: { + LogStep(92, + "If (MCORE.SC.RI_KEY) present, key RI must include the Rotating Device Identifier encoded as a uppercase " + "string with a maximum length of 100 chars"); + VerifyOrDo(!ShouldSkip("MCORE.SC.RI_KEY && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 93: { + LogStep(93, + "If (MCORE.SC.PH_KEY) present, key PH must be encoded as a variable-length decimal number in ASCII text, " + "omitting any leading zeros. If present value must be different of 0"); + VerifyOrDo(!ShouldSkip("MCORE.SC.PH_KEY && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 94: { + LogStep( + 94, + "If (MCORE.SC.PI_KEY) present, key PI must be encoded as a valid UTF-8 string with a maximum length of 128 bytes"); + VerifyOrDo(!ShouldSkip("MCORE.SC.PI_KEY && MCORE.SC.EXTENDED_DISCOVERY"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + } return CHIP_NO_ERROR; } }; @@ -135296,6 +138695,8 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -135353,6 +138754,9 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -135393,6 +138797,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -135634,10 +139039,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index dff6c7bd3e7c71..0eefdf94fa9f36 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -142,6 +142,9 @@ class TestList : public Command { printf("Test_TC_CONTENTLAUNCHER_10_1\n"); printf("Test_TC_WAKEONLAN_4_1\n"); printf("Test_TC_ALOGIN_12_1\n"); + printf("Test_TC_CONTENTLAUNCHER_10_3\n"); + printf("Test_TC_CONTENTLAUNCHER_10_5\n"); + printf("Test_TC_CONTENTLAUNCHER_10_7\n"); printf("Test_TC_MOD_1_1\n"); printf("OTA_SuccessfulTransfer\n"); printf("Test_TC_OCC_1_1\n"); @@ -20724,6 +20727,7 @@ class Test_TC_CC_6_1 : public TestCommandBridge { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("ConfigWait", 0, UINT16_MAX, &mConfigWait); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) @@ -20913,12 +20917,16 @@ class Test_TC_CC_6_1 : public TestCommandBridge { err = TestTurnOffLightThatWeTurnedOn_19(); break; case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Check on/off attribute value is false after off command\n"); + ChipLogProgress(chipTool, " ***** Test Step 20 : Wait to turn Off light\n"); + err = TestWaitToTurnOffLight_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Check on/off attribute value is false after off command\n"); if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_20(); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_21(); break; } @@ -20994,6 +21002,9 @@ class Test_TC_CC_6_1 : public TestCommandBridge { case 20: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -21007,11 +21018,12 @@ class Test_TC_CC_6_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 21; + const uint16_t mTestCount = 22; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mConfigWait; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() @@ -21383,7 +21395,15 @@ class Test_TC_CC_6_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_20() + CHIP_ERROR TestWaitToTurnOffLight_20() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mConfigWait.HasValue() ? mConfigWait.Value() : 5000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_21() { MTRBaseDevice * device = GetDevice("alpha"); @@ -21417,6 +21437,7 @@ class Test_TC_CC_6_5 : public TestCommandBridge { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("ConfigWait", 0, UINT16_MAX, &mConfigWait); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) @@ -21577,6 +21598,26 @@ class Test_TC_CC_6_5 : public TestCommandBridge { } err = TestThReadsEnhancedColorModeAttributeFromDut_16(); break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Turn Off light that we turned on\n"); + if (ShouldSkip("OO.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestTurnOffLightThatWeTurnedOn_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Wait to turn Off light\n"); + err = TestWaitToTurnOffLight_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Check on/off attribute value is false after off command\n"); + if (ShouldSkip("OO.S.A0000")) { + NextTest(); + return; + } + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_19(); + break; } if (CHIP_NO_ERROR != err) { @@ -21639,6 +21680,15 @@ class Test_TC_CC_6_5 : public TestCommandBridge { case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -21652,11 +21702,12 @@ class Test_TC_CC_6_5 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 17; + const uint16_t mTestCount = 20; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mConfigWait; chip::Optional mTimeout; CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() @@ -21977,6 +22028,55 @@ class Test_TC_CC_6_5 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestTurnOffLightThatWeTurnedOn_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster offWithCompletion:^(NSError * _Nullable err) { + NSLog(@"Turn Off light that we turned on Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitToTurnOffLight_18() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = mConfigWait.HasValue() ? mConfigWait.Value() : 5000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Check on/off attribute value is false after off command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_CC_7_3 : public TestCommandBridge { @@ -31773,6 +31873,7 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } + NSNumber * _Nullable MinMeasuredVariable; CHIP_ERROR TestReadTheMandatoryAttributeMinMeasuredValue_1() { @@ -31792,12 +31893,16 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value unsignedShortValue], 0U)); VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value unsignedShortValue], 65533U)); } + { + MinMeasuredVariable = value; + } NextTest(); }]; return CHIP_NO_ERROR; } + NSNumber * _Nullable MaxMeasuredVariable; CHIP_ERROR TestReadTheMandatoryAttributeMaxMeasuredValue_2() { @@ -31814,9 +31919,13 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value unsignedShortValue], 0U)); + VerifyOrReturn( + CheckConstraintMinValue("maxMeasuredValue", [value unsignedShortValue], MinMeasuredVariable)); VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value unsignedShortValue], 65534U)); } + { + MaxMeasuredVariable = value; + } NextTest(); }]; @@ -31839,8 +31948,8 @@ class Test_TC_FLW_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("measuredValue", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value unsignedShortValue], 65535U)); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value unsignedShortValue], MinMeasuredVariable)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value unsignedShortValue], MaxMeasuredVariable)); } NextTest(); @@ -54673,7 +54782,7 @@ class Test_TC_MEDIAPLAYBACK_6_4 : public TestCommandBridge { break; case 14: ChipLogProgress(chipTool, " ***** Test Step 14 : Reads the PlaybackSpeed attribute from the DUT\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp")) { + if (ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp")) { NextTest(); return; } @@ -54698,7 +54807,7 @@ class Test_TC_MEDIAPLAYBACK_6_4 : public TestCommandBridge { break; case 17: ChipLogProgress(chipTool, " ***** Test Step 17 : Reads the PlaybackSpeed attribute from the DUT\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp")) { + if (ShouldSkip("MEDIAPLAYBACK.S.A0004 && MEDIAPLAYBACK.S.C06.Rsp")) { NextTest(); return; } @@ -55120,12 +55229,24 @@ class Test_TC_MEDIAPLAYBACK_6_4 : public TestCommandBridge { CHIP_ERROR TestReadsThePlaybackSpeedAttributeFromTheDut_14() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please enter 'y' if PlaybackSpeed value is -1garbage: not in length on purpose", 45); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePlaybackSpeedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the PlaybackSpeed attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("PlaybackSpeed", actualValue, -1.0f)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } CHIP_ERROR TestSendsARewindCommandToTheDut_15() @@ -55165,12 +55286,24 @@ class Test_TC_MEDIAPLAYBACK_6_4 : public TestCommandBridge { CHIP_ERROR TestReadsThePlaybackSpeedAttributeFromTheDut_17() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message - = chip::Span("Please enter 'y' if PlaybackSpeed value is -2garbage: not in length on purpose", 45); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePlaybackSpeedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads the PlaybackSpeed attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("PlaybackSpeed", actualValue, -2.0f)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } CHIP_ERROR TestSendsAPlayCommand_18() @@ -56739,21 +56872,25 @@ class Test_TC_ALOGIN_12_1 : public TestCommandBridge { } }; -class Test_TC_MOD_1_1 : public TestCommandBridge { +class Test_TC_CONTENTLAUNCHER_10_3 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MOD_1_1() - : TestCommandBridge("Test_TC_MOD_1_1") + Test_TC_CONTENTLAUNCHER_10_3() + : TestCommandBridge("Test_TC_CONTENTLAUNCHER_10_3") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("data", &mData); + AddArgument("SearchValue", &mSearchValue); + AddArgument("ExternalIdName", &mExternalIdName); + AddArgument("ExternalIdValue", &mExternalIdValue); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MOD_1_1() {} + ~Test_TC_CONTENTLAUNCHER_10_3() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -56761,11 +56898,11 @@ class Test_TC_MOD_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MOD_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CONTENTLAUNCHER_10_3\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MOD_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CONTENTLAUNCHER_10_3\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -56782,58 +56919,1861 @@ class Test_TC_MOD_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision attribute from the DUT\n"); - err = TestThReadsTheClusterRevisionAttributeFromTheDut_1(); + ChipLogProgress(chipTool, + " ***** Test Step 1 : TH sends a LaunchContent command to the DUT with a search parameter and string, and AutoPlay " + "flag set to false\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALaunchContentCommandToTheDutWithASearchParameterAndStringAndAutoPlayFlagSetToFalse_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the FeatureMap attribute from the DUT\n"); - if (ShouldSkip("MOD.S.F00")) { + ChipLogProgress(chipTool, + " ***** Test Step 2 : Verify that DUT present via its user interface a list of matches based on the provided " + "search criteria.\n"); + if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) { NextTest(); return; } - err = TestThReadsTheFeatureMapAttributeFromTheDut_2(); + err = TestVerifyThatDutPresentViaItsUserInterfaceAListOfMatchesBasedOnTheProvidedSearchCriteria_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads the FeatureMap attribute from the DUT\n"); - if (ShouldSkip(" !MOD.S.F00 ")) { + ChipLogProgress(chipTool, + " ***** Test Step 3 : TH sends a LaunchContent command to the DUT with a search parameter and string, and AutoPlay " + "flag set to true\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) { NextTest(); return; } - err = TestThReadsTheFeatureMapAttributeFromTheDut_3(); + err = TestThSendsALaunchContentCommandToTheDutWithASearchParameterAndStringAndAutoPlayFlagSetToTrue_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads the AttributeList attribute from the DUT\n"); - err = TestThReadsTheAttributeListAttributeFromTheDut_4(); + ChipLogProgress(chipTool, + " ***** Test Step 4 : Verify that DUT should also begin playing content that best matched the given search " + "criteria\n"); + if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatDutShouldAlsoBeginPlayingContentThatBestMatchedTheGivenSearchCriteria_4(); break; - case 5: + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mData; + chip::Optional mSearchValue; + chip::Optional mExternalIdName; + chip::Optional mExternalIdValue; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThSendsALaunchContentCommandToTheDutWithASearchParameterAndStringAndAutoPlayFlagSetToFalse_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init]; + params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = mSearchValue.HasValue() + ? [[NSString alloc] initWithBytes:mSearchValue.Value().data() + length:mSearchValue.Value().size() + encoding:NSUTF8StringEncoding] + : @"exampleValue"; + { + NSMutableArray * temp_4 = [[NSMutableArray alloc] init]; + temp_4[0] = [[MTRContentLauncherClusterAdditionalInfoStruct alloc] init]; + ((MTRContentLauncherClusterAdditionalInfoStruct *) temp_4[0]).name = mExternalIdName.HasValue() + ? [[NSString alloc] initWithBytes:mExternalIdName.Value().data() + length:mExternalIdName.Value().size() + encoding:NSUTF8StringEncoding] + : @"name"; + ((MTRContentLauncherClusterAdditionalInfoStruct *) temp_4[0]).value = mExternalIdValue.HasValue() + ? [[NSString alloc] initWithBytes:mExternalIdValue.Value().data() + length:mExternalIdValue.Value().size() + encoding:NSUTF8StringEncoding] + : @"value"; + + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).externalIDList = temp_4; + } + + ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1; + } + + params.autoPlay = [NSNumber numberWithBool:false]; + params.data = mData.HasValue() + ? [[NSString alloc] initWithBytes:mData.Value().data() length:mData.Value().size() encoding:NSUTF8StringEncoding] + : @"exampleData"; + [cluster + launchContentWithParams:params + completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a LaunchContent command to the DUT with a search parameter and string, and AutoPlay " + @"flag set to false Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("Data", actualValue, + mData.HasValue() ? [[NSString alloc] initWithBytes:mData.Value().data() + length:mData.Value().size() + encoding:NSUTF8StringEncoding] + : @"exampleData")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatDutPresentViaItsUserInterfaceAListOfMatchesBasedOnTheProvidedSearchCriteria_2() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' if DUT present via its user interface a list of matches based on " + "the provided search criteria.garbage: not in length on purpose", + 111); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestThSendsALaunchContentCommandToTheDutWithASearchParameterAndStringAndAutoPlayFlagSetToTrue_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init]; + params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = mSearchValue.HasValue() + ? [[NSString alloc] initWithBytes:mSearchValue.Value().data() + length:mSearchValue.Value().size() + encoding:NSUTF8StringEncoding] + : @"exampleValue"; + { + NSMutableArray * temp_4 = [[NSMutableArray alloc] init]; + temp_4[0] = [[MTRContentLauncherClusterAdditionalInfoStruct alloc] init]; + ((MTRContentLauncherClusterAdditionalInfoStruct *) temp_4[0]).name = mExternalIdName.HasValue() + ? [[NSString alloc] initWithBytes:mExternalIdName.Value().data() + length:mExternalIdName.Value().size() + encoding:NSUTF8StringEncoding] + : @"name"; + ((MTRContentLauncherClusterAdditionalInfoStruct *) temp_4[0]).value = mExternalIdValue.HasValue() + ? [[NSString alloc] initWithBytes:mExternalIdValue.Value().data() + length:mExternalIdValue.Value().size() + encoding:NSUTF8StringEncoding] + : @"value"; + + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).externalIDList = temp_4; + } + + ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1; + } + + params.autoPlay = [NSNumber numberWithBool:true]; + params.data = mData.HasValue() + ? [[NSString alloc] initWithBytes:mData.Value().data() length:mData.Value().size() encoding:NSUTF8StringEncoding] + : @"exampleData"; + [cluster + launchContentWithParams:params + completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a LaunchContent command to the DUT with a search parameter and string, and AutoPlay " + @"flag set to true Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("Data", actualValue, + mData.HasValue() ? [[NSString alloc] initWithBytes:mData.Value().data() + length:mData.Value().size() + encoding:NSUTF8StringEncoding] + : @"exampleData")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatDutShouldAlsoBeginPlayingContentThatBestMatchedTheGivenSearchCriteria_4() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' if DUT begin playing content that best matched the given search " + "criteriagarbage: not in length on purpose", + 89); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } +}; + +class Test_TC_CONTENTLAUNCHER_10_5 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CONTENTLAUNCHER_10_5() + : TestCommandBridge("Test_TC_CONTENTLAUNCHER_10_5") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("GoodURL", &mGoodURL); + AddArgument("BadURL", &mBadURL); + AddArgument("UnauthorizedURL", &mUnauthorizedURL); + AddArgument("DisplayContent", &mDisplayContent); + AddArgument("providerNameString", &mProviderNameString); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_CONTENTLAUNCHER_10_5() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CONTENTLAUNCHER_10_5\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CONTENTLAUNCHER_10_5\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: ChipLogProgress( - chipTool, " ***** Test Step 5 : TH reads the optional attribute(StartUpMode) in AttributeList from the DUT\n"); - if (ShouldSkip("MOD.S.A0004")) { + chipTool, " ***** Test Step 1 : TH sends a LaunchURL command to the DUT with a known good content URL string\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp")) { NextTest(); return; } - err = TestThReadsTheOptionalAttributeStartUpModeInAttributeListFromTheDut_5(); + err = TestThSendsALaunchURLCommandToTheDutWithAKnownGoodContentUrlString_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Verify that DUT launched the content at the given URL\n"); + if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatDutLaunchedTheContentAtTheGivenUrl_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : TH sends a LaunchURL command to the DUT with a known good content URL string and a display " + "string\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALaunchURLCommandToTheDutWithAKnownGoodContentUrlStringAndADisplayString_3(); + break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : Verify that DUT launched the content at the given URL with the given display string in the " + "application-specific description area\n"); + if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatDutLaunchedTheContentAtTheGivenUrlWithTheGivenDisplayStringInTheApplicationSpecificDescriptionArea_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : TH sends a LaunchURL command to the DUT with a known good content URL string and a brand " + "information object.\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALaunchURLCommandToTheDutWithAKnownGoodContentUrlStringAndABrandInformationObject_5(); break; case 6: - ChipLogProgress( - chipTool, " ***** Test Step 6 : TH reads the optional attribute(OnMode) in AttributeList from the DUT\n"); - if (ShouldSkip("MOD.S.A0005")) { + ChipLogProgress(chipTool, + " ***** Test Step 6 : Verify that DUT launched the content at the given URL with the player interface updated as " + "per the provided branding information\n"); + if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) { NextTest(); return; } - err = TestThReadsTheOptionalAttributeOnModeInAttributeListFromTheDut_6(); + err = TestVerifyThatDutLaunchedTheContentAtTheGivenUrlWithThePlayerInterfaceUpdatedAsPerTheProvidedBrandingInformation_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: EventList\n"); - NextTest(); - return; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_8(); + ChipLogProgress(chipTool, + " ***** Test Step 7 : TH sends a LaunchURL command to the DUT with a known unreachable content URL string.\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALaunchURLCommandToTheDutWithAKnownUnreachableContentUrlString_7(); break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_9(); + case 8: + ChipLogProgress(chipTool, + " ***** Test Step 8 : TH sends a LaunchURL command to the DUT with a known un-authorized content URL string.\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALaunchURLCommandToTheDutWithAKnownUnAuthorizedContentUrlString_8(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 9; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mGoodURL; + chip::Optional mBadURL; + chip::Optional mUnauthorizedURL; + chip::Optional mDisplayContent; + chip::Optional mProviderNameString; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThSendsALaunchURLCommandToTheDutWithAKnownGoodContentUrlString_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRContentLauncherClusterLaunchURLParams alloc] init]; + params.contentURL = mGoodURL.HasValue() + ? [[NSString alloc] initWithBytes:mGoodURL.Value().data() length:mGoodURL.Value().size() encoding:NSUTF8StringEncoding] + : @"https://csa-iot.org/"; + params.brandingInformation = [[MTRContentLauncherClusterBrandingInformationStruct alloc] init]; + ((MTRContentLauncherClusterBrandingInformationStruct *) params.brandingInformation).providerName + = mProviderNameString.HasValue() ? [[NSString alloc] initWithBytes:mProviderNameString.Value().data() + length:mProviderNameString.Value().size() + encoding:NSUTF8StringEncoding] + : @"exampleName"; + + [cluster + launchURLWithParams:params + completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a LaunchURL command to the DUT with a known good content URL string Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatDutLaunchedTheContentAtTheGivenUrl_2() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT launched the content at the given URLgarbage: not in length on purpose", 61); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestThSendsALaunchURLCommandToTheDutWithAKnownGoodContentUrlStringAndADisplayString_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRContentLauncherClusterLaunchURLParams alloc] init]; + params.contentURL = mGoodURL.HasValue() + ? [[NSString alloc] initWithBytes:mGoodURL.Value().data() length:mGoodURL.Value().size() encoding:NSUTF8StringEncoding] + : @"https://csa-iot.org/"; + params.displayString = mDisplayContent.HasValue() ? [[NSString alloc] initWithBytes:mDisplayContent.Value().data() + length:mDisplayContent.Value().size() + encoding:NSUTF8StringEncoding] + : @"exampleData"; + params.brandingInformation = [[MTRContentLauncherClusterBrandingInformationStruct alloc] init]; + ((MTRContentLauncherClusterBrandingInformationStruct *) params.brandingInformation).providerName + = mProviderNameString.HasValue() ? [[NSString alloc] initWithBytes:mProviderNameString.Value().data() + length:mProviderNameString.Value().size() + encoding:NSUTF8StringEncoding] + : @"exampleName"; + + [cluster + launchURLWithParams:params + completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a LaunchURL command to the DUT with a known good content URL string and a display string " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + { + id actualValue = values.data; + VerifyOrReturn(CheckValueAsString("Data", actualValue, + mDisplayContent.HasValue() ? [[NSString alloc] initWithBytes:mDisplayContent.Value().data() + length:mDisplayContent.Value().size() + encoding:NSUTF8StringEncoding] + : @"exampleData")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatDutLaunchedTheContentAtTheGivenUrlWithTheGivenDisplayStringInTheApplicationSpecificDescriptionArea_4() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message + = chip::Span("Please enter 'y' if DUT launched the content at the given URL with the given display string " + "in the application-specific description areagarbage: not in length on purpose", + 136); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestThSendsALaunchURLCommandToTheDutWithAKnownGoodContentUrlStringAndABrandInformationObject_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRContentLauncherClusterLaunchURLParams alloc] init]; + params.contentURL = mGoodURL.HasValue() + ? [[NSString alloc] initWithBytes:mGoodURL.Value().data() length:mGoodURL.Value().size() encoding:NSUTF8StringEncoding] + : @"https://csa-iot.org/"; + params.brandingInformation = [[MTRContentLauncherClusterBrandingInformationStruct alloc] init]; + ((MTRContentLauncherClusterBrandingInformationStruct *) params.brandingInformation).providerName + = mProviderNameString.HasValue() ? [[NSString alloc] initWithBytes:mProviderNameString.Value().data() + length:mProviderNameString.Value().size() + encoding:NSUTF8StringEncoding] + : @"exampleName"; + + [cluster + launchURLWithParams:params + completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a LaunchURL command to the DUT with a known good content URL string and a brand " + @"information object. Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatDutLaunchedTheContentAtTheGivenUrlWithThePlayerInterfaceUpdatedAsPerTheProvidedBrandingInformation_6() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message + = chip::Span("Please enter 'y' if DUT launched the content at the given URL with the player interface " + "updated as per the provided branding informationgarbage: not in length on purpose", + 136); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestThSendsALaunchURLCommandToTheDutWithAKnownUnreachableContentUrlString_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRContentLauncherClusterLaunchURLParams alloc] init]; + params.contentURL = mBadURL.HasValue() + ? [[NSString alloc] initWithBytes:mBadURL.Value().data() length:mBadURL.Value().size() encoding:NSUTF8StringEncoding] + : @"https://badurl"; + params.brandingInformation = [[MTRContentLauncherClusterBrandingInformationStruct alloc] init]; + ((MTRContentLauncherClusterBrandingInformationStruct *) params.brandingInformation).providerName + = mProviderNameString.HasValue() ? [[NSString alloc] initWithBytes:mProviderNameString.Value().data() + length:mProviderNameString.Value().size() + encoding:NSUTF8StringEncoding] + : @"exampleName"; + + [cluster + launchURLWithParams:params + completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a LaunchURL command to the DUT with a known unreachable content URL string. Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 1U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsALaunchURLCommandToTheDutWithAKnownUnAuthorizedContentUrlString_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRContentLauncherClusterLaunchURLParams alloc] init]; + params.contentURL = mUnauthorizedURL.HasValue() ? [[NSString alloc] initWithBytes:mUnauthorizedURL.Value().data() + length:mUnauthorizedURL.Value().size() + encoding:NSUTF8StringEncoding] + : @"https://csa-iot.org/badauth"; + params.brandingInformation = [[MTRContentLauncherClusterBrandingInformationStruct alloc] init]; + ((MTRContentLauncherClusterBrandingInformationStruct *) params.brandingInformation).providerName + = mProviderNameString.HasValue() ? [[NSString alloc] initWithBytes:mProviderNameString.Value().data() + length:mProviderNameString.Value().size() + encoding:NSUTF8StringEncoding] + : @"exampleName"; + + [cluster + launchURLWithParams:params + completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a LaunchURL command to the DUT with a known un-authorized content URL string. Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CONTENTLAUNCHER_10_7 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CONTENTLAUNCHER_10_7() + : TestCommandBridge("Test_TC_CONTENTLAUNCHER_10_7") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("PopularityName", &mPopularityName); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_CONTENTLAUNCHER_10_7() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CONTENTLAUNCHER_10_7\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CONTENTLAUNCHER_10_7\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + "Actor and Value as An Actor’s name, for example, Gaby sHoffman\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsActorAndValueAsAnActorsNameForExampleGabySHoffman_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Verify that DUT should play or display the search result.\n"); + if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + "Channel and Value as Channel Name name, for example, PBS\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsChannelAndValueAsChannelNameNameForExamplePbs_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Verify that DUT should play or display the search result.\n"); + if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + "Character and Value as Character’s name,for example,Snow White\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsCharacterAndValueAsCharactersNameforExampleSnowWhite_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Verify that DUT should play or display the search result.\n"); + if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + "Director and Value as Director’s name, for example, Spike Lee\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsDirectorAndValueAsDirectorsNameForExampleSpikeLee_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Verify that DUT should play or display the search result.\n"); + if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + "Event and Value as An Event’s name , for example Football games\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsEventAndValueAsAnEventsNameForExampleFootballGames_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Verify that DUT should play or display the search result.\n"); + if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + "Franchise and Value as Franchise’s name,for example Star Wars\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsFranchiseAndValueAsFranchisesNameforExampleStarWars_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Verify that DUT should play or display the search result.\n"); + if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + "Genre and Value as Genre’s name, for example Horror\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsGenreAndValueAsGenresNameForExampleHorror_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Verify that DUT should play or display the search result.\n"); + if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_14(); + break; + case 15: + ChipLogProgress(chipTool, + " ***** Test Step 15 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + "League and Value as League’s name, for example NCAA\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsLeagueAndValueAsLeaguesNameForExampleNcaa_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Verify that DUT should play or display the search result.\n"); + if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_16(); + break; + case 17: + ChipLogProgress(chipTool, + " ***** Test Step 17 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + "Popularity and Value as Popularity’s name\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsPopularityAndValueAsPopularitysName_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Verify that DUT should play or display the search result.\n"); + if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + "Provider and Value as Provider’s name, for example Netflix\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsProviderAndValueAsProvidersNameForExampleNetflix_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Verify that DUT should play or display the search result.\n"); + if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + "Sport and Value as Sport’s name, for example, football\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsSportAndValueAsSportsNameForExampleFootball_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Verify that DUT should play or display the search result.\n"); + if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_22(); + break; + case 23: + ChipLogProgress(chipTool, + " ***** Test Step 23 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + "SportsTeam and Value as SportTeam’s name , for example Arsenel\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsSportsTeamAndValueAsSportTeamsNameForExampleArsenel_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Verify that DUT should play or display the search result.\n"); + if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_24(); + break; + case 25: + ChipLogProgress(chipTool, + " ***** Test Step 25 : TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + "Type and Value as Type’s name, for example TVSeries\n"); + if (ShouldSkip("CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsTypeAndValueAsTypesNameForExampleTVSeries_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Verify that DUT should play or display the search result.\n"); + if (ShouldSkip("PICS_USER_PROMPT && CONTENTLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_26(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 27; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mPopularityName; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR + TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsActorAndValueAsAnActorsNameForExampleGabySHoffman_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init]; + params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:0U]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"Gaby sHoffman"; + + ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1; + } + + params.autoPlay = [NSNumber numberWithBool:true]; + [cluster + launchContentWithParams:params + completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Actor " + @"and Value as An Actor’s name, for example, Gaby sHoffman Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_2() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR + TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsChannelAndValueAsChannelNameNameForExamplePbs_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init]; + params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:1U]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"PBS"; + + ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1; + } + + params.autoPlay = [NSNumber numberWithBool:true]; + [cluster + launchContentWithParams:params + completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + @"Channel and Value as Channel Name name, for example, PBS Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_4() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR + TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsCharacterAndValueAsCharactersNameforExampleSnowWhite_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init]; + params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:2U]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"Snow White"; + + ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1; + } + + params.autoPlay = [NSNumber numberWithBool:false]; + [cluster + launchContentWithParams:params + completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + @"Character and Value as Character’s name,for example,Snow White Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_6() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR + TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsDirectorAndValueAsDirectorsNameForExampleSpikeLee_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init]; + params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:3U]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"Spike Lee"; + + ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1; + } + + params.autoPlay = [NSNumber numberWithBool:true]; + [cluster + launchContentWithParams:params + completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + @"Director and Value as Director’s name, for example, Spike Lee Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_8() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR + TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsEventAndValueAsAnEventsNameForExampleFootballGames_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init]; + params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:4U]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"Football games"; + + ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1; + } + + params.autoPlay = [NSNumber numberWithBool:true]; + [cluster + launchContentWithParams:params + completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Event " + @"and Value as An Event’s name , for example Football games Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_10() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR + TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsFranchiseAndValueAsFranchisesNameforExampleStarWars_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init]; + params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:5U]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"Star Wars"; + + ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1; + } + + params.autoPlay = [NSNumber numberWithBool:true]; + [cluster + launchContentWithParams:params + completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + @"Franchise and Value as Franchise’s name,for example Star Wars Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_12() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR + TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsGenreAndValueAsGenresNameForExampleHorror_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init]; + params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:6U]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"Horror"; + + ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1; + } + + params.autoPlay = [NSNumber numberWithBool:true]; + [cluster + launchContentWithParams:params + completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Genre " + @"and Value as Genre’s name, for example Horror Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_14() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR + TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsLeagueAndValueAsLeaguesNameForExampleNcaa_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init]; + params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:7U]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"NCAA"; + + ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1; + } + + params.autoPlay = [NSNumber numberWithBool:true]; + [cluster + launchContentWithParams:params + completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + @"League and Value as League’s name, for example NCAA Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_16() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsPopularityAndValueAsPopularitysName_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init]; + params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:8U]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = mPopularityName.HasValue() + ? [[NSString alloc] initWithBytes:mPopularityName.Value().data() + length:mPopularityName.Value().size() + encoding:NSUTF8StringEncoding] + : @"popular content"; + + ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1; + } + + params.autoPlay = [NSNumber numberWithBool:true]; + [cluster + launchContentWithParams:params + completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + @"Popularity and Value as Popularity’s name Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_18() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR + TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsProviderAndValueAsProvidersNameForExampleNetflix_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init]; + params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:9U]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"Netflix"; + + ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1; + } + + params.autoPlay = [NSNumber numberWithBool:true]; + [cluster + launchContentWithParams:params + completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + @"Provider and Value as Provider’s name, for example Netflix Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_20() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR + TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsSportAndValueAsSportsNameForExampleFootball_21() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init]; + params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:10U]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"football"; + + ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1; + } + + params.autoPlay = [NSNumber numberWithBool:true]; + [cluster + launchContentWithParams:params + completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Sport " + @"and Value as Sport’s name, for example, football Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_22() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR + TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsSportsTeamAndValueAsSportTeamsNameForExampleArsenel_23() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init]; + params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:11U]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"Arsenel"; + + ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1; + } + + params.autoPlay = [NSNumber numberWithBool:true]; + [cluster + launchContentWithParams:params + completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As " + @"SportsTeam and Value as SportTeam’s name , for example Arsenel Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_24() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR + TestThSendsALaunchContentCommandToTheDutWithSearchParameterConsistingOfTypeAsTypeAndValueAsTypesNameForExampleTVSeries_25() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterContentLauncher alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRContentLauncherClusterLaunchContentParams alloc] init]; + params.search = [[MTRContentLauncherClusterContentSearchStruct alloc] init]; + { + NSMutableArray * temp_1 = [[NSMutableArray alloc] init]; + temp_1[0] = [[MTRContentLauncherClusterParameterStruct alloc] init]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).type = [NSNumber numberWithUnsignedChar:12U]; + ((MTRContentLauncherClusterParameterStruct *) temp_1[0]).value = @"TVSeries"; + + ((MTRContentLauncherClusterContentSearchStruct *) params.search).parameterList = temp_1; + } + + params.autoPlay = [NSNumber numberWithBool:true]; + [cluster + launchContentWithParams:params + completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a LaunchContent command to the DUT with search parameter consisting of Type As Type " + @"and Value as Type’s name, for example TVSeries Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatDutShouldPlayOrDisplayTheSearchResult_26() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span( + "Please enter 'y' if DUT play or display the search result.garbage: not in length on purpose", 58); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } +}; + +class Test_TC_MOD_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_MOD_1_1() + : TestCommandBridge("Test_TC_MOD_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_MOD_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MOD_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MOD_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision attribute from the DUT\n"); + err = TestThReadsTheClusterRevisionAttributeFromTheDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the FeatureMap attribute from the DUT\n"); + if (ShouldSkip("MOD.S.F00")) { + NextTest(); + return; + } + err = TestThReadsTheFeatureMapAttributeFromTheDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads the FeatureMap attribute from the DUT\n"); + if (ShouldSkip(" !MOD.S.F00 ")) { + NextTest(); + return; + } + err = TestThReadsTheFeatureMapAttributeFromTheDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads the AttributeList attribute from the DUT\n"); + err = TestThReadsTheAttributeListAttributeFromTheDut_4(); + break; + case 5: + ChipLogProgress( + chipTool, " ***** Test Step 5 : TH reads the optional attribute(StartUpMode) in AttributeList from the DUT\n"); + if (ShouldSkip("MOD.S.A0004")) { + NextTest(); + return; + } + err = TestThReadsTheOptionalAttributeStartUpModeInAttributeListFromTheDut_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : TH reads the optional attribute(OnMode) in AttributeList from the DUT\n"); + if (ShouldSkip("MOD.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsTheOptionalAttributeOnModeInAttributeListFromTheDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the global attribute: EventList\n"); + NextTest(); + return; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_9(); break; } @@ -62950,8 +64890,8 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("minMeasuredValue", "int16s", "int16s")); - VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value shortValue], -32768)); - VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value shortValue], 32767)); + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value shortValue], -32767)); + VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value shortValue], 32766)); } { MinMeasuredValue = value; @@ -62981,7 +64921,7 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "int16s", "int16s")); - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value shortValue], -32768)); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value shortValue], MinMeasuredValue)); VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value shortValue], 32767)); } { @@ -63063,8 +65003,8 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("minScaledValue", "int16s", "int16s")); - VerifyOrReturn(CheckConstraintMinValue("minScaledValue", [value shortValue], -32768)); - VerifyOrReturn(CheckConstraintMaxValue("minScaledValue", [value shortValue], 32767)); + VerifyOrReturn(CheckConstraintMinValue("minScaledValue", [value shortValue], -32767)); + VerifyOrReturn(CheckConstraintMaxValue("minScaledValue", [value shortValue], 32766)); } { MinScaledValue = value; @@ -63094,7 +65034,7 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("maxScaledValue", "int16s", "int16s")); - VerifyOrReturn(CheckConstraintMinValue("maxScaledValue", [value shortValue], -32768)); + VerifyOrReturn(CheckConstraintMinValue("maxScaledValue", [value shortValue], MinScaledValue)); VerifyOrReturn(CheckConstraintMaxValue("maxScaledValue", [value shortValue], 32767)); } { @@ -67928,6 +69868,7 @@ class Test_TC_RH_2_1 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } + NSNumber * _Nullable CurrentMinMeasured; CHIP_ERROR TestThReadsTheMinMeasuredValueAttributeFromTheDut_1() { @@ -67949,12 +69890,16 @@ class Test_TC_RH_2_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value unsignedShortValue], 0U)); VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value unsignedShortValue], 9999U)); } + { + CurrentMinMeasured = value; + } NextTest(); }]; return CHIP_NO_ERROR; } + NSNumber * _Nullable CurrentMaxMeasured; CHIP_ERROR TestThReadsTheMaxMeasuredValueAttributeFromTheDut_2() { @@ -67973,9 +69918,13 @@ class Test_TC_RH_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value unsignedShortValue], 1U)); + VerifyOrReturn( + CheckConstraintMinValue("maxMeasuredValue", [value unsignedShortValue], CurrentMinMeasured)); VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value unsignedShortValue], 10000U)); } + { + CurrentMaxMeasured = value; + } NextTest(); }]; @@ -68000,8 +69949,8 @@ class Test_TC_RH_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("measuredValue", "int16u", "int16u")); - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value unsignedShortValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value unsignedShortValue], 10000U)); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value unsignedShortValue], CurrentMinMeasured)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value unsignedShortValue], CurrentMaxMeasured)); } NextTest(); @@ -70096,7 +72045,7 @@ class Test_TC_TMP_2_1 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - NSNumber * _Nullable MinMeasuredValue; + NSNumber * _Nullable CurrentMinMeasured; CHIP_ERROR TestReadTheMandatoryAttributeMinMeasuredValue_1() { @@ -70116,10 +72065,10 @@ class Test_TC_TMP_2_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintType("minMeasuredValue", "int16s", "int16s")); VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value shortValue], -27315)); - VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value shortValue], 32767)); + VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value shortValue], 32766)); } { - MinMeasuredValue = value; + CurrentMinMeasured = value; } NextTest(); @@ -70127,7 +72076,7 @@ class Test_TC_TMP_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nullable MaxMeasuredValue; + NSNumber * _Nullable CurrentMaxMeasured; CHIP_ERROR TestReadTheMandatoryAttributeMaxMeasuredValue_2() { @@ -70146,11 +72095,11 @@ class Test_TC_TMP_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "int16s", "int16s")); - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value shortValue], -27314)); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value shortValue], CurrentMinMeasured)); VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value shortValue], 32767)); } { - MaxMeasuredValue = value; + CurrentMaxMeasured = value; } NextTest(); @@ -70176,8 +72125,8 @@ class Test_TC_TMP_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("measuredValue", "int16s", "int16s")); - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value shortValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value shortValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value shortValue], CurrentMinMeasured)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value shortValue], CurrentMaxMeasured)); } NextTest(); @@ -147939,6 +149888,9 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(),