diff --git a/src/app/tests/suites/certification/Test_TC_DL_2_11.yaml b/src/app/tests/suites/certification/Test_TC_DL_2_11.yaml index 48f4fc956955ac..250632904b3fd0 100644 --- a/src/app/tests/suites/certification/Test_TC_DL_2_11.yaml +++ b/src/app/tests/suites/certification/Test_TC_DL_2_11.yaml @@ -11,75 +11,235 @@ # 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: - 100.2.11. [TC-DL-2.11] Verification for the following Commands - Set Year + 108.2.11. [TC-DL-2.11] Verification for the following Commands - Set Year Schedule, Get Year Schedule, Get Year Day Schedule Response and Clear Year Day Schedule[DUT-Server] config: nodeId: 0x12344321 - cluster: "Basic" - endpoint: 0 + cluster: "Door Lock" + endpoint: 1 tests: - - label: - "TH reads RFID Users Supported attribute and saves as usersupported - for future use." - verification: | - https://github.com/project-chip/connectedhomeip/issues/15776 - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Create new PIN credential and lock/unlock user" + command: "SetCredential" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "operationType" + value: 0 + - name: "credential" + value: { CredentialType: 1, CredentialIndex: 1 } + - name: "credentialData" + value: "123456" + - name: "userIndex" + value: null + - name: "userStatus" + value: null + - name: "userType" + value: null + response: + values: + - name: "status" + value: 0 + - name: "userIndex" + value: 1 + - name: "nextCredentialIndex" + value: 2 + + - label: "Create new PIN credential and lock/unlock for second user" + command: "SetCredential" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "operationType" + value: 0 + - name: "credential" + value: { CredentialType: 1, CredentialIndex: 2 } + - name: "credentialData" + value: "123457" + - name: "userIndex" + value: null + - name: "userStatus" + value: null + - name: "userType" + value: null + response: + values: + - name: "status" + value: 0 + - name: "userIndex" + value: 2 + - name: "nextCredentialIndex" + value: 3 + + - label: "Get Max number of year Day schedules for user" + command: "readAttribute" + attribute: "NumberOfYearDaySchedulesSupportedPerUser" + response: + saveAs: NumberOfYearDaySchedulesSupportedPerUser + value: 10 + + - label: "Get number of supported users" + command: "readAttribute" + attribute: "NumberOfTotalUsersSupported" + response: + saveAs: NumberOfTotalUsersSupported + value: 10 + + - label: "Send Set Year Day Schedule Command to DUT" + command: "SetYearDaySchedule" + arguments: + values: + - name: "YearDayIndex" + value: 1 + - name: "userIndex" + value: 1 + - name: "LocalStartTime" + value: 10 + - name: "LocalEndTime" + value: 20 + + #issue #18591 and #18590 + - label: "send Get Year Day Schedule Command" + command: "GetYearDaySchedule" + arguments: + values: + - name: "YearDayIndex" + value: 1 + - name: "userIndex" + value: 1 + response: + values: + - name: "YearDayIndex" + constraints: + minValue: 1 + - name: "userIndex" + constraints: + minValue: 1 + - name: "status" + value: 0x0 + - name: "LocalStartTime" + constraints: + type: epoch-s + - name: "LocalEndTime" + constraints: + type: epoch-s - label: - "TH sends Set RFID Code Command to DUT with the following values: User - ID as 1 User Status as 0 User Type as 0 RFID Code as 785" - verification: | - - disabled: true + "Send Set Year Day Schedule Command to DUT and verify INVALID_COMMAND + response" + command: "SetYearDaySchedule" + arguments: + values: + - name: "YearDayIndex" + value: 0 + - name: "userIndex" + value: 10 + - name: "LocalStartTime" + value: 30 + - name: "LocalEndTime" + value: 10 + response: + error: INVALID_COMMAND - label: - "TH sends Set RFID Code Command to DUT with the following values: User - ID as usersupported+1 User Status as 0 User Type as 0 RFID Code as 824" - verification: | - - disabled: true + "send Get Year Day Schedule Command to DUT and Verify INVALID_FIELD + response" + command: "GetYearDaySchedule" + arguments: + values: + - name: "YearDayIndex" + value: 2 + - name: "userIndex" + value: 21 + response: + values: + - name: "YearDayIndex" + value: 2 + - name: "userIndex" + value: 21 + - name: "status" + value: 0x85 - label: - "TH sends Set RFID Code Command to DUT with the following values: User - ID as 2 User Status as 0 User Type as 0 RFID Code as 824" - verification: | - - disabled: true - - - label: "TH sends Get RFID Code Command to DUT" - verification: | - - disabled: true + "send Get Year Day Schedule Command to DUT and verify NOT_FOUND + response" + command: "GetYearDaySchedule" + arguments: + values: + - name: "YearDayIndex" + value: 10 + - name: "userIndex" + value: 5 + response: + values: + - name: "YearDayIndex" + value: 10 + - name: "userIndex" + value: 5 + - name: "status" + value: 0x8B - label: - "TH sends Get RFID Code Command to the DUT with User ID value as - usersupported +1" - verification: | - - disabled: true - - - label: "TH sends Clear RFID Code Command to DUT with the User ID as 2" - verification: | - - disabled: true - - - label: "TH sends Get RFID Code Command to DUT for User ID as 2" - verification: | - - disabled: true - - - label: "TH sends Clear All RFID Codes Command to DUT" - verification: | - - disabled: true - - - label: "TH sends Get RFID Code Command to DUT" - verification: | - - disabled: true + "send Get Year Day Schedule Command to DUT and verify NOT_FOUND + response " + command: "GetYearDaySchedule" + arguments: + values: + - name: "YearDayIndex" + value: 2 + - name: "userIndex" + value: 2 + response: + values: + - name: "YearDayIndex" + value: 2 + - name: "userIndex" + value: 2 + - name: "status" + value: 0x8B + + - label: "Send Set Year Day Schedule Command to DUT" + command: "SetYearDaySchedule" + arguments: + values: + - name: "YearDayIndex" + value: 2 + - name: "userIndex" + value: 2 + - name: "LocalStartTime" + value: 10 + - name: "LocalEndTime" + value: 20 + + - label: "send Get Year Day Schedule Command " + command: "GetYearDaySchedule" + arguments: + values: + - name: "YearDayIndex" + value: 2 + - name: "userIndex" + value: 2 + response: + values: + - name: "YearDayIndex" + value: 2 + - name: "userIndex" + value: 2 + - name: "status" + value: 0x0 + - name: "LocalStartTime" + value: 10 + - name: "LocalEndTime" + value: 20 diff --git a/src/app/tests/suites/certification/Test_TC_DL_2_8.yaml b/src/app/tests/suites/certification/Test_TC_DL_2_8.yaml index 941d89ba4e9836..158cfb588b3c24 100644 --- a/src/app/tests/suites/certification/Test_TC_DL_2_8.yaml +++ b/src/app/tests/suites/certification/Test_TC_DL_2_8.yaml @@ -11,65 +11,189 @@ # 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: - 100.2.8. [TC-DL-2.8] Verification for the following Commands - Set Week Day + 108.2.8. [TC-DL-2.8] Verification for the following Commands - Set Week Day Schedule, Get Week Day Schedule , Get Week Day Schedule Response, Clear Week Day Schedule [DUT-Server] config: nodeId: 0x12344321 - cluster: "Basic" - endpoint: 0 + cluster: "Door Lock" + endpoint: 1 tests: - - label: - "TH reads NumberOfWeekDaySchedulesSupportedPerUser attribute and saves - for future use." - verification: | - https://github.com/project-chip/connectedhomeip/issues/15776 - disabled: true - - - label: - "TH reads NumberOfTotalUsersSupported attribute and saves for future - use." - verification: | - - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Create new PIN credential and lock/unlock user" + command: "SetCredential" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "operationType" + value: 0 + - name: "credential" + value: { CredentialType: 1, CredentialIndex: 1 } + - name: "credentialData" + value: "123456" + - name: "userIndex" + value: null + - name: "userStatus" + value: null + - name: "userType" + value: null + response: + values: + - name: "status" + value: 0 + - name: "userIndex" + value: 1 + - name: "nextCredentialIndex" + value: 2 + + - label: "Get Max number of Week Day schedules for user" + command: "readAttribute" + attribute: "NumberOfWeekDaySchedulesSupportedPerUser" + response: + saveAs: NumberOfWeekDaySchedulesSupportedPerUser + value: 10 + + - label: "Get number of supported users" + command: "readAttribute" + attribute: "NumberOfTotalUsersSupported" + response: + saveAs: NumberOfTotalUsersSupported + value: 10 + + - label: "Send Set Week Day Schedule Command to DUT" + command: "SetWeekDaySchedule" + arguments: + values: + - name: "weekDayIndex" + value: 1 + - name: "userIndex" + value: 1 + - name: "daysMask" + value: 2 + - name: "startHour" + value: 15 + - name: "startMinute" + value: 45 + - name: "endHour" + value: 16 + - name: "endMinute" + value: 55 + + #issue #18591 + - label: "send GetWeekDay Schedule Command " + command: "GetWeekDaySchedule" + arguments: + values: + - name: "weekDayIndex" + value: 1 + - name: "userIndex" + value: 1 + response: + values: + - name: "weekDayIndex" + constraints: + minValue: 1 + - name: "userIndex" + constraints: + minValue: 1 + - name: "status" + value: 0x0 + - name: "daysMask" + constraints: + minValue: 0 + maxValue: 6 + - name: "startHour" + constraints: + minValue: 0 + maxValue: 23 + - name: "startMinute" + constraints: + minValue: 0 + maxValue: 59 + - name: "endHour" + constraints: + minValue: 0 + maxValue: 23 + - name: "endMinute" + constraints: + minValue: 0 + maxValue: 59 - label: - "TH send Set Week Day Schedule Command to DUT with the following - values: WeekDayIndex as 2 NumberOfTotalUsersSupported as 2 DaysMaskMap - as 2 StartHour as 15 StartMinute as 45 EndHour as 16 EndMinute as 55" - verification: | - - disabled: true - - - label: "TH send Get Week Day Schedule Command to DUT" - verification: | - - disabled: true + "Send Set Week Day Schedule Command to DUT and verify INVALID_COMMAND + response" + command: "SetWeekDaySchedule" + arguments: + values: + - name: "weekDayIndex" + value: 0 + - name: "userIndex" + value: 1 + - name: "daysMask" + value: 7 + - name: "startHour" + value: 15 + - name: "startMinute" + value: 45 + - name: "endHour" + value: 16 + - name: "endMinute" + value: 55 + response: + error: INVALID_COMMAND - label: - "TH send Set Week Day Schedule Command to DUT with the following - values: WeekDayIndex as 0 NumberOfTotalUsersSupported as 2 DaysMaskMap - as 7 StartHour as 15 StartMinute as 45 EndHour as 16 EndMinute as 55" - verification: | - - disabled: true - - - label: "TH send Get Week Day Schedule Command to DUT" - verification: | - - disabled: true - - - label: "TH sends Clear Week Day Schedule Command to DUT" - verification: | - - disabled: true - - - label: "TH sends Get Week Day Schedule Command to DUT" - verification: | - - disabled: true + "send GetWeekDay Schedule Command to DUT and verify INVALID_COMMAND + response" + command: "GetWeekDaySchedule" + arguments: + values: + - name: "weekDayIndex" + value: 0 + - name: "userIndex" + value: 1 + response: + values: + - name: "weekDayIndex" + value: 0 + - name: "userIndex" + value: 1 + - name: "status" + value: 0x85 + + - label: "Clear all week day schedules for the first user" + command: "ClearWeekDaySchedule" + arguments: + values: + - name: "weekDayIndex" + value: 0xFE + - name: "userIndex" + value: 1 + + - label: "send GetWeekDay Schedule Command " + command: "GetWeekDaySchedule" + arguments: + values: + - name: "weekDayIndex" + value: 2 + - name: "userIndex" + value: 1 + response: + values: + - name: "weekDayIndex" + value: 2 + - name: "userIndex" + value: 1 + - name: "status" + value: 0x8B diff --git a/src/app/tests/suites/certification/Test_TC_PS_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PS_2_1.yaml index ac16ea4e5c0ca1..77ce288221f775 100644 --- a/src/app/tests/suites/certification/Test_TC_PS_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_PS_2_1.yaml @@ -51,11 +51,10 @@ tests: constraints: type: string - #Issue disabled below steps due to #13758 - label: "Test Harness Client reads WiredAssessedInputVoltage attribue from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "WiredAssessedInputVoltage" response: @@ -65,7 +64,7 @@ tests: - label: "Test Harness Client reads WiredAssessedInputFrequency attribute from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "WiredAssessedInputFrequency" response: @@ -74,7 +73,7 @@ tests: - label: "Test Harness Client reads WiredCurrentType attribute from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "WiredCurrentType" response: @@ -86,7 +85,7 @@ tests: - label: "Test Harness Client reads WiredAssessedCurrent attribute from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "WiredAssessedCurrent" response: @@ -94,7 +93,7 @@ tests: type: uint32 - label: "Test Harness Client reads WiredNominalVoltage from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "WiredNominalVoltage" response: @@ -102,7 +101,7 @@ tests: type: uint32 - label: "Test Harness Client reads WiredMaximumCurrent from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "WiredMaximumCurrent" response: @@ -110,20 +109,47 @@ tests: type: uint32 - label: "Test Harness Client reads WiredPresent from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" - attribute: "WiredMaximumCurrent" + attribute: "WiredPresent" response: constraints: type: bool - label: "Test Harness Client reads ActiveWiredFaults from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" attribute: "ActiveWiredFaults" response: constraints: type: list + maxlength: 8 + + - label: "Test Harness Client reads BatVoltage from Server DUT" + PICS: PICS_SKIP_SAMPLE_APP + command: "readAttribute" + attribute: "BatteryVoltage" + response: + constraints: + type: uint32 + + - label: "Test Harness Client reads BatPercentRemaining from Server DUT" + PICS: PICS_SKIP_SAMPLE_APP + command: "readAttribute" + attribute: "BatteryPercentRemaining" + response: + constraints: + type: uint8 + minvalue: 0 + maxvalue: 200 + + - label: "Test Harness Client reads BatTimeRemaining from Server DUT" + PICS: PICS_SKIP_SAMPLE_APP + command: "readAttribute" + attribute: "BatteryTimeRemaining" + response: + constraints: + type: uint32 - label: "Test Harness Client reads BatChargeLevel from Server DUT" command: "readAttribute" @@ -135,17 +161,17 @@ tests: maxValue: 2 - label: "Test Harness Client reads BatReplacementNeeded from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" - attribute: "BatReplacementNeeded" + attribute: "BatteryReplacementNeeded" response: constraints: type: bool - label: "Test Harness Client reads BatReplaceability from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" - attribute: "BatReplaceability" + attribute: "BatteryReplaceability" response: constraints: type: enum8 @@ -153,27 +179,36 @@ tests: maxValue: 3 - label: "Test Harness Client reads BatPresent from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" - attribute: "BatPresent" + attribute: "BatteryPresent" response: constraints: type: bool + - label: "Test Harness Client readsActiveBatFaults from Server DUT" + PICS: PICS_SKIP_SAMPLE_APP + command: "readAttribute" + attribute: "ActiveBatteryFaults" + response: + constraints: + type: list + maxlength: 8 + - label: "Test Harness Client reads BatReplacementDescription from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" - attribute: "BatReplacementDescription" + attribute: "BatteryReplacementDescription" response: constraints: type: string maxLength: 60 - label: "Test Harness Client reads BatCommonDesignation from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" - attribute: "BatCommonDesignation" + attribute: "BatteryCommonDesignation" response: constraints: type: uint32 @@ -181,27 +216,27 @@ tests: maxValue: 80 - label: "Test Harness Client reads BatANSIDesignation from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" - attribute: "BatANSIDesignation" + attribute: "BatteryANSIDesignation" response: constraints: type: string maxLength: 20 - label: "Test Harness Client reads BatIECDesignation from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" - attribute: "BatIECDesignation" + attribute: "BatteryIECDesignation" response: constraints: type: string maxLength: 20 - label: "Test Harness Client reads BatApprovedChemistry from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" - attribute: "BatApprovedChemistry" + attribute: "BatteryApprovedChemistry" response: constraints: type: uint32 @@ -209,50 +244,60 @@ tests: maxValue: 32 - label: "Test Harness Client reads BatCapacity from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" - attribute: "BatCapacity" + attribute: "BatteryCapacity" response: constraints: type: uint32 - label: "Test Harness Client reads BatQuantity from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" - attribute: "BatQuantity" + attribute: "BatteryQuantity" response: constraints: type: uint8 + - label: "Test Harness Client reads BatChargeState from Server DUT" + PICS: PICS_SKIP_SAMPLE_APP + command: "readAttribute" + attribute: "BatteryChargeState" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 3 + - label: "Test Harness Client reads BatTimeToFullCharge from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" - attribute: "BatTimeToFullCharge" + attribute: "BatteryTimeToFullCharge" response: constraints: type: uint32 - label: "Test Harness Client reads BatFunctionalWhileCharging from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" - attribute: "BatFunctionalWhileCharging" + attribute: "BatteryFunctionalWhileCharging" response: constraints: type: bool - label: "Test Harness Client reads BatChargingCurrent from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" - attribute: "BatChargingCurrent" + attribute: "BatteryChargingCurrent" response: constraints: type: uint32 - label: "Test Harness Client reads ActiveBatChargeFaults from Server DUT" - disabled: true + PICS: PICS_SKIP_SAMPLE_APP command: "readAttribute" - attribute: "ActiveBatChargeFaults" + attribute: "ActiveBatteryChargeFaults" response: constraints: type: list diff --git a/src/app/tests/suites/certification/Test_TC_TSTAT_2_1.yaml b/src/app/tests/suites/certification/Test_TC_TSTAT_2_1.yaml index 5b42c72a1f7fae..979fe2b669af25 100644 --- a/src/app/tests/suites/certification/Test_TC_TSTAT_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TSTAT_2_1.yaml @@ -28,8 +28,6 @@ tests: - name: "nodeId" value: nodeId - #issue #11524 below disabled steps are for attributes not supported in YAML framework - - label: "Reads constraints of mandatory attributes from DUT: LocalTemperature" command: "readAttribute" @@ -84,27 +82,100 @@ tests: minValue: 1600 maxValue: 3200 + #issue #18319 - label: - "Reads constraints of mandatory attributes from DUT: PICoolingDemand" - disabled: true - command: "readAttribute" - attribute: "PICoolingDemand" - response: - constraints: - type: uint8 - minValue: 0 - maxValue: 100 + "Read PICoolingDemand attribute from the DUT Verify that the DUT + responds with a uint8 value.The value has to be in the range of 0 to + 100" + verification: | + ./apps/chip-tool thermostat read pi-cooling-demand 54321 1 + + [1651147835.214624][10638:10643] CHIP:DMG: ReportDataMessage = + [1651147835.214675][10638:10643] CHIP:DMG: { + [1651147835.214714][10638:10643] CHIP:DMG: AttributeReportIBs = + [1651147835.214772][10638:10643] CHIP:DMG: [ + [1651147835.214816][10638:10643] CHIP:DMG: AttributeReportIB = + [1651147835.214881][10638:10643] CHIP:DMG: { + [1651147835.214928][10638:10643] CHIP:DMG: AttributeStatusIB = + [1651147835.214985][10638:10643] CHIP:DMG: { + [1651147835.215039][10638:10643] CHIP:DMG: AttributePathIB = + [1651147835.215100][10638:10643] CHIP:DMG: { + [1651147835.215162][10638:10643] CHIP:DMG: Endpoint = 0x1, + [1651147835.215228][10638:10643] CHIP:DMG: Cluster = 0x201, + [1651147835.215293][10638:10643] CHIP:DMG: Attribute = 0x0000_0007, + [1651147835.215351][10638:10643] CHIP:DMG: } + [1651147835.215416][10638:10643] CHIP:DMG: + [1651147835.215469][10638:10643] CHIP:DMG: StatusIB = + [1651147835.215535][10638:10643] CHIP:DMG: { + [1651147835.215597][10638:10643] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147835.215657][10638:10643] CHIP:DMG: }, + [1651147835.215717][10638:10643] CHIP:DMG: + [1651147835.215772][10638:10643] CHIP:DMG: }, + [1651147835.215833][10638:10643] CHIP:DMG: + [1651147835.215879][10638:10643] CHIP:DMG: }, + [1651147835.215935][10638:10643] CHIP:DMG: + [1651147835.215978][10638:10643] CHIP:DMG: ], + [1651147835.216033][10638:10643] CHIP:DMG: + [1651147835.216078][10638:10643] CHIP:DMG: SuppressResponse = true, + [1651147835.216124][10638:10643] CHIP:DMG: InteractionModelRevision = 1 + [1651147835.216167][10638:10643] CHIP:DMG: } + [1651147835.216348][10638:10643] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of mandatory attributes from DUT: PIHeatingDemand" - disabled: true - command: "readAttribute" - attribute: "PIHeatingDemand" - response: - constraints: - type: uint8 - minValue: 0 - maxValue: 100 + "Read PIHeatingDemand attribute from the DUT and Verify that the DUT + responds with a uint8 value.The value has to be in the range of 0 to + 100" + verification: | + ./apps/chip-tool thermostat read pi-heating-demand 54321 1 + + [1651147869.659064][10648:10653] CHIP:DMG: ReportDataMessage = + [1651147869.659093][10648:10653] CHIP:DMG: { + [1651147869.659116][10648:10653] CHIP:DMG: AttributeReportIBs = + [1651147869.659149][10648:10653] CHIP:DMG: [ + [1651147869.659174][10648:10653] CHIP:DMG: AttributeReportIB = + [1651147869.659215][10648:10653] CHIP:DMG: { + [1651147869.659244][10648:10653] CHIP:DMG: AttributeStatusIB = + [1651147869.659277][10648:10653] CHIP:DMG: { + [1651147869.659308][10648:10653] CHIP:DMG: AttributePathIB = + [1651147869.659373][10648:10653] CHIP:DMG: { + [1651147869.659411][10648:10653] CHIP:DMG: Endpoint = 0x1, + [1651147869.659469][10648:10653] CHIP:DMG: Cluster = 0x201, + [1651147869.659511][10648:10653] CHIP:DMG: Attribute = 0x0000_0008, + [1651147869.659567][10648:10653] CHIP:DMG: } + [1651147869.659629][10648:10653] CHIP:DMG: + [1651147869.659688][10648:10653] CHIP:DMG: StatusIB = + [1651147869.659729][10648:10653] CHIP:DMG: { + [1651147869.659794][10648:10653] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147869.659852][10648:10653] CHIP:DMG: }, + [1651147869.659916][10648:10653] CHIP:DMG: + [1651147869.659948][10648:10653] CHIP:DMG: }, + [1651147869.660004][10648:10653] CHIP:DMG: + [1651147869.660062][10648:10653] CHIP:DMG: }, + [1651147869.660098][10648:10653] CHIP:DMG: + [1651147869.660123][10648:10653] CHIP:DMG: ], + [1651147869.660178][10648:10653] CHIP:DMG: + [1651147869.660230][10648:10653] CHIP:DMG: SuppressResponse = true, + [1651147869.660277][10648:10653] CHIP:DMG: InteractionModelRevision = 1 + [1651147869.660304][10648:10653] CHIP:DMG: } + [1651147869.660459][10648:10653] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Reads constraints of optional attributes from DUT: @@ -130,28 +201,92 @@ tests: maxValue: 2600 - label: - "Reads constraints of mandatory attributes from DUT: - UnoccupiedCoolingSetpoint" - disabled: true - command: "readAttribute" - attribute: "UnoccupiedCoolingSetpoint" - response: - constraints: - type: int16 - minValue: 1600 - maxValue: 2600 + "Read UnoccupiedCoolingSetpoint attribute from the DUT and Verify that + the DUT responds with an int16 value" + verification: | + ./apps/chip-tool thermostat read unoccupied-cooling-setpoint 54321 1 + [1651148145.862809][10702:10707] CHIP:DMG: ReportDataMessage = + [1651148145.862848][10702:10707] CHIP:DMG: { + [1651148145.862880][10702:10707] CHIP:DMG: AttributeReportIBs = + [1651148145.862930][10702:10707] CHIP:DMG: [ + [1651148145.862966][10702:10707] CHIP:DMG: AttributeReportIB = + [1651148145.863018][10702:10707] CHIP:DMG: { + [1651148145.863057][10702:10707] CHIP:DMG: AttributeStatusIB = + [1651148145.863109][10702:10707] CHIP:DMG: { + [1651148145.863156][10702:10707] CHIP:DMG: AttributePathIB = + [1651148145.863205][10702:10707] CHIP:DMG: { + [1651148145.863250][10702:10707] CHIP:DMG: Endpoint = 0x1, + [1651148145.863307][10702:10707] CHIP:DMG: Cluster = 0x201, + [1651148145.863360][10702:10707] CHIP:DMG: Attribute = 0x0000_0013, + [1651148145.863408][10702:10707] CHIP:DMG: } + [1651148145.863466][10702:10707] CHIP:DMG: + [1651148145.863513][10702:10707] CHIP:DMG: StatusIB = + [1651148145.863562][10702:10707] CHIP:DMG: { + [1651148145.863609][10702:10707] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651148145.863658][10702:10707] CHIP:DMG: }, + [1651148145.863707][10702:10707] CHIP:DMG: + [1651148145.863750][10702:10707] CHIP:DMG: }, + [1651148145.863799][10702:10707] CHIP:DMG: + [1651148145.863836][10702:10707] CHIP:DMG: }, + [1651148145.863883][10702:10707] CHIP:DMG: + [1651148145.863920][10702:10707] CHIP:DMG: ], + [1651148145.863965][10702:10707] CHIP:DMG: + [1651148145.864000][10702:10707] CHIP:DMG: SuppressResponse = true, + [1651148145.864037][10702:10707] CHIP:DMG: InteractionModelRevision = 1 + [1651148145.864072][10702:10707] CHIP:DMG: } + [1651148145.864219][10702:10707] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of mandatory attributes from DUT: - UnoccupiedHeatingSetpoint" - disabled: true - command: "readAttribute" - attribute: "UnoccupiedHeatingSetpoint" - response: - constraints: - type: int16 - minValue: 700 - maxValue: 2000 + "Read UnoccupiedHeatingSetpoint attribute from the DUT and Verify that + the DUT responds with an int16 value" + verification: | + ./apps/chip-tool thermostat read occupied-heating-setpoint 54321 1 + [1651148114.140452][10694:10699] CHIP:DMG: ReportDataMessage = + [1651148114.140501][10694:10699] CHIP:DMG: { + [1651148114.140541][10694:10699] CHIP:DMG: AttributeReportIBs = + [1651148114.140597][10694:10699] CHIP:DMG: [ + [1651148114.140643][10694:10699] CHIP:DMG: AttributeReportIB = + [1651148114.140798][10694:10699] CHIP:DMG: { + [1651148114.140855][10694:10699] CHIP:DMG: AttributeDataIB = + [1651148114.140914][10694:10699] CHIP:DMG: { + [1651148114.141054][10694:10699] CHIP:DMG: DataVersion = 0xeb3241b, + [1651148114.141118][10694:10699] CHIP:DMG: AttributePathIB = + [1651148114.141179][10694:10699] CHIP:DMG: { + [1651148114.141285][10694:10699] CHIP:DMG: Endpoint = 0x1, + [1651148114.141396][10694:10699] CHIP:DMG: Cluster = 0x201, + [1651148114.141474][10694:10699] CHIP:DMG: Attribute = 0x0000_0012, + [1651148114.141667][10694:10699] CHIP:DMG: } + [1651148114.141780][10694:10699] CHIP:DMG: + [1651148114.141945][10694:10699] CHIP:DMG: Data = 2000, + [1651148114.142024][10694:10699] CHIP:DMG: }, + [1651148114.142136][10694:10699] CHIP:DMG: + [1651148114.142195][10694:10699] CHIP:DMG: }, + [1651148114.142263][10694:10699] CHIP:DMG: + [1651148114.142399][10694:10699] CHIP:DMG: ], + [1651148114.142466][10694:10699] CHIP:DMG: + [1651148114.142517][10694:10699] CHIP:DMG: SuppressResponse = true, + [1651148114.142569][10694:10699] CHIP:DMG: InteractionModelRevision = 1 + [1651148114.142698][10694:10699] CHIP:DMG: } + [1651148114.143048][10694:10699] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0201 Attribute 0x0000_0012 DataVersion: 246621211 + [1651148114.143195][10694:10699] CHIP:TOO: occupied heating setpoint: 2000 + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Reads constraints of mandatory attributes from DUT: @@ -220,47 +355,190 @@ tests: maxValue: 9 - label: - "Reads constraints of optional attributes from DUT: OutdoorTemperature" - disabled: true - command: "readAttribute" - attribute: "OutdoorTemperature" - response: - constraints: - type: int16 + "Read OutdoorTemperature attribute from the DUT and Verify the + datatype" + verification: | + ./apps/chip-tool thermostat read outdoor-temperature 54321 1 - - label: "Reads constraints of optional attributes from DUT: Occupancy" - disabled: true - command: "readAttribute" - attribute: "Occupancy" - response: - constraints: - type: map8 - minValue: 0 - maxValue: 1 + [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = + [1651147597.962928][10583:10588] CHIP:DMG: { + [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = + [1651147597.963014][10583:10588] CHIP:DMG: [ + [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = + [1651147597.963103][10583:10588] CHIP:DMG: { + [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = + [1651147597.963177][10583:10588] CHIP:DMG: { + [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = + [1651147597.963286][10583:10588] CHIP:DMG: { + [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, + [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, + [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0001, + [1651147597.963575][10583:10588] CHIP:DMG: } + [1651147597.963641][10583:10588] CHIP:DMG: + [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = + [1651147597.963724][10583:10588] CHIP:DMG: { + [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147597.963846][10583:10588] CHIP:DMG: }, + [1651147597.963892][10583:10588] CHIP:DMG: + [1651147597.963945][10583:10588] CHIP:DMG: }, + [1651147597.963991][10583:10588] CHIP:DMG: + [1651147597.964040][10583:10588] CHIP:DMG: }, + [1651147597.964092][10583:10588] CHIP:DMG: + [1651147597.964125][10583:10588] CHIP:DMG: ], + [1651147597.964180][10583:10588] CHIP:DMG: + [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, + [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 + [1651147597.964290][10583:10588] CHIP:DMG: } + [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: - HVACSystemTypeConfiguration" - disabled: true - command: "readAttribute" - attribute: "HVACSystemTypeConfiguration" - response: - constraints: - type: map8 - minValue: 0 - maxValue: 63 + "Read Occupancy attribute from the DUT and Verify the datatype and + response value" + verification: | + ./apps/chip-tool thermostat read occupancy 54321 1 + + [1651147633.547776][10591:10596] CHIP:DMG: ReportDataMessage = + [1651147633.547816][10591:10596] CHIP:DMG: { + [1651147633.547848][10591:10596] CHIP:DMG: AttributeReportIBs = + [1651147633.547893][10591:10596] CHIP:DMG: [ + [1651147633.547929][10591:10596] CHIP:DMG: AttributeReportIB = + [1651147633.547988][10591:10596] CHIP:DMG: { + [1651147633.548028][10591:10596] CHIP:DMG: AttributeStatusIB = + [1651147633.548075][10591:10596] CHIP:DMG: { + [1651147633.548114][10591:10596] CHIP:DMG: AttributePathIB = + [1651147633.548168][10591:10596] CHIP:DMG: { + [1651147633.548222][10591:10596] CHIP:DMG: Endpoint = 0x1, + [1651147633.548278][10591:10596] CHIP:DMG: Cluster = 0x201, + [1651147633.548330][10591:10596] CHIP:DMG: Attribute = 0x0000_0002, + [1651147633.548383][10591:10596] CHIP:DMG: } + [1651147633.548446][10591:10596] CHIP:DMG: + [1651147633.548491][10591:10596] CHIP:DMG: StatusIB = + [1651147633.548538][10591:10596] CHIP:DMG: { + [1651147633.548585][10591:10596] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147633.548633][10591:10596] CHIP:DMG: }, + [1651147633.548679][10591:10596] CHIP:DMG: + [1651147633.548722][10591:10596] CHIP:DMG: }, + [1651147633.548773][10591:10596] CHIP:DMG: + [1651147633.548813][10591:10596] CHIP:DMG: }, + [1651147633.548860][10591:10596] CHIP:DMG: + [1651147633.548898][10591:10596] CHIP:DMG: ], + [1651147633.548942][10591:10596] CHIP:DMG: + [1651147633.548978][10591:10596] CHIP:DMG: SuppressResponse = true, + [1651147633.549016][10591:10596] CHIP:DMG: InteractionModelRevision = 1 + [1651147633.549050][10591:10596] CHIP:DMG: } + [1651147633.549200][10591:10596] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: - LocalTemperatureCalibration" - disabled: true - command: "readAttribute" - attribute: "LocalTemperatureCalibration" - response: - constraints: - type: int8 - minValue: -25 - maxValue: 25 + "Read HVACSystemTypeConfiguration attribute from the DUT and Verify + that the DUT responds with a map8 value. The value has to be in the + range of 0x00 to 0x3f" + verification: | + ./apps/chip-tool thermostat read hvac-system-type-configuration 54321 1 + + [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = + [1651147597.962928][10583:10588] CHIP:DMG: { + [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = + [1651147597.963014][10583:10588] CHIP:DMG: [ + [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = + [1651147597.963103][10583:10588] CHIP:DMG: { + [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = + [1651147597.963177][10583:10588] CHIP:DMG: { + [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = + [1651147597.963286][10583:10588] CHIP:DMG: { + [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, + [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, + [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0009, + [1651147597.963575][10583:10588] CHIP:DMG: } + [1651147597.963641][10583:10588] CHIP:DMG: + [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = + [1651147597.963724][10583:10588] CHIP:DMG: { + [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147597.963846][10583:10588] CHIP:DMG: }, + [1651147597.963892][10583:10588] CHIP:DMG: + [1651147597.963945][10583:10588] CHIP:DMG: }, + [1651147597.963991][10583:10588] CHIP:DMG: + [1651147597.964040][10583:10588] CHIP:DMG: }, + [1651147597.964092][10583:10588] CHIP:DMG: + [1651147597.964125][10583:10588] CHIP:DMG: ], + [1651147597.964180][10583:10588] CHIP:DMG: + [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, + [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 + [1651147597.964290][10583:10588] CHIP:DMG: } + [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: + "Read LocalTemperatureCalibration attribute from the DUT and Verify + that the DUT responds with an int8 value.The value has to be in the + range of -25 to 25" + verification: | + ./apps/chip-tool thermostat read local-temperature-calibration 54321 1 + + [1651147993.335400][10670:10675] CHIP:DMG: ReportDataMessage = + [1651147993.335427][10670:10675] CHIP:DMG: { + [1651147993.335448][10670:10675] CHIP:DMG: AttributeReportIBs = + [1651147993.335480][10670:10675] CHIP:DMG: [ + [1651147993.335504][10670:10675] CHIP:DMG: AttributeReportIB = + [1651147993.335539][10670:10675] CHIP:DMG: { + [1651147993.335567][10670:10675] CHIP:DMG: AttributeStatusIB = + [1651147993.335599][10670:10675] CHIP:DMG: { + [1651147993.335626][10670:10675] CHIP:DMG: AttributePathIB = + [1651147993.335659][10670:10675] CHIP:DMG: { + [1651147993.335695][10670:10675] CHIP:DMG: Endpoint = 0x1, + [1651147993.335727][10670:10675] CHIP:DMG: Cluster = 0x201, + [1651147993.335763][10670:10675] CHIP:DMG: Attribute = 0x0000_0010, + [1651147993.335797][10670:10675] CHIP:DMG: } + [1651147993.335833][10670:10675] CHIP:DMG: + [1651147993.335868][10670:10675] CHIP:DMG: StatusIB = + [1651147993.335902][10670:10675] CHIP:DMG: { + [1651147993.335933][10670:10675] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147993.335968][10670:10675] CHIP:DMG: }, + [1651147993.336002][10670:10675] CHIP:DMG: + [1651147993.336029][10670:10675] CHIP:DMG: }, + [1651147993.336063][10670:10675] CHIP:DMG: + [1651147993.336089][10670:10675] CHIP:DMG: }, + [1651147993.336122][10670:10675] CHIP:DMG: + [1651147993.336143][10670:10675] CHIP:DMG: ], + [1651147993.336174][10670:10675] CHIP:DMG: + [1651147993.336198][10670:10675] CHIP:DMG: SuppressResponse = true, + [1651147993.336224][10670:10675] CHIP:DMG: InteractionModelRevision = 1 + [1651147993.336245][10670:10675] CHIP:DMG: } + [1651147993.336348][10670:10675] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Reads constraints of optional attributes from DUT: @@ -274,37 +552,145 @@ tests: minValue: 0 maxValue: 25 - - label: "Reads constraints of optional attributes from DUT: RemoteSensing" - disabled: true - command: "readAttribute" - attribute: "RemoteSensing" - response: - constraints: - type: map8 - minValue: 0 - maxValue: 7 + - label: + "Read RemoteSensing attribute from the DUT and Verify that the DUT + responds with a map8 value. The value has to be in the range of 0x00 + to 0x07" + verification: | + ./apps/chip-tool thermostat read remote-sensing 54321 1 - - label: "Reads constraints of optional attributes from DUT: AlarmMask" - disabled: true - command: "readAttribute" - attribute: "AlarmMask" - response: - constraints: - type: map8 - minValue: 0 - maxValue: 2 + [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = + [1651147597.962928][10583:10588] CHIP:DMG: { + [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = + [1651147597.963014][10583:10588] CHIP:DMG: [ + [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = + [1651147597.963103][10583:10588] CHIP:DMG: { + [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = + [1651147597.963177][10583:10588] CHIP:DMG: { + [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = + [1651147597.963286][10583:10588] CHIP:DMG: { + [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, + [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, + [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_001A, + [1651147597.963575][10583:10588] CHIP:DMG: } + [1651147597.963641][10583:10588] CHIP:DMG: + [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = + [1651147597.963724][10583:10588] CHIP:DMG: { + [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147597.963846][10583:10588] CHIP:DMG: }, + [1651147597.963892][10583:10588] CHIP:DMG: + [1651147597.963945][10583:10588] CHIP:DMG: }, + [1651147597.963991][10583:10588] CHIP:DMG: + [1651147597.964040][10583:10588] CHIP:DMG: }, + [1651147597.964092][10583:10588] CHIP:DMG: + [1651147597.964125][10583:10588] CHIP:DMG: ], + [1651147597.964180][10583:10588] CHIP:DMG: + [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, + [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 + [1651147597.964290][10583:10588] CHIP:DMG: } + [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: - ThermostatRunningMode" - disabled: true - command: "readAttribute" - attribute: "ThermostatRunningMode" - response: - constraints: - type: enum8 - minValue: 0 - maxValue: 9 + "Read AlarmMask attribute from the DUT and Verify that the DUT + responds with a map8 value.The value has to be in the range of 0x00 to + 0x07." + verification: | + ./apps/chip-tool thermostat read alarm-mask 54321 1 + + [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = + [1651147597.962928][10583:10588] CHIP:DMG: { + [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = + [1651147597.963014][10583:10588] CHIP:DMG: [ + [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = + [1651147597.963103][10583:10588] CHIP:DMG: { + [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = + [1651147597.963177][10583:10588] CHIP:DMG: { + [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = + [1651147597.963286][10583:10588] CHIP:DMG: { + [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, + [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, + [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_001D, + [1651147597.963575][10583:10588] CHIP:DMG: } + [1651147597.963641][10583:10588] CHIP:DMG: + [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = + [1651147597.963724][10583:10588] CHIP:DMG: { + [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147597.963846][10583:10588] CHIP:DMG: }, + [1651147597.963892][10583:10588] CHIP:DMG: + [1651147597.963945][10583:10588] CHIP:DMG: }, + [1651147597.963991][10583:10588] CHIP:DMG: + [1651147597.964040][10583:10588] CHIP:DMG: }, + [1651147597.964092][10583:10588] CHIP:DMG: + [1651147597.964125][10583:10588] CHIP:DMG: ], + [1651147597.964180][10583:10588] CHIP:DMG: + [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, + [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 + [1651147597.964290][10583:10588] CHIP:DMG: } + [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: + "Read ThermostatRunningMode attribute from the DUT and Verify that the + DUT responds with an enum8 value.The value has to be 0, 3 or 4" + verification: | + ./apps/chip-tool thermostat read thermostat-running-mode 54321 1 + + [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = + [1651147597.962928][10583:10588] CHIP:DMG: { + [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = + [1651147597.963014][10583:10588] CHIP:DMG: [ + [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = + [1651147597.963103][10583:10588] CHIP:DMG: { + [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = + [1651147597.963177][10583:10588] CHIP:DMG: { + [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = + [1651147597.963286][10583:10588] CHIP:DMG: { + [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, + [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, + [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_001E, + [1651147597.963575][10583:10588] CHIP:DMG: } + [1651147597.963641][10583:10588] CHIP:DMG: + [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = + [1651147597.963724][10583:10588] CHIP:DMG: { + [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147597.963846][10583:10588] CHIP:DMG: }, + [1651147597.963892][10583:10588] CHIP:DMG: + [1651147597.963945][10583:10588] CHIP:DMG: }, + [1651147597.963991][10583:10588] CHIP:DMG: + [1651147597.964040][10583:10588] CHIP:DMG: }, + [1651147597.964092][10583:10588] CHIP:DMG: + [1651147597.964125][10583:10588] CHIP:DMG: ], + [1651147597.964180][10583:10588] CHIP:DMG: + [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, + [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 + [1651147597.964290][10583:10588] CHIP:DMG: } + [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Reads constraints of optional attributes from DUT: StartOfWeek" optional: true @@ -337,242 +723,774 @@ tests: type: uint8 - label: - "Reads constraints of optional attributes from DUT: - TemperatureSetpointHold" - disabled: true - command: "readAttribute" - attribute: "TemperatureSetpointHold" - response: - constraints: - type: enum8 - minValue: 0 - maxValue: 1 + "Read TemperatureSetpointHold attribute from the DUT and Verify that + the DUT responds with an enum8 value.The value has to 0 or 1" + verification: | + ./apps/chip-tool thermostat read temperature-setpoint-hold 54321 1 + + [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = + [1651147597.962928][10583:10588] CHIP:DMG: { + [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = + [1651147597.963014][10583:10588] CHIP:DMG: [ + [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = + [1651147597.963103][10583:10588] CHIP:DMG: { + [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = + [1651147597.963177][10583:10588] CHIP:DMG: { + [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = + [1651147597.963286][10583:10588] CHIP:DMG: { + [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, + [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, + [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0023, + [1651147597.963575][10583:10588] CHIP:DMG: } + [1651147597.963641][10583:10588] CHIP:DMG: + [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = + [1651147597.963724][10583:10588] CHIP:DMG: { + [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147597.963846][10583:10588] CHIP:DMG: }, + [1651147597.963892][10583:10588] CHIP:DMG: + [1651147597.963945][10583:10588] CHIP:DMG: }, + [1651147597.963991][10583:10588] CHIP:DMG: + [1651147597.964040][10583:10588] CHIP:DMG: }, + [1651147597.964092][10583:10588] CHIP:DMG: + [1651147597.964125][10583:10588] CHIP:DMG: ], + [1651147597.964180][10583:10588] CHIP:DMG: + [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, + [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 + [1651147597.964290][10583:10588] CHIP:DMG: } + [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: - TemperatureSetpointHoldDuration" - disabled: true - command: "readAttribute" - attribute: "TemperatureSetpointHoldDuration" - response: - constraints: - type: uint16 - minValue: 0 - maxValue: 1440 + "Read TemperatureSetpointHoldDuration attribute from the DUT and + Verify that the DUT responds with a uint16 value or NULL.The value has + to be in the range of 0 to 1440" + verification: | + ./apps/chip-tool thermostat read temperature-setpoint-hold-duration 54321 1 + + [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = + [1651147597.962928][10583:10588] CHIP:DMG: { + [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = + [1651147597.963014][10583:10588] CHIP:DMG: [ + [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = + [1651147597.963103][10583:10588] CHIP:DMG: { + [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = + [1651147597.963177][10583:10588] CHIP:DMG: { + [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = + [1651147597.963286][10583:10588] CHIP:DMG: { + [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, + [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, + [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0024, + [1651147597.963575][10583:10588] CHIP:DMG: } + [1651147597.963641][10583:10588] CHIP:DMG: + [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = + [1651147597.963724][10583:10588] CHIP:DMG: { + [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147597.963846][10583:10588] CHIP:DMG: }, + [1651147597.963892][10583:10588] CHIP:DMG: + [1651147597.963945][10583:10588] CHIP:DMG: }, + [1651147597.963991][10583:10588] CHIP:DMG: + [1651147597.964040][10583:10588] CHIP:DMG: }, + [1651147597.964092][10583:10588] CHIP:DMG: + [1651147597.964125][10583:10588] CHIP:DMG: ], + [1651147597.964180][10583:10588] CHIP:DMG: + [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, + [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 + [1651147597.964290][10583:10588] CHIP:DMG: } + [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: - ThermostatProgrammingOperationMode" - disabled: true - command: "readAttribute" - attribute: "ThermostatProgrammingOperationMode" - response: - constraints: - type: map8 - minValue: 0 - maxValue: 2 + "Read ThermostatProgrammingOperationMode attribute from the DUT and + Verify that the DUT responds with a map8 value.The value has to be in + the range of 0x00 to 0x07" + verification: | + ./apps/chip-tool thermostat read thermostat-programming-operation-mode 54321 1 + + [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = + [1651147597.962928][10583:10588] CHIP:DMG: { + [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = + [1651147597.963014][10583:10588] CHIP:DMG: [ + [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = + [1651147597.963103][10583:10588] CHIP:DMG: { + [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = + [1651147597.963177][10583:10588] CHIP:DMG: { + [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = + [1651147597.963286][10583:10588] CHIP:DMG: { + [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, + [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, + [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0025, + [1651147597.963575][10583:10588] CHIP:DMG: } + [1651147597.963641][10583:10588] CHIP:DMG: + [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = + [1651147597.963724][10583:10588] CHIP:DMG: { + [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147597.963846][10583:10588] CHIP:DMG: }, + [1651147597.963892][10583:10588] CHIP:DMG: + [1651147597.963945][10583:10588] CHIP:DMG: }, + [1651147597.963991][10583:10588] CHIP:DMG: + [1651147597.964040][10583:10588] CHIP:DMG: }, + [1651147597.964092][10583:10588] CHIP:DMG: + [1651147597.964125][10583:10588] CHIP:DMG: ], + [1651147597.964180][10583:10588] CHIP:DMG: + [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, + [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 + [1651147597.964290][10583:10588] CHIP:DMG: } + [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: - ThermostatRunningState" - disabled: true - command: "readAttribute" - attribute: "ThermostatRunningState" - response: - constraints: - type: map16 - minValue: 0 - maxValue: 6 + "Read ThermostatRunningState attribute from the DUT and Verify that + the DUT responds with a map16 value.The value has to be in the range + of 0x00 to 0x7F" + verification: | + ./apps/chip-tool thermostat read thermostat-running-mode 54321 1 + + [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = + [1651147597.962928][10583:10588] CHIP:DMG: { + [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = + [1651147597.963014][10583:10588] CHIP:DMG: [ + [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = + [1651147597.963103][10583:10588] CHIP:DMG: { + [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = + [1651147597.963177][10583:10588] CHIP:DMG: { + [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = + [1651147597.963286][10583:10588] CHIP:DMG: { + [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, + [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, + [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_001E, + [1651147597.963575][10583:10588] CHIP:DMG: } + [1651147597.963641][10583:10588] CHIP:DMG: + [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = + [1651147597.963724][10583:10588] CHIP:DMG: { + [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147597.963846][10583:10588] CHIP:DMG: }, + [1651147597.963892][10583:10588] CHIP:DMG: + [1651147597.963945][10583:10588] CHIP:DMG: }, + [1651147597.963991][10583:10588] CHIP:DMG: + [1651147597.964040][10583:10588] CHIP:DMG: }, + [1651147597.964092][10583:10588] CHIP:DMG: + [1651147597.964125][10583:10588] CHIP:DMG: ], + [1651147597.964180][10583:10588] CHIP:DMG: + [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, + [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 + [1651147597.964290][10583:10588] CHIP:DMG: } + [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: - SetpointChangeSource" - disabled: true - command: "readAttribute" - attribute: "SetpointChangeSource" - response: - constraints: - type: enum8 - minValue: 0 - maxValue: 2 + "Read SetpointChangeSource attribute from the DUT and Verify that the + DUT responds with an enum8 value. The value has to be in the range of + 0 to 2" + verification: | + ./apps/chip-tool thermostat read setpoint-change-source 54321 1 + + [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = + [1651147597.962928][10583:10588] CHIP:DMG: { + [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = + [1651147597.963014][10583:10588] CHIP:DMG: [ + [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = + [1651147597.963103][10583:10588] CHIP:DMG: { + [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = + [1651147597.963177][10583:10588] CHIP:DMG: { + [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = + [1651147597.963286][10583:10588] CHIP:DMG: { + [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, + [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, + [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0030, + [1651147597.963575][10583:10588] CHIP:DMG: } + [1651147597.963641][10583:10588] CHIP:DMG: + [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = + [1651147597.963724][10583:10588] CHIP:DMG: { + [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147597.963846][10583:10588] CHIP:DMG: }, + [1651147597.963892][10583:10588] CHIP:DMG: + [1651147597.963945][10583:10588] CHIP:DMG: }, + [1651147597.963991][10583:10588] CHIP:DMG: + [1651147597.964040][10583:10588] CHIP:DMG: }, + [1651147597.964092][10583:10588] CHIP:DMG: + [1651147597.964125][10583:10588] CHIP:DMG: ], + [1651147597.964180][10583:10588] CHIP:DMG: + [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, + [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 + [1651147597.964290][10583:10588] CHIP:DMG: } + [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: - SetpointChangeAmount" - disabled: true - command: "readAttribute" - attribute: "SetpointChangeAmount" - response: - constraints: - type: int16 + "Read SetpointChangeAmount attribute from the DUT and Verify that the + DUT responds with an int16 value or NULL" + verification: | + ./apps/chip-tool thermostat read setpoint-change-amount 54321 1 + + [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = + [1651147597.962928][10583:10588] CHIP:DMG: { + [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = + [1651147597.963014][10583:10588] CHIP:DMG: [ + [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = + [1651147597.963103][10583:10588] CHIP:DMG: { + [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = + [1651147597.963177][10583:10588] CHIP:DMG: { + [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = + [1651147597.963286][10583:10588] CHIP:DMG: { + [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, + [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, + [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0031, + [1651147597.963575][10583:10588] CHIP:DMG: } + [1651147597.963641][10583:10588] CHIP:DMG: + [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = + [1651147597.963724][10583:10588] CHIP:DMG: { + [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147597.963846][10583:10588] CHIP:DMG: }, + [1651147597.963892][10583:10588] CHIP:DMG: + [1651147597.963945][10583:10588] CHIP:DMG: }, + [1651147597.963991][10583:10588] CHIP:DMG: + [1651147597.964040][10583:10588] CHIP:DMG: }, + [1651147597.964092][10583:10588] CHIP:DMG: + [1651147597.964125][10583:10588] CHIP:DMG: ], + [1651147597.964180][10583:10588] CHIP:DMG: + [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, + [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 + [1651147597.964290][10583:10588] CHIP:DMG: } + [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: - SetpointChangeSourceTimestamp" - disabled: true - command: "readAttribute" - attribute: "SetpointChangeSourceTimestamp" - response: - constraints: - type: utc + "Read SetpointChangeSourceTimestamp attribute from the DUT and Verify + that the DUT responds with a utc value" + verification: | + ./apps/chip-tool thermostat read setpoint-change-source-timestamp 54321 1 + + [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = + [1651147597.962928][10583:10588] CHIP:DMG: { + [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = + [1651147597.963014][10583:10588] CHIP:DMG: [ + [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = + [1651147597.963103][10583:10588] CHIP:DMG: { + [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = + [1651147597.963177][10583:10588] CHIP:DMG: { + [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = + [1651147597.963286][10583:10588] CHIP:DMG: { + [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, + [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, + [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0001, + [1651147597.963575][10583:10588] CHIP:DMG: } + [1651147597.963641][10583:10588] CHIP:DMG: + [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = + [1651147597.963724][10583:10588] CHIP:DMG: { + [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147597.963846][10583:10588] CHIP:DMG: }, + [1651147597.963892][10583:10588] CHIP:DMG: + [1651147597.963945][10583:10588] CHIP:DMG: }, + [1651147597.963991][10583:10588] CHIP:DMG: + [1651147597.964040][10583:10588] CHIP:DMG: }, + [1651147597.964092][10583:10588] CHIP:DMG: + [1651147597.964125][10583:10588] CHIP:DMG: ], + [1651147597.964180][10583:10588] CHIP:DMG: + [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, + [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 + [1651147597.964290][10583:10588] CHIP:DMG: } + [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: OccupiedSetback" - disabled: true - command: "readAttribute" - attribute: "OccupiedSetback" - response: - constraints: - type: uint8 - minValue: 0 - maxValue: 254 + "Read OccupiedSetback attribute from the DUT and Verify that the DUT + responds with a uint8 value or NULL" + verification: | + Attribute Not implemented in the SDK + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: OccupiedSetbackMin" - disabled: true - command: "readAttribute" - attribute: "OccupiedSetbackMin" - response: - constraints: - type: uint8 - minValue: 0 - maxValue: 254 + "Read OccupiedSetbackMin attribute from the DUT and Verify that the + DUT responds with a uint8 value or NULL" + verification: | + Attribute Not implemented in the SDK + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: OccupiedSetbackMax" - disabled: true - command: "readAttribute" - attribute: "OccupiedSetbackMax" - response: - constraints: - type: uint8 - minValue: 0 - maxValue: 254 + "Read OccupiedSetbackMax attribute from the DUT and Verify that the + DUT responds with a uint8 value or NULL" + verification: | + Attribute Not implemented in the SDK + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: UnoccupiedSetback" - disabled: true - command: "readAttribute" - attribute: "UnoccupiedSetback" - response: - constraints: - type: uint8 - minValue: 0 - maxValue: 254 + "Read UnoccupiedSetback attribute from the DUT and Verify that the DUT + responds with a uint8 value or NULL" + verification: | + Attribute Not implemented in the SDK + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: - UnoccupiedSetbackMin" - disabled: true - command: "readAttribute" - attribute: "UnoccupiedSetbackMin" - response: - constraints: - type: uint8 - minValue: 0 - maxValue: 254 + "Read UnoccupiedSetbackMin attribute from the DUT and Verify that the + DUT responds with a uint8 value or NULL" + verification: | + Attribute Not implemented in the SDK + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: - UnoccupiedSetbackMax" - disabled: true - command: "readAttribute" - attribute: "UnoccupiedSetbackMax" - response: - constraints: - type: uint8 - minValue: 0 - maxValue: 254 + "Read UnoccupiedSetbackMax attribute from the DUT and Verify that the + DUT responds with a uint8 value or NULL" + verification: | + Attribute Not implemented in the SDK + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: EmergencyHeatDelta" - disabled: true - command: "readAttribute" - attribute: "EmergencyHeatDelta" - response: - constraints: - type: uint8 + "Read EmergencyHeatDelta attribute from the DUT and Verify that the + DUT responds with a uint8 value or NULL" + verification: | + Attribute Not implemented in the SDK + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - - label: "Reads constraints of optional attributes from DUT: ACType" - disabled: true - command: "readAttribute" - attribute: "ACType" - response: - constraints: - type: enum8 - minValue: 0 - maxValue: 4 + - label: + "Read ACType attribute from the DUT and Verify that the DUT responds + with an enum8 value. The value has to be in the range of 0 to 4" + verification: | + ./apps/chip-tool thermostat read ac-type 54321 1 - - label: "Reads constraints of optional attributes from DUT: ACCapacity" - disabled: true - command: "readAttribute" - attribute: "ACCapacity" - response: - constraints: - type: uint16 + [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = + [1651147597.962928][10583:10588] CHIP:DMG: { + [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = + [1651147597.963014][10583:10588] CHIP:DMG: [ + [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = + [1651147597.963103][10583:10588] CHIP:DMG: { + [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = + [1651147597.963177][10583:10588] CHIP:DMG: { + [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = + [1651147597.963286][10583:10588] CHIP:DMG: { + [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, + [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, + [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0040, + [1651147597.963575][10583:10588] CHIP:DMG: } + [1651147597.963641][10583:10588] CHIP:DMG: + [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = + [1651147597.963724][10583:10588] CHIP:DMG: { + [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147597.963846][10583:10588] CHIP:DMG: }, + [1651147597.963892][10583:10588] CHIP:DMG: + [1651147597.963945][10583:10588] CHIP:DMG: }, + [1651147597.963991][10583:10588] CHIP:DMG: + [1651147597.964040][10583:10588] CHIP:DMG: }, + [1651147597.964092][10583:10588] CHIP:DMG: + [1651147597.964125][10583:10588] CHIP:DMG: ], + [1651147597.964180][10583:10588] CHIP:DMG: + [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, + [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 + [1651147597.964290][10583:10588] CHIP:DMG: } + [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: ACRefrigerantType" - disabled: true - command: "readAttribute" - attribute: "ACRefrigerantType" - response: - constraints: - type: enum8 - minValue: 0 - maxValue: 3 + "Read ACCapacity attribute from the DUT and Verify that the DUT + responds with a uint16 value" + verification: | + ./apps/chip-tool thermostat read ac-capacity 54321 1 + + [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = + [1651147597.962928][10583:10588] CHIP:DMG: { + [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = + [1651147597.963014][10583:10588] CHIP:DMG: [ + [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = + [1651147597.963103][10583:10588] CHIP:DMG: { + [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = + [1651147597.963177][10583:10588] CHIP:DMG: { + [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = + [1651147597.963286][10583:10588] CHIP:DMG: { + [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, + [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, + [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0041, + [1651147597.963575][10583:10588] CHIP:DMG: } + [1651147597.963641][10583:10588] CHIP:DMG: + [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = + [1651147597.963724][10583:10588] CHIP:DMG: { + [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147597.963846][10583:10588] CHIP:DMG: }, + [1651147597.963892][10583:10588] CHIP:DMG: + [1651147597.963945][10583:10588] CHIP:DMG: }, + [1651147597.963991][10583:10588] CHIP:DMG: + [1651147597.964040][10583:10588] CHIP:DMG: }, + [1651147597.964092][10583:10588] CHIP:DMG: + [1651147597.964125][10583:10588] CHIP:DMG: ], + [1651147597.964180][10583:10588] CHIP:DMG: + [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, + [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 + [1651147597.964290][10583:10588] CHIP:DMG: } + [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: ACCompressorType" - disabled: true - command: "readAttribute" - attribute: "ACCompressorType" - response: - constraints: - type: enum8 - minValue: 0 - maxValue: 3 + "Read ACRefrigerantType attribute from the DUT and VVerify that the + DUT responds with an enum8 value.The value has to be in the range of 0 + to 3" + verification: | + ./apps/chip-tool thermostat read ac-refrigerant-type 54321 1 - - label: "Reads constraints of optional attributes from DUT: ACErrorCode" - disabled: true - command: "readAttribute" - attribute: "ACErrorCode" - response: - constraints: - type: map32 + [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = + [1651147597.962928][10583:10588] CHIP:DMG: { + [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = + [1651147597.963014][10583:10588] CHIP:DMG: [ + [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = + [1651147597.963103][10583:10588] CHIP:DMG: { + [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = + [1651147597.963177][10583:10588] CHIP:DMG: { + [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = + [1651147597.963286][10583:10588] CHIP:DMG: { + [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, + [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, + [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0042, + [1651147597.963575][10583:10588] CHIP:DMG: } + [1651147597.963641][10583:10588] CHIP:DMG: + [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = + [1651147597.963724][10583:10588] CHIP:DMG: { + [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147597.963846][10583:10588] CHIP:DMG: }, + [1651147597.963892][10583:10588] CHIP:DMG: + [1651147597.963945][10583:10588] CHIP:DMG: }, + [1651147597.963991][10583:10588] CHIP:DMG: + [1651147597.964040][10583:10588] CHIP:DMG: }, + [1651147597.964092][10583:10588] CHIP:DMG: + [1651147597.964125][10583:10588] CHIP:DMG: ], + [1651147597.964180][10583:10588] CHIP:DMG: + [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, + [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 + [1651147597.964290][10583:10588] CHIP:DMG: } + [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: ACLouverPosition" - disabled: true - command: "readAttribute" - attribute: "ACLouverPosition" - response: - constraints: - type: enum8 - minValue: 1 - maxValue: 5 + "Read ACCompressorType attribute from the DUT and Verify that the DUT + responds with an enum8 value.The value has to be in the range of 0 to + 3" + verification: | + ./apps/chip-tool thermostat read ac-compressor 54321 1 + + Attribute Not implemented in the SDK + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: ACCoilTemperature" - disabled: true - command: "readAttribute" - attribute: "ACCoilTemperature" - response: - constraints: - type: int16 + "Read ACErrorCode attribute from the DUT and Verify that the DUT + responds with a map32 value" + verification: | + ./apps/chip-tool thermostat read ac-error-code 54321 1 - - label: "Reads optional attributes from DUT: ACCapacityFormat" - disabled: true - command: "readAttribute" - attribute: "ACCapacityFormat" - response: - value: 0 + [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = + [1651147597.962928][10583:10588] CHIP:DMG: { + [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = + [1651147597.963014][10583:10588] CHIP:DMG: [ + [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = + [1651147597.963103][10583:10588] CHIP:DMG: { + [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = + [1651147597.963177][10583:10588] CHIP:DMG: { + [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = + [1651147597.963286][10583:10588] CHIP:DMG: { + [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, + [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, + [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0044, + [1651147597.963575][10583:10588] CHIP:DMG: } + [1651147597.963641][10583:10588] CHIP:DMG: + [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = + [1651147597.963724][10583:10588] CHIP:DMG: { + [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147597.963846][10583:10588] CHIP:DMG: }, + [1651147597.963892][10583:10588] CHIP:DMG: + [1651147597.963945][10583:10588] CHIP:DMG: }, + [1651147597.963991][10583:10588] CHIP:DMG: + [1651147597.964040][10583:10588] CHIP:DMG: }, + [1651147597.964092][10583:10588] CHIP:DMG: + [1651147597.964125][10583:10588] CHIP:DMG: ], + [1651147597.964180][10583:10588] CHIP:DMG: + [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, + [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 + [1651147597.964290][10583:10588] CHIP:DMG: } + [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: - "Reads constraints of optional attributes from DUT: ACCapacityFormat" - disabled: true - command: "readAttribute" - attribute: "ACCapacityFormat" - response: - constraints: - type: enum8 + "Read ACLouverPosition attribute from the DUT and Verify that the DUT + responds with an enum8 value.The value has to be in the range of 1 to + 5" + verification: | + ./apps/chip-tool thermostat read ac-louver-position 54321 1 + + [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = + [1651147597.962928][10583:10588] CHIP:DMG: { + [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = + [1651147597.963014][10583:10588] CHIP:DMG: [ + [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = + [1651147597.963103][10583:10588] CHIP:DMG: { + [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = + [1651147597.963177][10583:10588] CHIP:DMG: { + [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = + [1651147597.963286][10583:10588] CHIP:DMG: { + [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, + [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, + [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0045, + [1651147597.963575][10583:10588] CHIP:DMG: } + [1651147597.963641][10583:10588] CHIP:DMG: + [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = + [1651147597.963724][10583:10588] CHIP:DMG: { + [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147597.963846][10583:10588] CHIP:DMG: }, + [1651147597.963892][10583:10588] CHIP:DMG: + [1651147597.963945][10583:10588] CHIP:DMG: }, + [1651147597.963991][10583:10588] CHIP:DMG: + [1651147597.964040][10583:10588] CHIP:DMG: }, + [1651147597.964092][10583:10588] CHIP:DMG: + [1651147597.964125][10583:10588] CHIP:DMG: ], + [1651147597.964180][10583:10588] CHIP:DMG: + [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, + [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 + [1651147597.964290][10583:10588] CHIP:DMG: } + [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: + "Read ACCoilTemperature attribute from the DUT and Verify that the DUT + responds with an int16 value or NULL" + verification: | + ./apps/chip-tool thermostat read ac-coil-temperature 54321 1 + + [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = + [1651147597.962928][10583:10588] CHIP:DMG: { + [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = + [1651147597.963014][10583:10588] CHIP:DMG: [ + [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = + [1651147597.963103][10583:10588] CHIP:DMG: { + [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = + [1651147597.963177][10583:10588] CHIP:DMG: { + [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = + [1651147597.963286][10583:10588] CHIP:DMG: { + [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, + [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, + [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0046, + [1651147597.963575][10583:10588] CHIP:DMG: } + [1651147597.963641][10583:10588] CHIP:DMG: + [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = + [1651147597.963724][10583:10588] CHIP:DMG: { + [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147597.963846][10583:10588] CHIP:DMG: }, + [1651147597.963892][10583:10588] CHIP:DMG: + [1651147597.963945][10583:10588] CHIP:DMG: }, + [1651147597.963991][10583:10588] CHIP:DMG: + [1651147597.964040][10583:10588] CHIP:DMG: }, + [1651147597.964092][10583:10588] CHIP:DMG: + [1651147597.964125][10583:10588] CHIP:DMG: ], + [1651147597.964180][10583:10588] CHIP:DMG: + [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, + [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 + [1651147597.964290][10583:10588] CHIP:DMG: } + [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: + "Read ACCapacityFormat attribute from the DUT and Verify that the DUT + responds with an enum8 value.The value has to be 0." + verification: | + ./apps/chip-tool thermostat read ac-capacity-format 54321 1 + + [1651147597.962878][10583:10588] CHIP:DMG: ReportDataMessage = + [1651147597.962928][10583:10588] CHIP:DMG: { + [1651147597.962957][10583:10588] CHIP:DMG: AttributeReportIBs = + [1651147597.963014][10583:10588] CHIP:DMG: [ + [1651147597.963047][10583:10588] CHIP:DMG: AttributeReportIB = + [1651147597.963103][10583:10588] CHIP:DMG: { + [1651147597.963138][10583:10588] CHIP:DMG: AttributeStatusIB = + [1651147597.963177][10583:10588] CHIP:DMG: { + [1651147597.963226][10583:10588] CHIP:DMG: AttributePathIB = + [1651147597.963286][10583:10588] CHIP:DMG: { + [1651147597.963329][10583:10588] CHIP:DMG: Endpoint = 0x1, + [1651147597.963389][10583:10588] CHIP:DMG: Cluster = 0x201, + [1651147597.963449][10583:10588] CHIP:DMG: Attribute = 0x0000_0047, + [1651147597.963575][10583:10588] CHIP:DMG: } + [1651147597.963641][10583:10588] CHIP:DMG: + [1651147597.963683][10583:10588] CHIP:DMG: StatusIB = + [1651147597.963724][10583:10588] CHIP:DMG: { + [1651147597.963785][10583:10588] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), + [1651147597.963846][10583:10588] CHIP:DMG: }, + [1651147597.963892][10583:10588] CHIP:DMG: + [1651147597.963945][10583:10588] CHIP:DMG: }, + [1651147597.963991][10583:10588] CHIP:DMG: + [1651147597.964040][10583:10588] CHIP:DMG: }, + [1651147597.964092][10583:10588] CHIP:DMG: + [1651147597.964125][10583:10588] CHIP:DMG: ], + [1651147597.964180][10583:10588] CHIP:DMG: + [1651147597.964213][10583:10588] CHIP:DMG: SuppressResponse = true, + [1651147597.964258][10583:10588] CHIP:DMG: InteractionModelRevision = 1 + [1651147597.964290][10583:10588] CHIP:DMG: } + [1651147597.964450][10583:10588] CHIP:TOO: Response Failure: IM Error 0x00000586: General error: 0x86 (UNSUPPORTED_ATTRIBUTE) + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/tests.js b/src/app/tests/suites/tests.js index 1b175d6578fc9d..b41a4078fe48fa 100644 --- a/src/app/tests/suites/tests.js +++ b/src/app/tests/suites/tests.js @@ -322,9 +322,7 @@ function getManualTests() { 'Test_TC_DL_2_5', 'Test_TC_DL_2_6', 'Test_TC_DL_2_7', - 'Test_TC_DL_2_8', 'Test_TC_DL_2_10', - 'Test_TC_DL_2_11', 'Test_TC_DL_2_13', 'Test_TC_DL_2_14', 'Test_TC_DL_2_15', @@ -761,6 +759,8 @@ function getTests() { 'Test_TC_DL_2_2', 'Test_TC_DL_2_3', 'Test_TC_DL_2_4', + 'Test_TC_DL_2_8', + 'Test_TC_DL_2_11', ]; const Groups = [ diff --git a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h index 346cff4a0c06be..937be987c6011a 100644 --- a/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool-darwin/zap-generated/test/Commands.h @@ -223,6 +223,8 @@ class TestList : public Command { printf("Test_TC_DL_2_2\n"); printf("Test_TC_DL_2_3\n"); printf("Test_TC_DL_2_4\n"); + printf("Test_TC_DL_2_8\n"); + printf("Test_TC_DL_2_11\n"); printf("TestGroupsCluster\n"); printf("TestGroupKeyManagementCluster\n"); @@ -43246,8 +43248,230 @@ class Test_TC_PS_2_1 : public TestCommandBridge { err = TestTestHarnessClientReadsDescriptionAttributeFromServerDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Test Harness Client reads BatChargeLevel from Server DUT\n"); - err = TestTestHarnessClientReadsBatChargeLevelFromServerDut_4(); + ChipLogProgress( + chipTool, " ***** Test Step 4 : Test Harness Client reads WiredAssessedInputVoltage attribue from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsWiredAssessedInputVoltageAttribueFromServerDut_4(); + break; + case 5: + ChipLogProgress( + chipTool, " ***** Test Step 5 : Test Harness Client reads WiredAssessedInputFrequency attribute from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsWiredAssessedInputFrequencyAttributeFromServerDut_5(); + break; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : Test Harness Client reads WiredCurrentType attribute from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsWiredCurrentTypeAttributeFromServerDut_6(); + break; + case 7: + ChipLogProgress( + chipTool, " ***** Test Step 7 : Test Harness Client reads WiredAssessedCurrent attribute from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsWiredAssessedCurrentAttributeFromServerDut_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Test Harness Client reads WiredNominalVoltage from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsWiredNominalVoltageFromServerDut_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Test Harness Client reads WiredMaximumCurrent from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsWiredMaximumCurrentFromServerDut_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Test Harness Client reads WiredPresent from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsWiredPresentFromServerDut_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Test Harness Client reads ActiveWiredFaults from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsActiveWiredFaultsFromServerDut_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Test Harness Client reads BatVoltage from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatVoltageFromServerDut_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Test Harness Client reads BatPercentRemaining from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatPercentRemainingFromServerDut_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Test Harness Client reads BatTimeRemaining from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatTimeRemainingFromServerDut_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Test Harness Client reads BatChargeLevel from Server DUT\n"); + err = TestTestHarnessClientReadsBatChargeLevelFromServerDut_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Test Harness Client reads BatReplacementNeeded from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatReplacementNeededFromServerDut_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Test Harness Client reads BatReplaceability from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatReplaceabilityFromServerDut_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Test Harness Client reads BatPresent from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatPresentFromServerDut_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Test Harness Client readsActiveBatFaults from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsActiveBatFaultsFromServerDut_19(); + break; + case 20: + ChipLogProgress( + chipTool, " ***** Test Step 20 : Test Harness Client reads BatReplacementDescription from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatReplacementDescriptionFromServerDut_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Test Harness Client reads BatCommonDesignation from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatCommonDesignationFromServerDut_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Test Harness Client reads BatANSIDesignation from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatANSIDesignationFromServerDut_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Test Harness Client reads BatIECDesignation from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatIECDesignationFromServerDut_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : Test Harness Client reads BatApprovedChemistry from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatApprovedChemistryFromServerDut_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : Test Harness Client reads BatCapacity from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatCapacityFromServerDut_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Test Harness Client reads BatQuantity from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatQuantityFromServerDut_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Test Harness Client reads BatChargeState from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatChargeStateFromServerDut_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Test Harness Client reads BatTimeToFullCharge from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatTimeToFullChargeFromServerDut_28(); + break; + case 29: + ChipLogProgress( + chipTool, " ***** Test Step 29 : Test Harness Client reads BatFunctionalWhileCharging from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatFunctionalWhileChargingFromServerDut_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Test Harness Client reads BatChargingCurrent from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsBatChargingCurrentFromServerDut_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Test Harness Client reads ActiveBatChargeFaults from Server DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestTestHarnessClientReadsActiveBatChargeFaultsFromServerDut_31(); break; } @@ -43275,6 +43499,87 @@ class Test_TC_PS_2_1 : public TestCommandBridge { 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; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -43288,7 +43593,7 @@ class Test_TC_PS_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 32; chip::Optional mNodeId; chip::Optional mCluster; @@ -43363,513 +43668,273 @@ class Test_TC_PS_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTestHarnessClientReadsBatChargeLevelFromServerDut_4() + CHIP_ERROR TestTestHarnessClientReadsWiredAssessedInputVoltageAttribueFromServerDut_4() { CHIPDevice * device = GetDevice("alpha"); CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeBatteryChargeLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Test Harness Client reads BatChargeLevel from Server DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + [cluster + readAttributeWiredAssessedInputVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads WiredAssessedInputVoltage attribue from Server DUT Error: %@", err); - VerifyOrReturn(CheckConstraintType("batteryChargeLevel", "", "enum8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("batteryChargeLevel", [value unsignedCharValue], 0)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("batteryChargeLevel", [value unsignedCharValue], 2)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + VerifyOrReturn(CheckConstraintType("wiredAssessedInputVoltage", "", "uint32")); + NextTest(); + }]; return CHIP_NO_ERROR; } -}; -class Test_TC_PRS_1_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_PRS_1_1() - : TestCommandBridge("Test_TC_PRS_1_1") - , mTestIndex(0) + CHIP_ERROR TestTestHarnessClientReadsWiredAssessedInputFrequencyAttributeFromServerDut_5() { - 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) + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - ~Test_TC_PRS_1_1() {} + [cluster + readAttributeWiredAssessedInputFrequencyWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads WiredAssessedInputFrequency attribute from Server DUT Error: %@", err); - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PRS_1_1\n"); - } + VerifyOrReturn(CheckConstraintType("wiredAssessedInputFrequency", "", "uint16")); + NextTest(); + }]; - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PRS_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + return CHIP_NO_ERROR; + } - Wait(); + CHIP_ERROR TestTestHarnessClientReadsWiredCurrentTypeAttributeFromServerDut_6() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - // 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 : Read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); - err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); - break; - case 3: - ChipLogProgress( - chipTool, " ***** Test Step 3 : Write the default values to mandatory global attribute: ClusterRevision\n"); - err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Reads back global attribute: ClusterRevision\n"); - err = TestReadsBackGlobalAttributeClusterRevision_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global mandatory attribute constraints: AttributeList\n"); - err = TestReadTheGlobalMandatoryAttributeConstraintsAttributeList_5(); - break; - case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " - "supported events.\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); - break; - case 7: - ChipLogProgress(chipTool, - " ***** Test Step 7 : Read AcceptedCommandList attribute from the DUT and Verify that the DUT response\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { - NextTest(); - return; - } - err = TestReadAcceptedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_7(); - break; - case 8: - ChipLogProgress(chipTool, - " ***** Test Step 8 : Read GeneratedCommandList attribute from the DUT and Verify that the DUT response\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { - NextTest(); - return; + [cluster readAttributeWiredCurrentTypeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads WiredCurrentType attribute from Server DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("wiredCurrentType", "", "enum8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("wiredCurrentType", [value unsignedCharValue], 0)); } - err = TestReadGeneratedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_8(); - break; - case 9: - ChipLogProgress( - chipTool, " ***** Test Step 9 : Read FeatureMap attribute from the DUT and Verify that the DUT response\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { - NextTest(); - return; + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("wiredCurrentType", [value unsignedCharValue], 1)); } - err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_9(); - 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), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - 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; - } + NextTest(); + }]; - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestTestHarnessClientReadsWiredAssessedCurrentAttributeFromServerDut_7() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + [cluster readAttributeWiredAssessedCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads WiredAssessedCurrent attribute from Server DUT Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); + VerifyOrReturn(CheckConstraintType("wiredAssessedCurrent", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestTestHarnessClientReadsWiredNominalVoltageFromServerDut_8() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeWiredNominalVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads WiredNominalVoltage from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); - } - + VerifyOrReturn(CheckConstraintType("wiredNominalVoltage", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() + CHIP_ERROR TestTestHarnessClientReadsWiredMaximumCurrentFromServerDut_9() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); + [cluster readAttributeWiredMaximumCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads WiredMaximumCurrent from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); + VerifyOrReturn(CheckConstraintType("wiredMaximumCurrent", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() + CHIP_ERROR TestTestHarnessClientReadsWiredPresentFromServerDut_10() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id clusterRevisionArgument; - clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; - [cluster - writeAttributeClusterRevisionWithValue:clusterRevisionArgument - completionHandler:^(NSError * _Nullable err) { - NSLog( - @"Write the default values to mandatory global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeWiredPresentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads WiredPresent from Server DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("wiredPresent", "", "bool")); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() + CHIP_ERROR TestTestHarnessClientReadsActiveWiredFaultsFromServerDut_11() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Reads back global attribute: ClusterRevision Error: %@", err); + [cluster readAttributeActiveWiredFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads ActiveWiredFaults from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); - } - + VerifyOrReturn(CheckConstraintType("activeWiredFaults", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalMandatoryAttributeConstraintsAttributeList_5() + CHIP_ERROR TestTestHarnessClientReadsBatVoltageFromServerDut_12() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global mandatory attribute constraints: AttributeList Error: %@", err); + [cluster readAttributeBatteryVoltageWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatVoltage from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); + VerifyOrReturn(CheckConstraintType("batteryVoltage", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() + CHIP_ERROR TestTestHarnessClientReadsBatPercentRemainingFromServerDut_13() { - 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("alpha", value); - } + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIP_ERROR TestReadAcceptedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_7() - { - 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("alpha", value); - } + [cluster readAttributeBatteryPercentRemainingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatPercentRemaining from Server DUT Error: %@", err); - CHIP_ERROR TestReadGeneratedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_8() - { - 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("alpha", value); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_9() - { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter '0' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("0garbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } -}; + VerifyOrReturn(CheckConstraintType("batteryPercentRemaining", "", "uint8")); + NextTest(); + }]; -class Test_TC_PRS_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_PRS_2_1() - : TestCommandBridge("Test_TC_PRS_2_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_PRS_2_1() {} - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR TestTestHarnessClientReadsBatTimeRemainingFromServerDut_14() { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PRS_2_1\n"); - } + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PRS_2_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + [cluster readAttributeBatteryTimeRemainingWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatTimeRemaining from Server DUT Error: %@", err); - Wait(); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - // 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 : Read the mandatory attribute constraints: MeasuredValue\n"); - err = TestReadTheMandatoryAttributeConstraintsMeasuredValue_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the mandatory attribute constraints: MinMeasuredValue\n"); - err = TestReadTheMandatoryAttributeConstraintsMinMeasuredValue_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the mandatory attribute constraints: MaxMeasuredValue\n"); - err = TestReadTheMandatoryAttributeConstraintsMaxMeasuredValue_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the optional attribute: Tolerance\n"); - err = TestReadTheOptionalAttributeTolerance_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the optional attribute: ScaledValue\n"); - err = TestReadTheOptionalAttributeScaledValue_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Read the optional attribute: MinScaledValue\n"); - err = TestReadTheOptionalAttributeMinScaledValue_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the optional attribute: MaxScaledValue\n"); - err = TestReadTheOptionalAttributeMaxScaledValue_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the optional attribute: ScaledTolerance\n"); - err = TestReadTheOptionalAttributeScaledTolerance_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional attribute: Scale\n"); - err = TestReadTheOptionalAttributeScale_9(); - break; - } + VerifyOrReturn(CheckConstraintType("batteryTimeRemaining", "", "uint32")); + NextTest(); + }]; - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return CHIP_NO_ERROR; } - void OnStatusUpdate(const chip::app::StatusIB & status) override + CHIP_ERROR TestTestHarnessClientReadsBatChargeLevelFromServerDut_15() { - 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; - } + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); + [cluster readAttributeBatteryChargeLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatChargeLevel from Server DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("batteryChargeLevel", "", "enum8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("batteryChargeLevel", [value unsignedCharValue], 0)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("batteryChargeLevel", [value unsignedCharValue], 2)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestTestHarnessClientReadsBatReplacementNeededFromServerDut_16() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 10; + [cluster readAttributeBatteryReplacementNeededWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatReplacementNeeded from Server DUT Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); + VerifyOrReturn(CheckConstraintType("batteryReplacementNeeded", "", "bool")); + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMeasuredValue_1() + CHIP_ERROR TestTestHarnessClientReadsBatReplaceabilityFromServerDut_17() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute constraints: MeasuredValue Error: %@", err); + [cluster readAttributeBatteryReplaceabilityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatReplaceability from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); + VerifyOrReturn(CheckConstraintType("batteryReplaceability", "", "enum8")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value shortValue], -32768)); + VerifyOrReturn(CheckConstraintMinValue("batteryReplaceability", [value unsignedCharValue], 0)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value shortValue], 32767)); + VerifyOrReturn(CheckConstraintMaxValue("batteryReplaceability", [value unsignedCharValue], 3)); } NextTest(); @@ -43878,84 +43943,79 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMinMeasuredValue_2() + CHIP_ERROR TestTestHarnessClientReadsBatPresentFromServerDut_18() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute constraints: MinMeasuredValue Error: %@", err); + [cluster readAttributeBatteryPresentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatPresent from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value shortValue], -32768)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value shortValue], 32767)); - } - + VerifyOrReturn(CheckConstraintType("batteryPresent", "", "bool")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMaxMeasuredValue_3() + CHIP_ERROR TestTestHarnessClientReadsActiveBatFaultsFromServerDut_19() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the mandatory attribute constraints: MaxMeasuredValue Error: %@", err); + [cluster readAttributeActiveBatteryFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client readsActiveBatFaults from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value shortValue], -32768)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value shortValue], 32767)); - } - + VerifyOrReturn(CheckConstraintType("activeBatteryFaults", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeTolerance_4() + CHIP_ERROR TestTestHarnessClientReadsBatReplacementDescriptionFromServerDut_20() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: Tolerance Error: %@", err); + [cluster + readAttributeBatteryReplacementDescriptionWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatReplacementDescription from Server DUT Error: %@", err); - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("batteryReplacementDescription", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("batteryReplacementDescription", [value length], 60)); NextTest(); - return; - } + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTestHarnessClientReadsBatCommonDesignationFromServerDut_21() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBatteryCommonDesignationWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatCommonDesignation from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("tolerance", "", "int16")); + VerifyOrReturn(CheckConstraintType("batteryCommonDesignation", "", "uint32")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("tolerance", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMinValue("batteryCommonDesignation", [value unsignedIntValue], 0UL)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("tolerance", [value unsignedShortValue], 2048U)); + VerifyOrReturn(CheckConstraintMaxValue("batteryCommonDesignation", [value unsignedIntValue], 80UL)); } NextTest(); @@ -43964,62 +44024,61 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeScaledValue_5() + CHIP_ERROR TestTestHarnessClientReadsBatANSIDesignationFromServerDut_22() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeScaledValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: ScaledValue Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeBatteryANSIDesignationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatANSIDesignation from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("scaledValue", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("scaledValue", [value shortValue], -32768)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("scaledValue", [value shortValue], 32767)); - } - + VerifyOrReturn(CheckConstraintType("batteryANSIDesignation", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("batteryANSIDesignation", [value length], 20)); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeMinScaledValue_6() + CHIP_ERROR TestTestHarnessClientReadsBatIECDesignationFromServerDut_23() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinScaledValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: MinScaledValue Error: %@", err); + [cluster readAttributeBatteryIECDesignationWithCompletionHandler:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatIECDesignation from Server DUT Error: %@", err); - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("batteryIECDesignation", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("batteryIECDesignation", [value length], 20)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTestHarnessClientReadsBatApprovedChemistryFromServerDut_24() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBatteryApprovedChemistryWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatApprovedChemistry from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("minScaledValue", "", "int16")); + VerifyOrReturn(CheckConstraintType("batteryApprovedChemistry", "", "uint32")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("minScaledValue", [value shortValue], -32768)); + VerifyOrReturn(CheckConstraintMinValue("batteryApprovedChemistry", [value unsignedIntValue], 0UL)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("minScaledValue", [value shortValue], 32767)); + VerifyOrReturn(CheckConstraintMaxValue("batteryApprovedChemistry", [value unsignedIntValue], 32UL)); } NextTest(); @@ -44028,62 +44087,59 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeMaxScaledValue_7() + CHIP_ERROR TestTestHarnessClientReadsBatCapacityFromServerDut_25() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxScaledValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: MaxScaledValue Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeBatteryCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatCapacity from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("maxScaledValue", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("maxScaledValue", [value shortValue], -32768)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("maxScaledValue", [value shortValue], 32767)); - } - + VerifyOrReturn(CheckConstraintType("batteryCapacity", "", "uint32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeScaledTolerance_8() + CHIP_ERROR TestTestHarnessClientReadsBatQuantityFromServerDut_26() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeScaledToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: ScaledTolerance Error: %@", err); + [cluster readAttributeBatteryQuantityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatQuantity from Server DUT Error: %@", err); - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("batteryQuantity", "", "uint8")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTestHarnessClientReadsBatChargeStateFromServerDut_27() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBatteryChargeStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatChargeState from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("scaledTolerance", "", "int16")); + VerifyOrReturn(CheckConstraintType("batteryChargeState", "", "enum8")); if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("scaledTolerance", [value unsignedShortValue], 0U)); + VerifyOrReturn(CheckConstraintMinValue("batteryChargeState", [value unsignedCharValue], 0)); } if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("scaledTolerance", [value unsignedShortValue], 2048U)); + VerifyOrReturn(CheckConstraintMaxValue("batteryChargeState", [value unsignedCharValue], 3)); } NextTest(); @@ -44092,32 +44148,73 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeScale_9() + CHIP_ERROR TestTestHarnessClientReadsBatTimeToFullChargeFromServerDut_28() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeScaleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional attribute: Scale Error: %@", err); + [cluster readAttributeBatteryTimeToFullChargeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatTimeToFullCharge from Server DUT Error: %@", err); - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("batteryTimeToFullCharge", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTestHarnessClientReadsBatFunctionalWhileChargingFromServerDut_29() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBatteryFunctionalWhileChargingWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatFunctionalWhileCharging from Server DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("scale", "", "int8")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("scale", [value charValue], -127)); - } - if (value != nil) { - VerifyOrReturn(CheckConstraintMaxValue("scale", [value charValue], 127)); - } + VerifyOrReturn(CheckConstraintType("batteryFunctionalWhileCharging", "", "bool")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTestHarnessClientReadsBatChargingCurrentFromServerDut_30() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeBatteryChargingCurrentWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads BatChargingCurrent from Server DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintType("batteryChargingCurrent", "", "uint32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTestHarnessClientReadsActiveBatChargeFaultsFromServerDut_31() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPowerSource * cluster = [[CHIPTestPowerSource alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeActiveBatteryChargeFaultsWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Test Harness Client reads ActiveBatChargeFaults from Server DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("activeBatteryChargeFaults", "", "list")); NextTest(); }]; @@ -44125,11 +44222,11 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { } }; -class Test_TC_PCC_1_1 : public TestCommandBridge { +class Test_TC_PRS_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_PCC_1_1() - : TestCommandBridge("Test_TC_PCC_1_1") + Test_TC_PRS_1_1() + : TestCommandBridge("Test_TC_PRS_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -44139,7 +44236,7 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_PCC_1_1() {} + ~Test_TC_PRS_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -44147,11 +44244,11 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PRS_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PRS_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -44168,36 +44265,62 @@ class Test_TC_PCC_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 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the FeatureMap attribute from the DUT\n"); - err = TestThReadsTheFeatureMapAttributeFromTheDut_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute constraints: ClusterRevision\n"); + err = TestReadTheGlobalAttributeConstraintsClusterRevision_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads the AttributeList attribute from the DUT\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + ChipLogProgress( + chipTool, " ***** Test Step 3 : Write the default values to mandatory global attribute: ClusterRevision\n"); + err = TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Reads back global attribute: ClusterRevision\n"); + err = TestReadsBackGlobalAttributeClusterRevision_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global mandatory attribute constraints: AttributeList\n"); + err = TestReadTheGlobalMandatoryAttributeConstraintsAttributeList_5(); + break; + case 6: + ChipLogProgress(chipTool, + " ***** Test Step 6 : Read EventList attribute from the DUT and Verify that the DUT response provides a list of " + "supported events.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { NextTest(); return; } - err = TestThReadsTheAttributeListAttributeFromTheDut_3(); + err = TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6(); break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads the EventList attribute from the DUT\n"); + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read AcceptedCommandList attribute from the DUT and Verify that the DUT response\n"); if (ShouldSkip("PICS_USER_PROMPT")) { NextTest(); return; } - err = TestThReadsTheEventListAttributeFromTheDut_4(); + err = TestReadAcceptedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_7(); break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads the AcceptedCommandList attribute from the DUT\n"); - err = TestThReadsTheAcceptedCommandListAttributeFromTheDut_5(); + case 8: + ChipLogProgress(chipTool, + " ***** Test Step 8 : Read GeneratedCommandList attribute from the DUT and Verify that the DUT response\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadGeneratedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_8(); break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads the GeneratedCommandList attribute from the DUT\n"); - err = TestThReadsTheGeneratedCommandListAttributeFromTheDut_6(); + case 9: + ChipLogProgress( + chipTool, " ***** Test Step 9 : Read FeatureMap attribute from the DUT and Verify that the DUT response\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_9(); break; } @@ -44220,7 +44343,7 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); break; case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -44231,6 +44354,15 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { 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; } // Go on to the next test. @@ -44244,7 +44376,7 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 7; + const uint16_t mTestCount = 10; chip::Optional mNodeId; chip::Optional mCluster; @@ -44258,16 +44390,16 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThReadsTheClusterRevisionAttributeFromTheDut_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the ClusterRevision attribute from the DUT Error: %@", err); + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -44276,141 +44408,141 @@ class Test_TC_PCC_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); } - VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheFeatureMapAttributeFromTheDut_2() + CHIP_ERROR TestReadTheGlobalAttributeConstraintsClusterRevision_2() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the FeatureMap attribute from the DUT Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute constraints: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } - - VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheAttributeListAttributeFromTheDut_3() + CHIP_ERROR TestWriteTheDefaultValuesToMandatoryGlobalAttributeClusterRevision_3() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the AttributeList attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(13))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 17UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 18UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 19UL)); - VerifyOrReturn(CheckValue("", actualValue[6], 32UL)); - VerifyOrReturn(CheckValue("", actualValue[7], 65528UL)); - VerifyOrReturn(CheckValue("", actualValue[8], 65529UL)); - VerifyOrReturn(CheckValue("", actualValue[9], 65530UL)); - VerifyOrReturn(CheckValue("", actualValue[10], 65531UL)); - VerifyOrReturn(CheckValue("", actualValue[11], 65532UL)); - VerifyOrReturn(CheckValue("", actualValue[12], 65533UL)); - } + id clusterRevisionArgument; + clusterRevisionArgument = [NSNumber numberWithUnsignedShort:3U]; + [cluster + writeAttributeClusterRevisionWithValue:clusterRevisionArgument + completionHandler:^(NSError * _Nullable err) { + NSLog( + @"Write the default values to mandatory global attribute: ClusterRevision Error: %@", err); - VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheEventListAttributeFromTheDut_4() - { - 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("alpha", value); - } - - CHIP_ERROR TestThReadsTheAcceptedCommandListAttributeFromTheDut_5() + CHIP_ERROR TestReadsBackGlobalAttributeClusterRevision_4() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the AcceptedCommandList attribute from the DUT Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads back global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); } - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheGeneratedCommandListAttributeFromTheDut_6() + CHIP_ERROR TestReadTheGlobalMandatoryAttributeConstraintsAttributeList_5() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the GeneratedCommandList attribute from the DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global mandatory attribute constraints: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } - - VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } + + CHIP_ERROR TestReadEventListAttributeFromTheDutAndVerifyThatTheDutResponseProvidesAListOfSupportedEvents_6() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadAcceptedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_7() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadGeneratedCommandListAttributeFromTheDutAndVerifyThatTheDutResponse_8() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadFeatureMapAttributeFromTheDutAndVerifyThatTheDutResponse_9() + { + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter '0' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("0garbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } }; -class Test_TC_PCC_2_1 : public TestCommandBridge { +class Test_TC_PRS_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_PCC_2_1() - : TestCommandBridge("Test_TC_PCC_2_1") + Test_TC_PRS_2_1() + : TestCommandBridge("Test_TC_PRS_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -44420,7 +44552,7 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_PCC_2_1() {} + ~Test_TC_PRS_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -44428,11 +44560,11 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PRS_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PRS_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -44449,200 +44581,40 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the mandatory attribute: MaxPressure\n"); - err = TestReadTheMandatoryAttributeMaxPressure_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the mandatory attribute constraints: MeasuredValue\n"); + err = TestReadTheMandatoryAttributeConstraintsMeasuredValue_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: MaxSpeed\n"); - err = TestReadTheMandatoryAttributeMaxSpeed_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the mandatory attribute constraints: MinMeasuredValue\n"); + err = TestReadTheMandatoryAttributeConstraintsMinMeasuredValue_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: MaxFlow\n"); - err = TestReadTheMandatoryAttributeMaxFlow_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the mandatory attribute constraints: MaxMeasuredValue\n"); + err = TestReadTheMandatoryAttributeConstraintsMaxMeasuredValue_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: EffectiveOperationMode\n"); - err = TestReadTheMandatoryAttributeEffectiveOperationMode_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the optional attribute: Tolerance\n"); + err = TestReadTheOptionalAttributeTolerance_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : read the mandatory attribute: EffectiveControlMode\n"); - err = TestReadTheMandatoryAttributeEffectiveControlMode_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the optional attribute: ScaledValue\n"); + err = TestReadTheOptionalAttributeScaledValue_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: Capacity\n"); - err = TestReadTheMandatoryAttributeCapacity_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the optional attribute: MinScaledValue\n"); + err = TestReadTheOptionalAttributeMinScaledValue_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : read the mandatory attribute: MaxPressure\n"); - err = TestReadTheMandatoryAttributeMaxPressure_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the optional attribute: MaxScaledValue\n"); + err = TestReadTheOptionalAttributeMaxScaledValue_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : read the mandatory attribute: MaxSpeed\n"); - err = TestReadTheMandatoryAttributeMaxSpeed_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the optional attribute: ScaledTolerance\n"); + err = TestReadTheOptionalAttributeScaledTolerance_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : read the mandatory attribute: MaxFlow\n"); - err = TestReadTheMandatoryAttributeMaxFlow_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : read the mandatory attribute: EffectiveOperationMode\n"); - err = TestReadTheMandatoryAttributeEffectiveOperationMode_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : read the mandatory attribute: EffectiveControlMode\n"); - err = TestReadTheMandatoryAttributeEffectiveControlMode_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : read the mandatory attribute: Capacity\n"); - err = TestReadTheMandatoryAttributeCapacity_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : read the optional attribute: MinConstPressure\n"); - err = TestReadTheOptionalAttributeMinConstPressure_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : read the optional attribute: MaxConstPressure\n"); - err = TestReadTheOptionalAttributeMaxConstPressure_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : read the optional attribute: MinCompPressure\n"); - err = TestReadTheOptionalAttributeMinCompPressure_15(); - break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : read the optional attribute: MaxCompPressure\n"); - err = TestReadTheOptionalAttributeMaxCompPressure_16(); - break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : read the optional attribute: MinConstSpeed\n"); - err = TestReadTheOptionalAttributeMinConstSpeed_17(); - break; - case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : read the optional attribute: MaxConstSpeed\n"); - err = TestReadTheOptionalAttributeMaxConstSpeed_18(); - break; - case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : read the optional attribute: MinConstFlow\n"); - err = TestReadTheOptionalAttributeMinConstFlow_19(); - break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : read the optional attribute: MaxConstFlow\n"); - err = TestReadTheOptionalAttributeMaxConstFlow_20(); - break; - case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : read the optional attribute: MinConstTemp\n"); - err = TestReadTheOptionalAttributeMinConstTemp_21(); - break; - case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : read the optional attribute: MaxConstTemp\n"); - err = TestReadTheOptionalAttributeMaxConstTemp_22(); - break; - case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : read the optional attribute: PumpStatus\n"); - err = TestReadTheOptionalAttributePumpStatus_23(); - break; - case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : read the optional attribute: PumpStatus\n"); - err = TestReadTheOptionalAttributePumpStatus_24(); - break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : read the optional attribute: Speed\n"); - err = TestReadTheOptionalAttributeSpeed_25(); - break; - case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : read the optional attribute: LifetimeRunningHours\n"); - err = TestReadTheOptionalAttributeLifetimeRunningHours_26(); - break; - case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : read the optional attribute: LifetimeRunningHours\n"); - err = TestReadTheOptionalAttributeLifetimeRunningHours_27(); - break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : read the optional attribute: Power\n"); - err = TestReadTheOptionalAttributePower_28(); - break; - case 29: - ChipLogProgress(chipTool, " ***** Test Step 29 : read the optional attribute: LifetimeEnergyConsumed\n"); - err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_29(); - break; - case 30: - ChipLogProgress(chipTool, " ***** Test Step 30 : read the optional attribute: LifetimeEnergyConsumed\n"); - err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_30(); - break; - case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : write to the optional attribute: LifetimeEnergyConsumed\n"); - err = TestWriteToTheOptionalAttributeLifetimeEnergyConsumed_31(); - break; - case 32: - ChipLogProgress(chipTool, " ***** Test Step 32 : read the optional attribute: MinConstPressure\n"); - err = TestReadTheOptionalAttributeMinConstPressure_32(); - break; - case 33: - ChipLogProgress(chipTool, " ***** Test Step 33 : read the optional attribute: MaxConstPressure\n"); - err = TestReadTheOptionalAttributeMaxConstPressure_33(); - break; - case 34: - ChipLogProgress(chipTool, " ***** Test Step 34 : read the optional attribute: MinCompPressure\n"); - err = TestReadTheOptionalAttributeMinCompPressure_34(); - break; - case 35: - ChipLogProgress(chipTool, " ***** Test Step 35 : read the optional attribute: MaxCompPressure\n"); - err = TestReadTheOptionalAttributeMaxCompPressure_35(); - break; - case 36: - ChipLogProgress(chipTool, " ***** Test Step 36 : read the optional attribute: MinConstSpeed\n"); - err = TestReadTheOptionalAttributeMinConstSpeed_36(); - break; - case 37: - ChipLogProgress(chipTool, " ***** Test Step 37 : read the optional attribute: MaxConstSpeed\n"); - err = TestReadTheOptionalAttributeMaxConstSpeed_37(); - break; - case 38: - ChipLogProgress(chipTool, " ***** Test Step 38 : read the optional attribute: MinConstFlow\n"); - err = TestReadTheOptionalAttributeMinConstFlow_38(); - break; - case 39: - ChipLogProgress(chipTool, " ***** Test Step 39 : read the optional attribute: MaxConstFlow\n"); - err = TestReadTheOptionalAttributeMaxConstFlow_39(); - break; - case 40: - ChipLogProgress(chipTool, " ***** Test Step 40 : read the optional attribute: MinConstTemp\n"); - err = TestReadTheOptionalAttributeMinConstTemp_40(); - break; - case 41: - ChipLogProgress(chipTool, " ***** Test Step 41 : read the optional attribute: MaxConstTemp\n"); - err = TestReadTheOptionalAttributeMaxConstTemp_41(); - break; - case 42: - ChipLogProgress(chipTool, " ***** Test Step 42 : read the optional attribute: PumpStatus\n"); - err = TestReadTheOptionalAttributePumpStatus_42(); - break; - case 43: - ChipLogProgress(chipTool, " ***** Test Step 43 : read the optional attribute: PumpStatus\n"); - err = TestReadTheOptionalAttributePumpStatus_43(); - break; - case 44: - ChipLogProgress(chipTool, " ***** Test Step 44 : read the optional attribute: Speed\n"); - err = TestReadTheOptionalAttributeSpeed_44(); - break; - case 45: - ChipLogProgress(chipTool, " ***** Test Step 45 : read the optional attribute: LifetimeRunningHours\n"); - err = TestReadTheOptionalAttributeLifetimeRunningHours_45(); - break; - case 46: - ChipLogProgress(chipTool, " ***** Test Step 46 : read the optional attribute: LifetimeRunningHours\n"); - err = TestReadTheOptionalAttributeLifetimeRunningHours_46(); - break; - case 47: - ChipLogProgress(chipTool, " ***** Test Step 47 : read the optional attribute: Power\n"); - err = TestReadTheOptionalAttributePower_47(); - break; - case 48: - ChipLogProgress(chipTool, " ***** Test Step 48 : read the optional attribute: LifetimeEnergyConsumed\n"); - err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_48(); - break; - case 49: - ChipLogProgress(chipTool, " ***** Test Step 49 : read the optional attribute: LifetimeEnergyConsumed\n"); - err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_49(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional attribute: Scale\n"); + err = TestReadTheOptionalAttributeScale_9(); break; } @@ -44685,126 +44657,6 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { 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; - case 27: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 28: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 29: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 30: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 31: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 32: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 33: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 34: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 35: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 36: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 37: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 38: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 39: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 40: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 41: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 42: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 43: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 44: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 45: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 46: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 47: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 48: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 49: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -44818,7 +44670,7 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 50; + const uint16_t mTestCount = 10; chip::Optional mNodeId; chip::Optional mCluster; @@ -44832,247 +44684,414 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_1() + CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMeasuredValue_1() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxPressure Error: %@", err); + [cluster readAttributeMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the mandatory attribute constraints: MeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); + VerifyOrReturn(CheckConstraintType("measuredValue", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value shortValue], -32768)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value shortValue], 32767)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMaxSpeed_2() + CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMinMeasuredValue_2() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxSpeed Error: %@", err); + [cluster readAttributeMinMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the mandatory attribute constraints: MinMeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("maxSpeed", "", "uint16")); + VerifyOrReturn(CheckConstraintType("minMeasuredValue", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value shortValue], -32768)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value shortValue], 32767)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMaxFlow_3() + CHIP_ERROR TestReadTheMandatoryAttributeConstraintsMaxMeasuredValue_3() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxFlow Error: %@", err); + [cluster readAttributeMaxMeasuredValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the mandatory attribute constraints: MaxMeasuredValue Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("maxFlow", "", "uint16")); + VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value shortValue], -32768)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value shortValue], 32767)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_4() + CHIP_ERROR TestReadTheOptionalAttributeTolerance_4() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: EffectiveOperationMode Error: %@", err); + [cluster readAttributeToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute: Tolerance Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); + VerifyOrReturn(CheckConstraintType("tolerance", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("tolerance", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("tolerance", [value unsignedShortValue], 2048U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_5() + CHIP_ERROR TestReadTheOptionalAttributeScaledValue_5() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: EffectiveControlMode Error: %@", err); + [cluster readAttributeScaledValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute: ScaledValue Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); + VerifyOrReturn(CheckConstraintType("scaledValue", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("scaledValue", [value shortValue], -32768)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("scaledValue", [value shortValue], 32767)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeCapacity_6() + CHIP_ERROR TestReadTheOptionalAttributeMinScaledValue_6() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: Capacity Error: %@", err); + [cluster readAttributeMinScaledValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute: MinScaledValue Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); + VerifyOrReturn(CheckConstraintType("minScaledValue", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("minScaledValue", [value shortValue], -32768)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("minScaledValue", [value shortValue], 32767)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_7() + CHIP_ERROR TestReadTheOptionalAttributeMaxScaledValue_7() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxPressure Error: %@", err); + [cluster readAttributeMaxScaledValueWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute: MaxScaledValue Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); + VerifyOrReturn(CheckConstraintType("maxScaledValue", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("maxScaledValue", [value shortValue], -32768)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("maxScaledValue", [value shortValue], 32767)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMaxSpeed_8() + CHIP_ERROR TestReadTheOptionalAttributeScaledTolerance_8() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxSpeed Error: %@", err); + [cluster readAttributeScaledToleranceWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute: ScaledTolerance Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("maxSpeed", "", "uint16")); + VerifyOrReturn(CheckConstraintType("scaledTolerance", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("scaledTolerance", [value unsignedShortValue], 0U)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("scaledTolerance", [value unsignedShortValue], 2048U)); + } + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheMandatoryAttributeMaxFlow_9() + CHIP_ERROR TestReadTheOptionalAttributeScale_9() { CHIPDevice * device = GetDevice("alpha"); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; + CHIPTestPressureMeasurement * cluster = [[CHIPTestPressureMeasurement alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: MaxFlow Error: %@", err); + [cluster readAttributeScaleWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional attribute: Scale Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("maxFlow", "", "uint16")); + VerifyOrReturn(CheckConstraintType("scale", "", "int8")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("scale", [value charValue], -127)); + } + if (value != nil) { + VerifyOrReturn(CheckConstraintMaxValue("scale", [value charValue], 127)); + } + NextTest(); }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_10() +class Test_TC_PCC_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_PCC_1_1() + : TestCommandBridge("Test_TC_PCC_1_1") + , mTestIndex(0) { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + 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) - [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: EffectiveOperationMode Error: %@", err); + ~Test_TC_PCC_1_1() {} - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); - NextTest(); - }]; + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_1_1\n"); + } - return CHIP_NO_ERROR; - } + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_11() - { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + Wait(); - [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: EffectiveControlMode Error: %@", err); + // 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"); + err = TestThReadsTheFeatureMapAttributeFromTheDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads the AttributeList attribute from the DUT\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { + NextTest(); + return; + } + err = TestThReadsTheAttributeListAttributeFromTheDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads the EventList attribute from the DUT\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestThReadsTheEventListAttributeFromTheDut_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads the AcceptedCommandList attribute from the DUT\n"); + err = TestThReadsTheAcceptedCommandListAttributeFromTheDut_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads the GeneratedCommandList attribute from the DUT\n"); + err = TestThReadsTheGeneratedCommandListAttributeFromTheDut_6(); + break; + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } - VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); - NextTest(); - }]; + 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; + } - return CHIP_NO_ERROR; + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); } - CHIP_ERROR TestReadTheMandatoryAttributeCapacity_12() + chip::System::Clock::Timeout GetWaitDuration() const override { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the mandatory attribute: Capacity Error: %@", err); + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 7; - VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); - NextTest(); - }]; + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; - return CHIP_NO_ERROR; + 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 TestReadTheOptionalAttributeMinConstPressure_13() + CHIP_ERROR TestThReadsTheClusterRevisionAttributeFromTheDut_1() { CHIPDevice * device = GetDevice("alpha"); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -45080,24 +45099,24 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinConstPressure Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeClusterRevisionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the ClusterRevision attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("minConstPressure", "", "int16")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 3U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeMaxConstPressure_14() + CHIP_ERROR TestThReadsTheFeatureMapAttributeFromTheDut_2() { CHIPDevice * device = GetDevice("alpha"); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -45105,24 +45124,24 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxConstPressure Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeFeatureMapWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the FeatureMap attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("maxConstPressure", "", "int16")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "", "map32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeMinCompPressure_15() + CHIP_ERROR TestThReadsTheAttributeListAttributeFromTheDut_3() { CHIPDevice * device = GetDevice("alpha"); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -45130,49 +45149,46 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinCompPressure Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeAttributeListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the AttributeList attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("minCompPressure", "", "int16")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(13))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 1UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 2UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 17UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 18UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 19UL)); + VerifyOrReturn(CheckValue("", actualValue[6], 32UL)); + VerifyOrReturn(CheckValue("", actualValue[7], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[8], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[9], 65530UL)); + VerifyOrReturn(CheckValue("", actualValue[10], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[11], 65532UL)); + VerifyOrReturn(CheckValue("", actualValue[12], 65533UL)); + } + + VerifyOrReturn(CheckConstraintType("attributeList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeMaxCompPressure_16() + CHIP_ERROR TestThReadsTheEventListAttributeFromTheDut_4() { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeMaxCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxCompPressure Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("maxCompPressure", "", "int16")); - NextTest(); - }]; - - return CHIP_NO_ERROR; + 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("alpha", value); } - CHIP_ERROR TestReadTheOptionalAttributeMinConstSpeed_17() + CHIP_ERROR TestThReadsTheAcceptedCommandListAttributeFromTheDut_5() { CHIPDevice * device = GetDevice("alpha"); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -45180,24 +45196,24 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinConstSpeed Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeAcceptedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the AcceptedCommandList attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("minConstSpeed", "", "uint16")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeMaxConstSpeed_18() + CHIP_ERROR TestThReadsTheGeneratedCommandListAttributeFromTheDut_6() { CHIPDevice * device = GetDevice("alpha"); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -45205,74 +45221,451 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxConstSpeed Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeGeneratedCommandListWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the GeneratedCommandList attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("maxConstSpeed", "", "uint16")); + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "", "list")); NextTest(); }]; return CHIP_NO_ERROR; } +}; - CHIP_ERROR TestReadTheOptionalAttributeMinConstFlow_19() +class Test_TC_PCC_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_PCC_2_1() + : TestCommandBridge("Test_TC_PCC_2_1") + , mTestIndex(0) { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + 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) - [cluster readAttributeMinConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinConstFlow Error: %@", err); + ~Test_TC_PCC_2_1() {} - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_PCC_2_1\n"); + } - VerifyOrReturn(CheckConstraintType("minConstFlow", "", "uint16")); - NextTest(); - }]; + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_PCC_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } - return CHIP_NO_ERROR; - } + Wait(); - CHIP_ERROR TestReadTheOptionalAttributeMaxConstFlow_20() - { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device - endpoint:1 - queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + // 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 : read the mandatory attribute: MaxPressure\n"); + err = TestReadTheMandatoryAttributeMaxPressure_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : read the mandatory attribute: MaxSpeed\n"); + err = TestReadTheMandatoryAttributeMaxSpeed_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : read the mandatory attribute: MaxFlow\n"); + err = TestReadTheMandatoryAttributeMaxFlow_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : read the mandatory attribute: EffectiveOperationMode\n"); + err = TestReadTheMandatoryAttributeEffectiveOperationMode_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : read the mandatory attribute: EffectiveControlMode\n"); + err = TestReadTheMandatoryAttributeEffectiveControlMode_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : read the mandatory attribute: Capacity\n"); + err = TestReadTheMandatoryAttributeCapacity_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : read the mandatory attribute: MaxPressure\n"); + err = TestReadTheMandatoryAttributeMaxPressure_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : read the mandatory attribute: MaxSpeed\n"); + err = TestReadTheMandatoryAttributeMaxSpeed_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : read the mandatory attribute: MaxFlow\n"); + err = TestReadTheMandatoryAttributeMaxFlow_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : read the mandatory attribute: EffectiveOperationMode\n"); + err = TestReadTheMandatoryAttributeEffectiveOperationMode_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : read the mandatory attribute: EffectiveControlMode\n"); + err = TestReadTheMandatoryAttributeEffectiveControlMode_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : read the mandatory attribute: Capacity\n"); + err = TestReadTheMandatoryAttributeCapacity_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : read the optional attribute: MinConstPressure\n"); + err = TestReadTheOptionalAttributeMinConstPressure_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : read the optional attribute: MaxConstPressure\n"); + err = TestReadTheOptionalAttributeMaxConstPressure_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : read the optional attribute: MinCompPressure\n"); + err = TestReadTheOptionalAttributeMinCompPressure_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : read the optional attribute: MaxCompPressure\n"); + err = TestReadTheOptionalAttributeMaxCompPressure_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : read the optional attribute: MinConstSpeed\n"); + err = TestReadTheOptionalAttributeMinConstSpeed_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : read the optional attribute: MaxConstSpeed\n"); + err = TestReadTheOptionalAttributeMaxConstSpeed_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : read the optional attribute: MinConstFlow\n"); + err = TestReadTheOptionalAttributeMinConstFlow_19(); + break; + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : read the optional attribute: MaxConstFlow\n"); + err = TestReadTheOptionalAttributeMaxConstFlow_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : read the optional attribute: MinConstTemp\n"); + err = TestReadTheOptionalAttributeMinConstTemp_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : read the optional attribute: MaxConstTemp\n"); + err = TestReadTheOptionalAttributeMaxConstTemp_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : read the optional attribute: PumpStatus\n"); + err = TestReadTheOptionalAttributePumpStatus_23(); + break; + case 24: + ChipLogProgress(chipTool, " ***** Test Step 24 : read the optional attribute: PumpStatus\n"); + err = TestReadTheOptionalAttributePumpStatus_24(); + break; + case 25: + ChipLogProgress(chipTool, " ***** Test Step 25 : read the optional attribute: Speed\n"); + err = TestReadTheOptionalAttributeSpeed_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : read the optional attribute: LifetimeRunningHours\n"); + err = TestReadTheOptionalAttributeLifetimeRunningHours_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : read the optional attribute: LifetimeRunningHours\n"); + err = TestReadTheOptionalAttributeLifetimeRunningHours_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : read the optional attribute: Power\n"); + err = TestReadTheOptionalAttributePower_28(); + break; + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : read the optional attribute: LifetimeEnergyConsumed\n"); + err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : read the optional attribute: LifetimeEnergyConsumed\n"); + err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : write to the optional attribute: LifetimeEnergyConsumed\n"); + err = TestWriteToTheOptionalAttributeLifetimeEnergyConsumed_31(); + break; + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : read the optional attribute: MinConstPressure\n"); + err = TestReadTheOptionalAttributeMinConstPressure_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : read the optional attribute: MaxConstPressure\n"); + err = TestReadTheOptionalAttributeMaxConstPressure_33(); + break; + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : read the optional attribute: MinCompPressure\n"); + err = TestReadTheOptionalAttributeMinCompPressure_34(); + break; + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : read the optional attribute: MaxCompPressure\n"); + err = TestReadTheOptionalAttributeMaxCompPressure_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : read the optional attribute: MinConstSpeed\n"); + err = TestReadTheOptionalAttributeMinConstSpeed_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : read the optional attribute: MaxConstSpeed\n"); + err = TestReadTheOptionalAttributeMaxConstSpeed_37(); + break; + case 38: + ChipLogProgress(chipTool, " ***** Test Step 38 : read the optional attribute: MinConstFlow\n"); + err = TestReadTheOptionalAttributeMinConstFlow_38(); + break; + case 39: + ChipLogProgress(chipTool, " ***** Test Step 39 : read the optional attribute: MaxConstFlow\n"); + err = TestReadTheOptionalAttributeMaxConstFlow_39(); + break; + case 40: + ChipLogProgress(chipTool, " ***** Test Step 40 : read the optional attribute: MinConstTemp\n"); + err = TestReadTheOptionalAttributeMinConstTemp_40(); + break; + case 41: + ChipLogProgress(chipTool, " ***** Test Step 41 : read the optional attribute: MaxConstTemp\n"); + err = TestReadTheOptionalAttributeMaxConstTemp_41(); + break; + case 42: + ChipLogProgress(chipTool, " ***** Test Step 42 : read the optional attribute: PumpStatus\n"); + err = TestReadTheOptionalAttributePumpStatus_42(); + break; + case 43: + ChipLogProgress(chipTool, " ***** Test Step 43 : read the optional attribute: PumpStatus\n"); + err = TestReadTheOptionalAttributePumpStatus_43(); + break; + case 44: + ChipLogProgress(chipTool, " ***** Test Step 44 : read the optional attribute: Speed\n"); + err = TestReadTheOptionalAttributeSpeed_44(); + break; + case 45: + ChipLogProgress(chipTool, " ***** Test Step 45 : read the optional attribute: LifetimeRunningHours\n"); + err = TestReadTheOptionalAttributeLifetimeRunningHours_45(); + break; + case 46: + ChipLogProgress(chipTool, " ***** Test Step 46 : read the optional attribute: LifetimeRunningHours\n"); + err = TestReadTheOptionalAttributeLifetimeRunningHours_46(); + break; + case 47: + ChipLogProgress(chipTool, " ***** Test Step 47 : read the optional attribute: Power\n"); + err = TestReadTheOptionalAttributePower_47(); + break; + case 48: + ChipLogProgress(chipTool, " ***** Test Step 48 : read the optional attribute: LifetimeEnergyConsumed\n"); + err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_48(); + break; + case 49: + ChipLogProgress(chipTool, " ***** Test Step 49 : read the optional attribute: LifetimeEnergyConsumed\n"); + err = TestReadTheOptionalAttributeLifetimeEnergyConsumed_49(); + break; + } - [cluster readAttributeMaxConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxConstFlow Error: %@", err); + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + 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; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } - VerifyOrReturn(CheckConstraintType("maxConstFlow", "", "uint16")); - NextTest(); - }]; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } - return CHIP_NO_ERROR; +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 50; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + 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 TestReadTheOptionalAttributeMinConstTemp_21() + CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_1() { CHIPDevice * device = GetDevice("alpha"); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -45280,28 +45673,19 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMinConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MinConstTemp Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeMaxPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: MaxPressure Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("minConstTemp", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("minConstTemp", [value shortValue], -27315)); - } - + VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeMaxConstTemp_22() + CHIP_ERROR TestReadTheMandatoryAttributeMaxSpeed_2() { CHIPDevice * device = GetDevice("alpha"); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -45309,28 +45693,19 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeMaxConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: MaxConstTemp Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeMaxSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: MaxSpeed Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("maxConstTemp", "", "int16")); - if (value != nil) { - VerifyOrReturn(CheckConstraintMinValue("maxConstTemp", [value shortValue], -27315)); - } - + VerifyOrReturn(CheckConstraintType("maxSpeed", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributePumpStatus_23() + CHIP_ERROR TestReadTheMandatoryAttributeMaxFlow_3() { CHIPDevice * device = GetDevice("alpha"); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -45338,28 +45713,19 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: PumpStatus Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeMaxFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: MaxFlow Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("PumpStatus", actualValue, 0U)); - } - + VerifyOrReturn(CheckConstraintType("maxFlow", "", "uint16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributePumpStatus_24() + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_4() { CHIPDevice * device = GetDevice("alpha"); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -45367,24 +45733,19 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: PumpStatus Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: EffectiveOperationMode Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("pumpStatus", "", "map16")); + VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeSpeed_25() + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_5() { CHIPDevice * device = GetDevice("alpha"); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -45392,24 +45753,19 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: Speed Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: EffectiveControlMode Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("speed", "", "uint16")); + VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeLifetimeRunningHours_26() + CHIP_ERROR TestReadTheMandatoryAttributeCapacity_6() { CHIPDevice * device = GetDevice("alpha"); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -45417,29 +45773,19 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: LifetimeRunningHours Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: Capacity Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("LifetimeRunningHours", actualValue)); - VerifyOrReturn(CheckValue("LifetimeRunningHours", actualValue, 0UL)); - } - + VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributeLifetimeRunningHours_27() + CHIP_ERROR TestReadTheMandatoryAttributeMaxPressure_7() { CHIPDevice * device = GetDevice("alpha"); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -45447,24 +45793,19 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: LifetimeRunningHours Error: %@", err); - - if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { - NextTest(); - return; - } + [cluster readAttributeMaxPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: MaxPressure Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("lifetimeRunningHours", "", "uint24")); + VerifyOrReturn(CheckConstraintType("maxPressure", "", "int16")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheOptionalAttributePower_28() + CHIP_ERROR TestReadTheMandatoryAttributeMaxSpeed_8() { CHIPDevice * device = GetDevice("alpha"); CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device @@ -45472,8 +45813,500 @@ class Test_TC_PCC_2_1 : public TestCommandBridge { queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the optional attribute: Power Error: %@", err); + [cluster readAttributeMaxSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: MaxSpeed Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("maxSpeed", "", "uint16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheMandatoryAttributeMaxFlow_9() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: MaxFlow Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("maxFlow", "", "uint16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveOperationMode_10() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEffectiveOperationModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: EffectiveOperationMode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("effectiveOperationMode", "", "enum8")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheMandatoryAttributeEffectiveControlMode_11() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeEffectiveControlModeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: EffectiveControlMode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("effectiveControlMode", "", "enum8")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheMandatoryAttributeCapacity_12() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCapacityWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the mandatory attribute: Capacity Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("capacity", "", "int16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeMinConstPressure_13() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MinConstPressure Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("minConstPressure", "", "int16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeMaxConstPressure_14() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxConstPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MaxConstPressure Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("maxConstPressure", "", "int16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeMinCompPressure_15() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MinCompPressure Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("minCompPressure", "", "int16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeMaxCompPressure_16() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxCompPressureWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MaxCompPressure Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("maxCompPressure", "", "int16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeMinConstSpeed_17() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MinConstSpeed Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("minConstSpeed", "", "uint16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeMaxConstSpeed_18() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxConstSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MaxConstSpeed Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("maxConstSpeed", "", "uint16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeMinConstFlow_19() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MinConstFlow Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("minConstFlow", "", "uint16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeMaxConstFlow_20() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxConstFlowWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MaxConstFlow Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("maxConstFlow", "", "uint16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeMinConstTemp_21() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MinConstTemp Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("minConstTemp", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("minConstTemp", [value shortValue], -27315)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeMaxConstTemp_22() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxConstTempWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: MaxConstTemp Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("maxConstTemp", "", "int16")); + if (value != nil) { + VerifyOrReturn(CheckConstraintMinValue("maxConstTemp", [value shortValue], -27315)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributePumpStatus_23() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: PumpStatus Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("PumpStatus", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributePumpStatus_24() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePumpStatusWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: PumpStatus Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("pumpStatus", "", "map16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeSpeed_25() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSpeedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: Speed Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("speed", "", "uint16")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeLifetimeRunningHours_26() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: LifetimeRunningHours Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LifetimeRunningHours", actualValue)); + VerifyOrReturn(CheckValue("LifetimeRunningHours", actualValue, 0UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributeLifetimeRunningHours_27() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLifetimeRunningHoursWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: LifetimeRunningHours Error: %@", err); + + if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { + NextTest(); + return; + } + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("lifetimeRunningHours", "", "uint24")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalAttributePower_28() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestPumpConfigurationAndControl * cluster = [[CHIPTestPumpConfigurationAndControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributePowerWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the optional attribute: Power Error: %@", err); if (err.code == MatterInteractionErrorCodeUnsupportedAttribute) { NextTest(); @@ -50135,62 +50968,390 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { err = TestReadsConstraintsOfOptionalAttributesFromDutAbsMaxCoolSetpointLimit_5(); break; case 6: - ChipLogProgress( - chipTool, " ***** Test Step 6 : Reads constraints of optional attributes from DUT: OccupiedCoolingSetpoint\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutOccupiedCoolingSetpoint_6(); + ChipLogProgress(chipTool, + " ***** Test Step 6 : Read PICoolingDemand attribute from the DUT Verify that the DUT responds with a uint8 " + "value.The value has to be in the range of 0 to 100\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadPICoolingDemandAttributeFromTheDutVerifyThatTheDutRespondsWithAUint8ValueTheValueHasToBeInTheRangeOf0To100_6(); break; case 7: - ChipLogProgress( - chipTool, " ***** Test Step 7 : Reads constraints of mandatory attributes from DUT: OccupiedHeatingSetpoint\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedHeatingSetpoint_7(); + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read PIHeatingDemand attribute from the DUT and Verify that the DUT responds with a uint8 " + "value.The value has to be in the range of 0 to 100\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadPIHeatingDemandAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueTheValueHasToBeInTheRangeOf0To100_7(); break; case 8: ChipLogProgress( - chipTool, " ***** Test Step 8 : Reads constraints of mandatory attributes from DUT: MinHeatSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutMinHeatSetpointLimit_8(); + chipTool, " ***** Test Step 8 : Reads constraints of optional attributes from DUT: OccupiedCoolingSetpoint\n"); + err = TestReadsConstraintsOfOptionalAttributesFromDutOccupiedCoolingSetpoint_8(); break; case 9: ChipLogProgress( - chipTool, " ***** Test Step 9 : Reads constraints of mandatory attributes from DUT: MaxHeatSetpointLimit\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutMaxHeatSetpointLimit_9(); + chipTool, " ***** Test Step 9 : Reads constraints of mandatory attributes from DUT: OccupiedHeatingSetpoint\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedHeatingSetpoint_9(); break; case 10: - ChipLogProgress( - chipTool, " ***** Test Step 10 : Reads constraints of optional attributes from DUT: MinCoolSetpointLimit\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutMinCoolSetpointLimit_10(); + ChipLogProgress(chipTool, + " ***** Test Step 10 : Read UnoccupiedCoolingSetpoint attribute from the DUT and Verify that the DUT responds with " + "an int16 value\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadUnoccupiedCoolingSetpointAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnInt16Value_10(); break; case 11: - ChipLogProgress( - chipTool, " ***** Test Step 11 : Reads constraints of optional attributes from DUT: MaxCoolSetpointLimit\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutMaxCoolSetpointLimit_11(); + ChipLogProgress(chipTool, + " ***** Test Step 11 : Read UnoccupiedHeatingSetpoint attribute from the DUT and Verify that the DUT responds with " + "an int16 value\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadUnoccupiedHeatingSetpointAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnInt16Value_11(); break; case 12: ChipLogProgress( - chipTool, " ***** Test Step 12 : Reads constraints of mandatory attributes from DUT: ControlSequenceOfOperation\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutControlSequenceOfOperation_12(); + chipTool, " ***** Test Step 12 : Reads constraints of mandatory attributes from DUT: MinHeatSetpointLimit\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutMinHeatSetpointLimit_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Reads constraints of mandatory attributes from DUT: SystemMode\n"); - err = TestReadsConstraintsOfMandatoryAttributesFromDutSystemMode_13(); + ChipLogProgress( + chipTool, " ***** Test Step 13 : Reads constraints of mandatory attributes from DUT: MaxHeatSetpointLimit\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutMaxHeatSetpointLimit_13(); break; case 14: ChipLogProgress( - chipTool, " ***** Test Step 14 : Reads constraints of optional attributes from DUT: MinSetpointDeadBand\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutMinSetpointDeadBand_14(); + chipTool, " ***** Test Step 14 : Reads constraints of optional attributes from DUT: MinCoolSetpointLimit\n"); + err = TestReadsConstraintsOfOptionalAttributesFromDutMinCoolSetpointLimit_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Reads constraints of optional attributes from DUT: StartOfWeek\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_15(); + ChipLogProgress( + chipTool, " ***** Test Step 15 : Reads constraints of optional attributes from DUT: MaxCoolSetpointLimit\n"); + err = TestReadsConstraintsOfOptionalAttributesFromDutMaxCoolSetpointLimit_15(); break; case 16: ChipLogProgress( - chipTool, " ***** Test Step 16 : Reads constraints of optional attributes from DUT: NumberOfWeeklyTransitions\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutNumberOfWeeklyTransitions_16(); + chipTool, " ***** Test Step 16 : Reads constraints of mandatory attributes from DUT: ControlSequenceOfOperation\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutControlSequenceOfOperation_16(); break; case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Reads constraints of mandatory attributes from DUT: SystemMode\n"); + err = TestReadsConstraintsOfMandatoryAttributesFromDutSystemMode_17(); + break; + case 18: + ChipLogProgress( + chipTool, " ***** Test Step 18 : Read OutdoorTemperature attribute from the DUT and Verify the datatype\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadOutdoorTemperatureAttributeFromTheDutAndVerifyTheDatatype_18(); + break; + case 19: + ChipLogProgress(chipTool, + " ***** Test Step 19 : Read Occupancy attribute from the DUT and Verify the datatype and response value\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadOccupancyAttributeFromTheDutAndVerifyTheDatatypeAndResponseValue_19(); + break; + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : Read HVACSystemTypeConfiguration attribute from the DUT and Verify that the DUT responds " + "with a map8 value. The value has to be in the range of 0x00 to 0x3f\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadHVACSystemTypeConfigurationAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap8ValueTheValueHasToBeInTheRangeOf0x00To0x3f_20(); + break; + case 21: + ChipLogProgress(chipTool, + " ***** Test Step 21 : Read LocalTemperatureCalibration attribute from the DUT and Verify that the DUT responds " + "with an int8 value.The value has to be in the range of -25 to 25\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadLocalTemperatureCalibrationAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnInt8ValueTheValueHasToBeInTheRangeOf25To25_21(); + break; + case 22: + ChipLogProgress( + chipTool, " ***** Test Step 22 : Reads constraints of optional attributes from DUT: MinSetpointDeadBand\n"); + err = TestReadsConstraintsOfOptionalAttributesFromDutMinSetpointDeadBand_22(); + break; + case 23: + ChipLogProgress(chipTool, + " ***** Test Step 23 : Read RemoteSensing attribute from the DUT and Verify that the DUT responds with a map8 " + "value. The value has to be in the range of 0x00 to 0x07\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadRemoteSensingAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap8ValueTheValueHasToBeInTheRangeOf0x00To0x07_23(); + break; + case 24: + ChipLogProgress(chipTool, + " ***** Test Step 24 : Read AlarmMask attribute from the DUT and Verify that the DUT responds with a map8 " + "value.The value has to be in the range of 0x00 to 0x07.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadAlarmMaskAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap8ValueTheValueHasToBeInTheRangeOf0x00To0x07_24(); + break; + case 25: + ChipLogProgress(chipTool, + " ***** Test Step 25 : Read ThermostatRunningMode attribute from the DUT and Verify that the DUT responds with an " + "enum8 value.The value has to be 0, 3 or 4\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadThermostatRunningModeAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBe03Or4_25(); + break; + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Reads constraints of optional attributes from DUT: StartOfWeek\n"); + err = TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_26(); + break; + case 27: + ChipLogProgress( + chipTool, " ***** Test Step 27 : Reads constraints of optional attributes from DUT: NumberOfWeeklyTransitions\n"); + err = TestReadsConstraintsOfOptionalAttributesFromDutNumberOfWeeklyTransitions_27(); + break; + case 28: ChipLogProgress( - chipTool, " ***** Test Step 17 : Reads constraints of optional attributes from DUT: NumberOfDailyTransitions\n"); - err = TestReadsConstraintsOfOptionalAttributesFromDutNumberOfDailyTransitions_17(); + chipTool, " ***** Test Step 28 : Reads constraints of optional attributes from DUT: NumberOfDailyTransitions\n"); + err = TestReadsConstraintsOfOptionalAttributesFromDutNumberOfDailyTransitions_28(); + break; + case 29: + ChipLogProgress(chipTool, + " ***** Test Step 29 : Read TemperatureSetpointHold attribute from the DUT and Verify that the DUT responds with " + "an enum8 value.The value has to 0 or 1\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadTemperatureSetpointHoldAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasTo0Or1_29(); + break; + case 30: + ChipLogProgress(chipTool, + " ***** Test Step 30 : Read TemperatureSetpointHoldDuration attribute from the DUT and Verify that the DUT " + "responds with a uint16 value or NULL.The value has to be in the range of 0 to 1440\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadTemperatureSetpointHoldDurationAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint16ValueOrNULLTheValueHasToBeInTheRangeOf0To1440_30(); + break; + case 31: + ChipLogProgress(chipTool, + " ***** Test Step 31 : Read ThermostatProgrammingOperationMode attribute from the DUT and Verify that the DUT " + "responds with a map8 value.The value has to be in the range of 0x00 to 0x07\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadThermostatProgrammingOperationModeAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap8ValueTheValueHasToBeInTheRangeOf0x00To0x07_31(); + break; + case 32: + ChipLogProgress(chipTool, + " ***** Test Step 32 : Read ThermostatRunningState attribute from the DUT and Verify that the DUT responds with a " + "map16 value.The value has to be in the range of 0x00 to 0x7F\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadThermostatRunningStateAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap16ValueTheValueHasToBeInTheRangeOf0x00To0x7F_32(); + break; + case 33: + ChipLogProgress(chipTool, + " ***** Test Step 33 : Read SetpointChangeSource attribute from the DUT and Verify that the DUT responds with an " + "enum8 value. The value has to be in the range of 0 to 2\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadSetpointChangeSourceAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBeInTheRangeOf0To2_33(); + break; + case 34: + ChipLogProgress(chipTool, + " ***** Test Step 34 : Read SetpointChangeAmount attribute from the DUT and Verify that the DUT responds with an " + "int16 value or NULL\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadSetpointChangeAmountAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnInt16ValueOrNull_34(); + break; + case 35: + ChipLogProgress(chipTool, + " ***** Test Step 35 : Read SetpointChangeSourceTimestamp attribute from the DUT and Verify that the DUT responds " + "with a utc value\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadSetpointChangeSourceTimestampAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUtcValue_35(); + break; + case 36: + ChipLogProgress(chipTool, + " ***** Test Step 36 : Read OccupiedSetback attribute from the DUT and Verify that the DUT responds with a uint8 " + "value or NULL\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadOccupiedSetbackAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_36(); + break; + case 37: + ChipLogProgress(chipTool, + " ***** Test Step 37 : Read OccupiedSetbackMin attribute from the DUT and Verify that the DUT responds with a " + "uint8 value or NULL\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadOccupiedSetbackMinAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_37(); + break; + case 38: + ChipLogProgress(chipTool, + " ***** Test Step 38 : Read OccupiedSetbackMax attribute from the DUT and Verify that the DUT responds with a " + "uint8 value or NULL\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadOccupiedSetbackMaxAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_38(); + break; + case 39: + ChipLogProgress(chipTool, + " ***** Test Step 39 : Read UnoccupiedSetback attribute from the DUT and Verify that the DUT responds with a uint8 " + "value or NULL\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadUnoccupiedSetbackAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_39(); + break; + case 40: + ChipLogProgress(chipTool, + " ***** Test Step 40 : Read UnoccupiedSetbackMin attribute from the DUT and Verify that the DUT responds with a " + "uint8 value or NULL\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadUnoccupiedSetbackMinAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_40(); + break; + case 41: + ChipLogProgress(chipTool, + " ***** Test Step 41 : Read UnoccupiedSetbackMax attribute from the DUT and Verify that the DUT responds with a " + "uint8 value or NULL\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadUnoccupiedSetbackMaxAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_41(); + break; + case 42: + ChipLogProgress(chipTool, + " ***** Test Step 42 : Read EmergencyHeatDelta attribute from the DUT and Verify that the DUT responds with a " + "uint8 value or NULL\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadEmergencyHeatDeltaAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_42(); + break; + case 43: + ChipLogProgress(chipTool, + " ***** Test Step 43 : Read ACType attribute from the DUT and Verify that the DUT responds with an enum8 value. " + "The value has to be in the range of 0 to 4\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadACTypeAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBeInTheRangeOf0To4_43(); + break; + case 44: + ChipLogProgress(chipTool, + " ***** Test Step 44 : Read ACCapacity attribute from the DUT and Verify that the DUT responds with a uint16 " + "value\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadACCapacityAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint16Value_44(); + break; + case 45: + ChipLogProgress(chipTool, + " ***** Test Step 45 : Read ACRefrigerantType attribute from the DUT and VVerify that the DUT responds with an " + "enum8 value.The value has to be in the range of 0 to 3\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadACRefrigerantTypeAttributeFromTheDutAndVVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBeInTheRangeOf0To3_45(); + break; + case 46: + ChipLogProgress(chipTool, + " ***** Test Step 46 : Read ACCompressorType attribute from the DUT and Verify that the DUT responds with an enum8 " + "value.The value has to be in the range of 0 to 3\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadACCompressorTypeAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBeInTheRangeOf0To3_46(); + break; + case 47: + ChipLogProgress(chipTool, + " ***** Test Step 47 : Read ACErrorCode attribute from the DUT and Verify that the DUT responds with a map32 " + "value\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadACErrorCodeAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap32Value_47(); + break; + case 48: + ChipLogProgress(chipTool, + " ***** Test Step 48 : Read ACLouverPosition attribute from the DUT and Verify that the DUT responds with an enum8 " + "value.The value has to be in the range of 1 to 5\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadACLouverPositionAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBeInTheRangeOf1To5_48(); + break; + case 49: + ChipLogProgress(chipTool, + " ***** Test Step 49 : Read ACCoilTemperature attribute from the DUT and Verify that the DUT responds with an " + "int16 value or NULL\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadACCoilTemperatureAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnInt16ValueOrNull_49(); + break; + case 50: + ChipLogProgress(chipTool, + " ***** Test Step 50 : Read ACCapacityFormat attribute from the DUT and Verify that the DUT responds with an enum8 " + "value.The value has to be 0.\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { + NextTest(); + return; + } + err = TestReadACCapacityFormatAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBe0_50(); break; } @@ -50257,6 +51418,105 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { 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; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -50270,7 +51530,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 18; + const uint16_t mTestCount = 51; chip::Optional mNodeId; chip::Optional mCluster; @@ -50412,7 +51672,27 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutOccupiedCoolingSetpoint_6() + CHIP_ERROR + TestReadPICoolingDemandAttributeFromTheDutVerifyThatTheDutRespondsWithAUint8ValueTheValueHasToBeInTheRangeOf0To100_6() + { + 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("alpha", value); + } + + CHIP_ERROR + TestReadPIHeatingDemandAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueTheValueHasToBeInTheRangeOf0To100_7() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutOccupiedCoolingSetpoint_8() { CHIPDevice * device = GetDevice("alpha"); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -50442,7 +51722,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedHeatingSetpoint_7() + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutOccupiedHeatingSetpoint_9() { CHIPDevice * device = GetDevice("alpha"); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -50467,7 +51747,25 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMinHeatSetpointLimit_8() + CHIP_ERROR TestReadUnoccupiedCoolingSetpointAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnInt16Value_10() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadUnoccupiedHeatingSetpointAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnInt16Value_11() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMinHeatSetpointLimit_12() { CHIPDevice * device = GetDevice("alpha"); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -50492,7 +51790,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMaxHeatSetpointLimit_9() + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutMaxHeatSetpointLimit_13() { CHIPDevice * device = GetDevice("alpha"); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -50517,7 +51815,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutMinCoolSetpointLimit_10() + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutMinCoolSetpointLimit_14() { CHIPDevice * device = GetDevice("alpha"); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -50547,7 +51845,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutMaxCoolSetpointLimit_11() + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutMaxCoolSetpointLimit_15() { CHIPDevice * device = GetDevice("alpha"); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -50577,7 +51875,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutControlSequenceOfOperation_12() + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutControlSequenceOfOperation_16() { CHIPDevice * device = GetDevice("alpha"); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -50603,7 +51901,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutSystemMode_13() + CHIP_ERROR TestReadsConstraintsOfMandatoryAttributesFromDutSystemMode_17() { CHIPDevice * device = GetDevice("alpha"); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -50628,7 +51926,45 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutMinSetpointDeadBand_14() + CHIP_ERROR TestReadOutdoorTemperatureAttributeFromTheDutAndVerifyTheDatatype_18() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadOccupancyAttributeFromTheDutAndVerifyTheDatatypeAndResponseValue_19() + { + 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("alpha", value); + } + + CHIP_ERROR + TestReadHVACSystemTypeConfigurationAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap8ValueTheValueHasToBeInTheRangeOf0x00To0x3f_20() + { + 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("alpha", value); + } + + CHIP_ERROR + TestReadLocalTemperatureCalibrationAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnInt8ValueTheValueHasToBeInTheRangeOf25To25_21() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutMinSetpointDeadBand_22() { CHIPDevice * device = GetDevice("alpha"); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -50658,7 +51994,36 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_15() + CHIP_ERROR + TestReadRemoteSensingAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap8ValueTheValueHasToBeInTheRangeOf0x00To0x07_23() + { + 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("alpha", value); + } + + CHIP_ERROR + TestReadAlarmMaskAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap8ValueTheValueHasToBeInTheRangeOf0x00To0x07_24() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadThermostatRunningModeAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBe03Or4_25() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutStartOfWeek_26() { CHIPDevice * device = GetDevice("alpha"); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -50688,7 +52053,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutNumberOfWeeklyTransitions_16() + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutNumberOfWeeklyTransitions_27() { CHIPDevice * device = GetDevice("alpha"); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -50712,7 +52077,7 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutNumberOfDailyTransitions_17() + CHIP_ERROR TestReadsConstraintsOfOptionalAttributesFromDutNumberOfDailyTransitions_28() { CHIPDevice * device = GetDevice("alpha"); CHIPTestThermostat * cluster = [[CHIPTestThermostat alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -50734,52 +52099,257 @@ class Test_TC_TSTAT_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } -}; -class Test_TC_TSTAT_2_2 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_TSTAT_2_2() - : TestCommandBridge("Test_TC_TSTAT_2_2") - , mTestIndex(0) + CHIP_ERROR TestReadTemperatureSetpointHoldAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasTo0Or1_29() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + 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("alpha", value); } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_TSTAT_2_2() {} + CHIP_ERROR + TestReadTemperatureSetpointHoldDurationAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint16ValueOrNULLTheValueHasToBeInTheRangeOf0To1440_30() + { + 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("alpha", value); + } - /////////// TestCommand Interface ///////// - void NextTest() override + CHIP_ERROR + TestReadThermostatProgrammingOperationModeAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap8ValueTheValueHasToBeInTheRangeOf0x00To0x07_31() { - CHIP_ERROR err = CHIP_NO_ERROR; + 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("alpha", value); + } - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSTAT_2_2\n"); - } + CHIP_ERROR + TestReadThermostatRunningStateAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap16ValueTheValueHasToBeInTheRangeOf0x00To0x7F_32() + { + 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("alpha", value); + } - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_2_2\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + CHIP_ERROR + TestReadSetpointChangeSourceAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBeInTheRangeOf0To2_33() + { + 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("alpha", value); + } - Wait(); + CHIP_ERROR TestReadSetpointChangeAmountAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnInt16ValueOrNull_34() + { + 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("alpha", value); + } - // 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, + CHIP_ERROR TestReadSetpointChangeSourceTimestampAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUtcValue_35() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadOccupiedSetbackAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_36() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadOccupiedSetbackMinAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_37() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadOccupiedSetbackMaxAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_38() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadUnoccupiedSetbackAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_39() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadUnoccupiedSetbackMinAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_40() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadUnoccupiedSetbackMaxAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_41() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadEmergencyHeatDeltaAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint8ValueOrNull_42() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadACTypeAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBeInTheRangeOf0To4_43() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadACCapacityAttributeFromTheDutAndVerifyThatTheDutRespondsWithAUint16Value_44() + { + 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("alpha", value); + } + + CHIP_ERROR + TestReadACRefrigerantTypeAttributeFromTheDutAndVVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBeInTheRangeOf0To3_45() + { + 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("alpha", value); + } + + CHIP_ERROR + TestReadACCompressorTypeAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBeInTheRangeOf0To3_46() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadACErrorCodeAttributeFromTheDutAndVerifyThatTheDutRespondsWithAMap32Value_47() + { + 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("alpha", value); + } + + CHIP_ERROR + TestReadACLouverPositionAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBeInTheRangeOf1To5_48() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadACCoilTemperatureAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnInt16ValueOrNull_49() + { + 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("alpha", value); + } + + CHIP_ERROR TestReadACCapacityFormatAttributeFromTheDutAndVerifyThatTheDutRespondsWithAnEnum8ValueTheValueHasToBe0_50() + { + 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("alpha", value); + } +}; + +class Test_TC_TSTAT_2_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TSTAT_2_2() + : TestCommandBridge("Test_TC_TSTAT_2_2") + , 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_TSTAT_2_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TSTAT_2_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TSTAT_2_2\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 : Reads OccupiedCoolingSetpoint attribute from Server DUT and verifies that the value is " "within range\n"); if (ShouldSkip("A_OCCUPIEDCOOLINGSETPOINT")) { @@ -104746,160 +106316,1298 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureClearingFirstUserAlsoClearedWeekDaySchedules_80() + CHIP_ERROR TestMakeSureClearingFirstUserAlsoClearedWeekDaySchedules_80() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterGetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getWeekDayScheduleWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure clearing first user also cleared week day schedules Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.weekDayIndex; + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMakeSureClearingFirstUserAlsoClearedYearDaySchedules_81() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:4]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getYearDayScheduleWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure clearing first user also cleared year day schedules Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 4)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMakeSureClearingSecondUserAlsoClearedWeekDaySchedules_82() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterGetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:4]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + [cluster getWeekDayScheduleWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure clearing second user also cleared week day schedules Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.weekDayIndex; + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 4)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMakeSureClearingSecondUserAlsoClearedYearDaySchedules_83() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + [cluster getYearDayScheduleWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Make sure clearing second user also cleared year day schedules Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DL_2_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_DL_2_2() + : TestCommandBridge("Test_TC_DL_2_2") + , 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_DL_2_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DL_2_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DL_2_2\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 writes the RequirePINforRemoteOperation attribute value as False on the DUT\n"); + err = TestThWritesTheRequirePINforRemoteOperationAttributeValueAsFalseOnTheDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH sends Lock Door Command to the DUT without PINCode\n"); + err = TestThSendsLockDoorCommandToTheDutWithoutPINCode_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : TH writes the RequirePINforRemoteOperation attribute value as True on the DUT\n"); + err = TestThWritesTheRequirePINforRemoteOperationAttributeValueAsTrueOnTheDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Create new PIN credential and lock/unlock user\n"); + err = TestCreateNewPinCredentialAndLockUnlockUser_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH sends Lock Door Command to the DUT with valid PINCode\n"); + err = TestThSendsLockDoorCommandToTheDutWithValidPINCode_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH sends Lock Door Command to the DUT without any argument PINCode\n"); + err = TestThSendsLockDoorCommandToTheDutWithoutAnyArgumentPINCode_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH writes WrongCodeEntryLimit attribute value as 3 on the DUT\n"); + err = TestThWritesWrongCodeEntryLimitAttributeValueAs3OnTheDut_7(); + break; + case 8: + ChipLogProgress( + chipTool, " ***** Test Step 8 : TH writes UserCodeTemporaryDisableTime attribute value as 5 seconds on the DUT\n"); + err = TestThWritesUserCodeTemporaryDisableTimeAttributeValueAs5SecondsOnTheDut_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH sends Lock Door Command to the DUT with invalid PINCode\n"); + err = TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH sends Lock Door Command to the DUT with invalid PINCode\n"); + err = TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH sends Lock Door Command to the DUT with invalid PINCode\n"); + err = TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : TH sends Lock Door Command to the DUT with invalid PINCode\n"); + err = TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads UserCodeTemporaryDisableTime attribute from DUT\n"); + err = TestThReadsUserCodeTemporaryDisableTimeAttributeFromDut_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : TH sends Lock Door Command to the DUT with valid PINCode\n"); + err = TestThSendsLockDoorCommandToTheDutWithValidPINCode_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Clean the created credential\n"); + err = TestCleanTheCreatedCredential_15(); + 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), EMBER_ZCL_STATUS_FAILURE)); + 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), EMBER_ZCL_STATUS_FAILURE)); + 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), EMBER_ZCL_STATUS_FAILURE)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + 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; + } + + // 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 = 16; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + 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 TestThWritesTheRequirePINforRemoteOperationAttributeValueAsFalseOnTheDut_1() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id requirePINforRemoteOperationArgument; + requirePINforRemoteOperationArgument = [NSNumber numberWithBool:false]; + [cluster writeAttributeRequirePINforRemoteOperationWithValue:requirePINforRemoteOperationArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes the RequirePINforRemoteOperation attribute value as False " + @"on the DUT Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithoutPINCode_2() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"" length:0]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Lock Door Command to the DUT without PINCode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThWritesTheRequirePINforRemoteOperationAttributeValueAsTrueOnTheDut_3() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id requirePINforRemoteOperationArgument; + requirePINforRemoteOperationArgument = [NSNumber numberWithBool:true]; + [cluster writeAttributeRequirePINforRemoteOperationWithValue:requirePINforRemoteOperationArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes the RequirePINforRemoteOperation attribute value as True " + @"on the DUT Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockUser_4() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterSetCredentialParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0]; + params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; + params.userIndex = nil; + params.userStatus = nil; + params.userType = nil; + [cluster + setCredentialWithParams:params + completionHandler:^(CHIPDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Create new PIN credential and lock/unlock user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithValidPINCode_5() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Lock Door Command to the DUT with valid PINCode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithoutAnyArgumentPINCode_6() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"" length:0]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Lock Door Command to the DUT without any argument PINCode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThWritesWrongCodeEntryLimitAttributeValueAs3OnTheDut_7() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id wrongCodeEntryLimitArgument; + wrongCodeEntryLimitArgument = [NSNumber numberWithUnsignedChar:3]; + [cluster + writeAttributeWrongCodeEntryLimitWithValue:wrongCodeEntryLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes WrongCodeEntryLimit attribute value as 3 on the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThWritesUserCodeTemporaryDisableTimeAttributeValueAs5SecondsOnTheDut_8() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id userCodeTemporaryDisableTimeArgument; + userCodeTemporaryDisableTimeArgument = [NSNumber numberWithUnsignedChar:5]; + [cluster writeAttributeUserCodeTemporaryDisableTimeWithValue:userCodeTemporaryDisableTimeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes UserCodeTemporaryDisableTime attribute value as 5 seconds " + @"on the DUT Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_9() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"12345" length:5]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Lock Door Command to the DUT with invalid PINCode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_10() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"54321" length:5]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Lock Door Command to the DUT with invalid PINCode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_11() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"987623" length:6]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Lock Door Command to the DUT with invalid PINCode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_12() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"67890" length:5]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Lock Door Command to the DUT with invalid PINCode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsUserCodeTemporaryDisableTimeAttributeFromDut_13() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeUserCodeTemporaryDisableTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads UserCodeTemporaryDisableTime attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("UserCodeTemporaryDisableTime", actualValue, 5)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithValidPINCode_14() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Lock Door Command to the DUT with valid PINCode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCleanTheCreatedCredential_15() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterClearCredentialParams alloc] init]; + params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + [cluster clearCredentialWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clean the created credential Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DL_2_3 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_DL_2_3() + : TestCommandBridge("Test_TC_DL_2_3") + , 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_DL_2_3() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DL_2_3\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DL_2_3\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 : Create new PIN credential and lock/unlock user\n"); + err = TestCreateNewPinCredentialAndLockUnlockUser_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Precondition: Door is in locked state\n"); + err = TestPreconditionDoorIsInLockedState_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH writes AutoRelockTime attribute value as 10 seconds on the DUT\n"); + err = TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH sends the unlock Door command to the DUT with valid PINCode\n"); + err = TestThSendsTheUnlockDoorCommandToTheDutWithValidPINCode_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads AutoRelockTime attribute from DUT\n"); + err = TestThReadsAutoRelockTimeAttributeFromDut_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 10000ms\n"); + err = TestWait10000ms_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads LockState attribute\n"); + err = TestThReadsLockStateAttribute_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Clean the created credential\n"); + err = TestCleanTheCreatedCredential_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 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 TestCreateNewPinCredentialAndLockUnlockUser_1() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterSetCredentialParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0]; + params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; + params.userIndex = nil; + params.userStatus = nil; + params.userType = nil; + [cluster + setCredentialWithParams:params + completionHandler:^(CHIPDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Create new PIN credential and lock/unlock user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestPreconditionDoorIsInLockedState_2() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Precondition: Door is in locked state Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id autoRelockTimeArgument; + autoRelockTimeArgument = [NSNumber numberWithUnsignedInt:10UL]; + [cluster writeAttributeAutoRelockTimeWithValue:autoRelockTimeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes AutoRelockTime attribute value as 10 seconds on the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsTheUnlockDoorCommandToTheDutWithValidPINCode_4() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterUnlockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster unlockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends the unlock Door command to the DUT with valid PINCode Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsAutoRelockTimeAttributeFromDut_5() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAutoRelockTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AutoRelockTime attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AutoRelockTime", actualValue, 10UL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait10000ms_6() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestThReadsLockStateAttribute_7() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads LockState attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LockState", actualValue)); + VerifyOrReturn(CheckValue("LockState", actualValue, 1)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCleanTheCreatedCredential_8() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterClearCredentialParams alloc] init]; + params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + [cluster clearCredentialWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clean the created credential Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DL_2_4 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_DL_2_4() + : TestCommandBridge("Test_TC_DL_2_4") + , 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_DL_2_4() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DL_2_4\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DL_2_4\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 : Create new PIN credential and lock/unlock user\n"); + err = TestCreateNewPinCredentialAndLockUnlockUser_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Precondition: Door is in locked state\n"); + err = TestPreconditionDoorIsInLockedState_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH writes AutoRelockTime attribute value as 10 seconds on the DUT\n"); + err = TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH sends the unlock with Timeout command to the DUT \n"); + err = TestThSendsTheUnlockWithTimeoutCommandToTheDut_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads AutoRelockTime attribute from DUT\n"); + err = TestThReadsAutoRelockTimeAttributeFromDut_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 5000ms\n"); + err = TestWait5000ms_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads LockState attribute\n"); + err = TestThReadsLockStateAttribute_7(); + 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; + } + + // 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 = 8; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + 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 TestCreateNewPinCredentialAndLockUnlockUser_1() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterSetCredentialParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0]; + params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; + params.userIndex = nil; + params.userStatus = nil; + params.userType = nil; + [cluster + setCredentialWithParams:params + completionHandler:^(CHIPDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Create new PIN credential and lock/unlock user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestPreconditionDoorIsInLockedState_2() + { + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Precondition: Door is in locked state Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterGetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:1]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getWeekDayScheduleWithParams:params - completionHandler:^( - CHIPDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure clearing first user also cleared week day schedules Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.weekDayIndex; - VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1)); - } - - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } + id autoRelockTimeArgument; + autoRelockTimeArgument = [NSNumber numberWithUnsignedInt:10UL]; + [cluster writeAttributeAutoRelockTimeWithValue:autoRelockTimeArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH writes AutoRelockTime attribute value as 10 seconds on the DUT Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureClearingFirstUserAlsoClearedYearDaySchedules_81() + CHIP_ERROR TestThSendsTheUnlockWithTimeoutCommandToTheDut_4() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:4]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getYearDayScheduleWithParams:params - completionHandler:^( - CHIPDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure clearing first user also cleared year day schedules Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 4)); - } - - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } + __auto_type * params = [[CHIPDoorLockClusterUnlockWithTimeoutParams alloc] init]; + params.timeout = [NSNumber numberWithUnsignedShort:5U]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster unlockWithTimeoutWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends the unlock with Timeout command to the DUT Error: %@", err); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureClearingSecondUserAlsoClearedWeekDaySchedules_82() + CHIP_ERROR TestThReadsAutoRelockTimeAttributeFromDut_5() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterGetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:4]; - params.userIndex = [NSNumber numberWithUnsignedShort:2U]; - [cluster getWeekDayScheduleWithParams:params - completionHandler:^( - CHIPDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure clearing second user also cleared week day schedules Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.weekDayIndex; - VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 4)); - } + [cluster readAttributeAutoRelockTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AutoRelockTime attribute from DUT Error: %@", err); - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("AutoRelockTime", actualValue, 10UL)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureClearingSecondUserAlsoClearedYearDaySchedules_83() + CHIP_ERROR TestWait5000ms_6() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestThReadsLockStateAttribute_7() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1]; - params.userIndex = [NSNumber numberWithUnsignedShort:2U]; - [cluster getYearDayScheduleWithParams:params - completionHandler:^( - CHIPDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure clearing second user also cleared year day schedules Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1)); - } + [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads LockState attribute Error: %@", err); - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LockState", actualValue)); + VerifyOrReturn(CheckValue("LockState", actualValue, 1)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class Test_TC_DL_2_2 : public TestCommandBridge { +class Test_TC_DL_2_8 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DL_2_2() - : TestCommandBridge("Test_TC_DL_2_2") + Test_TC_DL_2_8() + : TestCommandBridge("Test_TC_DL_2_8") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -104909,7 +107617,7 @@ class Test_TC_DL_2_2 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_DL_2_2() {} + ~Test_TC_DL_2_8() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -104917,11 +107625,11 @@ class Test_TC_DL_2_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DL_2_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DL_2_8\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DL_2_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DL_2_8\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -104938,67 +107646,42 @@ class Test_TC_DL_2_2 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress( - chipTool, " ***** Test Step 1 : TH writes the RequirePINforRemoteOperation attribute value as False on the DUT\n"); - err = TestThWritesTheRequirePINforRemoteOperationAttributeValueAsFalseOnTheDut_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Create new PIN credential and lock/unlock user\n"); + err = TestCreateNewPinCredentialAndLockUnlockUser_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH sends Lock Door Command to the DUT without PINCode\n"); - err = TestThSendsLockDoorCommandToTheDutWithoutPINCode_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Get Max number of Week Day schedules for user\n"); + err = TestGetMaxNumberOfWeekDaySchedulesForUser_2(); break; case 3: - ChipLogProgress( - chipTool, " ***** Test Step 3 : TH writes the RequirePINforRemoteOperation attribute value as True on the DUT\n"); - err = TestThWritesTheRequirePINforRemoteOperationAttributeValueAsTrueOnTheDut_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Get number of supported users\n"); + err = TestGetNumberOfSupportedUsers_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Create new PIN credential and lock/unlock user\n"); - err = TestCreateNewPinCredentialAndLockUnlockUser_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Send Set Week Day Schedule Command to DUT\n"); + err = TestSendSetWeekDayScheduleCommandToDut_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH sends Lock Door Command to the DUT with valid PINCode\n"); - err = TestThSendsLockDoorCommandToTheDutWithValidPINCode_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : send GetWeekDay Schedule Command \n"); + err = TestSendGetWeekDayScheduleCommand_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : TH sends Lock Door Command to the DUT without any argument PINCode\n"); - err = TestThSendsLockDoorCommandToTheDutWithoutAnyArgumentPINCode_6(); + ChipLogProgress( + chipTool, " ***** Test Step 6 : Send Set Week Day Schedule Command to DUT and verify INVALID_COMMAND response\n"); + err = TestSendSetWeekDayScheduleCommandToDutAndVerifyInvalidCommandResponse_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH writes WrongCodeEntryLimit attribute value as 3 on the DUT\n"); - err = TestThWritesWrongCodeEntryLimitAttributeValueAs3OnTheDut_7(); + ChipLogProgress( + chipTool, " ***** Test Step 7 : send GetWeekDay Schedule Command to DUT and verify INVALID_COMMAND response\n"); + err = TestSendGetWeekDayScheduleCommandToDutAndVerifyInvalidCommandResponse_7(); break; case 8: - ChipLogProgress( - chipTool, " ***** Test Step 8 : TH writes UserCodeTemporaryDisableTime attribute value as 5 seconds on the DUT\n"); - err = TestThWritesUserCodeTemporaryDisableTimeAttributeValueAs5SecondsOnTheDut_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Clear all week day schedules for the first user\n"); + err = TestClearAllWeekDaySchedulesForTheFirstUser_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : TH sends Lock Door Command to the DUT with invalid PINCode\n"); - err = TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : TH sends Lock Door Command to the DUT with invalid PINCode\n"); - err = TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : TH sends Lock Door Command to the DUT with invalid PINCode\n"); - err = TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_11(); - break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : TH sends Lock Door Command to the DUT with invalid PINCode\n"); - err = TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_12(); - break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads UserCodeTemporaryDisableTime attribute from DUT\n"); - err = TestThReadsUserCodeTemporaryDisableTimeAttributeFromDut_13(); - break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : TH sends Lock Door Command to the DUT with valid PINCode\n"); - err = TestThSendsLockDoorCommandToTheDutWithValidPINCode_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Clean the created credential\n"); - err = TestCleanTheCreatedCredential_15(); + ChipLogProgress(chipTool, " ***** Test Step 9 : send GetWeekDay Schedule Command \n"); + err = TestSendGetWeekDayScheduleCommand_9(); break; } @@ -105018,7 +107701,7 @@ class Test_TC_DL_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -105030,7 +107713,7 @@ class Test_TC_DL_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -105039,24 +107722,6 @@ class Test_TC_DL_2_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); - break; - case 12: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); - 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; } @@ -105072,7 +107737,7 @@ class Test_TC_DL_2_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 16; + const uint16_t mTestCount = 10; chip::Optional mNodeId; chip::Optional mCluster; @@ -105086,70 +107751,7 @@ class Test_TC_DL_2_2 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThWritesTheRequirePINforRemoteOperationAttributeValueAsFalseOnTheDut_1() - { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id requirePINforRemoteOperationArgument; - requirePINforRemoteOperationArgument = [NSNumber numberWithBool:false]; - [cluster writeAttributeRequirePINforRemoteOperationWithValue:requirePINforRemoteOperationArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes the RequirePINforRemoteOperation attribute value as False " - @"on the DUT Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithoutPINCode_2() - { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; - params.pinCode = [[NSData alloc] initWithBytes:"" length:0]; - [cluster lockDoorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends Lock Door Command to the DUT without PINCode Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThWritesTheRequirePINforRemoteOperationAttributeValueAsTrueOnTheDut_3() - { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - id requirePINforRemoteOperationArgument; - requirePINforRemoteOperationArgument = [NSNumber numberWithBool:true]; - [cluster writeAttributeRequirePINforRemoteOperationWithValue:requirePINforRemoteOperationArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes the RequirePINforRemoteOperation attribute value as True " - @"on the DUT Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockUser_4() + CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockUser_1() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -105194,237 +107796,294 @@ class Test_TC_DL_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } + NSNumber * _Nonnull NumberOfWeekDaySchedulesSupportedPerUser; - CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithValidPINCode_5() + CHIP_ERROR TestGetMaxNumberOfWeekDaySchedulesForUser_2() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; - params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; - [cluster lockDoorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends Lock Door Command to the DUT with valid PINCode Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + [cluster readAttributeNumberOfWeekDaySchedulesSupportedPerUserWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Get Max number of Week Day schedules for user Error: %@", err); - CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithoutAnyArgumentPINCode_6() - { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; - params.pinCode = [[NSData alloc] initWithBytes:"" length:0]; - [cluster lockDoorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends Lock Door Command to the DUT without any argument PINCode Error: %@", err); + { + id actualValue = value; + VerifyOrReturn(CheckValue("NumberOfWeekDaySchedulesSupportedPerUser", actualValue, 10)); + } + { + NumberOfWeekDaySchedulesSupportedPerUser = value; + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull NumberOfTotalUsersSupported; - CHIP_ERROR TestThWritesWrongCodeEntryLimitAttributeValueAs3OnTheDut_7() + CHIP_ERROR TestGetNumberOfSupportedUsers_3() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id wrongCodeEntryLimitArgument; - wrongCodeEntryLimitArgument = [NSNumber numberWithUnsignedChar:3]; [cluster - writeAttributeWrongCodeEntryLimitWithValue:wrongCodeEntryLimitArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes WrongCodeEntryLimit attribute value as 3 on the DUT Error: %@", err); + readAttributeNumberOfTotalUsersSupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Get number of supported users Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("NumberOfTotalUsersSupported", actualValue, 10U)); + } + { + NumberOfTotalUsersSupported = value; + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThWritesUserCodeTemporaryDisableTimeAttributeValueAs5SecondsOnTheDut_8() + CHIP_ERROR TestSendSetWeekDayScheduleCommandToDut_4() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id userCodeTemporaryDisableTimeArgument; - userCodeTemporaryDisableTimeArgument = [NSNumber numberWithUnsignedChar:5]; - [cluster writeAttributeUserCodeTemporaryDisableTimeWithValue:userCodeTemporaryDisableTimeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes UserCodeTemporaryDisableTime attribute value as 5 seconds " - @"on the DUT Error: %@", - err); + __auto_type * params = [[CHIPDoorLockClusterSetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.daysMask = [NSNumber numberWithUnsignedChar:2]; + params.startHour = [NSNumber numberWithUnsignedChar:15]; + params.startMinute = [NSNumber numberWithUnsignedChar:45]; + params.endHour = [NSNumber numberWithUnsignedChar:16]; + params.endMinute = [NSNumber numberWithUnsignedChar:55]; + [cluster setWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Set Week Day Schedule Command to DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_9() + CHIP_ERROR TestSendGetWeekDayScheduleCommand_5() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; - params.pinCode = [[NSData alloc] initWithBytes:"12345" length:5]; - [cluster lockDoorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends Lock Door Command to the DUT with invalid PINCode Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + __auto_type * params = [[CHIPDoorLockClusterGetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster + getWeekDayScheduleWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"send GetWeekDay Schedule Command Error: %@", err); - CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_10() - { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; - params.pinCode = [[NSData alloc] initWithBytes:"54321" length:5]; - [cluster lockDoorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends Lock Door Command to the DUT with invalid PINCode Error: %@", err); + if (values.weekDayIndex != nil) { + VerifyOrReturn( + CheckConstraintMinValue("weekDayIndex", [values.weekDayIndex unsignedCharValue], 1)); + } + + if (values.userIndex != nil) { + VerifyOrReturn( + CheckConstraintMinValue("userIndex", [values.userIndex unsignedShortValue], 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } + + if (values.daysMask != nil) { + VerifyOrReturn(CheckConstraintMinValue("daysMask", [values.daysMask unsignedCharValue], 0)); + } + if (values.daysMask != nil) { + VerifyOrReturn(CheckConstraintMaxValue("daysMask", [values.daysMask unsignedCharValue], 6)); + } + + if (values.startHour != nil) { + VerifyOrReturn( + CheckConstraintMinValue("startHour", [values.startHour unsignedCharValue], 0)); + } + if (values.startHour != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("startHour", [values.startHour unsignedCharValue], 23)); + } + + if (values.startMinute != nil) { + VerifyOrReturn( + CheckConstraintMinValue("startMinute", [values.startMinute unsignedCharValue], 0)); + } + if (values.startMinute != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("startMinute", [values.startMinute unsignedCharValue], 59)); + } + + if (values.endHour != nil) { + VerifyOrReturn(CheckConstraintMinValue("endHour", [values.endHour unsignedCharValue], 0)); + } + if (values.endHour != nil) { + VerifyOrReturn(CheckConstraintMaxValue("endHour", [values.endHour unsignedCharValue], 23)); + } + + if (values.endMinute != nil) { + VerifyOrReturn( + CheckConstraintMinValue("endMinute", [values.endMinute unsignedCharValue], 0)); + } + if (values.endMinute != nil) { + VerifyOrReturn( + CheckConstraintMaxValue("endMinute", [values.endMinute unsignedCharValue], 59)); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_11() + CHIP_ERROR TestSendSetWeekDayScheduleCommandToDutAndVerifyInvalidCommandResponse_6() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; - params.pinCode = [[NSData alloc] initWithBytes:"987623" length:6]; - [cluster lockDoorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends Lock Door Command to the DUT with invalid PINCode Error: %@", err); + __auto_type * params = [[CHIPDoorLockClusterSetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:0]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.daysMask = [NSNumber numberWithUnsignedChar:7]; + params.startHour = [NSNumber numberWithUnsignedChar:15]; + params.startMinute = [NSNumber numberWithUnsignedChar:45]; + params.endHour = [NSNumber numberWithUnsignedChar:16]; + params.endMinute = [NSNumber numberWithUnsignedChar:55]; + [cluster + setWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Set Week Day Schedule Command to DUT and verify INVALID_COMMAND response Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithInvalidPINCode_12() + CHIP_ERROR TestSendGetWeekDayScheduleCommandToDutAndVerifyInvalidCommandResponse_7() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; - params.pinCode = [[NSData alloc] initWithBytes:"67890" length:5]; - [cluster lockDoorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends Lock Door Command to the DUT with invalid PINCode Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_FAILURE)); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } + __auto_type * params = [[CHIPDoorLockClusterGetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:0]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster + getWeekDayScheduleWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"send GetWeekDay Schedule Command to DUT and verify INVALID_COMMAND response Error: %@", err); - CHIP_ERROR TestThReadsUserCodeTemporaryDisableTimeAttributeFromDut_13() - { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - [cluster - readAttributeUserCodeTemporaryDisableTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads UserCodeTemporaryDisableTime attribute from DUT Error: %@", err); + { + id actualValue = values.weekDayIndex; + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 0)); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } - { - id actualValue = value; - VerifyOrReturn(CheckValue("UserCodeTemporaryDisableTime", actualValue, 5)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 133)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsLockDoorCommandToTheDutWithValidPINCode_14() + CHIP_ERROR TestClearAllWeekDaySchedulesForTheFirstUser_8() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; - params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; - [cluster lockDoorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends Lock Door Command to the DUT with valid PINCode Error: %@", err); + __auto_type * params = [[CHIPDoorLockClusterClearWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:254]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster clearWeekDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Clear all week day schedules for the first user Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCleanTheCreatedCredential_15() + CHIP_ERROR TestSendGetWeekDayScheduleCommand_9() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterClearCredentialParams alloc] init]; - params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; - ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; - ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + __auto_type * params = [[CHIPDoorLockClusterGetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:2]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getWeekDayScheduleWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"send GetWeekDay Schedule Command Error: %@", err); - [cluster clearCredentialWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clean the created credential Error: %@", err); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = values.weekDayIndex; + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 2)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } }; -class Test_TC_DL_2_3 : public TestCommandBridge { +class Test_TC_DL_2_11 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DL_2_3() - : TestCommandBridge("Test_TC_DL_2_3") + Test_TC_DL_2_11() + : TestCommandBridge("Test_TC_DL_2_11") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -105434,7 +108093,7 @@ class Test_TC_DL_2_3 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_DL_2_3() {} + ~Test_TC_DL_2_11() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -105442,11 +108101,11 @@ class Test_TC_DL_2_3 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DL_2_3\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DL_2_11\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DL_2_3\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DL_2_11\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -105467,32 +108126,52 @@ class Test_TC_DL_2_3 : public TestCommandBridge { err = TestCreateNewPinCredentialAndLockUnlockUser_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Precondition: Door is in locked state\n"); - err = TestPreconditionDoorIsInLockedState_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Create new PIN credential and lock/unlock for second user\n"); + err = TestCreateNewPinCredentialAndLockUnlockForSecondUser_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH writes AutoRelockTime attribute value as 10 seconds on the DUT\n"); - err = TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Get Max number of year Day schedules for user\n"); + err = TestGetMaxNumberOfYearDaySchedulesForUser_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH sends the unlock Door command to the DUT with valid PINCode\n"); - err = TestThSendsTheUnlockDoorCommandToTheDutWithValidPINCode_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Get number of supported users\n"); + err = TestGetNumberOfSupportedUsers_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads AutoRelockTime attribute from DUT\n"); - err = TestThReadsAutoRelockTimeAttributeFromDut_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Send Set Year Day Schedule Command to DUT\n"); + err = TestSendSetYearDayScheduleCommandToDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 10000ms\n"); - err = TestWait10000ms_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : send Get Year Day Schedule Command\n"); + err = TestSendGetYearDayScheduleCommand_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads LockState attribute\n"); - err = TestThReadsLockStateAttribute_7(); + ChipLogProgress( + chipTool, " ***** Test Step 7 : Send Set Year Day Schedule Command to DUT and verify INVALID_COMMAND response\n"); + err = TestSendSetYearDayScheduleCommandToDutAndVerifyInvalidCommandResponse_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Clean the created credential\n"); - err = TestCleanTheCreatedCredential_8(); + ChipLogProgress( + chipTool, " ***** Test Step 8 : send Get Year Day Schedule Command to DUT and Verify INVALID_FIELD response\n"); + err = TestSendGetYearDayScheduleCommandToDutAndVerifyInvalidFieldResponse_8(); + break; + case 9: + ChipLogProgress( + chipTool, " ***** Test Step 9 : send Get Year Day Schedule Command to DUT and verify NOT_FOUND response\n"); + err = TestSendGetYearDayScheduleCommandToDutAndVerifyNotFoundResponse_9(); + break; + case 10: + ChipLogProgress( + chipTool, " ***** Test Step 10 : send Get Year Day Schedule Command to DUT and verify NOT_FOUND response \n"); + err = TestSendGetYearDayScheduleCommandToDutAndVerifyNotFoundResponse_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Send Set Year Day Schedule Command to DUT\n"); + err = TestSendSetYearDayScheduleCommandToDut_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : send Get Year Day Schedule Command \n"); + err = TestSendGetYearDayScheduleCommand_12(); break; } @@ -105527,11 +108206,23 @@ class Test_TC_DL_2_3 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); 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; } // Go on to the next test. @@ -105545,7 +108236,7 @@ class Test_TC_DL_2_3 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + const uint16_t mTestCount = 13; chip::Optional mNodeId; chip::Optional mCluster; @@ -105605,80 +108296,71 @@ class Test_TC_DL_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestPreconditionDoorIsInLockedState_2() - { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; - params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; - [cluster lockDoorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Precondition: Door is in locked state Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3() + CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockForSecondUser_2() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id autoRelockTimeArgument; - autoRelockTimeArgument = [NSNumber numberWithUnsignedInt:10UL]; - [cluster writeAttributeAutoRelockTimeWithValue:autoRelockTimeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes AutoRelockTime attribute value as 10 seconds on the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + __auto_type * params = [[CHIPDoorLockClusterSetCredentialParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0]; + params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; + ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:2U]; - NextTest(); - }]; + params.credentialData = [[NSData alloc] initWithBytes:"123457" length:6]; + params.userIndex = nil; + params.userStatus = nil; + params.userType = nil; + [cluster + setCredentialWithParams:params + completionHandler:^(CHIPDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Create new PIN credential and lock/unlock for second user Error: %@", err); - return CHIP_NO_ERROR; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - CHIP_ERROR TestThSendsTheUnlockDoorCommandToTheDutWithValidPINCode_4() - { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } - __auto_type * params = [[CHIPDoorLockClusterUnlockDoorParams alloc] init]; - params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; - [cluster unlockDoorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends the unlock Door command to the DUT with valid PINCode Error: %@", err); + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 3U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } + NSNumber * _Nonnull NumberOfYearDaySchedulesSupportedPerUser; - CHIP_ERROR TestThReadsAutoRelockTimeAttributeFromDut_5() + CHIP_ERROR TestGetMaxNumberOfYearDaySchedulesForUser_3() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAutoRelockTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads AutoRelockTime attribute from DUT Error: %@", err); + [cluster readAttributeNumberOfYearDaySchedulesSupportedPerUserWithCompletionHandler:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Get Max number of year Day schedules for user Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("AutoRelockTime", actualValue, 10UL)); + VerifyOrReturn(CheckValue("NumberOfYearDaySchedulesSupportedPerUser", actualValue, 10)); + } + { + NumberOfYearDaySchedulesSupportedPerUser = value; } NextTest(); @@ -105686,348 +108368,298 @@ class Test_TC_DL_2_3 : public TestCommandBridge { return CHIP_NO_ERROR; } + NSNumber * _Nonnull NumberOfTotalUsersSupported; - CHIP_ERROR TestWait10000ms_6() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; - return WaitForMs("alpha", value); - } - - CHIP_ERROR TestThReadsLockStateAttribute_7() + CHIP_ERROR TestGetNumberOfSupportedUsers_4() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads LockState attribute Error: %@", err); + [cluster + readAttributeNumberOfTotalUsersSupportedWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Get number of supported users Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("LockState", actualValue)); - VerifyOrReturn(CheckValue("LockState", actualValue, 1)); - } + { + id actualValue = value; + VerifyOrReturn(CheckValue("NumberOfTotalUsersSupported", actualValue, 10U)); + } + { + NumberOfTotalUsersSupported = value; + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestCleanTheCreatedCredential_8() + CHIP_ERROR TestSendSetYearDayScheduleCommandToDut_5() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterClearCredentialParams alloc] init]; - params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; - ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; - ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; - - [cluster clearCredentialWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clean the created credential Error: %@", err); + __auto_type * params = [[CHIPDoorLockClusterSetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:10UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:20UL]; + [cluster setYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Set Year Day Schedule Command to DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } -}; -class Test_TC_DL_2_4 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_DL_2_4() - : TestCommandBridge("Test_TC_DL_2_4") - , mTestIndex(0) + CHIP_ERROR TestSendGetYearDayScheduleCommand_6() { - 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_DL_2_4() {} + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; + __auto_type * params = [[CHIPDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getYearDayScheduleWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"send Get Year Day Schedule Command Error: %@", err); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_DL_2_4\n"); - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DL_2_4\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + if (values.yearDayIndex != nil) { + VerifyOrReturn(CheckConstraintMinValue( + "yearDayIndex", [values.yearDayIndex unsignedCharValue], 1)); + } - Wait(); + if (values.userIndex != nil) { + VerifyOrReturn( + CheckConstraintMinValue("userIndex", [values.userIndex unsignedShortValue], 1U)); + } - // 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 : Create new PIN credential and lock/unlock user\n"); - err = TestCreateNewPinCredentialAndLockUnlockUser_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Precondition: Door is in locked state\n"); - err = TestPreconditionDoorIsInLockedState_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH writes AutoRelockTime attribute value as 10 seconds on the DUT\n"); - err = TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : TH sends the unlock with Timeout command to the DUT \n"); - err = TestThSendsTheUnlockWithTimeoutCommandToTheDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads AutoRelockTime attribute from DUT\n"); - err = TestThReadsAutoRelockTimeAttributeFromDut_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Wait 5000ms\n"); - err = TestWait5000ms_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads LockState attribute\n"); - err = TestThReadsLockStateAttribute_7(); - break; - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } + VerifyOrReturn(CheckConstraintType("localStartTime", "", "epoch-s")); - 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; - } + VerifyOrReturn(CheckConstraintType("localEndTime", "", "epoch-s")); + NextTest(); + }]; - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestSendSetYearDayScheduleCommandToDutAndVerifyInvalidCommandResponse_7() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + CHIPDevice * device = GetDevice("alpha"); + CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; + __auto_type * params = [[CHIPDoorLockClusterSetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:0]; + params.userIndex = [NSNumber numberWithUnsignedShort:10U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:30UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:10UL]; + [cluster + setYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Set Year Day Schedule Command to DUT and verify INVALID_COMMAND response Error: %@", err); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); + return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewPinCredentialAndLockUnlockUser_1() + CHIP_ERROR TestSendGetYearDayScheduleCommandToDutAndVerifyInvalidFieldResponse_8() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterSetCredentialParams alloc] init]; - params.operationType = [NSNumber numberWithUnsignedChar:0]; - params.credential = [[CHIPDoorLockClusterDlCredential alloc] init]; - ((CHIPDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1]; - ((CHIPDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; - - params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; - params.userIndex = nil; - params.userStatus = nil; - params.userType = nil; + __auto_type * params = [[CHIPDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:2]; + params.userIndex = [NSNumber numberWithUnsignedShort:21U]; [cluster - setCredentialWithParams:params - completionHandler:^(CHIPDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Create new PIN credential and lock/unlock user Error: %@", err); + getYearDayScheduleWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"send Get Year Day Schedule Command to DUT and Verify INVALID_FIELD response Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0)); - } + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 2)); + } - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 21U)); + } - { - id actualValue = values.nextCredentialIndex; - VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); - VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 133)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestPreconditionDoorIsInLockedState_2() + CHIP_ERROR TestSendGetYearDayScheduleCommandToDutAndVerifyNotFoundResponse_9() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterLockDoorParams alloc] init]; - params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; - [cluster lockDoorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Precondition: Door is in locked state Error: %@", err); + __auto_type * params = [[CHIPDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:10]; + params.userIndex = [NSNumber numberWithUnsignedShort:5U]; + [cluster getYearDayScheduleWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"send Get Year Day Schedule Command to DUT and verify NOT_FOUND response Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 10)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 5U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThWritesAutoRelockTimeAttributeValueAs10SecondsOnTheDut_3() + CHIP_ERROR TestSendGetYearDayScheduleCommandToDutAndVerifyNotFoundResponse_10() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id autoRelockTimeArgument; - autoRelockTimeArgument = [NSNumber numberWithUnsignedInt:10UL]; - [cluster writeAttributeAutoRelockTimeWithValue:autoRelockTimeArgument - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH writes AutoRelockTime attribute value as 10 seconds on the DUT Error: %@", err); + __auto_type * params = [[CHIPDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:2]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + [cluster getYearDayScheduleWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"send Get Year Day Schedule Command to DUT and verify NOT_FOUND response Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 2)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139)); + } + + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsTheUnlockWithTimeoutCommandToTheDut_4() + CHIP_ERROR TestSendSetYearDayScheduleCommandToDut_11() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[CHIPDoorLockClusterUnlockWithTimeoutParams alloc] init]; - params.timeout = [NSNumber numberWithUnsignedShort:5U]; - params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; - [cluster unlockWithTimeoutWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"TH sends the unlock with Timeout command to the DUT Error: %@", err); + __auto_type * params = [[CHIPDoorLockClusterSetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:2]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:10UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:20UL]; + [cluster setYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Send Set Year Day Schedule Command to DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsAutoRelockTimeAttributeFromDut_5() + CHIP_ERROR TestSendGetYearDayScheduleCommand_12() { CHIPDevice * device = GetDevice("alpha"); CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAutoRelockTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads AutoRelockTime attribute from DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("AutoRelockTime", actualValue, 10UL)); - } - - NextTest(); - }]; + __auto_type * params = [[CHIPDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:2]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + [cluster getYearDayScheduleWithParams:params + completionHandler:^( + CHIPDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"send Get Year Day Schedule Command Error: %@", err); - return CHIP_NO_ERROR; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - CHIP_ERROR TestWait5000ms_6() - { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 5000UL; - return WaitForMs("alpha", value); - } + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 2)); + } - CHIP_ERROR TestThReadsLockStateAttribute_7() - { - CHIPDevice * device = GetDevice("alpha"); - CHIPTestDoorLock * cluster = [[CHIPTestDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 2U)); + } - [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads LockState attribute Error: %@", err); + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0)); + } - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = values.localStartTime; + VerifyOrReturn(CheckValue("localStartTime", actualValue, 10UL)); + } - { - id actualValue = value; - VerifyOrReturn(CheckValueNonNull("LockState", actualValue)); - VerifyOrReturn(CheckValue("LockState", actualValue, 1)); - } + { + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("localEndTime", actualValue, 20UL)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -107749,6 +110381,8 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), #endif // CONFIG_ENABLE_YAML_TESTS diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 8752779796dd8d..77610643b2b4d2 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -228,6 +228,8 @@ class TestList : public Command printf("Test_TC_DL_2_2\n"); printf("Test_TC_DL_2_3\n"); printf("Test_TC_DL_2_4\n"); + printf("Test_TC_DL_2_8\n"); + printf("Test_TC_DL_2_11\n"); printf("TestGroupMessaging\n"); printf("TestGroupsCluster\n"); printf("TestGroupKeyManagementCluster\n"); @@ -444,9 +446,7 @@ class ManualTestList : public Command printf("Test_TC_DL_2_5\n"); printf("Test_TC_DL_2_6\n"); printf("Test_TC_DL_2_7\n"); - printf("Test_TC_DL_2_8\n"); printf("Test_TC_DL_2_10\n"); - printf("Test_TC_DL_2_11\n"); printf("Test_TC_DL_2_13\n"); printf("Test_TC_DL_2_14\n"); printf("Test_TC_DL_2_15\n"); @@ -25710,7 +25710,7 @@ class Test_TC_PS_1_1Suite : public TestCommand class Test_TC_PS_2_1Suite : public TestCommand { public: - Test_TC_PS_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PS_2_1", 5, credsIssuerConfig) + Test_TC_PS_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PS_2_1", 32, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -25774,152 +25774,543 @@ class Test_TC_PS_2_1Suite : public TestCommand } break; case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + } + break; + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "enum8")); VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 2)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 1)); } 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, "Test Harness Client reads Status attribute from Server DUT"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::Status::Id, true, - chip::NullOptional); - } - case 2: { - LogStep(2, "Test Harness Client reads Order attribute from Server DUT"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::Order::Id, true, - chip::NullOptional); - } - case 3: { - LogStep(3, "Test Harness Client reads Description attribute from Server DUT"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::Description::Id, true, - chip::NullOptional); - } - case 4: { - LogStep(4, "Test Harness Client reads BatChargeLevel from Server DUT"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatteryChargeLevel::Id, - true, chip::NullOptional); - } - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_PRS_1_1Suite : public TestCommand -{ -public: - Test_TC_PRS_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PRS_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_PRS_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: + case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } break; - case 1: + case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint16_t value; + uint32_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); } break; - case 2: + case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint16_t value; + uint32_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); } break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "bool")); + } break; - case 4: + 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(CheckValue("clusterRevision", value, 3U)); + VerifyOrReturn(CheckConstraintType("value", "", "list")); } break; - case 5: + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 2)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "bool")); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "bool")); + } + break; + case 19: + 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")); } break; - case 6: + case 20: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 60)); + } break; - case 7: + case 21: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 80UL)); + } break; - case 8: + case 22: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 20)); + } break; - case 9: + case 23: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value.size(), 20)); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 32UL)); + } + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 3)); + } + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "bool")); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint32")); + } + break; + case 31: + 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")); + } + 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, "Test Harness Client reads Status attribute from Server DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::Status::Id, true, + chip::NullOptional); + } + case 2: { + LogStep(2, "Test Harness Client reads Order attribute from Server DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::Order::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Test Harness Client reads Description attribute from Server DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::Description::Id, true, + chip::NullOptional); + } + case 4: { + LogStep(4, "Test Harness Client reads WiredAssessedInputVoltage attribue from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, + PowerSource::Attributes::WiredAssessedInputVoltage::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Test Harness Client reads WiredAssessedInputFrequency attribute from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, + PowerSource::Attributes::WiredAssessedInputFrequency::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Test Harness Client reads WiredCurrentType attribute from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::WiredCurrentType::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "Test Harness Client reads WiredAssessedCurrent attribute from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::WiredAssessedCurrent::Id, + true, chip::NullOptional); + } + case 8: { + LogStep(8, "Test Harness Client reads WiredNominalVoltage from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::WiredNominalVoltage::Id, + true, chip::NullOptional); + } + case 9: { + LogStep(9, "Test Harness Client reads WiredMaximumCurrent from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::WiredMaximumCurrent::Id, + true, chip::NullOptional); + } + case 10: { + LogStep(10, "Test Harness Client reads WiredPresent from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::WiredPresent::Id, true, + chip::NullOptional); + } + case 11: { + LogStep(11, "Test Harness Client reads ActiveWiredFaults from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::ActiveWiredFaults::Id, + true, chip::NullOptional); + } + case 12: { + LogStep(12, "Test Harness Client reads BatVoltage from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatteryVoltage::Id, true, + chip::NullOptional); + } + case 13: { + LogStep(13, "Test Harness Client reads BatPercentRemaining from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, + PowerSource::Attributes::BatteryPercentRemaining::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "Test Harness Client reads BatTimeRemaining from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatteryTimeRemaining::Id, + true, chip::NullOptional); + } + case 15: { + LogStep(15, "Test Harness Client reads BatChargeLevel from Server DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatteryChargeLevel::Id, + true, chip::NullOptional); + } + case 16: { + LogStep(16, "Test Harness Client reads BatReplacementNeeded from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, + PowerSource::Attributes::BatteryReplacementNeeded::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "Test Harness Client reads BatReplaceability from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, + PowerSource::Attributes::BatteryReplaceability::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "Test Harness Client reads BatPresent from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatteryPresent::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "Test Harness Client readsActiveBatFaults from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::ActiveBatteryFaults::Id, + true, chip::NullOptional); + } + case 20: { + LogStep(20, "Test Harness Client reads BatReplacementDescription from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, + PowerSource::Attributes::BatteryReplacementDescription::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, "Test Harness Client reads BatCommonDesignation from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, + PowerSource::Attributes::BatteryCommonDesignation::Id, true, chip::NullOptional); + } + case 22: { + LogStep(22, "Test Harness Client reads BatANSIDesignation from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, + PowerSource::Attributes::BatteryANSIDesignation::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "Test Harness Client reads BatIECDesignation from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, + PowerSource::Attributes::BatteryIECDesignation::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "Test Harness Client reads BatApprovedChemistry from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, + PowerSource::Attributes::BatteryApprovedChemistry::Id, true, chip::NullOptional); + } + case 25: { + LogStep(25, "Test Harness Client reads BatCapacity from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatteryCapacity::Id, + true, chip::NullOptional); + } + case 26: { + LogStep(26, "Test Harness Client reads BatQuantity from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatteryQuantity::Id, + true, chip::NullOptional); + } + case 27: { + LogStep(27, "Test Harness Client reads BatChargeState from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, PowerSource::Attributes::BatteryChargeState::Id, + true, chip::NullOptional); + } + case 28: { + LogStep(28, "Test Harness Client reads BatTimeToFullCharge from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, + PowerSource::Attributes::BatteryTimeToFullCharge::Id, true, chip::NullOptional); + } + case 29: { + LogStep(29, "Test Harness Client reads BatFunctionalWhileCharging from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, + PowerSource::Attributes::BatteryFunctionalWhileCharging::Id, true, chip::NullOptional); + } + case 30: { + LogStep(30, "Test Harness Client reads BatChargingCurrent from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, + PowerSource::Attributes::BatteryChargingCurrent::Id, true, chip::NullOptional); + } + case 31: { + LogStep(31, "Test Harness Client reads ActiveBatChargeFaults from Server DUT"); + VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), PowerSource::Id, + PowerSource::Attributes::ActiveBatteryChargeFaults::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_PRS_1_1Suite : public TestCommand +{ +public: + Test_TC_PRS_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_PRS_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_PRS_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, 3U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "", "uint16")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 3U)); + } + 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")); + } + 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)); + shouldContinue = true; + 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)); + shouldContinue = true; break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); @@ -30163,7 +30554,7 @@ class Test_TC_TSTAT_1_1Suite : public TestCommand class Test_TC_TSTAT_2_1Suite : public TestCommand { public: - Test_TC_TSTAT_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSTAT_2_1", 18, credsIssuerConfig) + Test_TC_TSTAT_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_TSTAT_2_1", 51, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -30257,6 +30648,14 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand } 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)); + shouldContinue = true; + break; + case 8: if (IsUnsupported(status.mStatus)) { return; @@ -30270,7 +30669,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 2600)); } break; - case 7: + case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -30280,7 +30679,15 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 2600)); } break; - case 8: + 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)); + shouldContinue = true; + break; + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -30290,7 +30697,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 3000)); } break; - case 9: + case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { int16_t value; @@ -30300,7 +30707,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 3000)); } break; - case 10: + case 14: if (IsUnsupported(status.mStatus)) { return; @@ -30314,7 +30721,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 3200)); } break; - case 11: + case 15: if (IsUnsupported(status.mStatus)) { return; @@ -30328,7 +30735,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 3200)); } break; - case 12: + case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::Thermostat::ThermostatControlSequence value; @@ -30338,7 +30745,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 5)); } break; - case 13: + case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -30348,7 +30755,23 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 9)); } break; - case 14: + 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)); + shouldContinue = true; + 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)); + shouldContinue = true; + break; + case 22: if (IsUnsupported(status.mStatus)) { return; @@ -30362,7 +30785,19 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 25)); } break; - case 15: + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + 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: if (IsUnsupported(status.mStatus)) { return; @@ -30376,7 +30811,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintMaxValue("value", value, 6)); } break; - case 16: + case 27: if (IsUnsupported(status.mStatus)) { return; @@ -30388,7 +30823,7 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "uint8")); } break; - case 17: + case 28: if (IsUnsupported(status.mStatus)) { return; @@ -30400,6 +30835,94 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "", "uint8")); } break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + 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)); + shouldContinue = true; + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 50: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -30448,65 +30971,441 @@ class Test_TC_TSTAT_2_1Suite : public TestCommand Thermostat::Attributes::AbsMaxCoolSetpointLimit::Id, true, chip::NullOptional); } case 6: { - LogStep(6, "Reads constraints of optional attributes from DUT: OccupiedCoolingSetpoint"); + LogStep(6, + "Read PICoolingDemand attribute from the DUT Verify that the DUT responds with a uint8 value.The value has to " + "be in the range of 0 to 100"); + 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); + } + case 7: { + LogStep(7, + "Read PIHeatingDemand attribute from the DUT and Verify that the DUT responds with a uint8 value.The value has " + "to be in the range of 0 to 100"); + 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); + } + case 8: { + LogStep(8, "Reads constraints of optional attributes from DUT: OccupiedCoolingSetpoint"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedCoolingSetpoint::Id, true, chip::NullOptional); } - case 7: { - LogStep(7, "Reads constraints of mandatory attributes from DUT: OccupiedHeatingSetpoint"); + case 9: { + LogStep(9, "Reads constraints of mandatory attributes from DUT: OccupiedHeatingSetpoint"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::OccupiedHeatingSetpoint::Id, true, chip::NullOptional); } - case 8: { - LogStep(8, "Reads constraints of mandatory attributes from DUT: MinHeatSetpointLimit"); + case 10: { + LogStep(10, + "Read UnoccupiedCoolingSetpoint attribute from the DUT and Verify that the DUT responds with an int16 value"); + 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); + } + case 11: { + LogStep(11, + "Read UnoccupiedHeatingSetpoint attribute from the DUT and Verify that the DUT responds with an int16 value"); + 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); + } + case 12: { + LogStep(12, "Reads constraints of mandatory attributes from DUT: MinHeatSetpointLimit"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinHeatSetpointLimit::Id, true, chip::NullOptional); } - case 9: { - LogStep(9, "Reads constraints of mandatory attributes from DUT: MaxHeatSetpointLimit"); + case 13: { + LogStep(13, "Reads constraints of mandatory attributes from DUT: MaxHeatSetpointLimit"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxHeatSetpointLimit::Id, true, chip::NullOptional); } - case 10: { - LogStep(10, "Reads constraints of optional attributes from DUT: MinCoolSetpointLimit"); + case 14: { + LogStep(14, "Reads constraints of optional attributes from DUT: MinCoolSetpointLimit"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinCoolSetpointLimit::Id, true, chip::NullOptional); } - case 11: { - LogStep(11, "Reads constraints of optional attributes from DUT: MaxCoolSetpointLimit"); + case 15: { + LogStep(15, "Reads constraints of optional attributes from DUT: MaxCoolSetpointLimit"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MaxCoolSetpointLimit::Id, true, chip::NullOptional); } - case 12: { - LogStep(12, "Reads constraints of mandatory attributes from DUT: ControlSequenceOfOperation"); + case 16: { + LogStep(16, "Reads constraints of mandatory attributes from DUT: ControlSequenceOfOperation"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::ControlSequenceOfOperation::Id, true, chip::NullOptional); } - case 13: { - LogStep(13, "Reads constraints of mandatory attributes from DUT: SystemMode"); + case 17: { + LogStep(17, "Reads constraints of mandatory attributes from DUT: SystemMode"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::SystemMode::Id, true, chip::NullOptional); } - case 14: { - LogStep(14, "Reads constraints of optional attributes from DUT: MinSetpointDeadBand"); + case 18: { + LogStep(18, "Read OutdoorTemperature attribute from the DUT and Verify the datatype"); + 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); + } + case 19: { + LogStep(19, "Read Occupancy attribute from the DUT and Verify the datatype and response value"); + 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); + } + case 20: { + LogStep(20, + "Read HVACSystemTypeConfiguration attribute from the DUT and Verify that the DUT responds with a map8 value. " + "The value has to be in the range of 0x00 to 0x3f"); + 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); + } + case 21: { + LogStep(21, + "Read LocalTemperatureCalibration attribute from the DUT and Verify that the DUT responds with an int8 " + "value.The value has to be in the range of -25 to 25"); + 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); + } + case 22: { + LogStep(22, "Reads constraints of optional attributes from DUT: MinSetpointDeadBand"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::MinSetpointDeadBand::Id, true, chip::NullOptional); } - case 15: { - LogStep(15, "Reads constraints of optional attributes from DUT: StartOfWeek"); + case 23: { + LogStep(23, + "Read RemoteSensing attribute from the DUT and Verify that the DUT responds with a map8 value. The value has " + "to be in the range of 0x00 to 0x07"); + 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); + } + case 24: { + LogStep(24, + "Read AlarmMask attribute from the DUT and Verify that the DUT responds with a map8 value.The value has to be " + "in the range of 0x00 to 0x07."); + 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); + } + case 25: { + LogStep(25, + "Read ThermostatRunningMode attribute from the DUT and Verify that the DUT responds with an enum8 value.The " + "value has to be 0, 3 or 4"); + 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); + } + case 26: { + LogStep(26, "Reads constraints of optional attributes from DUT: StartOfWeek"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::StartOfWeek::Id, true, chip::NullOptional); } - case 16: { - LogStep(16, "Reads constraints of optional attributes from DUT: NumberOfWeeklyTransitions"); + case 27: { + LogStep(27, "Reads constraints of optional attributes from DUT: NumberOfWeeklyTransitions"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::NumberOfWeeklyTransitions::Id, true, chip::NullOptional); } - case 17: { - LogStep(17, "Reads constraints of optional attributes from DUT: NumberOfDailyTransitions"); + case 28: { + LogStep(28, "Reads constraints of optional attributes from DUT: NumberOfDailyTransitions"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), Thermostat::Id, Thermostat::Attributes::NumberOfDailyTransitions::Id, true, chip::NullOptional); } + case 29: { + LogStep(29, + "Read TemperatureSetpointHold attribute from the DUT and Verify that the DUT responds with an enum8 value.The " + "value has to 0 or 1"); + 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); + } + case 30: { + LogStep(30, + "Read TemperatureSetpointHoldDuration attribute from the DUT and Verify that the DUT responds with a uint16 " + "value or NULL.The value has to be in the range of 0 to 1440"); + 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); + } + case 31: { + LogStep(31, + "Read ThermostatProgrammingOperationMode attribute from the DUT and Verify that the DUT responds with a map8 " + "value.The value has to be in the range of 0x00 to 0x07"); + 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); + } + case 32: { + LogStep(32, + "Read ThermostatRunningState attribute from the DUT and Verify that the DUT responds with a map16 value.The " + "value has to be in the range of 0x00 to 0x7F"); + 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); + } + case 33: { + LogStep(33, + "Read SetpointChangeSource attribute from the DUT and Verify that the DUT responds with an enum8 value. The " + "value has to be in the range of 0 to 2"); + 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); + } + case 34: { + LogStep( + 34, + "Read SetpointChangeAmount attribute from the DUT and Verify that the DUT responds with an int16 value or NULL"); + 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); + } + case 35: { + LogStep(35, + "Read SetpointChangeSourceTimestamp attribute from the DUT and Verify that the DUT responds with a utc value"); + 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); + } + case 36: { + LogStep(36, "Read OccupiedSetback attribute from the DUT and Verify that the DUT responds with a uint8 value or NULL"); + 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); + } + case 37: { + LogStep(37, + "Read OccupiedSetbackMin attribute from the DUT and Verify that the DUT responds with a uint8 value or NULL"); + 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); + } + case 38: { + LogStep(38, + "Read OccupiedSetbackMax attribute from the DUT and Verify that the DUT responds with a uint8 value or NULL"); + 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); + } + case 39: { + LogStep(39, + "Read UnoccupiedSetback attribute from the DUT and Verify that the DUT responds with a uint8 value or NULL"); + 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); + } + case 40: { + LogStep(40, + "Read UnoccupiedSetbackMin attribute from the DUT and Verify that the DUT responds with a uint8 value or NULL"); + 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); + } + case 41: { + LogStep(41, + "Read UnoccupiedSetbackMax attribute from the DUT and Verify that the DUT responds with a uint8 value or NULL"); + 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); + } + case 42: { + LogStep(42, + "Read EmergencyHeatDelta attribute from the DUT and Verify that the DUT responds with a uint8 value or NULL"); + 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); + } + case 43: { + LogStep(43, + "Read ACType attribute from the DUT and Verify that the DUT responds with an enum8 value. The value has to be " + "in the range of 0 to 4"); + 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); + } + case 44: { + LogStep(44, "Read ACCapacity attribute from the DUT and Verify that the DUT responds with a uint16 value"); + 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); + } + case 45: { + LogStep(45, + "Read ACRefrigerantType attribute from the DUT and VVerify that the DUT responds with an enum8 value.The value " + "has to be in the range of 0 to 3"); + 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); + } + case 46: { + LogStep(46, + "Read ACCompressorType attribute from the DUT and Verify that the DUT responds with an enum8 value.The value " + "has to be in the range of 0 to 3"); + 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); + } + case 47: { + LogStep(47, "Read ACErrorCode attribute from the DUT and Verify that the DUT responds with a map32 value"); + 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); + } + case 48: { + LogStep(48, + "Read ACLouverPosition attribute from the DUT and Verify that the DUT responds with an enum8 value.The value " + "has to be in the range of 1 to 5"); + 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); + } + case 49: { + LogStep(49, + "Read ACCoilTemperature attribute from the DUT and Verify that the DUT responds with an int16 value or NULL"); + 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); + } + case 50: { + LogStep(50, + "Read ACCapacityFormat attribute from the DUT and Verify that the DUT responds with an enum8 value.The value " + "has to be 0."); + 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; } @@ -61021,22 +61920,551 @@ class Test_TC_DL_2_4Suite : public TestCommand case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint32_t value; + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("autoRelockTime", value, 10UL)); + } + 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::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 1)); + } + 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, "Create new PIN credential and lock/unlock user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Precondition: Door is in locked state"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + value.pinCode.Emplace(); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 3: { + LogStep(3, "TH writes AutoRelockTime attribute value as 10 seconds on the DUT"); + ListFreer listFreer; + uint32_t value; + value = 10UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AutoRelockTime::Id, value, + chip::NullOptional, chip::NullOptional); + } + case 4: { + LogStep(4, "TH sends the unlock with Timeout command to the DUT "); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockWithTimeout::Type value; + value.timeout = 5U; + value.pinCode.Emplace(); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockWithTimeout::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 5: { + LogStep(5, "TH reads AutoRelockTime attribute from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AutoRelockTime::Id, true, + chip::NullOptional); + } + case 6: { + LogStep(6, "Wait 5000ms"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 5000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 7: { + LogStep(7, "TH reads LockState attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, + chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DL_2_8Suite : public TestCommand +{ +public: + Test_TC_DL_2_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_8", 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_DL_2_8Suite() {} + + 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; + + uint8_t NumberOfWeekDaySchedulesSupportedPerUser; + uint16_t NumberOfTotalUsersSupported; + + 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::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0)); + + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("numberOfWeekDaySchedulesSupportedPerUser", value, 10)); + + NumberOfWeekDaySchedulesSupportedPerUser = value; + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("numberOfTotalUsersSupported", value, 10U)); + + NumberOfTotalUsersSupported = value; + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value.weekDayIndex", value.weekDayIndex, 1)); + VerifyOrReturn(CheckConstraintMinValue("value.userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0)); + + VerifyOrReturn(CheckValuePresent("value.daysMask", value.daysMask)); + VerifyOrReturn(CheckConstraintMinValue("value.daysMask.Value()", value.daysMask.Value(), 0)); + VerifyOrReturn(CheckConstraintMaxValue("value.daysMask.Value()", value.daysMask.Value(), 6)); + VerifyOrReturn(CheckValuePresent("value.startHour", value.startHour)); + VerifyOrReturn(CheckConstraintMinValue("value.startHour.Value()", value.startHour.Value(), 0)); + VerifyOrReturn(CheckConstraintMaxValue("value.startHour.Value()", value.startHour.Value(), 23)); + VerifyOrReturn(CheckValuePresent("value.startMinute", value.startMinute)); + VerifyOrReturn(CheckConstraintMinValue("value.startMinute.Value()", value.startMinute.Value(), 0)); + VerifyOrReturn(CheckConstraintMaxValue("value.startMinute.Value()", value.startMinute.Value(), 59)); + VerifyOrReturn(CheckValuePresent("value.endHour", value.endHour)); + VerifyOrReturn(CheckConstraintMinValue("value.endHour.Value()", value.endHour.Value(), 0)); + VerifyOrReturn(CheckConstraintMaxValue("value.endHour.Value()", value.endHour.Value(), 23)); + VerifyOrReturn(CheckValuePresent("value.endMinute", value.endMinute)); + VerifyOrReturn(CheckConstraintMinValue("value.endMinute.Value()", value.endMinute.Value(), 0)); + VerifyOrReturn(CheckConstraintMaxValue("value.endMinute.Value()", value.endMinute.Value(), 59)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 0)); + + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + + VerifyOrReturn(CheckValue("status", value.status, 133)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 2)); + + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); + + VerifyOrReturn(CheckValue("status", value.status, 139)); + } + 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, "Create new PIN credential and lock/unlock user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Get Max number of Week Day schedules for user"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::NumberOfWeekDaySchedulesSupportedPerUser::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Get number of supported users"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::NumberOfTotalUsersSupported::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Send Set Week Day Schedule Command to DUT"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 1; + value.userIndex = 1U; + value.daysMask = static_cast>(2); + value.startHour = 15; + value.startMinute = 45; + value.endHour = 16; + value.endMinute = 55; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 5: { + LogStep(5, "send GetWeekDay Schedule Command "); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 1; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Send Set Week Day Schedule Command to DUT and verify INVALID_COMMAND response"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; + value.weekDayIndex = 0; + value.userIndex = 1U; + value.daysMask = static_cast>(7); + value.startHour = 15; + value.startMinute = 45; + value.endHour = 16; + value.endMinute = 55; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 7: { + LogStep(7, "send GetWeekDay Schedule Command to DUT and verify INVALID_COMMAND response"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 0; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Clear all week day schedules for the first user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearWeekDaySchedule::Type value; + value.weekDayIndex = 254; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "send GetWeekDay Schedule Command "); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; + value.weekDayIndex = 2; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, + chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_DL_2_11Suite : public TestCommand +{ +public: + Test_TC_DL_2_11Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_11", 13, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DL_2_11Suite() {} + + 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; + + uint8_t NumberOfYearDaySchedulesSupportedPerUser; + uint16_t NumberOfTotalUsersSupported; + + 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::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0)); + + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); + + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0)); + + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 2U)); + + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("numberOfYearDaySchedulesSupportedPerUser", value, 10)); + + NumberOfYearDaySchedulesSupportedPerUser = value; + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("numberOfTotalUsersSupported", value, 10U)); + + NumberOfTotalUsersSupported = value; + } + 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::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("autoRelockTime", value, 10UL)); + VerifyOrReturn(CheckConstraintMinValue("value.yearDayIndex", value.yearDayIndex, 1)); + VerifyOrReturn(CheckConstraintMinValue("value.userIndex", value.userIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0)); + + VerifyOrReturn(CheckValuePresent("value.localStartTime", value.localStartTime)); + VerifyOrReturn(CheckConstraintType("value.localStartTime.Value()", "", "epoch-s")); + VerifyOrReturn(CheckValuePresent("value.localEndTime", value.localEndTime)); + VerifyOrReturn(CheckConstraintType("value.localEndTime.Value()", "", "epoch-s")); } break; - case 6: + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 2)); + + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 21U)); + + VerifyOrReturn(CheckValue("status", value.status, 133)); + } break; - case 7: + case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable value; + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValueNonNull("lockState", value)); - VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 1)); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 10)); + + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 5U)); + + VerifyOrReturn(CheckValue("status", value.status, 139)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 2)); + + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 2U)); + + VerifyOrReturn(CheckValue("status", value.status, 139)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 2)); + + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 2U)); + + VerifyOrReturn(CheckValue("status", value.status, 0)); + + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 10UL)); + + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 20UL)); } break; default: @@ -61080,52 +62508,126 @@ class Test_TC_DL_2_4Suite : public TestCommand ); } case 2: { - LogStep(2, "Precondition: Door is in locked state"); + LogStep(2, "Create new PIN credential and lock/unlock for second user"); ListFreer listFreer; - chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; - value.pinCode.Emplace(); - value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); - return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 2U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123457garbage: not in length on purpose"), 6); + value.userIndex.SetNull(); + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, chip::Optional(10000), chip::NullOptional ); } case 3: { - LogStep(3, "TH writes AutoRelockTime attribute value as 10 seconds on the DUT"); - ListFreer listFreer; - uint32_t value; - value = 10UL; - return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AutoRelockTime::Id, value, - chip::NullOptional, chip::NullOptional); + LogStep(3, "Get Max number of year Day schedules for user"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::NumberOfYearDaySchedulesSupportedPerUser::Id, true, chip::NullOptional); } case 4: { - LogStep(4, "TH sends the unlock with Timeout command to the DUT "); + LogStep(4, "Get number of supported users"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::NumberOfTotalUsersSupported::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Send Set Year Day Schedule Command to DUT"); ListFreer listFreer; - chip::app::Clusters::DoorLock::Commands::UnlockWithTimeout::Type value; - value.timeout = 5U; - value.pinCode.Emplace(); - value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); - return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockWithTimeout::Id, value, - chip::Optional(10000), chip::NullOptional + chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; + value.yearDayIndex = 1; + value.userIndex = 1U; + value.localStartTime = 10UL; + value.localEndTime = 20UL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetYearDaySchedule::Id, value, + chip::NullOptional ); } - case 5: { - LogStep(5, "TH reads AutoRelockTime attribute from DUT"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::AutoRelockTime::Id, true, - chip::NullOptional); - } case 6: { - LogStep(6, "Wait 5000ms"); + LogStep(6, "send Get Year Day Schedule Command"); ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 5000UL; - return WaitForMs(kIdentityAlpha, value); + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 1; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); } case 7: { - LogStep(7, "TH reads LockState attribute"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, - chip::NullOptional); + LogStep(7, "Send Set Year Day Schedule Command to DUT and verify INVALID_COMMAND response"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; + value.yearDayIndex = 0; + value.userIndex = 10U; + value.localStartTime = 30UL; + value.localEndTime = 10UL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "send Get Year Day Schedule Command to DUT and Verify INVALID_FIELD response"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 2; + value.userIndex = 21U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "send Get Year Day Schedule Command to DUT and verify NOT_FOUND response"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 10; + value.userIndex = 5U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 10: { + LogStep(10, "send Get Year Day Schedule Command to DUT and verify NOT_FOUND response "); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 2; + value.userIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Send Set Year Day Schedule Command to DUT"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; + value.yearDayIndex = 2; + value.userIndex = 2U; + value.localStartTime = 10UL; + value.localEndTime = 20UL; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 12: { + LogStep(12, "send Get Year Day Schedule Command "); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; + value.yearDayIndex = 2; + value.userIndex = 2U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetYearDaySchedule::Id, value, + chip::NullOptional + + ); } } return CHIP_NO_ERROR; @@ -75288,62 +76790,6 @@ class Test_TC_DL_2_7Suite : public TestCommand } }; -class Test_TC_DL_2_8Suite : public TestCommand -{ -public: - Test_TC_DL_2_8Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_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_DL_2_8Suite() {} - - 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_DL_2_10Suite : public TestCommand { public: @@ -75400,62 +76846,6 @@ class Test_TC_DL_2_10Suite : public TestCommand } }; -class Test_TC_DL_2_11Suite : public TestCommand -{ -public: - Test_TC_DL_2_11Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DL_2_11", 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_DL_2_11Suite() {} - - 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_DL_2_13Suite : public TestCommand { public: @@ -77960,6 +79350,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), @@ -78165,9 +79557,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),