From 74901485905549168fc8e069c344b6cc7e0d8580 Mon Sep 17 00:00:00 2001 From: manjunath-grl <102359958+manjunath-grl@users.noreply.github.com> Date: Thu, 28 Jul 2022 08:04:07 +0530 Subject: [PATCH] Modified script july 27 (#21276) * Modified scripts TC-DRLK-2.5 TC-DRLK-2.7 TC-DRLK-2.9 TC-LVL-5.1 * Added auto generated files * Auto generated files --- .../certification/Test_TC_DRLK_2_5.yaml | 53 +- .../certification/Test_TC_DRLK_2_7.yaml | 82 +- .../certification/Test_TC_DRLK_2_9.yaml | 176 ++- .../suites/certification/Test_TC_LVL_5_1.yaml | 72 +- .../chip-tool/zap-generated/test/Commands.h | 488 +++++-- .../zap-generated/test/Commands.h | 1136 +++++++++++------ 6 files changed, 1405 insertions(+), 602 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_5.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_5.yaml index b0b84a8a7220c9..9a6d1b97abbdaa 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_5.yaml @@ -80,7 +80,7 @@ tests: - name: "nextUserIndex" value: null - - label: "Get Max number of Week Day schedules for user" + - label: "TH reads NumberOfWeekDay SchedulesSupportedPerUser attribute" PICS: DRLK.S.F04 && DRLK.S.A0014 command: "readAttribute" attribute: "NumberOfWeekDaySchedulesSupportedPerUser" @@ -90,7 +90,7 @@ tests: minValue: 0 maxValue: 255 - - label: "Get number of supported users" + - label: "TH reads NumberOfTotalUsers Supported attribute" PICS: DRLK.S.F08 && DRLK.S.A0011 command: "readAttribute" attribute: "NumberOfTotalUsersSupported" @@ -100,7 +100,7 @@ tests: minValue: 0 maxValue: 65534 - - label: "Send Set Week Day Schedule Command to DUT" + - label: "TH send Set Week Day Schedule Command" PICS: DRLK.S.F04 && DRLK.S.C0b.Rsp command: "SetWeekDaySchedule" arguments: @@ -121,7 +121,7 @@ tests: value: 55 #issue #18591 - - label: "send GetWeekDay Schedule Command " + - label: "TH send Get Week Day Schedule Command to DUT" PICS: DRLK.S.F04 && DRLK.S.C0c.Rsp && DRLK.S.C0c.Tx command: "GetWeekDaySchedule" arguments: @@ -133,44 +133,27 @@ tests: response: values: - name: "weekDayIndex" - constraints: - minValue: 1 - maxValue: NumberOfWeekDaySchedulesSupportedPerUser + value: 1 - name: "userIndex" - constraints: - minValue: 1 - maxValue: NumberOfTotalUsersSupported + value: 1 - name: "status" value: 0x0 - name: "daysMask" - constraints: - hasValue: true - minValue: 0 - maxValue: 6 + value: 2 - name: "startHour" - constraints: - hasValue: true - minValue: 0 - maxValue: 23 + value: 15 - name: "startMinute" - constraints: - hasValue: true - minValue: 0 - maxValue: 59 + value: 45 - name: "endHour" constraints: hasValue: true - minValue: 0 - maxValue: 23 + minValue: 16 - name: "endMinute" constraints: hasValue: true - minValue: 0 - maxValue: 59 + minValue: 55 - - label: - "Send Set Week Day Schedule Command to DUT and verify INVALID_COMMAND - response" + - label: "TH send Set Week Day Schedule Command" PICS: DRLK.S.F04 && DRLK.S.C0b.Rsp command: "SetWeekDaySchedule" arguments: @@ -192,9 +175,7 @@ tests: response: error: INVALID_COMMAND - - label: - "send GetWeekDay Schedule Command to DUT and verify INVALID_COMMAND - response" + - label: "TH send Get Week Day Schedule Command to DUT" PICS: DRLK.S.F04 && DRLK.S.C0c.Rsp && DRLK.S.C0c.Tx command: "GetWeekDaySchedule" arguments: @@ -227,7 +208,7 @@ tests: constraints: hasValue: false - - label: "Clear all week day schedules for the first user" + - label: "TH sends Clear Week Day Schedule Command to DUT" PICS: DRLK.S.F04 && DRLK.S.C0d.Rsp command: "ClearWeekDaySchedule" arguments: @@ -237,19 +218,19 @@ tests: - name: "userIndex" value: 1 - - label: "send GetWeekDay Schedule Command " + - label: "TH sends Get Week Day Schedule Command to DUT" PICS: DRLK.S.F04 && DRLK.S.C0c.Rsp && DRLK.S.C0c.Tx command: "GetWeekDaySchedule" arguments: values: - name: "weekDayIndex" - value: 2 + value: 1 - name: "userIndex" value: 1 response: values: - name: "weekDayIndex" - value: 2 + value: 1 - name: "userIndex" value: 1 - name: "status" diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_7.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_7.yaml index 6f8e48563d57c9..408fc6a9f4c8a8 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_7.yaml @@ -80,7 +80,7 @@ tests: - name: "nextUserIndex" value: null - - label: "Get Max number of year Day schedules for user" + - label: "TH reads NumberOfYearDay SchedulesSupportedPerUser attribute" PICS: DRLK.S.F04 && DRLK.S.A0015 command: "readAttribute" attribute: "NumberOfYearDaySchedulesSupportedPerUser" @@ -90,7 +90,7 @@ tests: minValue: 0 maxValue: 255 - - label: "Get number of supported users" + - label: "TH reads NumberOfTotalUsers Supported attribute" PICS: DRLK.C.F08 && DRLK.S.A0011 command: "readAttribute" attribute: "NumberOfTotalUsersSupported" @@ -100,7 +100,7 @@ tests: minValue: 0 maxValue: 65534 - - label: "Send Set Year Day Schedule Command to DUT" + - label: "TH sends Set Year Day Schedule Command to DUT" PICS: DRLK.S.F04 && DRLK.S.C0e.Rsp command: "SetYearDaySchedule" arguments: @@ -115,7 +115,7 @@ tests: value: 1980 #issue #18591 - - label: "send Get Year Day Schedule Command" + - label: "TH sends Get Year Day Schedule Command to DUT" PICS: DRLK.S.F04 && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx command: "GetYearDaySchedule" arguments: @@ -127,27 +127,19 @@ tests: response: values: - name: "YearDayIndex" - constraints: - minValue: 1 - maxValue: NumberOfYearDaySchedulesSupportedPerUser + value: 1 - name: "userIndex" - constraints: - minValue: 1 - maxValue: NumberOfTotalUsersSupported + value: 1 - name: "status" value: 0x0 - name: "LocalStartTime" - constraints: - hasValue: true - type: epoch-s + value: 960 - name: "LocalEndTime" + value: 1980 constraints: - hasValue: true - type: epoch-s + minValue: 961 - - label: - "Send Set Year Day Schedule Command to DUT and verify INVALID_COMMAND - response" + - label: "TH send Set Year Day Schedule Command to DUT" PICS: DRLK.S.C0e.Rsp command: "SetYearDaySchedule" arguments: @@ -163,9 +155,7 @@ tests: response: error: INVALID_COMMAND - - label: - "send Get Year Day Schedule Command to DUT and Verify INVALID_FIELD - response" + - label: "TH sends Get Year Day Schedule Command to DUT" PICS: DRLK.S.F04 && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx command: "GetYearDaySchedule" arguments: @@ -189,10 +179,28 @@ tests: constraints: hasValue: false - - label: - "send Get Year Day Schedule Command to DUT and verify FAILURE response" - PICS: - PICS_SKIP_SAMPLE_APP && DRLK.S.F04 && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx + - label: "Create a user with userIndex as 5" + command: "SetUser" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "operationType" + value: 0 + - name: "userIndex" + value: 5 + - name: "userName" + value: "xxx" + - name: "userUniqueId" + value: 6452 + - name: "userStatus" + value: 1 + - name: "userType" + value: 0 + - name: "credentialRule" + value: 0 + + - label: "TH sends Get Year Day Schedule Command to DUT" + PICS: DRLK.S.F04 && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx command: "GetYearDaySchedule" arguments: values: @@ -215,7 +223,7 @@ tests: constraints: hasValue: false - - label: "Clear a year day schedule for the first user" + - label: "TH sends Clear Year Day Schedule to DUT" PICS: DRLK.S.C10.Rsp command: "ClearYearDaySchedule" arguments: @@ -225,9 +233,7 @@ tests: - name: "userIndex" value: 1 - - label: - "send Get Year Day Schedule Command to DUT and verify NOT_FOUND - response" + - label: "TH sends Get Year Day Schedule Command to DUT" PICS: DRLK.S.F04 && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx && DRLK.S.C10.Rsp command: "GetYearDaySchedule" arguments: @@ -251,7 +257,7 @@ tests: constraints: hasValue: false - - label: "Send Set Year Day Schedule Command to DUT " + - label: "TH sends Set Year Day Schedule Command to DUT" PICS: DRLK.S.C0e.Rsp command: "SetYearDaySchedule" arguments: @@ -265,7 +271,7 @@ tests: - name: "LocalEndTime" value: 2100 - - label: "send Get Year Day Schedule Command" + - label: "TH sends Get Year Day Schedule Command to DUT" PICS: DRLK.S.F04 && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx command: "GetYearDaySchedule" arguments: @@ -286,6 +292,20 @@ tests: value: 1080 - name: "LocalEndTime" value: 2100 + constraints: + minValue: 1081 + + - label: "TH sends Clear Year Day Schedule to DUT" + PICS: DRLK.S.F04 && DRLK.S.C10.Rsp + command: "ClearYearDaySchedule" + arguments: + values: + - name: "yearDayIndex" + value: 0 + - name: "userIndex" + value: 0 + response: + error: INVALID_COMMAND - label: "Clear a year day schedule for the first user" PICS: DRLK.S.F04 && DRLK.S.C10.Rsp diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_9.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_9.yaml index 2c1da053d9c7fe..0050fdaa3862d1 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_9.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_9.yaml @@ -92,6 +92,7 @@ tests: minValue: 0 maxValue: 255 + #Issues 20930 - label: "TH sends Set Credential Command to DUT" PICS: DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx command: "SetCredential" @@ -132,9 +133,7 @@ tests: constraints: type: boolean - name: "userIndex" - constraints: - minValue: 1 - maxValue: NumberOfTotalUsersSupported + value: 1 - name: "creatorFabricIndex" value: 1 - name: "lastModifiedFabricIndex" @@ -142,9 +141,7 @@ tests: - name: "nextCredentialIndex" value: null - - label: - "TH sends Set Credential Command to DUT and verify the - INVALID_COMMAND if any of the fields are invalid" + - label: "TH sends Set Credential Command to DUT" PICS: DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx command: "SetCredential" timedInteractionTimeoutMs: 10000 @@ -155,7 +152,7 @@ tests: - name: "credential" value: { CredentialType: 1, CredentialIndex: 2 } - name: "credentialData" - value: "1234" + value: "4321" - name: "userIndex" value: 2 - name: "userStatus" @@ -171,9 +168,7 @@ tests: - name: "nextCredentialIndex" value: 3 - - label: - "TH sends Set Credential Command to DUT and verify response as - DUPLICATE if CredentialData is repeated" + - label: "TH sends Set Credential Command to DUT" PICS: DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx command: "SetCredential" timedInteractionTimeoutMs: 10000 @@ -200,9 +195,8 @@ tests: - name: "nextCredentialIndex" value: 3 - - label: - "TH sends Set Credential Command to DUT and verify response as - OCCUPIED if CredentialIndex is repeated" + #Issue 19990 expected response OCCUPIED, but CHIP Tool Verification Steps shows status: 2 fix script once the issue is fixed. + - label: "TH sends Set Credential Command to DUT" PICS: DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx command: "SetCredential" timedInteractionTimeoutMs: 10000 @@ -229,9 +223,86 @@ tests: - name: "nextCredentialIndex" value: 2 + #Issue 19990 expected response OCCUPIED, but CHIP Tool Verification Steps shows status: 2 fix script once the issue is fixed. + - label: + "TH sends Set Credential Command to DUT and Verify that the DUT sends + Set Credential Response command with response as OCCUPIED if the + CredentialIndex is repeated" + verification: | + ./chip-tool doorlock set-credential 0 '{ "credentialType" : 1, "credentialIndex" : 1 }' 123456 2 0 0 1 1 --timedInteractionTimeoutMs 1000 + + [1656506733.767451][27276:27281] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0023 + [1656506733.767542][27276:27281] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Command 0x0000_0023 + [1656506733.767663][27276:27281] CHIP:TOO: SetCredentialResponse: { + [1656506733.767731][27276:27281] CHIP:TOO: status: 2 + [1656506733.767779][27276:27281] CHIP:TOO: userIndex: null + [1656506733.767826][27276:27281] CHIP:TOO: nextCredentialIndex: 2 + [1656506733.767871][27276:27281] CHIP:TOO: } + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + #Issue 19990 expected response OCCUPIED, but CHIP Tool Verification Steps shows status: 2 fix script once the issue is fixed. + - label: "TH sends Set Credential Command to DUT" + PICS: DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx + command: "SetCredential" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "operationType" + value: 0 + - name: "credential" + value: { CredentialType: 1, CredentialIndex: 3 } + - name: "credentialData" + value: "123456" + - name: "userIndex" + value: 3 + - name: "userStatus" + value: 0 + - name: "userType" + value: 0 + response: + values: + - name: "status" + value: 0x02 + - name: "userIndex" + value: null + - name: "nextCredentialIndex" + value: 4 + + #Issue 19990 expected response OCCUPIED, but CHIP Tool Verification Steps shows status: 2 fix script once the issue is fixed. - label: - "TH sends Set Credential Command to DUT and verify the DUT response as - OCCUPIED if the CredentialIndex is not associated with the UserIndex" + "TH sends Set Credential Command to DUT and Verify that the DUT sends + Set Credential Response command with response as OCCUPIED if the + CredentialIndex is repeated" + verification: | + ./chip-tool doorlock set-credential 0 '{ "credentialType" : 1, "credentialIndex" : 3 }' 123456 3 0 0 1 1 --timedInteractionTimeoutMs 1000 + + [1656506733.767451][27276:27281] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0023 + [1656506733.767542][27276:27281] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Command 0x0000_0023 + [1656506733.767663][27276:27281] CHIP:TOO: SetCredentialResponse: { + [1656506733.767731][27276:27281] CHIP:TOO: status: 2 + [1656506733.767779][27276:27281] CHIP:TOO: userIndex: null + [1656506733.767826][27276:27281] CHIP:TOO: nextCredentialIndex: 4 + [1656506733.767871][27276:27281] CHIP:TOO: } + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + #Issue 19990 expected response OCCUPIED, but CHIP Tool Verification Steps shows status: 2 fix script once the issue is fixed. + - label: "TH sends Set Credential Command to DUT" PICS: DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx command: "SetCredential" timedInteractionTimeoutMs: 10000 @@ -258,6 +329,31 @@ tests: - name: "nextCredentialIndex" value: 4 + #Issue 19990 expected response OCCUPIED, but CHIP Tool Verification Steps shows status: 2 fix script once the issue is fixed. + - label: + "TH sends Set Credential Command to DUT and Verify that the DUT sends + Set Credential Response command with response as OCCUPIED if the + CredentialIndex is repeated" + verification: | + ./chip-tool doorlock set-credential 0 '{ "credentialType" : 1, "credentialIndex" : 3 }' 123456 2 0 0 1 1 --timedInteractionTimeoutMs 1000 + + [1656506733.767451][27276:27281] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0023 + [1656506733.767542][27276:27281] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Command 0x0000_0023 + [1656506733.767663][27276:27281] CHIP:TOO: SetCredentialResponse: { + [1656506733.767731][27276:27281] CHIP:TOO: status: 2 + [1656506733.767779][27276:27281] CHIP:TOO: userIndex: null + [1656506733.767826][27276:27281] CHIP:TOO: nextCredentialIndex: 4 + [1656506733.767871][27276:27281] CHIP:TOO: } + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + - label: "TH sends Clear Credential Command to DUT" PICS: DRLK.S.F08 && DRLK.S.C26.Rsp command: "ClearCredential" @@ -267,9 +363,7 @@ tests: - name: "credential" value: { CredentialType: 1, CredentialIndex: 1 } - - label: - "TH sends Get Credential Status Command and verify that the - CredentialType and CredentialIndex for the provided value is cleared" + - label: "TH sends Get Credential Status Command to DUT" PICS: DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx command: "GetCredentialStatus" arguments: @@ -318,7 +412,7 @@ tests: - name: "operationType" value: 0 - name: "credential" - value: { CredentialType: 1, CredentialIndex: 3 } + value: { CredentialType: 1, CredentialIndex: 1 } - name: "credentialData" value: "123456" - name: "userIndex" @@ -334,7 +428,7 @@ tests: - name: "userIndex" value: null - name: "nextCredentialIndex" - value: 4 + value: 2 - label: "TH sends Clear Credential Command to DUT" PICS: DRLK.S.F08 && DRLK.S.C26.Rsp @@ -345,6 +439,7 @@ tests: - name: "credential" value: { CredentialType: 1, CredentialIndex: 65534 } + #Issue 20991 expected NULL values but got INVALID_COMMAND response fix script once the issue is fixed. - label: "TH sends Get Credential Status Command" PICS: DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx command: "GetCredentialStatus" @@ -355,6 +450,39 @@ tests: response: error: INVALID_COMMAND + #Issue 20991 expected NULL values but got INVALID_COMMAND response fix script once the issue is fixed. + - label: + "TH sends Get Credential command to DUT and Verify that the + CredentialType for the provided value is cleared Verify that the + CredentialIndex is cleared" + verification: | + ./chip-tool doorlock get-credential-status '{ "credentialType" : 1 , "credentialIndex" : 65534 }' 1 1 --timedInteractionTimeoutMs 1000 + Verify on the TH Log: + + [1654698175.243889][5478:5483] CHIP:DMG: + [1654698175.243965][5478:5483] CHIP:DMG: StatusIB = + [1654698175.244054][5478:5483] CHIP:DMG: { + [1654698175.244136][5478:5483] CHIP:DMG: status = 0x85 (INVALID_COMMAND), + [1654698175.244218][5478:5483] CHIP:DMG: }, + [1654698175.244307][5478:5483] CHIP:DMG: + [1654698175.244388][5478:5483] CHIP:DMG: }, + [1654698175.244473][5478:5483] CHIP:DMG: + [1654698175.244541][5478:5483] CHIP:DMG: }, + [1654698175.244621][5478:5483] CHIP:DMG: + [1654698175.244681][5478:5483] CHIP:DMG: ], + [1654698175.244755][5478:5483] CHIP:DMG: + [1654698175.244814][5478:5483] CHIP:DMG: InteractionModelRevision = 1 + [1654698175.244872][5478:5483] CHIP:DMG: } + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + - label: "TH sends Get Credential Status Command" PICS: DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx command: "GetCredentialStatus" @@ -385,3 +513,11 @@ tests: value: { CredentialType: 8, CredentialIndex: 2 } response: error: INVALID_COMMAND + + - label: "Cleanup the created user" + command: "ClearUser" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "userIndex" + value: 1 diff --git a/src/app/tests/suites/certification/Test_TC_LVL_5_1.yaml b/src/app/tests/suites/certification/Test_TC_LVL_5_1.yaml index fbf31b9ab5dfc8..c26c3951abb8c5 100644 --- a/src/app/tests/suites/certification/Test_TC_LVL_5_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LVL_5_1.yaml @@ -57,7 +57,7 @@ tests: constraints: type: uint8 minValue: 0 - maxValue: 255 + maxValue: 254 - label: "Sends MoveToLevelWithOnOff command to DUT" PICS: LVL.S.C04.Rsp && LVL.S.A0002 @@ -97,7 +97,7 @@ tests: constraints: type: uint8 minValue: 0 - maxValue: 255 + maxValue: 254 - label: "Reads current level attribute from DUT" PICS: LVL.S.A0000 && !LVL.S.A0002 && LVL.S.C04.Rsp @@ -108,7 +108,7 @@ tests: constraints: type: uint8 minValue: 0 - maxValue: 255 + maxValue: 254 - label: "Sends step up command to DUT" PICS: LVL.S.C02.Rsp && LVL.S.M.VarRate @@ -126,23 +126,47 @@ tests: - name: "optionOverride" value: 0 - - label: "Wait 4000ms" + - label: "Sends step up command to DUT" + PICS: LVL.S.C02.Rsp && !LVL.S.M.VarRate + command: "Step" + arguments: + values: + - name: "stepMode" + value: 0 + - name: "stepSize" + value: 64 + - name: "transitionTime" + value: 20 + - name: "optionMask" + value: 0 + - name: "optionOverride" + value: 0 + + - label: "Wait 2500ms" cluster: "DelayCommands" command: "WaitForMs" arguments: values: - name: "ms" - value: 4000 + value: 2500 - label: "Reads current level attribute from DUT" PICS: LVL.S.A0000 && LVL.S.C02.Rsp && LVL.S.M.VarRate command: "readAttribute" attribute: "current level" response: + value: 66 + constraints: + type: uint8 + + - label: "Reads current level attribute from DUT" + PICS: LVL.S.A0000 && LVL.S.C02.Rsp && !LVL.S.M.VarRate + command: "readAttribute" + attribute: "current level" + response: + value: 66 constraints: type: uint8 - minValue: 60 - maxValue: 68 - label: "Sends a StepWithOnOff command" PICS: LVL.S.C06.Rsp && LVL.S.M.VarRate @@ -160,13 +184,29 @@ tests: - name: "optionOverride" value: 0 - - label: "Wait 4000ms" + - label: "Sends a StepWithOnOff command" + PICS: LVL.S.C06.Rsp && !LVL.S.M.VarRate + command: "StepWithOnOff" + arguments: + values: + - name: "stepMode" + value: 1 + - name: "stepSize" + value: 64 + - name: "transitionTime" + value: 20 + - name: "optionMask" + value: 0 + - name: "optionOverride" + value: 0 + + - label: "Wait 2500ms" cluster: "DelayCommands" command: "WaitForMs" arguments: values: - name: "ms" - value: 4000 + value: 2500 - label: "Reads current level attribute from DUT" PICS: LVL.S.C06.Rsp && LVL.S.A0000 && LVL.S.M.VarRate @@ -175,6 +215,13 @@ tests: response: value: CurrentlevelValue + - label: "Reads current level attribute from DUT" + PICS: LVL.S.C06.Rsp && LVL.S.A0000 && !LVL.S.M.VarRate + command: "readAttribute" + attribute: "current level" + response: + value: CurrentlevelValue + - label: "Reads current level attribute from DUT" PICS: LVL.S.C06.Rsp && LVL.S.A0000 && !LVL.S.A0002 && LVL.S.M.VarRate command: "readAttribute" @@ -182,6 +229,13 @@ tests: response: value: 2 + - label: "Reads current level attribute from DUT" + PICS: LVL.S.C06.Rsp && LVL.S.A0000 && !LVL.S.A0002 && !LVL.S.M.VarRate + command: "readAttribute" + attribute: "current level" + response: + value: 2 + - label: "Precondition send Off Command" cluster: "On/Off" PICS: OO.S.C00.Rsp diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index ba27dcfb2fd4e0..5cd4070384f40d 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -15002,7 +15002,7 @@ class Test_TC_LVL_4_1Suite : public TestCommand class Test_TC_LVL_5_1Suite : public TestCommand { public: - Test_TC_LVL_5_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_5_1", 18, credsIssuerConfig) + Test_TC_LVL_5_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_LVL_5_1", 23, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -15063,7 +15063,7 @@ class Test_TC_LVL_5_1Suite : public TestCommand VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "uint8")); VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); MinlevelValue = value; } break; @@ -15081,7 +15081,7 @@ class Test_TC_LVL_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentLevel", value, static_cast(MinlevelValue + 1))); VerifyOrReturn(CheckConstraintType("value", "", "uint8")); VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); CurrentlevelValue = value; } break; @@ -15093,7 +15093,7 @@ class Test_TC_LVL_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentLevel", value, 2U)); VerifyOrReturn(CheckConstraintType("value", "", "uint8")); VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 254U)); } break; case 9: @@ -15101,26 +15101,40 @@ class Test_TC_LVL_5_1Suite : public TestCommand break; case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentLevel", value, 66U)); VerifyOrReturn(CheckConstraintType("value", "", "uint8")); - VerifyOrReturn(CheckConstraintMinValue("value", value, 60U)); - VerifyOrReturn(CheckConstraintMaxValue("value", value, 68U)); } break; - case 12: + case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentLevel", value, 66U)); + VerifyOrReturn(CheckConstraintType("value", "", "uint8")); + } break; - case 13: + 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)); shouldContinue = true; break; - case 14: + case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -15128,7 +15142,15 @@ class Test_TC_LVL_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentLevel", value, CurrentlevelValue)); } break; - case 15: + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentLevel", value, CurrentlevelValue)); + } + break; + case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { uint8_t value; @@ -15136,10 +15158,18 @@ class Test_TC_LVL_5_1Suite : public TestCommand VerifyOrReturn(CheckValue("currentLevel", value, 2U)); } break; - case 16: + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentLevel", value, 2U)); + } + break; + case 21: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 17: + case 22: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { bool value; @@ -15250,21 +15280,43 @@ class Test_TC_LVL_5_1Suite : public TestCommand ); } case 10: { - LogStep(10, "Wait 4000ms"); + LogStep(10, "Sends step up command to DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C02.Rsp && !LVL.S.M.VarRate"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::Step::Type value; + value.stepMode = static_cast(0); + value.stepSize = 64U; + value.transitionTime = 20U; + value.optionMask = 0U; + value.optionOverride = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::Step::Id, value, + chip::NullOptional + + ); + } + case 11: { + LogStep(11, "Wait 2500ms"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 4000UL; + value.ms = 2500UL; return WaitForMs(kIdentityAlpha, value); } - case 11: { - LogStep(11, "Reads current level attribute from DUT"); + case 12: { + LogStep(12, "Reads current level attribute from DUT"); VerifyOrDo(!ShouldSkip("LVL.S.A0000 && LVL.S.C02.Rsp && LVL.S.M.VarRate"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, chip::NullOptional); } - case 12: { - LogStep(12, "Sends a StepWithOnOff command"); + case 13: { + LogStep(13, "Reads current level attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.A0000 && LVL.S.C02.Rsp && !LVL.S.M.VarRate"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 14: { + LogStep(14, "Sends a StepWithOnOff command"); VerifyOrDo(!ShouldSkip("LVL.S.C06.Rsp && LVL.S.M.VarRate"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::LevelControl::Commands::StepWithOnOff::Type value; @@ -15276,29 +15328,56 @@ class Test_TC_LVL_5_1Suite : public TestCommand ); } - case 13: { - LogStep(13, "Wait 4000ms"); + case 15: { + LogStep(15, "Sends a StepWithOnOff command"); + VerifyOrDo(!ShouldSkip("LVL.S.C06.Rsp && !LVL.S.M.VarRate"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LevelControl::Commands::StepWithOnOff::Type value; + value.stepMode = static_cast(1); + value.stepSize = 64U; + value.transitionTime = 20U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Commands::StepWithOnOff::Id, value, + chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Wait 2500ms"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 4000UL; + value.ms = 2500UL; return WaitForMs(kIdentityAlpha, value); } - case 14: { - LogStep(14, "Reads current level attribute from DUT"); + case 17: { + LogStep(17, "Reads current level attribute from DUT"); VerifyOrDo(!ShouldSkip("LVL.S.C06.Rsp && LVL.S.A0000 && LVL.S.M.VarRate"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, chip::NullOptional); } - case 15: { - LogStep(15, "Reads current level attribute from DUT"); + case 18: { + LogStep(18, "Reads current level attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C06.Rsp && LVL.S.A0000 && !LVL.S.M.VarRate"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 19: { + LogStep(19, "Reads current level attribute from DUT"); VerifyOrDo(!ShouldSkip("LVL.S.C06.Rsp && LVL.S.A0000 && !LVL.S.A0002 && LVL.S.M.VarRate"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, chip::NullOptional); } - case 16: { - LogStep(16, "Precondition send Off Command"); + case 20: { + LogStep(20, "Reads current level attribute from DUT"); + VerifyOrDo(!ShouldSkip("LVL.S.C06.Rsp && LVL.S.A0000 && !LVL.S.A0002 && !LVL.S.M.VarRate"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), LevelControl::Id, LevelControl::Attributes::CurrentLevel::Id, true, + chip::NullOptional); + } + case 21: { + LogStep(21, "Precondition send Off Command"); VerifyOrDo(!ShouldSkip("OO.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::OnOff::Commands::Off::Type value; @@ -15306,8 +15385,8 @@ class Test_TC_LVL_5_1Suite : public TestCommand ); } - case 17: { - LogStep(17, "Check on/off attribute value is false after off command"); + case 22: { + LogStep(22, "Check on/off attribute value is false after off command"); VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); } @@ -63224,27 +63303,19 @@ class Test_TC_DRLK_2_5Suite : public TestCommand { chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMinValue("value.weekDayIndex", value.weekDayIndex, 1U)); - VerifyOrReturn( - CheckConstraintMaxValue("value.weekDayIndex", value.weekDayIndex, NumberOfWeekDaySchedulesSupportedPerUser)); - VerifyOrReturn(CheckConstraintMinValue("value.userIndex", value.userIndex, 1U)); - VerifyOrReturn(CheckConstraintMaxValue("value.userIndex", value.userIndex, NumberOfTotalUsersSupported)); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); VerifyOrReturn(CheckValue("status", value.status, 0U)); - VerifyOrReturn(CheckConstraintHasValue("value.daysMask", value.daysMask, true)); - VerifyOrReturn(CheckConstraintMinValue("value.daysMask.Value()", value.daysMask.Value(), 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value.daysMask.Value()", value.daysMask.Value(), 6U)); - VerifyOrReturn(CheckConstraintHasValue("value.startHour", value.startHour, true)); - VerifyOrReturn(CheckConstraintMinValue("value.startHour.Value()", value.startHour.Value(), 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value.startHour.Value()", value.startHour.Value(), 23U)); - VerifyOrReturn(CheckConstraintHasValue("value.startMinute", value.startMinute, true)); - VerifyOrReturn(CheckConstraintMinValue("value.startMinute.Value()", value.startMinute.Value(), 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value.startMinute.Value()", value.startMinute.Value(), 59U)); + VerifyOrReturn(CheckValuePresent("daysMask", value.daysMask)); + VerifyOrReturn(CheckValue("daysMask.Value()", value.daysMask.Value(), 2U)); + VerifyOrReturn(CheckValuePresent("startHour", value.startHour)); + VerifyOrReturn(CheckValue("startHour.Value()", value.startHour.Value(), 15U)); + VerifyOrReturn(CheckValuePresent("startMinute", value.startMinute)); + VerifyOrReturn(CheckValue("startMinute.Value()", value.startMinute.Value(), 45U)); VerifyOrReturn(CheckConstraintHasValue("value.endHour", value.endHour, true)); - VerifyOrReturn(CheckConstraintMinValue("value.endHour.Value()", value.endHour.Value(), 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value.endHour.Value()", value.endHour.Value(), 23U)); + VerifyOrReturn(CheckConstraintMinValue("value.endHour.Value()", value.endHour.Value(), 16U)); VerifyOrReturn(CheckConstraintHasValue("value.endMinute", value.endMinute, true)); - VerifyOrReturn(CheckConstraintMinValue("value.endMinute.Value()", value.endMinute.Value(), 0U)); - VerifyOrReturn(CheckConstraintMaxValue("value.endMinute.Value()", value.endMinute.Value(), 59U)); + VerifyOrReturn(CheckConstraintMinValue("value.endMinute.Value()", value.endMinute.Value(), 55U)); } break; case 7: @@ -63273,7 +63344,7 @@ class Test_TC_DRLK_2_5Suite : public TestCommand { chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 2U)); + VerifyOrReturn(CheckValue("weekDayIndex", value.weekDayIndex, 1U)); VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); VerifyOrReturn(CheckValue("status", value.status, 139U)); VerifyOrReturn(CheckConstraintHasValue("value.daysMask", value.daysMask, false)); @@ -63340,19 +63411,19 @@ class Test_TC_DRLK_2_5Suite : public TestCommand ); } case 3: { - LogStep(3, "Get Max number of Week Day schedules for user"); + LogStep(3, "TH reads NumberOfWeekDay SchedulesSupportedPerUser attribute"); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.A0014"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::NumberOfWeekDaySchedulesSupportedPerUser::Id, true, chip::NullOptional); } case 4: { - LogStep(4, "Get number of supported users"); + LogStep(4, "TH reads NumberOfTotalUsers Supported attribute"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::NumberOfTotalUsersSupported::Id, true, chip::NullOptional); } case 5: { - LogStep(5, "Send Set Week Day Schedule Command to DUT"); + LogStep(5, "TH send Set Week Day Schedule Command"); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; @@ -63369,7 +63440,7 @@ class Test_TC_DRLK_2_5Suite : public TestCommand ); } case 6: { - LogStep(6, "send GetWeekDay Schedule Command "); + LogStep(6, "TH send Get Week Day Schedule Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0c.Rsp && DRLK.S.C0c.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -63382,7 +63453,7 @@ class Test_TC_DRLK_2_5Suite : public TestCommand ); } case 7: { - LogStep(7, "Send Set Week Day Schedule Command to DUT and verify INVALID_COMMAND response"); + LogStep(7, "TH send Set Week Day Schedule Command"); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0b.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; @@ -63399,7 +63470,7 @@ class Test_TC_DRLK_2_5Suite : public TestCommand ); } case 8: { - LogStep(8, "send GetWeekDay Schedule Command to DUT and verify INVALID_COMMAND response"); + LogStep(8, "TH send Get Week Day Schedule Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0c.Rsp && DRLK.S.C0c.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -63412,7 +63483,7 @@ class Test_TC_DRLK_2_5Suite : public TestCommand ); } case 9: { - LogStep(9, "Clear all week day schedules for the first user"); + LogStep(9, "TH sends Clear Week Day Schedule Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0d.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearWeekDaySchedule::Type value; @@ -63424,12 +63495,12 @@ class Test_TC_DRLK_2_5Suite : public TestCommand ); } case 10: { - LogStep(10, "send GetWeekDay Schedule Command "); + LogStep(10, "TH sends Get Week Day Schedule Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0c.Rsp && DRLK.S.C0c.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetWeekDaySchedule::Type value; - value.weekDayIndex = 2U; + value.weekDayIndex = 1U; value.userIndex = 1U; return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetWeekDaySchedule::Id, value, chip::NullOptional @@ -63454,7 +63525,7 @@ class Test_TC_DRLK_2_5Suite : public TestCommand class Test_TC_DRLK_2_7Suite : public TestCommand { public: - Test_TC_DRLK_2_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_7", 16, credsIssuerConfig) + Test_TC_DRLK_2_7Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_7", 18, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -63549,16 +63620,17 @@ class Test_TC_DRLK_2_7Suite : public TestCommand { chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintMinValue("value.yearDayIndex", value.yearDayIndex, 1U)); - VerifyOrReturn( - CheckConstraintMaxValue("value.yearDayIndex", value.yearDayIndex, NumberOfYearDaySchedulesSupportedPerUser)); - VerifyOrReturn(CheckConstraintMinValue("value.userIndex", value.userIndex, 1U)); - VerifyOrReturn(CheckConstraintMaxValue("value.userIndex", value.userIndex, NumberOfTotalUsersSupported)); + VerifyOrReturn(CheckValue("yearDayIndex", value.yearDayIndex, 1U)); + VerifyOrReturn(CheckValue("userIndex", value.userIndex, 1U)); VerifyOrReturn(CheckValue("status", value.status, 0U)); - VerifyOrReturn(CheckConstraintHasValue("value.localStartTime", value.localStartTime, true)); - VerifyOrReturn(CheckConstraintType("value.localStartTime.Value()", "", "epoch-s")); - VerifyOrReturn(CheckConstraintHasValue("value.localEndTime", value.localEndTime, true)); - VerifyOrReturn(CheckConstraintType("value.localEndTime.Value()", "", "epoch-s")); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 960UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 1980UL)); + if (value.localEndTime.HasValue()) + { + VerifyOrReturn(CheckConstraintMinValue("value.localEndTime.Value()", value.localEndTime.Value(), 961UL)); + } } break; case 7: @@ -63577,6 +63649,9 @@ class Test_TC_DRLK_2_7Suite : public TestCommand } break; case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; @@ -63588,10 +63663,10 @@ class Test_TC_DRLK_2_7Suite : public TestCommand VerifyOrReturn(CheckConstraintHasValue("value.localEndTime", value.localEndTime, false)); } break; - case 10: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 11: + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; @@ -63603,10 +63678,10 @@ class Test_TC_DRLK_2_7Suite : public TestCommand VerifyOrReturn(CheckConstraintHasValue("value.localEndTime", value.localEndTime, false)); } break; - case 12: + case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 13: + case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType value; @@ -63618,12 +63693,19 @@ class Test_TC_DRLK_2_7Suite : public TestCommand VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 1080UL)); VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 2100UL)); + if (value.localEndTime.HasValue()) + { + VerifyOrReturn(CheckConstraintMinValue("value.localEndTime.Value()", value.localEndTime.Value(), 1081UL)); + } } break; - case 14: + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 15: + case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; default: @@ -63680,19 +63762,19 @@ class Test_TC_DRLK_2_7Suite : public TestCommand ); } case 3: { - LogStep(3, "Get Max number of year Day schedules for user"); + LogStep(3, "TH reads NumberOfYearDay SchedulesSupportedPerUser attribute"); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.A0015"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::NumberOfYearDaySchedulesSupportedPerUser::Id, true, chip::NullOptional); } case 4: { - LogStep(4, "Get number of supported users"); + LogStep(4, "TH reads NumberOfTotalUsers Supported attribute"); VerifyOrDo(!ShouldSkip("DRLK.C.F08 && DRLK.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); 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"); + LogStep(5, "TH sends Set Year Day Schedule Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0e.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; @@ -63706,7 +63788,7 @@ class Test_TC_DRLK_2_7Suite : public TestCommand ); } case 6: { - LogStep(6, "send Get Year Day Schedule Command"); + LogStep(6, "TH sends Get Year Day Schedule Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -63719,7 +63801,7 @@ class Test_TC_DRLK_2_7Suite : public TestCommand ); } case 7: { - LogStep(7, "Send Set Year Day Schedule Command to DUT and verify INVALID_COMMAND response"); + LogStep(7, "TH send Set Year Day Schedule Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.C0e.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; @@ -63733,7 +63815,7 @@ class Test_TC_DRLK_2_7Suite : public TestCommand ); } case 8: { - LogStep(8, "send Get Year Day Schedule Command to DUT and Verify INVALID_FIELD response"); + LogStep(8, "TH sends Get Year Day Schedule Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -63746,8 +63828,29 @@ class Test_TC_DRLK_2_7Suite : public TestCommand ); } case 9: { - LogStep(9, "send Get Year Day Schedule Command to DUT and verify FAILURE response"); - VerifyOrDo(!ShouldSkip("PICS_SKIP_SAMPLE_APP && DRLK.S.F04 && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx"), + LogStep(9, "Create a user with userIndex as 5"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetUser::Type value; + value.operationType = static_cast(0); + value.userIndex = 5U; + value.userName.SetNonNull(); + value.userName.Value() = chip::Span("xxxgarbage: not in length on purpose", 3); + value.userUniqueId.SetNonNull(); + value.userUniqueId.Value() = 6452UL; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + value.credentialRule.SetNonNull(); + value.credentialRule.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 10: { + LogStep(10, "TH sends Get Year Day Schedule Command to DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetYearDaySchedule::Type value; @@ -63758,8 +63861,8 @@ class Test_TC_DRLK_2_7Suite : public TestCommand ); } - case 10: { - LogStep(10, "Clear a year day schedule for the first user"); + case 11: { + LogStep(11, "TH sends Clear Year Day Schedule to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.C10.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearYearDaySchedule::Type value; @@ -63770,8 +63873,8 @@ class Test_TC_DRLK_2_7Suite : public TestCommand ); } - case 11: { - LogStep(11, "send Get Year Day Schedule Command to DUT and verify NOT_FOUND response"); + case 12: { + LogStep(12, "TH sends Get Year Day Schedule Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx && DRLK.S.C10.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -63783,8 +63886,8 @@ class Test_TC_DRLK_2_7Suite : public TestCommand ); } - case 12: { - LogStep(12, "Send Set Year Day Schedule Command to DUT "); + case 13: { + LogStep(13, "TH sends Set Year Day Schedule Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.C0e.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetYearDaySchedule::Type value; @@ -63797,8 +63900,8 @@ class Test_TC_DRLK_2_7Suite : public TestCommand ); } - case 13: { - LogStep(13, "send Get Year Day Schedule Command"); + case 14: { + LogStep(14, "TH sends Get Year Day Schedule Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -63810,8 +63913,20 @@ class Test_TC_DRLK_2_7Suite : public TestCommand ); } - case 14: { - LogStep(14, "Clear a year day schedule for the first user"); + case 15: { + LogStep(15, "TH sends Clear Year Day Schedule to DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C10.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearYearDaySchedule::Type value; + value.yearDayIndex = 0U; + value.userIndex = 0U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearYearDaySchedule::Id, value, + chip::NullOptional + + ); + } + case 16: { + LogStep(16, "Clear a year day schedule for the first user"); VerifyOrDo(!ShouldSkip("DRLK.S.F04 && DRLK.S.C10.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearYearDaySchedule::Type value; @@ -63822,8 +63937,8 @@ class Test_TC_DRLK_2_7Suite : public TestCommand ); } - case 15: { - LogStep(15, "Cleanup the created user"); + case 17: { + LogStep(17, "Cleanup the created user"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; value.userIndex = 1U; @@ -63840,7 +63955,7 @@ class Test_TC_DRLK_2_7Suite : public TestCommand class Test_TC_DRLK_2_9Suite : public TestCommand { public: - Test_TC_DRLK_2_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_9", 18, credsIssuerConfig) + Test_TC_DRLK_2_9Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_9", 24, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -63933,8 +64048,8 @@ class Test_TC_DRLK_2_9Suite : public TestCommand chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value.credentialExists", "", "boolean")); - VerifyOrReturn(CheckConstraintMinValue("value.userIndex", value.userIndex, 1U)); - VerifyOrReturn(CheckConstraintMaxValue("value.userIndex", value.userIndex, NumberOfTotalUsersSupported)); + VerifyOrReturn(CheckValueNonNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValue("userIndex.Value()", value.userIndex.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("creatorFabricIndex", value.creatorFabricIndex)); VerifyOrReturn(CheckValue("creatorFabricIndex.Value()", value.creatorFabricIndex.Value(), 1U)); VerifyOrReturn(CheckValueNonNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); @@ -63976,6 +64091,10 @@ class Test_TC_DRLK_2_9Suite : public TestCommand } break; case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -63986,10 +64105,29 @@ class Test_TC_DRLK_2_9Suite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 4U)); } break; - case 10: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; - case 11: + case 12: + 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, 2U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 4U)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; @@ -64001,10 +64139,10 @@ class Test_TC_DRLK_2_9Suite : public TestCommand VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); } break; - case 12: + case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 13: + case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -64012,16 +64150,20 @@ class Test_TC_DRLK_2_9Suite : public TestCommand VerifyOrReturn(CheckValue("status", value.status, 0U)); VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); - VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 4U)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); } break; - case 14: + case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 15: + case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; - case 16: + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 21: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; @@ -64033,9 +64175,12 @@ class Test_TC_DRLK_2_9Suite : public TestCommand VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); } break; - case 17: + case 22: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -64134,7 +64279,7 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } case 6: { - LogStep(6, "TH sends Set Credential Command to DUT and verify the INVALID_COMMAND if any of the fields are invalid"); + LogStep(6, "TH sends Set Credential Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -64144,7 +64289,7 @@ class Test_TC_DRLK_2_9Suite : public TestCommand value.credential.credentialType = static_cast(1); value.credential.credentialIndex = 2U; - value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("1234garbage: not in length on purpose"), 4); + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("4321garbage: not in length on purpose"), 4); value.userIndex.SetNonNull(); value.userIndex.Value() = 2U; value.userStatus.SetNonNull(); @@ -64157,7 +64302,7 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } case 7: { - LogStep(7, "TH sends Set Credential Command to DUT and verify response as DUPLICATE if CredentialData is repeated"); + LogStep(7, "TH sends Set Credential Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -64180,7 +64325,7 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } case 8: { - LogStep(8, "TH sends Set Credential Command to DUT and verify response as OCCUPIED if CredentialIndex is repeated"); + LogStep(8, "TH sends Set Credential Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -64204,8 +64349,55 @@ class Test_TC_DRLK_2_9Suite : public TestCommand } case 9: { LogStep(9, - "TH sends Set Credential Command to DUT and verify the DUT response as OCCUPIED if the CredentialIndex is not " - "associated with the UserIndex"); + "TH sends Set Credential Command to DUT and Verify that the DUT sends Set Credential Response command with " + "response as OCCUPIED if the CredentialIndex is repeated"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), + 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 10: { + LogStep(10, "TH sends Set Credential Command to DUT"); + VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 3U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 3U; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(0); + value.userType.SetNonNull(); + value.userType.Value() = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 11: { + LogStep(11, + "TH sends Set Credential Command to DUT and Verify that the DUT sends Set Credential Response command with " + "response as OCCUPIED if the CredentialIndex is repeated"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), + 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, "TH sends Set Credential Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -64227,8 +64419,21 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } - case 10: { - LogStep(10, "TH sends Clear Credential Command to DUT"); + case 13: { + LogStep(13, + "TH sends Set Credential Command to DUT and Verify that the DUT sends Set Credential Response command with " + "response as OCCUPIED if the CredentialIndex is repeated"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), + 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 14: { + LogStep(14, "TH sends Clear Credential Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C26.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; @@ -64242,10 +64447,8 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } - case 11: { - LogStep(11, - "TH sends Get Credential Status Command and verify that the CredentialType and CredentialIndex for the " - "provided value is cleared"); + case 15: { + LogStep(15, "TH sends Get Credential Status Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -64259,8 +64462,8 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } - case 12: { - LogStep(12, "TH sends Set User Command to DUT"); + case 16: { + LogStep(16, "TH sends Set User Command to DUT"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetUser::Type value; value.operationType = static_cast(0); @@ -64280,8 +64483,8 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } - case 13: { - LogStep(13, "TH sends Set Credential Command to DUT"); + case 17: { + LogStep(17, "TH sends Set Credential Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -64289,7 +64492,7 @@ class Test_TC_DRLK_2_9Suite : public TestCommand value.operationType = static_cast(0); value.credential.credentialType = static_cast(1); - value.credential.credentialIndex = 3U; + value.credential.credentialIndex = 1U; value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); value.userIndex.SetNonNull(); @@ -64303,8 +64506,8 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } - case 14: { - LogStep(14, "TH sends Clear Credential Command to DUT"); + case 18: { + LogStep(18, "TH sends Clear Credential Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C26.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; @@ -64318,8 +64521,8 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } - case 15: { - LogStep(15, "TH sends Get Credential Status Command"); + case 19: { + LogStep(19, "TH sends Get Credential Status Command"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -64333,8 +64536,21 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } - case 16: { - LogStep(16, "TH sends Get Credential Status Command"); + case 20: { + LogStep(20, + "TH sends Get Credential command to DUT and Verify that the CredentialType for the provided value is cleared " + "Verify that the CredentialIndex is cleared"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx"), + 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, "TH sends Get Credential Status Command"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; @@ -64348,8 +64564,8 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } - case 17: { - LogStep(17, "TH sends Clear Credential Command to DUT"); + case 22: { + LogStep(22, "TH sends Clear Credential Command to DUT"); VerifyOrDo(!ShouldSkip("DRLK.S.F08 && DRLK.S.C26.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; @@ -64363,6 +64579,16 @@ class Test_TC_DRLK_2_9Suite : public TestCommand ); } + case 23: { + LogStep(23, "Cleanup the created user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } } return CHIP_NO_ERROR; } diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 039ba57ecc4bc4..e7f77a97ec950f 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -24414,60 +24414,100 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { err = TestSendsStepUpCommandToDut_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Wait 4000ms\n"); - err = TestWait4000ms_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Sends step up command to DUT\n"); + if (ShouldSkip("LVL.S.C02.Rsp && !LVL.S.M.VarRate")) { + NextTest(); + return; + } + err = TestSendsStepUpCommandToDut_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Reads current level attribute from DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 11 : Wait 2500ms\n"); + err = TestWait2500ms_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Reads current level attribute from DUT\n"); if (ShouldSkip("LVL.S.A0000 && LVL.S.C02.Rsp && LVL.S.M.VarRate")) { NextTest(); return; } - err = TestReadsCurrentLevelAttributeFromDut_11(); + err = TestReadsCurrentLevelAttributeFromDut_12(); break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Sends a StepWithOnOff command\n"); + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : Reads current level attribute from DUT\n"); + if (ShouldSkip("LVL.S.A0000 && LVL.S.C02.Rsp && !LVL.S.M.VarRate")) { + NextTest(); + return; + } + err = TestReadsCurrentLevelAttributeFromDut_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : Sends a StepWithOnOff command\n"); if (ShouldSkip("LVL.S.C06.Rsp && LVL.S.M.VarRate")) { NextTest(); return; } - err = TestSendsAStepWithOnOffCommand_12(); + err = TestSendsAStepWithOnOffCommand_14(); break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Wait 4000ms\n"); - err = TestWait4000ms_13(); + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : Sends a StepWithOnOff command\n"); + if (ShouldSkip("LVL.S.C06.Rsp && !LVL.S.M.VarRate")) { + NextTest(); + return; + } + err = TestSendsAStepWithOnOffCommand_15(); break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Reads current level attribute from DUT\n"); + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Wait 2500ms\n"); + err = TestWait2500ms_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Reads current level attribute from DUT\n"); if (ShouldSkip("LVL.S.C06.Rsp && LVL.S.A0000 && LVL.S.M.VarRate")) { NextTest(); return; } - err = TestReadsCurrentLevelAttributeFromDut_14(); + err = TestReadsCurrentLevelAttributeFromDut_17(); break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Reads current level attribute from DUT\n"); + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Reads current level attribute from DUT\n"); + if (ShouldSkip("LVL.S.C06.Rsp && LVL.S.A0000 && !LVL.S.M.VarRate")) { + NextTest(); + return; + } + err = TestReadsCurrentLevelAttributeFromDut_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Reads current level attribute from DUT\n"); if (ShouldSkip("LVL.S.C06.Rsp && LVL.S.A0000 && !LVL.S.A0002 && LVL.S.M.VarRate")) { NextTest(); return; } - err = TestReadsCurrentLevelAttributeFromDut_15(); + err = TestReadsCurrentLevelAttributeFromDut_19(); break; - case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Precondition send Off Command\n"); + case 20: + ChipLogProgress(chipTool, " ***** Test Step 20 : Reads current level attribute from DUT\n"); + if (ShouldSkip("LVL.S.C06.Rsp && LVL.S.A0000 && !LVL.S.A0002 && !LVL.S.M.VarRate")) { + NextTest(); + return; + } + err = TestReadsCurrentLevelAttributeFromDut_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : Precondition send Off Command\n"); if (ShouldSkip("OO.S.C00.Rsp")) { NextTest(); return; } - err = TestPreconditionSendOffCommand_16(); + err = TestPreconditionSendOffCommand_21(); break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Check on/off attribute value is false after off command\n"); + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : Check on/off attribute value is false after off command\n"); if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_17(); + err = TestCheckOnOffAttributeValueIsFalseAfterOffCommand_22(); break; } @@ -24534,6 +24574,21 @@ class Test_TC_LVL_5_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; } // Go on to the next test. @@ -24547,7 +24602,7 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 18; + const uint16_t mTestCount = 23; chip::Optional mNodeId; chip::Optional mCluster; @@ -24638,7 +24693,7 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintType("minLevel", "", "uint8")); VerifyOrReturn(CheckConstraintMinValue("minLevel", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("minLevel", [value unsignedCharValue], 255U)); + VerifyOrReturn(CheckConstraintMaxValue("minLevel", [value unsignedCharValue], 254U)); { MinlevelValue = value; } @@ -24716,7 +24771,7 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintType("currentLevel", "", "uint8")); VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 255U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 254U)); { CurrentlevelValue = value; } @@ -24747,7 +24802,7 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintType("currentLevel", "", "uint8")); VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 255U)); + VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 254U)); NextTest(); }]; @@ -24781,14 +24836,40 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait4000ms_10() + CHIP_ERROR TestSendsStepUpCommandToDut_10() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRLevelControlClusterStepParams alloc] init]; + params.stepMode = [NSNumber numberWithUnsignedChar:0U]; + params.stepSize = [NSNumber numberWithUnsignedChar:64U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:20U]; + params.optionMask = [NSNumber numberWithUnsignedChar:0U]; + params.optionOverride = [NSNumber numberWithUnsignedChar:0U]; + [cluster stepWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sends step up command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait2500ms_11() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 4000UL; + value.ms = 2500UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_11() + CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_12() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24801,17 +24882,68 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("current level", actualValue, 66U)); + } + VerifyOrReturn(CheckConstraintType("currentLevel", "", "uint8")); - VerifyOrReturn(CheckConstraintMinValue("currentLevel", [value unsignedCharValue], 60U)); - VerifyOrReturn(CheckConstraintMaxValue("currentLevel", [value unsignedCharValue], 68U)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_13() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads current level attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("current level", actualValue, 66U)); + } + VerifyOrReturn(CheckConstraintType("currentLevel", "", "uint8")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendsAStepWithOnOffCommand_12() + CHIP_ERROR TestSendsAStepWithOnOffCommand_14() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRLevelControlClusterStepWithOnOffParams alloc] init]; + params.stepMode = [NSNumber numberWithUnsignedChar:1U]; + params.stepSize = [NSNumber numberWithUnsignedChar:64U]; + params.transitionTime = [NSNumber numberWithUnsignedShort:20U]; + [cluster stepWithOnOffWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Sends a StepWithOnOff command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSendsAStepWithOnOffCommand_15() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24835,14 +24967,38 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWait4000ms_13() + CHIP_ERROR TestWait2500ms_16() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 4000UL; + value.ms = 2500UL; return WaitForMs("alpha", value); } - CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_14() + CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_17() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads current level attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("current level", actualValue, CurrentlevelValue)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_18() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24866,7 +25022,7 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_15() + CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_19() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device @@ -24890,7 +25046,31 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestPreconditionSendOffCommand_16() + CHIP_ERROR TestReadsCurrentLevelAttributeFromDut_20() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterLevelControl * cluster = [[MTRBaseClusterLevelControl alloc] initWithDevice:device + endpoint:1 + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentLevelWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Reads current level attribute from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("current level", actualValue, 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestPreconditionSendOffCommand_21() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -24907,7 +25087,7 @@ class Test_TC_LVL_5_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_17() + CHIP_ERROR TestCheckOnOffAttributeValueIsFalseAfterOffCommand_22() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterOnOff * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -110704,70 +110884,68 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { err = TestReadTheUserBackAndVerifyItsFields_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Get Max number of Week Day schedules for user\n"); + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads NumberOfWeekDay SchedulesSupportedPerUser attribute\n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.A0014")) { NextTest(); return; } - err = TestGetMaxNumberOfWeekDaySchedulesForUser_3(); + err = TestThReadsNumberOfWeekDaySchedulesSupportedPerUserAttribute_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Get number of supported users\n"); + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads NumberOfTotalUsers Supported attribute\n"); if (ShouldSkip("DRLK.S.F08 && DRLK.S.A0011")) { NextTest(); return; } - err = TestGetNumberOfSupportedUsers_4(); + err = TestThReadsNumberOfTotalUsersSupportedAttribute_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Send Set Week Day Schedule Command to DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 5 : TH send Set Week Day Schedule Command\n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0b.Rsp")) { NextTest(); return; } - err = TestSendSetWeekDayScheduleCommandToDut_5(); + err = TestThSendSetWeekDayScheduleCommand_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : send GetWeekDay Schedule Command \n"); + ChipLogProgress(chipTool, " ***** Test Step 6 : TH send Get Week Day Schedule Command to DUT\n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0c.Rsp && DRLK.S.C0c.Tx")) { NextTest(); return; } - err = TestSendGetWeekDayScheduleCommand_6(); + err = TestThSendGetWeekDayScheduleCommandToDut_6(); break; case 7: - ChipLogProgress( - chipTool, " ***** Test Step 7 : Send Set Week Day Schedule Command to DUT and verify INVALID_COMMAND response\n"); + ChipLogProgress(chipTool, " ***** Test Step 7 : TH send Set Week Day Schedule Command\n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0b.Rsp")) { NextTest(); return; } - err = TestSendSetWeekDayScheduleCommandToDutAndVerifyInvalidCommandResponse_7(); + err = TestThSendSetWeekDayScheduleCommand_7(); break; case 8: - ChipLogProgress( - chipTool, " ***** Test Step 8 : send GetWeekDay Schedule Command to DUT and verify INVALID_COMMAND response\n"); + ChipLogProgress(chipTool, " ***** Test Step 8 : TH send Get Week Day Schedule Command to DUT\n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0c.Rsp && DRLK.S.C0c.Tx")) { NextTest(); return; } - err = TestSendGetWeekDayScheduleCommandToDutAndVerifyInvalidCommandResponse_8(); + err = TestThSendGetWeekDayScheduleCommandToDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Clear all week day schedules for the first user\n"); + ChipLogProgress(chipTool, " ***** Test Step 9 : TH sends Clear Week Day Schedule Command to DUT\n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0d.Rsp")) { NextTest(); return; } - err = TestClearAllWeekDaySchedulesForTheFirstUser_9(); + err = TestThSendsClearWeekDayScheduleCommandToDut_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : send GetWeekDay Schedule Command \n"); + ChipLogProgress(chipTool, " ***** Test Step 10 : TH sends Get Week Day Schedule Command to DUT\n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0c.Rsp && DRLK.S.C0c.Tx")) { NextTest(); return; } - err = TestSendGetWeekDayScheduleCommand_10(); + err = TestThSendsGetWeekDayScheduleCommandToDut_10(); break; case 11: ChipLogProgress(chipTool, " ***** Test Step 11 : Cleanup the created user\n"); @@ -110951,7 +111129,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { } NSNumber * _Nonnull NumberOfWeekDaySchedulesSupportedPerUser; - CHIP_ERROR TestGetMaxNumberOfWeekDaySchedulesForUser_3() + CHIP_ERROR TestThReadsNumberOfWeekDaySchedulesSupportedPerUserAttribute_3() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -110959,7 +111137,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { [cluster readAttributeNumberOfWeekDaySchedulesSupportedPerUserWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Get Max number of Week Day schedules for user Error: %@", err); + NSLog(@"TH reads NumberOfWeekDay SchedulesSupportedPerUser attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -110978,7 +111156,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { } NSNumber * _Nonnull NumberOfTotalUsersSupported; - CHIP_ERROR TestGetNumberOfSupportedUsers_4() + CHIP_ERROR TestThReadsNumberOfTotalUsersSupportedAttribute_4() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -110986,7 +111164,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { [cluster readAttributeNumberOfTotalUsersSupportedWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Get number of supported users Error: %@", err); + NSLog(@"TH reads NumberOfTotalUsers Supported attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -111002,7 +111180,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendSetWeekDayScheduleCommandToDut_5() + CHIP_ERROR TestThSendSetWeekDayScheduleCommand_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -111018,7 +111196,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { params.endMinute = [NSNumber numberWithUnsignedChar:55U]; [cluster setWeekDayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Set Week Day Schedule Command to DUT Error: %@", err); + NSLog(@"TH send Set Week Day Schedule Command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -111028,7 +111206,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendGetWeekDayScheduleCommand_6() + CHIP_ERROR TestThSendGetWeekDayScheduleCommandToDut_6() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -111041,66 +111219,51 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { getWeekDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"send GetWeekDay Schedule Command Error: %@", err); + NSLog(@"TH send Get Week Day Schedule Command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn( - CheckConstraintMinValue("weekDayIndex", [values.weekDayIndex unsignedCharValue], 1U)); - VerifyOrReturn(CheckConstraintMaxValue( - "weekDayIndex", [values.weekDayIndex unsignedCharValue], NumberOfWeekDaySchedulesSupportedPerUser)); + { + id actualValue = values.weekDayIndex; + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1U)); + } - VerifyOrReturn( - CheckConstraintMinValue("userIndex", [values.userIndex unsignedShortValue], 1U)); - VerifyOrReturn(CheckConstraintMaxValue( - "userIndex", [values.userIndex unsignedShortValue], NumberOfTotalUsersSupported)); + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } { id actualValue = values.status; VerifyOrReturn(CheckValue("status", actualValue, 0U)); } - VerifyOrReturn(CheckConstraintHasValue("daysMask", values.daysMask, true)); - if (values.daysMask != nil) { - - VerifyOrReturn( - CheckConstraintMinValue("daysMask", [values.daysMask unsignedCharValue], 0U)); - VerifyOrReturn( - CheckConstraintMaxValue("daysMask", [values.daysMask unsignedCharValue], 6U)); + { + id actualValue = values.daysMask; + VerifyOrReturn(CheckValue("daysMask", actualValue, 2U)); } - VerifyOrReturn(CheckConstraintHasValue("startHour", values.startHour, true)); - if (values.startHour != nil) { - - VerifyOrReturn( - CheckConstraintMinValue("startHour", [values.startHour unsignedCharValue], 0U)); - VerifyOrReturn( - CheckConstraintMaxValue("startHour", [values.startHour unsignedCharValue], 23U)); + { + id actualValue = values.startHour; + VerifyOrReturn(CheckValue("startHour", actualValue, 15U)); } - VerifyOrReturn(CheckConstraintHasValue("startMinute", values.startMinute, true)); - if (values.startMinute != nil) { - - VerifyOrReturn( - CheckConstraintMinValue("startMinute", [values.startMinute unsignedCharValue], 0U)); - VerifyOrReturn( - CheckConstraintMaxValue("startMinute", [values.startMinute unsignedCharValue], 59U)); + { + id actualValue = values.startMinute; + VerifyOrReturn(CheckValue("startMinute", actualValue, 45U)); } VerifyOrReturn(CheckConstraintHasValue("endHour", values.endHour, true)); if (values.endHour != nil) { - VerifyOrReturn(CheckConstraintMinValue("endHour", [values.endHour unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("endHour", [values.endHour unsignedCharValue], 23U)); + VerifyOrReturn(CheckConstraintMinValue("endHour", [values.endHour unsignedCharValue], 16U)); } VerifyOrReturn(CheckConstraintHasValue("endMinute", values.endMinute, true)); if (values.endMinute != nil) { VerifyOrReturn( - CheckConstraintMinValue("endMinute", [values.endMinute unsignedCharValue], 0U)); - VerifyOrReturn( - CheckConstraintMaxValue("endMinute", [values.endMinute unsignedCharValue], 59U)); + CheckConstraintMinValue("endMinute", [values.endMinute unsignedCharValue], 55U)); } NextTest(); @@ -111109,7 +111272,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendSetWeekDayScheduleCommandToDutAndVerifyInvalidCommandResponse_7() + CHIP_ERROR TestThSendSetWeekDayScheduleCommand_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -111126,7 +111289,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { [cluster setWeekDayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Set Week Day Schedule Command to DUT and verify INVALID_COMMAND response Error: %@", err); + NSLog(@"TH send Set Week Day Schedule Command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) @@ -111138,7 +111301,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendGetWeekDayScheduleCommandToDutAndVerifyInvalidCommandResponse_8() + CHIP_ERROR TestThSendGetWeekDayScheduleCommandToDut_8() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -111147,56 +111310,55 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; params.weekDayIndex = [NSNumber numberWithUnsignedChar:0U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster - getWeekDayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"send GetWeekDay Schedule Command to DUT and verify INVALID_COMMAND response Error: %@", err); + [cluster getWeekDayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH send Get Week Day Schedule Command to DUT 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, 0U)); - } + { + id actualValue = values.weekDayIndex; + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 0U)); + } - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 133U)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 133U)); + } - VerifyOrReturn(CheckConstraintHasValue("daysMask", values.daysMask, false)); - if (values.daysMask != nil) { - } + VerifyOrReturn(CheckConstraintHasValue("daysMask", values.daysMask, false)); + if (values.daysMask != nil) { + } - VerifyOrReturn(CheckConstraintHasValue("startHour", values.startHour, false)); - if (values.startHour != nil) { - } + VerifyOrReturn(CheckConstraintHasValue("startHour", values.startHour, false)); + if (values.startHour != nil) { + } - VerifyOrReturn(CheckConstraintHasValue("startMinute", values.startMinute, false)); - if (values.startMinute != nil) { - } + VerifyOrReturn(CheckConstraintHasValue("startMinute", values.startMinute, false)); + if (values.startMinute != nil) { + } - VerifyOrReturn(CheckConstraintHasValue("endHour", values.endHour, false)); - if (values.endHour != nil) { - } + VerifyOrReturn(CheckConstraintHasValue("endHour", values.endHour, false)); + if (values.endHour != nil) { + } - VerifyOrReturn(CheckConstraintHasValue("endMinute", values.endMinute, false)); - if (values.endMinute != nil) { - } + VerifyOrReturn(CheckConstraintHasValue("endMinute", values.endMinute, false)); + if (values.endMinute != nil) { + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestClearAllWeekDaySchedulesForTheFirstUser_9() + CHIP_ERROR TestThSendsClearWeekDayScheduleCommandToDut_9() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -111207,7 +111369,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster clearWeekDayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear all week day schedules for the first user Error: %@", err); + NSLog(@"TH sends Clear Week Day Schedule Command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -111217,25 +111379,25 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendGetWeekDayScheduleCommand_10() + CHIP_ERROR TestThSendsGetWeekDayScheduleCommandToDut_10() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:2U]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster getWeekDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"send GetWeekDay Schedule Command Error: %@", err); + NSLog(@"TH sends Get Week Day Schedule Command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = values.weekDayIndex; - VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 2U)); + VerifyOrReturn(CheckValue("weekDayIndex", actualValue, 1U)); } { @@ -111346,108 +111508,116 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { err = TestReadTheUserBackAndVerifyItsFields_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Get Max number of year Day schedules for user\n"); + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads NumberOfYearDay SchedulesSupportedPerUser attribute\n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.A0015")) { NextTest(); return; } - err = TestGetMaxNumberOfYearDaySchedulesForUser_3(); + err = TestThReadsNumberOfYearDaySchedulesSupportedPerUserAttribute_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Get number of supported users\n"); + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads NumberOfTotalUsers Supported attribute\n"); if (ShouldSkip("DRLK.C.F08 && DRLK.S.A0011")) { NextTest(); return; } - err = TestGetNumberOfSupportedUsers_4(); + err = TestThReadsNumberOfTotalUsersSupportedAttribute_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Send Set Year Day Schedule Command to DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 5 : TH sends Set Year Day Schedule Command to DUT\n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0e.Rsp")) { NextTest(); return; } - err = TestSendSetYearDayScheduleCommandToDut_5(); + err = TestThSendsSetYearDayScheduleCommandToDut_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : send Get Year Day Schedule Command\n"); + ChipLogProgress(chipTool, " ***** Test Step 6 : TH sends Get Year Day Schedule Command to DUT\n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx")) { NextTest(); return; } - err = TestSendGetYearDayScheduleCommand_6(); + err = TestThSendsGetYearDayScheduleCommandToDut_6(); break; case 7: - ChipLogProgress( - chipTool, " ***** Test Step 7 : Send Set Year Day Schedule Command to DUT and verify INVALID_COMMAND response\n"); + ChipLogProgress(chipTool, " ***** Test Step 7 : TH send Set Year Day Schedule Command to DUT\n"); if (ShouldSkip("DRLK.S.C0e.Rsp")) { NextTest(); return; } - err = TestSendSetYearDayScheduleCommandToDutAndVerifyInvalidCommandResponse_7(); + err = TestThSendSetYearDayScheduleCommandToDut_7(); break; case 8: - ChipLogProgress( - chipTool, " ***** Test Step 8 : send Get Year Day Schedule Command to DUT and Verify INVALID_FIELD response\n"); + ChipLogProgress(chipTool, " ***** Test Step 8 : TH sends Get Year Day Schedule Command to DUT\n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx")) { NextTest(); return; } - err = TestSendGetYearDayScheduleCommandToDutAndVerifyInvalidFieldResponse_8(); + err = TestThSendsGetYearDayScheduleCommandToDut_8(); break; case 9: - ChipLogProgress( - chipTool, " ***** Test Step 9 : send Get Year Day Schedule Command to DUT and verify FAILURE response\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && DRLK.S.F04 && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx")) { + ChipLogProgress(chipTool, " ***** Test Step 9 : Create a user with userIndex as 5\n"); + err = TestCreateAUserWithUserIndexAs5_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH sends Get Year Day Schedule Command to DUT\n"); + if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx")) { NextTest(); return; } - err = TestSendGetYearDayScheduleCommandToDutAndVerifyFailureResponse_9(); + err = TestThSendsGetYearDayScheduleCommandToDut_10(); break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Clear a year day schedule for the first user\n"); + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : TH sends Clear Year Day Schedule to DUT\n"); if (ShouldSkip("DRLK.S.C10.Rsp")) { NextTest(); return; } - err = TestClearAYearDayScheduleForTheFirstUser_10(); + err = TestThSendsClearYearDayScheduleToDut_11(); break; - case 11: - ChipLogProgress( - chipTool, " ***** Test Step 11 : send Get Year Day Schedule Command to DUT and verify NOT_FOUND response\n"); + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : TH sends Get Year Day Schedule Command to DUT\n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx && DRLK.S.C10.Rsp")) { NextTest(); return; } - err = TestSendGetYearDayScheduleCommandToDutAndVerifyNotFoundResponse_11(); + err = TestThSendsGetYearDayScheduleCommandToDut_12(); break; - case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Send Set Year Day Schedule Command to DUT \n"); + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : TH sends Set Year Day Schedule Command to DUT\n"); if (ShouldSkip("DRLK.S.C0e.Rsp")) { NextTest(); return; } - err = TestSendSetYearDayScheduleCommandToDut_12(); + err = TestThSendsSetYearDayScheduleCommandToDut_13(); break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : send Get Year Day Schedule Command\n"); + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : TH sends Get Year Day Schedule Command to DUT\n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx")) { NextTest(); return; } - err = TestSendGetYearDayScheduleCommand_13(); + err = TestThSendsGetYearDayScheduleCommandToDut_14(); break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Clear a year day schedule for the first user\n"); + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : TH sends Clear Year Day Schedule to DUT\n"); if (ShouldSkip("DRLK.S.F04 && DRLK.S.C10.Rsp")) { NextTest(); return; } - err = TestClearAYearDayScheduleForTheFirstUser_14(); + err = TestThSendsClearYearDayScheduleToDut_15(); break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Cleanup the created user\n"); - err = TestCleanupTheCreatedUser_15(); + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : Clear a year day schedule for the first user\n"); + if (ShouldSkip("DRLK.S.F04 && DRLK.S.C10.Rsp")) { + NextTest(); + return; + } + err = TestClearAYearDayScheduleForTheFirstUser_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : Cleanup the created user\n"); + err = TestCleanupTheCreatedUser_17(); break; } @@ -111506,6 +111676,12 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + 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; } @@ -111521,7 +111697,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 16; + const uint16_t mTestCount = 18; chip::Optional mNodeId; chip::Optional mCluster; @@ -111639,7 +111815,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { } NSNumber * _Nonnull NumberOfYearDaySchedulesSupportedPerUser; - CHIP_ERROR TestGetMaxNumberOfYearDaySchedulesForUser_3() + CHIP_ERROR TestThReadsNumberOfYearDaySchedulesSupportedPerUserAttribute_3() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -111647,7 +111823,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { [cluster readAttributeNumberOfYearDaySchedulesSupportedPerUserWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Get Max number of year Day schedules for user Error: %@", err); + NSLog(@"TH reads NumberOfYearDay SchedulesSupportedPerUser attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -111666,7 +111842,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { } NSNumber * _Nonnull NumberOfTotalUsersSupported; - CHIP_ERROR TestGetNumberOfSupportedUsers_4() + CHIP_ERROR TestThReadsNumberOfTotalUsersSupportedAttribute_4() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -111674,7 +111850,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { [cluster readAttributeNumberOfTotalUsersSupportedWithCompletionHandler:^( NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Get number of supported users Error: %@", err); + NSLog(@"TH reads NumberOfTotalUsers Supported attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -111690,7 +111866,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendSetYearDayScheduleCommandToDut_5() + CHIP_ERROR TestThSendsSetYearDayScheduleCommandToDut_5() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -111703,7 +111879,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { params.localEndTime = [NSNumber numberWithUnsignedInt:1980UL]; [cluster setYearDayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Set Year Day Schedule Command to DUT Error: %@", err); + NSLog(@"TH sends Set Year Day Schedule Command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -111713,7 +111889,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendGetYearDayScheduleCommand_6() + CHIP_ERROR TestThSendsGetYearDayScheduleCommandToDut_6() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -111725,35 +111901,39 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { [cluster getYearDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"send Get Year Day Schedule Command Error: %@", err); + NSLog(@"TH sends Get Year Day Schedule Command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn( - CheckConstraintMinValue("yearDayIndex", [values.yearDayIndex unsignedCharValue], 1U)); - VerifyOrReturn(CheckConstraintMaxValue("yearDayIndex", - [values.yearDayIndex unsignedCharValue], NumberOfYearDaySchedulesSupportedPerUser)); + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); + } - VerifyOrReturn( - CheckConstraintMinValue("userIndex", [values.userIndex unsignedShortValue], 1U)); - VerifyOrReturn(CheckConstraintMaxValue( - "userIndex", [values.userIndex unsignedShortValue], NumberOfTotalUsersSupported)); + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } { id actualValue = values.status; VerifyOrReturn(CheckValue("status", actualValue, 0U)); } - VerifyOrReturn(CheckConstraintHasValue("localStartTime", values.localStartTime, true)); - if (values.localStartTime != nil) { + { + id actualValue = values.localStartTime; + VerifyOrReturn(CheckValue("localStartTime", actualValue, 960UL)); + } - VerifyOrReturn(CheckConstraintType("localStartTime", "", "epoch-s")); + { + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("localEndTime", actualValue, 1980UL)); } - VerifyOrReturn(CheckConstraintHasValue("localEndTime", values.localEndTime, true)); if (values.localEndTime != nil) { - VerifyOrReturn(CheckConstraintType("localEndTime", "", "epoch-s")); + VerifyOrReturn(CheckConstraintMinValue( + "localEndTime", [values.localEndTime unsignedIntValue], 961UL)); } NextTest(); @@ -111762,7 +111942,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendSetYearDayScheduleCommandToDutAndVerifyInvalidCommandResponse_7() + CHIP_ERROR TestThSendSetYearDayScheduleCommandToDut_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -111776,7 +111956,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { [cluster setYearDayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Set Year Day Schedule Command to DUT and verify INVALID_COMMAND response Error: %@", err); + NSLog(@"TH send Set Year Day Schedule Command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) @@ -111788,7 +111968,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendGetYearDayScheduleCommandToDutAndVerifyInvalidFieldResponse_8() + CHIP_ERROR TestThSendsGetYearDayScheduleCommandToDut_8() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -111797,44 +111977,69 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; params.yearDayIndex = [NSNumber numberWithUnsignedChar:2U]; params.userIndex = [NSNumber numberWithUnsignedShort:21U]; - [cluster - getYearDayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"send Get Year Day Schedule Command to DUT and Verify INVALID_FIELD response Error: %@", err); + [cluster getYearDayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends Get Year Day Schedule Command to DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 2U)); - } + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 2U)); + } - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 21U)); - } + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 21U)); + } - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 133U)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 133U)); + } - VerifyOrReturn(CheckConstraintHasValue("localStartTime", values.localStartTime, false)); - if (values.localStartTime != nil) { - } + VerifyOrReturn(CheckConstraintHasValue("localStartTime", values.localStartTime, false)); + if (values.localStartTime != nil) { + } - VerifyOrReturn(CheckConstraintHasValue("localEndTime", values.localEndTime, false)); - if (values.localEndTime != nil) { - } + VerifyOrReturn(CheckConstraintHasValue("localEndTime", values.localEndTime, false)); + if (values.localEndTime != nil) { + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSendGetYearDayScheduleCommandToDutAndVerifyFailureResponse_9() + CHIP_ERROR TestCreateAUserWithUserIndexAs5_9() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetUserParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0U]; + params.userIndex = [NSNumber numberWithUnsignedShort:5U]; + params.userName = @"xxx"; + params.userUniqueId = [NSNumber numberWithUnsignedInt:6452UL]; + params.userStatus = [NSNumber numberWithUnsignedChar:1U]; + params.userType = [NSNumber numberWithUnsignedChar:0U]; + params.credentialRule = [NSNumber numberWithUnsignedChar:0U]; + [cluster setUserWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Create a user with userIndex as 5 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsGetYearDayScheduleCommandToDut_10() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -111846,7 +112051,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { [cluster getYearDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"send Get Year Day Schedule Command to DUT and verify FAILURE response Error: %@", err); + NSLog(@"TH sends Get Year Day Schedule Command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -111879,7 +112084,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearAYearDayScheduleForTheFirstUser_10() + CHIP_ERROR TestThSendsClearYearDayScheduleToDut_11() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -111890,7 +112095,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster clearYearDayScheduleWithParams:params completionHandler:^(NSError * _Nullable err) { - NSLog(@"Clear a year day schedule for the first user Error: %@", err); + NSLog(@"TH sends Clear Year Day Schedule to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -111900,7 +112105,75 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendGetYearDayScheduleCommandToDutAndVerifyNotFoundResponse_11() + CHIP_ERROR TestThSendsGetYearDayScheduleCommandToDut_12() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster getYearDayScheduleWithParams:params + completionHandler:^( + MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends Get Year Day Schedule Command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139U)); + } + + VerifyOrReturn(CheckConstraintHasValue("localStartTime", values.localStartTime, false)); + if (values.localStartTime != nil) { + } + + VerifyOrReturn(CheckConstraintHasValue("localEndTime", values.localEndTime, false)); + if (values.localEndTime != nil) { + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsSetYearDayScheduleCommandToDut_13() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:1080UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:2100UL]; + [cluster setYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Set Year Day Schedule Command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsGetYearDayScheduleCommandToDut_14() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -111912,7 +112185,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { [cluster getYearDayScheduleWithParams:params completionHandler:^( MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"send Get Year Day Schedule Command to DUT and verify NOT_FOUND response Error: %@", err); + NSLog(@"TH sends Get Year Day Schedule Command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -111928,39 +112201,24 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { { id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 139U)); + VerifyOrReturn(CheckValue("status", actualValue, 0U)); } - VerifyOrReturn(CheckConstraintHasValue("localStartTime", values.localStartTime, false)); - if (values.localStartTime != nil) { + { + id actualValue = values.localStartTime; + VerifyOrReturn(CheckValue("localStartTime", actualValue, 1080UL)); } - VerifyOrReturn(CheckConstraintHasValue("localEndTime", values.localEndTime, false)); - if (values.localEndTime != nil) { + { + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("localEndTime", actualValue, 2100UL)); } - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestSendSetYearDayScheduleCommandToDut_12() - { - MTRBaseDevice * device = GetDevice("alpha"); - MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - params.localStartTime = [NSNumber numberWithUnsignedInt:1080UL]; - params.localEndTime = [NSNumber numberWithUnsignedInt:2100UL]; - [cluster setYearDayScheduleWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Send Set Year Day Schedule Command to DUT Error: %@", err); + if (values.localEndTime != nil) { - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintMinValue( + "localEndTime", [values.localEndTime unsignedIntValue], 1081UL)); + } NextTest(); }]; @@ -111968,54 +112226,31 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSendGetYearDayScheduleCommand_13() + CHIP_ERROR TestThSendsClearYearDayScheduleToDut_15() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:1U]; - [cluster getYearDayScheduleWithParams:params - completionHandler:^( - MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"send Get Year Day Schedule Command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.yearDayIndex; - VerifyOrReturn(CheckValue("yearDayIndex", actualValue, 1U)); - } - - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); - } - - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("status", actualValue, 0U)); - } - - { - id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("localStartTime", actualValue, 1080UL)); - } - - { - id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("localEndTime", actualValue, 2100UL)); - } + __auto_type * params = [[MTRDoorLockClusterClearYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:0U]; + params.userIndex = [NSNumber numberWithUnsignedShort:0U]; + [cluster clearYearDayScheduleWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"TH sends Clear Year Day Schedule to DUT Error: %@", err); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestClearAYearDayScheduleForTheFirstUser_14() + CHIP_ERROR TestClearAYearDayScheduleForTheFirstUser_16() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -112036,7 +112271,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCleanupTheCreatedUser_15() + CHIP_ERROR TestCleanupTheCreatedUser_17() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -112133,74 +112368,74 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { err = TestThSendsGetCredentialStatusCommand_5(); break; case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : TH sends Set Credential Command to DUT and verify the INVALID_COMMAND if any of the fields " - "are invalid\n"); + ChipLogProgress(chipTool, " ***** Test Step 6 : TH sends Set Credential Command to DUT\n"); if (ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx")) { NextTest(); return; } - err = TestThSendsSetCredentialCommandToDutAndVerifyTheInvalidCommandIfAnyOfTheFieldsAreInvalid_6(); + err = TestThSendsSetCredentialCommandToDut_6(); break; case 7: - ChipLogProgress(chipTool, - " ***** Test Step 7 : TH sends Set Credential Command to DUT and verify response as DUPLICATE if CredentialData is " - "repeated\n"); + ChipLogProgress(chipTool, " ***** Test Step 7 : TH sends Set Credential Command to DUT\n"); if (ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx")) { NextTest(); return; } - err = TestThSendsSetCredentialCommandToDutAndVerifyResponseAsDuplicateIfCredentialDataIsRepeated_7(); + err = TestThSendsSetCredentialCommandToDut_7(); break; case 8: - ChipLogProgress(chipTool, - " ***** Test Step 8 : TH sends Set Credential Command to DUT and verify response as OCCUPIED if CredentialIndex is " - "repeated\n"); + ChipLogProgress(chipTool, " ***** Test Step 8 : TH sends Set Credential Command to DUT\n"); if (ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx")) { NextTest(); return; } - err = TestThSendsSetCredentialCommandToDutAndVerifyResponseAsOccupiedIfCredentialIndexIsRepeated_8(); + err = TestThSendsSetCredentialCommandToDut_8(); break; case 9: ChipLogProgress(chipTool, - " ***** Test Step 9 : TH sends Set Credential Command to DUT and verify the DUT response as OCCUPIED if the " - "CredentialIndex is not associated with the UserIndex\n"); - if (ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx")) { + " ***** Test Step 9 : TH sends Set Credential Command to DUT and Verify that the DUT sends Set Credential Response " + "command with response as OCCUPIED if the CredentialIndex is repeated\n"); + if (ShouldSkip("PICS_USER_PROMPT && DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx")) { NextTest(); return; } - err = TestThSendsSetCredentialCommandToDutAndVerifyTheDutResponseAsOccupiedIfTheCredentialIndexIsNotAssociatedWithTheUserIndex_9(); + err = TestThSendsSetCredentialCommandToDutAndVerifyThatTheDutSendsSetCredentialResponseCommandWithResponseAsOccupiedIfTheCredentialIndexIsRepeated_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : TH sends Clear Credential Command to DUT\n"); - if (ShouldSkip("DRLK.S.F08 && DRLK.S.C26.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 10 : TH sends Set Credential Command to DUT\n"); + if (ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx")) { NextTest(); return; } - err = TestThSendsClearCredentialCommandToDut_10(); + err = TestThSendsSetCredentialCommandToDut_10(); break; case 11: ChipLogProgress(chipTool, - " ***** Test Step 11 : TH sends Get Credential Status Command and verify that the CredentialType and " - "CredentialIndex for the provided value is cleared\n"); - if (ShouldSkip("DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx")) { + " ***** Test Step 11 : TH sends Set Credential Command to DUT and Verify that the DUT sends Set Credential " + "Response command with response as OCCUPIED if the CredentialIndex is repeated\n"); + if (ShouldSkip("PICS_USER_PROMPT && DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx")) { NextTest(); return; } - err = TestThSendsGetCredentialStatusCommandAndVerifyThatTheCredentialTypeAndCredentialIndexForTheProvidedValueIsCleared_11(); + err = TestThSendsSetCredentialCommandToDutAndVerifyThatTheDutSendsSetCredentialResponseCommandWithResponseAsOccupiedIfTheCredentialIndexIsRepeated_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : TH sends Set User Command to DUT\n"); - err = TestThSendsSetUserCommandToDut_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : TH sends Set Credential Command to DUT\n"); + if (ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx")) { + NextTest(); + return; + } + err = TestThSendsSetCredentialCommandToDut_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : TH sends Set Credential Command to DUT\n"); - if (ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx")) { + ChipLogProgress(chipTool, + " ***** Test Step 13 : TH sends Set Credential Command to DUT and Verify that the DUT sends Set Credential " + "Response command with response as OCCUPIED if the CredentialIndex is repeated\n"); + if (ShouldSkip("PICS_USER_PROMPT && DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx")) { NextTest(); return; } - err = TestThSendsSetCredentialCommandToDut_13(); + err = TestThSendsSetCredentialCommandToDutAndVerifyThatTheDutSendsSetCredentialResponseCommandWithResponseAsOccupiedIfTheCredentialIndexIsRepeated_13(); break; case 14: ChipLogProgress(chipTool, " ***** Test Step 14 : TH sends Clear Credential Command to DUT\n"); @@ -112211,28 +112446,70 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { err = TestThSendsClearCredentialCommandToDut_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : TH sends Get Credential Status Command\n"); + ChipLogProgress(chipTool, " ***** Test Step 15 : TH sends Get Credential Status Command to DUT\n"); if (ShouldSkip("DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx")) { NextTest(); return; } - err = TestThSendsGetCredentialStatusCommand_15(); + err = TestThSendsGetCredentialStatusCommandToDut_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : TH sends Get Credential Status Command\n"); + ChipLogProgress(chipTool, " ***** Test Step 16 : TH sends Set User Command to DUT\n"); + err = TestThSendsSetUserCommandToDut_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : TH sends Set Credential Command to DUT\n"); + if (ShouldSkip("DRLK.S.F08 && DRLK.S.C22.Rsp && DRLK.S.C23.Tx")) { + NextTest(); + return; + } + err = TestThSendsSetCredentialCommandToDut_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : TH sends Clear Credential Command to DUT\n"); + if (ShouldSkip("DRLK.S.F08 && DRLK.S.C26.Rsp")) { + NextTest(); + return; + } + err = TestThSendsClearCredentialCommandToDut_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : TH sends Get Credential Status Command\n"); if (ShouldSkip("DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx")) { NextTest(); return; } - err = TestThSendsGetCredentialStatusCommand_16(); + err = TestThSendsGetCredentialStatusCommand_19(); break; - case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : TH sends Clear Credential Command to DUT\n"); + case 20: + ChipLogProgress(chipTool, + " ***** Test Step 20 : TH sends Get Credential command to DUT and Verify that the CredentialType for the provided " + "value is cleared Verify that the CredentialIndex is cleared\n"); + if (ShouldSkip("PICS_USER_PROMPT && DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx")) { + NextTest(); + return; + } + err = TestThSendsGetCredentialCommandToDutAndVerifyThatTheCredentialTypeForTheProvidedValueIsClearedVerifyThatTheCredentialIndexIsCleared_20(); + break; + case 21: + ChipLogProgress(chipTool, " ***** Test Step 21 : TH sends Get Credential Status Command\n"); + if (ShouldSkip("DRLK.S.F08 && DRLK.S.C24.Rsp && DRLK.S.C25.Tx")) { + NextTest(); + return; + } + err = TestThSendsGetCredentialStatusCommand_21(); + break; + case 22: + ChipLogProgress(chipTool, " ***** Test Step 22 : TH sends Clear Credential Command to DUT\n"); if (ShouldSkip("DRLK.S.F08 && DRLK.S.C26.Rsp")) { NextTest(); return; } - err = TestThSendsClearCredentialCommandToDut_17(); + err = TestThSendsClearCredentialCommandToDut_22(); + break; + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Cleanup the created user\n"); + err = TestCleanupTheCreatedUser_23(); break; } @@ -112291,14 +112568,32 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + 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), EMBER_ZCL_STATUS_INVALID_COMMAND)); 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), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -112312,7 +112607,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 18; + const uint16_t mTestCount = 24; chip::Optional mNodeId; chip::Optional mCluster; @@ -112518,12 +112813,10 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("credentialExists", "", "boolean")); - if (values.userIndex != nil) { - - VerifyOrReturn( - CheckConstraintMinValue("userIndex", [values.userIndex unsignedShortValue], 1U)); - VerifyOrReturn(CheckConstraintMaxValue( - "userIndex", [values.userIndex unsignedShortValue], NumberOfTotalUsersSupported)); + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNonNull("userIndex", actualValue)); + VerifyOrReturn(CheckValue("userIndex", actualValue, 1U)); } { @@ -112549,7 +112842,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsSetCredentialCommandToDutAndVerifyTheInvalidCommandIfAnyOfTheFieldsAreInvalid_6() + CHIP_ERROR TestThSendsSetCredentialCommandToDut_6() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -112561,16 +112854,14 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { ((MTRDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:2U]; - params.credentialData = [[NSData alloc] initWithBytes:"1234" length:4]; + params.credentialData = [[NSData alloc] initWithBytes:"4321" length:4]; params.userIndex = [NSNumber numberWithUnsignedShort:2U]; params.userStatus = [NSNumber numberWithUnsignedChar:5U]; params.userType = [NSNumber numberWithUnsignedChar:10U]; [cluster setCredentialWithParams:params completionHandler:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"TH sends Set Credential Command to DUT and verify the INVALID_COMMAND if any of the fields are " - @"invalid Error: %@", - err); + NSLog(@"TH sends Set Credential Command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -112596,7 +112887,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsSetCredentialCommandToDutAndVerifyResponseAsDuplicateIfCredentialDataIsRepeated_7() + CHIP_ERROR TestThSendsSetCredentialCommandToDut_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -112615,9 +112906,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { [cluster setCredentialWithParams:params completionHandler:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"TH sends Set Credential Command to DUT and verify response as DUPLICATE if CredentialData is " - @"repeated Error: %@", - err); + NSLog(@"TH sends Set Credential Command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -112643,7 +112932,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsSetCredentialCommandToDutAndVerifyResponseAsOccupiedIfCredentialIndexIsRepeated_8() + CHIP_ERROR TestThSendsSetCredentialCommandToDut_8() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -112662,9 +112951,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { [cluster setCredentialWithParams:params completionHandler:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"TH sends Set Credential Command to DUT and verify response as OCCUPIED if CredentialIndex is " - @"repeated Error: %@", - err); + NSLog(@"TH sends Set Credential Command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -112691,7 +112978,71 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { } CHIP_ERROR - TestThSendsSetCredentialCommandToDutAndVerifyTheDutResponseAsOccupiedIfTheCredentialIndexIsNotAssociatedWithTheUserIndex_9() + TestThSendsSetCredentialCommandToDutAndVerifyThatTheDutSendsSetCredentialResponseCommandWithResponseAsOccupiedIfTheCredentialIndexIsRepeated_9() + { + 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 TestThSendsSetCredentialCommandToDut_10() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetCredentialParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0U]; + params.credential = [[MTRDoorLockClusterDlCredential alloc] init]; + ((MTRDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; + ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:3U]; + + params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; + params.userIndex = [NSNumber numberWithUnsignedShort:3U]; + params.userStatus = [NSNumber numberWithUnsignedChar:0U]; + params.userType = [NSNumber numberWithUnsignedChar:0U]; + [cluster + setCredentialWithParams:params + completionHandler:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends Set Credential Command to DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 2U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNull("userIndex", actualValue)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 4U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestThSendsSetCredentialCommandToDutAndVerifyThatTheDutSendsSetCredentialResponseCommandWithResponseAsOccupiedIfTheCredentialIndexIsRepeated_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 TestThSendsSetCredentialCommandToDut_12() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -112710,9 +113061,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { [cluster setCredentialWithParams:params completionHandler:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"TH sends Set Credential Command to DUT and verify the DUT response as OCCUPIED if the " - @"CredentialIndex is not associated with the UserIndex Error: %@", - err); + NSLog(@"TH sends Set Credential Command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -112738,7 +113087,17 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsClearCredentialCommandToDut_10() + CHIP_ERROR + TestThSendsSetCredentialCommandToDutAndVerifyThatTheDutSendsSetCredentialResponseCommandWithResponseAsOccupiedIfTheCredentialIndexIsRepeated_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); + } + + CHIP_ERROR TestThSendsClearCredentialCommandToDut_14() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -112761,8 +113120,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR - TestThSendsGetCredentialStatusCommandAndVerifyThatTheCredentialTypeAndCredentialIndexForTheProvidedValueIsCleared_11() + CHIP_ERROR TestThSendsGetCredentialStatusCommandToDut_15() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -112776,9 +113134,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { [cluster getCredentialStatusWithParams:params completionHandler:^( MTRDoorLockClusterGetCredentialStatusResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"TH sends Get Credential Status Command and verify that the CredentialType and " - @"CredentialIndex for the provided value is cleared Error: %@", - err); + NSLog(@"TH sends Get Credential Status Command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -112813,7 +113169,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsSetUserCommandToDut_12() + CHIP_ERROR TestThSendsSetUserCommandToDut_16() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -112839,7 +113195,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsSetCredentialCommandToDut_13() + CHIP_ERROR TestThSendsSetCredentialCommandToDut_17() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -112849,7 +113205,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { params.operationType = [NSNumber numberWithUnsignedChar:0U]; params.credential = [[MTRDoorLockClusterDlCredential alloc] init]; ((MTRDoorLockClusterDlCredential *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; - ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:3U]; + ((MTRDoorLockClusterDlCredential *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; params.userIndex = [NSNumber numberWithUnsignedShort:2U]; @@ -112875,7 +113231,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { { id actualValue = values.nextCredentialIndex; VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", actualValue)); - VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 4U)); + VerifyOrReturn(CheckValue("nextCredentialIndex", actualValue, 2U)); } NextTest(); @@ -112884,7 +113240,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsClearCredentialCommandToDut_14() + CHIP_ERROR TestThSendsClearCredentialCommandToDut_18() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -112907,7 +113263,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsGetCredentialStatusCommand_15() + CHIP_ERROR TestThSendsGetCredentialStatusCommand_19() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -112934,7 +113290,17 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsGetCredentialStatusCommand_16() + CHIP_ERROR + TestThSendsGetCredentialCommandToDutAndVerifyThatTheCredentialTypeForTheProvidedValueIsClearedVerifyThatTheCredentialIndexIsCleared_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 TestThSendsGetCredentialStatusCommand_21() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -112983,7 +113349,7 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThSendsClearCredentialCommandToDut_17() + CHIP_ERROR TestThSendsClearCredentialCommandToDut_22() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -113008,6 +113374,26 @@ class Test_TC_DRLK_2_9 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestCleanupTheCreatedUser_23() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterClearUserParams alloc] init]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster clearUserWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Cleanup the created user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class TestGroupsCluster : public TestCommandBridge {