From 1142751ea18c27142acfb67ec8263ab646d4a7ef Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 23 Feb 2023 11:27:04 -0500 Subject: [PATCH] Fix incoming command validity checks in Set Credential. (#25264) * When Set Credential happens with OperationType set to Modify and UserIndex set to null, that means we are modifying the credential for the programming user. In this case, UserStatus must be null and UserType must be ProgrammingUser, but we were not checking that. * When Set Credential happens with OperationType set to Modify and UserIndex not null, UserStatus and UserType must both be null. We were incorrectly allowing UserType to be ProgrammingUser in this case. * When Set Credential happens with OperationType set to Add and UserIndex not null, UserStatus and UserType must both be null. We were not checking for this at all. Fixes https://github.com/project-chip/connectedhomeip/issues/25259 --- .../door-lock-server/door-lock-server.cpp | 19 +- .../tests/suites/DL_UsersAndCredentials.yaml | 186 +++- .../chip-tool/zap-generated/test/Commands.h | 589 ++++++++----- .../zap-generated/test/Commands.h | 828 ++++++++++++------ 4 files changed, 1118 insertions(+), 504 deletions(-) diff --git a/src/app/clusters/door-lock-server/door-lock-server.cpp b/src/app/clusters/door-lock-server/door-lock-server.cpp index 0cbca3e70e1ee9..2b08ec9c128d63 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -700,6 +700,12 @@ void DoorLockServer::setCredentialCommandHandler( // if userIndex is NULL then we're changing the programming user PIN if (userIndex.IsNull()) { + if (!userStatus.IsNull() || userType != UserTypeEnum::kProgrammingUser) + { + emberAfDoorLockClusterPrintln("[SetCredential] Unable to modify programming PIN: invalid argument " + "[endpointId=%d,credentialIndex=%d]", + commandPath.mEndpointId, credentialIndex); + } status = modifyProgrammingPIN(commandPath.mEndpointId, fabricIdx, sourceNodeId, credentialIndex, credentialType, existingCredential, credentialData); sendSetCredentialResponse(commandObj, commandPath, status, 0, nextAvailableCredentialSlot); @@ -2245,7 +2251,16 @@ DlStatus DoorLockServer::createCredential(chip::EndpointId endpointId, chip::Fab } else { - // appclusters, 5.2.4.40: if user index is NULL, we should try to modify the existing user + // appclusters, 5.2.4.40: if user index is NULL, we should try to modify + // the existing user. In this case userStatus and userType shall both + // be null. + if (!userStatus.IsNull() || !userType.IsNull()) + { + emberAfDoorLockClusterPrintln("[SetCredential] Unable to add credential: invalid arguments " + "[endpointId=%d,credentialIndex=%d,credentialType=%u]", + endpointId, credentialIndex, to_underlying(credentialType)); + return DlStatus::kInvalidField; + } status = createNewCredentialAndAddItToUser(endpointId, creatorFabricIdx, userIndex.Value(), credential, credentialData); } @@ -2314,7 +2329,7 @@ DlStatus DoorLockServer::modifyCredential(chip::EndpointId endpointId, chip::Fab { // appclusters, 5.2.4.40: when modifying a credential, userStatus and userType shall both be NULL. - if (!userStatus.IsNull() || (!userType.IsNull() && UserTypeEnum::kProgrammingUser != userType.Value())) + if (!userStatus.IsNull() || !userType.IsNull()) { emberAfDoorLockClusterPrintln("[SetCredential] Unable to modify the credential: invalid arguments " "[endpointId=%d,credentialIndex=%d,credentialType=%u]", diff --git a/src/app/tests/suites/DL_UsersAndCredentials.yaml b/src/app/tests/suites/DL_UsersAndCredentials.yaml index e8c09fa05dd39e..d62a8291181084 100644 --- a/src/app/tests/suites/DL_UsersAndCredentials.yaml +++ b/src/app/tests/suites/DL_UsersAndCredentials.yaml @@ -1199,15 +1199,18 @@ tests: - name: "NextCredentialIndex" value: null - # Duplicate of the previous test that does not check the value of nextCredentialIndex - label: - "Reading RFID credential with index 0 returns no credential duplicate - with bug workaround" + "Reading RFID credential with out-of-bounds index returns no + credential" command: "GetCredentialStatus" arguments: values: - name: "Credential" - value: { CredentialType: 2, CredentialIndex: 0 } + value: + { + CredentialType: 2, + CredentialIndex: NumberOfRFIDUsersSupported + 1, + } response: values: - name: "CredentialExists" @@ -1218,19 +1221,15 @@ tests: value: null - name: "LastModifiedFabricIndex" value: null + - name: "NextCredentialIndex" + value: null - - label: - "Reading RFID credential with out-of-bounds index returns no - credential" + - label: "Check that RFID credential does not exist" command: "GetCredentialStatus" arguments: values: - name: "Credential" - value: - { - CredentialType: 2, - CredentialIndex: NumberOfRFIDUsersSupported + 1, - } + value: { CredentialType: 2, CredentialIndex: 2 } response: values: - name: "CredentialExists" @@ -1244,24 +1243,89 @@ tests: - name: "NextCredentialIndex" value: null - - label: "Check that RFID credential does not exist" - command: "GetCredentialStatus" + - label: + "Create new RFID credential and add it to existing user with non-null + UserStatus should fail" + command: "SetCredential" + timedInteractionTimeoutMs: 10000 arguments: values: + - name: "OperationType" + value: 0 - name: "Credential" - value: { CredentialType: 2, CredentialIndex: 2 } + value: { CredentialType: 2, CredentialIndex: 1 } + - name: "CredentialData" + value: "rfid_data_123456" + - name: "UserIndex" + value: 1 + - name: "UserStatus" + value: 1 + - name: "UserType" + value: null response: values: - - name: "CredentialExists" - value: false + - name: "Status" + value: 0x85 # INVALID_COMMAND - name: "UserIndex" value: null - - name: "CreatorFabricIndex" + - name: "NextCredentialIndex" + value: 2 + + - label: + "Create new RFID credential and add it to existing user with non-null + UserType should fail" + command: "SetCredential" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "OperationType" + value: 0 + - name: "Credential" + value: { CredentialType: 2, CredentialIndex: 1 } + - name: "CredentialData" + value: "rfid_data_123456" + - name: "UserIndex" + value: 1 + - name: "UserStatus" value: null - - name: "LastModifiedFabricIndex" + - name: "UserType" + value: 0 + response: + values: + - name: "Status" + value: 0x85 # INVALID_COMMAND + - name: "UserIndex" value: null - name: "NextCredentialIndex" + value: 2 + + - label: + "Create new RFID credential and add it to existing user with non-null + UserType and UserStatus should fail" + command: "SetCredential" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "OperationType" + value: 0 + - name: "Credential" + value: { CredentialType: 2, CredentialIndex: 1 } + - name: "CredentialData" + value: "rfid_data_123456" + - name: "UserIndex" + value: 1 + - name: "UserStatus" + value: 1 + - name: "UserType" + value: 0 + response: + values: + - name: "Status" + value: 0x85 # INVALID_COMMAND + - name: "UserIndex" value: null + - name: "NextCredentialIndex" + value: 2 - label: "Create new RFID credential and add it to existing user" command: "SetCredential" @@ -1632,6 +1696,90 @@ tests: - name: "NextCredentialIndex" value: 3 + - label: + "Modify credentialData of existing PIN credential with non-null + UserStatus should fail" + command: "SetCredential" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "OperationType" + value: 2 + - name: "Credential" + value: { CredentialType: 1, CredentialIndex: 1 } + - name: "CredentialData" + value: "123456" + - name: "UserIndex" + value: 1 + - name: "UserStatus" + value: 1 + - name: "UserType" + value: null + response: + values: + - name: "Status" + value: 0x85 # INVALID_COMMAND + - name: "UserIndex" + value: null + - name: "NextCredentialIndex" + value: 2 + + - label: + "Modify credentialData of existing PIN credential with non-null + UserType should fail" + command: "SetCredential" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "OperationType" + value: 2 + - name: "Credential" + value: { CredentialType: 1, CredentialIndex: 1 } + - name: "CredentialData" + value: "123456" + - name: "UserIndex" + value: 1 + - name: "UserStatus" + value: null + - name: "UserType" + value: 0 + response: + values: + - name: "Status" + value: 0x85 # INVALID_COMMAND + - name: "UserIndex" + value: null + - name: "NextCredentialIndex" + value: 2 + + - label: + "Modify credentialData of existing PIN credential with non-null + UserStatus and UserType should fail" + command: "SetCredential" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "OperationType" + value: 2 + - name: "Credential" + value: { CredentialType: 1, CredentialIndex: 1 } + - name: "CredentialData" + value: "123456" + - name: "UserIndex" + value: 1 + - name: "UserStatus" + value: 1 + - name: "UserType" + value: 0 + response: + values: + - name: "Status" + value: 0x85 # INVALID_COMMAND + - name: "UserIndex" + value: null + - name: "NextCredentialIndex" + value: 2 + - label: "Modify credentialData of existing PIN credential" command: "SetCredential" timedInteractionTimeoutMs: 10000 diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 72cc34b399f0cd..63b41695f40832 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -74750,7 +74750,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand { public: DL_UsersAndCredentialsSuite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("DL_UsersAndCredentials", 123, credsIssuerConfig) + TestCommand("DL_UsersAndCredentials", 128, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -75449,6 +75449,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); + VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); } break; case 55: @@ -75466,13 +75467,12 @@ class DL_UsersAndCredentialsSuite : public TestCommand case 56: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; + chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("credentialExists", value.credentialExists, false)); + VerifyOrReturn(CheckValue("status", value.status, 133U)); VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); - VerifyOrReturn(CheckValueNull("creatorFabricIndex", value.creatorFabricIndex)); - VerifyOrReturn(CheckValueNull("lastModifiedFabricIndex", value.lastModifiedFabricIndex)); - VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); } break; case 57: @@ -75480,13 +75480,35 @@ class DL_UsersAndCredentialsSuite : public TestCommand { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValue("status", value.status, 133U)); VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); } break; case 58: + 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, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 59: + 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, 0U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 60: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; @@ -75519,7 +75541,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); } break; - case 59: + case 61: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; @@ -75534,7 +75556,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); } break; - case 60: + case 62: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -75545,7 +75567,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); } break; - case 61: + case 63: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -75555,7 +75577,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); } break; - case 62: + case 64: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -75566,7 +75588,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); } break; - case 63: + case 65: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -75577,7 +75599,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); } break; - case 64: + case 66: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -75588,7 +75610,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); } break; - case 65: + case 67: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -75599,7 +75621,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); } break; - case 66: + case 68: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -75610,7 +75632,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); } break; - case 67: + case 69: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -75621,7 +75643,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); } break; - case 68: + case 70: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -75632,7 +75654,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); } break; - case 69: + case 71: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -75643,7 +75665,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 4U)); } break; - case 70: + case 72: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -75654,7 +75676,40 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); } break; - case 71: + case 73: + 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, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 74: + 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, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 75: + 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, 133U)); + VerifyOrReturn(CheckValueNull("userIndex", value.userIndex)); + VerifyOrReturn(CheckValueNonNull("nextCredentialIndex", value.nextCredentialIndex)); + VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); + } + break; + case 76: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -75665,7 +75720,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); } break; - case 72: + case 77: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -75677,7 +75732,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); } break; - case 73: + case 78: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -75688,7 +75743,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 4U)); } break; - case 74: + case 79: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -75699,7 +75754,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); } break; - case 75: + case 80: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; @@ -75736,7 +75791,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextUserIndex.Value()", value.nextUserIndex.Value(), 2U)); } break; - case 76: + case 81: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -75747,7 +75802,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 4U)); } break; - case 77: + case 82: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; @@ -75787,10 +75842,10 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextUserIndex.Value()", value.nextUserIndex.Value(), 2U)); } break; - case 78: + case 83: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 79: + case 84: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; @@ -75803,7 +75858,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); } break; - case 80: + case 85: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; @@ -75840,10 +75895,10 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextUserIndex.Value()", value.nextUserIndex.Value(), 2U)); } break; - case 81: + case 86: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 82: + case 87: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; @@ -75856,7 +75911,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); } break; - case 83: + case 88: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; @@ -75873,7 +75928,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); } break; - case 84: + case 89: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -75885,10 +75940,10 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 4U)); } break; - case 85: + case 90: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 86: + case 91: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; @@ -75900,7 +75955,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); } break; - case 87: + case 92: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; @@ -75912,7 +75967,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); } break; - case 88: + case 93: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; @@ -75924,7 +75979,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); } break; - case 89: + case 94: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; @@ -75954,7 +76009,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); } break; - case 90: + case 95: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; @@ -75971,7 +76026,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); } break; - case 91: + case 96: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -75983,7 +76038,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); } break; - case 92: + case 97: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -75995,7 +76050,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); } break; - case 93: + case 98: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -76007,10 +76062,10 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 7U)); } break; - case 94: + case 99: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 95: + case 100: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; @@ -76022,7 +76077,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); } break; - case 96: + case 101: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; @@ -76034,7 +76089,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); } break; - case 97: + case 102: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; @@ -76046,7 +76101,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); } break; - case 98: + case 103: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; @@ -76063,7 +76118,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); } break; - case 99: + case 104: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; @@ -76080,7 +76135,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); } break; - case 100: + case 105: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; @@ -76097,7 +76152,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); } break; - case 101: + case 106: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; @@ -76114,7 +76169,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); } break; - case 102: + case 107: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -76124,7 +76179,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); } break; - case 103: + case 108: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -76135,7 +76190,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); } break; - case 104: + case 109: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; @@ -76165,7 +76220,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); } break; - case 105: + case 110: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; @@ -76180,7 +76235,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); } break; - case 106: + case 111: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -76190,28 +76245,28 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); } break; - case 107: + case 112: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; - case 108: + case 113: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; - case 109: + case 114: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; - case 110: + case 115: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; - case 111: + case 116: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; - case 112: + case 117: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; - case 113: + case 118: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 114: + case 119: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType value; @@ -76228,7 +76283,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextUserIndex", value.nextUserIndex)); } break; - case 115: + case 120: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType value; @@ -76240,7 +76295,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValueNull("nextCredentialIndex", value.nextCredentialIndex)); } break; - case 116: + case 121: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -76252,7 +76307,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 2U)); } break; - case 117: + case 122: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -76263,7 +76318,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); } break; - case 118: + case 123: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -76274,7 +76329,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 4U)); } break; - case 119: + case 124: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -76285,7 +76340,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 5U)); } break; - case 120: + case 125: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -76296,7 +76351,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 6U)); } break; - case 121: + case 126: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -76307,7 +76362,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 7U)); } break; - case 122: + case 127: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; default: @@ -77026,12 +77081,12 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } case 54: { - LogStep(54, "Reading RFID credential with index 0 returns no credential duplicate with bug workaround"); + LogStep(54, "Reading RFID credential with out-of-bounds index returns no credential"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; value.credential.credentialType = static_cast(2); - value.credential.credentialIndex = 0U; + value.credential.credentialIndex = static_cast(NumberOfRFIDUsersSupported + 1); return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, chip::NullOptional @@ -77039,12 +77094,12 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } case 55: { - LogStep(55, "Reading RFID credential with out-of-bounds index returns no credential"); + LogStep(55, "Check that RFID credential does not exist"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; value.credential.credentialType = static_cast(2); - value.credential.credentialIndex = static_cast(NumberOfRFIDUsersSupported + 1); + value.credential.credentialIndex = 2U; return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, chip::NullOptional @@ -77052,20 +77107,28 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } case 56: { - LogStep(56, "Check that RFID credential does not exist"); + LogStep(56, "Create new RFID credential and add it to existing user with non-null UserStatus should fail"); ListFreer listFreer; - chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); value.credential.credentialType = static_cast(2); - value.credential.credentialIndex = 2U; + value.credential.credentialIndex = 1U; - return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetCredentialStatus::Id, value, - chip::NullOptional + value.credentialData = + chip::ByteSpan(chip::Uint8::from_const_char("rfid_data_123456garbage: not in length on purpose"), 16); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional ); } case 57: { - LogStep(57, "Create new RFID credential and add it to existing user"); + LogStep(57, "Create new RFID credential and add it to existing user with non-null UserType should fail"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77078,14 +77141,57 @@ class DL_UsersAndCredentialsSuite : public TestCommand value.userIndex.SetNonNull(); value.userIndex.Value() = 1U; value.userStatus.SetNull(); - value.userType.SetNull(); + 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 58: { - LogStep(58, "Verify modified user"); + LogStep(58, "Create new RFID credential and add it to existing user with non-null UserType and UserStatus should fail"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 1U; + + value.credentialData = + chip::ByteSpan(chip::Uint8::from_const_char("rfid_data_123456garbage: not in length on purpose"), 16); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + 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 59: { + LogStep(59, "Create new RFID credential and add it to existing user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(0); + + value.credential.credentialType = static_cast(2); + value.credential.credentialIndex = 1U; + + value.credentialData = + chip::ByteSpan(chip::Uint8::from_const_char("rfid_data_123456garbage: not in length on purpose"), 16); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNull(); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 60: { + LogStep(60, "Verify modified user"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetUser::Type value; value.userIndex = 1U; @@ -77094,8 +77200,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 59: { - LogStep(59, "Verify created credential"); + case 61: { + LogStep(61, "Verify created credential"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; @@ -77107,8 +77213,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 60: { - LogStep(60, "Create new RFID credential and user with index 0 fails"); + case 62: { + LogStep(62, "Create new RFID credential and user with index 0 fails"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77126,8 +77232,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 61: { - LogStep(61, "Create new RFID credential and user with out-of-bounds index fails"); + case 63: { + LogStep(63, "Create new RFID credential and user with out-of-bounds index fails"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77145,8 +77251,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 62: { - LogStep(62, "Create new credential and try to add it to 0 user"); + case 64: { + LogStep(64, "Create new credential and try to add it to 0 user"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77164,8 +77270,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 63: { - LogStep(63, "Create new credential and try to add it to out-of-bounds user"); + case 65: { + LogStep(65, "Create new credential and try to add it to out-of-bounds user"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77183,8 +77289,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 64: { - LogStep(64, "Create new PIN with too short data"); + case 66: { + LogStep(66, "Create new PIN with too short data"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77202,8 +77308,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 65: { - LogStep(65, "Create new PIN with too long data"); + case 67: { + LogStep(67, "Create new PIN with too long data"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77221,8 +77327,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 66: { - LogStep(66, "Create new RFID with too short data"); + case 68: { + LogStep(68, "Create new RFID with too short data"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77240,8 +77346,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 67: { - LogStep(67, "Create new PIN with Programming user type fails"); + case 69: { + LogStep(69, "Create new PIN with Programming user type fails"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77260,8 +77366,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 68: { - LogStep(68, "Create new RFID with too short data"); + case 70: { + LogStep(70, "Create new RFID with too short data"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77280,8 +77386,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 69: { - LogStep(69, "Create new PIN credential with data the would cause duplicate"); + case 71: { + LogStep(71, "Create new PIN credential with data the would cause duplicate"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77298,8 +77404,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 70: { - LogStep(70, "Create new RFID credential with data the would cause duplicate"); + case 72: { + LogStep(72, "Create new RFID credential with data the would cause duplicate"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77317,8 +77423,69 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 71: { - LogStep(71, "Modify credentialData of existing PIN credential"); + case 73: { + LogStep(73, "Modify credentialData of existing PIN credential with non-null UserStatus should fail"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(2); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + value.userType.SetNull(); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetCredential::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 74: { + LogStep(74, "Modify credentialData of existing PIN credential with non-null UserType should fail"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(2); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNull(); + 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 75: { + LogStep(75, "Modify credentialData of existing PIN credential with non-null UserStatus and UserType should fail"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; + value.operationType = static_cast(2); + + value.credential.credentialType = static_cast(1); + value.credential.credentialIndex = 1U; + + value.credentialData = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + value.userIndex.SetNonNull(); + value.userIndex.Value() = 1U; + value.userStatus.SetNonNull(); + value.userStatus.Value() = static_cast(1); + 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 76: { + LogStep(76, "Modify credentialData of existing PIN credential"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(2); @@ -77336,8 +77503,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 72: { - LogStep(72, "Verify that credential was changed by creating new credential with old data"); + case 77: { + LogStep(77, "Verify that credential was changed by creating new credential with old data"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77354,8 +77521,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 73: { - LogStep(73, "Verify that credential was changed by creating new credential with new data"); + case 78: { + LogStep(78, "Verify that credential was changed by creating new credential with new data"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77372,8 +77539,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 74: { - LogStep(74, "Create new RFID credential and add it to existing user"); + case 79: { + LogStep(79, "Create new RFID credential and add it to existing user"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77392,8 +77559,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 75: { - LogStep(75, "Verify modified user"); + case 80: { + LogStep(80, "Verify modified user"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetUser::Type value; value.userIndex = 1U; @@ -77402,8 +77569,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 76: { - LogStep(76, "Create new RFID credential and add it to existing user"); + case 81: { + LogStep(81, "Create new RFID credential and add it to existing user"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77421,8 +77588,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 77: { - LogStep(77, "Verify modified user"); + case 82: { + LogStep(82, "Verify modified user"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetUser::Type value; value.userIndex = 1U; @@ -77431,8 +77598,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 78: { - LogStep(78, "Clear first PIN credential"); + case 83: { + LogStep(83, "Clear first PIN credential"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; value.credential.SetNonNull(); @@ -77445,8 +77612,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 79: { - LogStep(79, "Read back the credential and make sure it is deleted"); + case 84: { + LogStep(84, "Read back the credential and make sure it is deleted"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; @@ -77458,8 +77625,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 80: { - LogStep(80, "Read the user back and make sure PIN credential is deleted"); + case 85: { + LogStep(85, "Read the user back and make sure PIN credential is deleted"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetUser::Type value; value.userIndex = 1U; @@ -77468,8 +77635,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 81: { - LogStep(81, "Clear the second PIN credential"); + case 86: { + LogStep(86, "Clear the second PIN credential"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; value.credential.SetNonNull(); @@ -77482,8 +77649,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 82: { - LogStep(82, "Read back the credential and make sure it is deleted"); + case 87: { + LogStep(87, "Read back the credential and make sure it is deleted"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; @@ -77495,8 +77662,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 83: { - LogStep(83, "Read the user back and make sure related user is deleted"); + case 88: { + LogStep(88, "Read the user back and make sure related user is deleted"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetUser::Type value; value.userIndex = 2U; @@ -77505,8 +77672,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 84: { - LogStep(84, "Create new RFID credential with user"); + case 89: { + LogStep(89, "Create new RFID credential with user"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77524,8 +77691,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 85: { - LogStep(85, "Clear all the RFID credentials"); + case 90: { + LogStep(90, "Clear all the RFID credentials"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; value.credential.SetNonNull(); @@ -77538,8 +77705,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 86: { - LogStep(86, "Read back the fist RFID credential and make sure it is deleted"); + case 91: { + LogStep(91, "Read back the fist RFID credential and make sure it is deleted"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; @@ -77551,8 +77718,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 87: { - LogStep(87, "Read back the second RFID credential and make sure it is deleted"); + case 92: { + LogStep(92, "Read back the second RFID credential and make sure it is deleted"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; @@ -77564,8 +77731,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 88: { - LogStep(88, "Read back the third RFID credential and make sure it is deleted"); + case 93: { + LogStep(93, "Read back the third RFID credential and make sure it is deleted"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; @@ -77577,8 +77744,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 89: { - LogStep(89, "Read the user related with first RFID back and make sure it has only PIN credential"); + case 94: { + LogStep(94, "Read the user related with first RFID back and make sure it has only PIN credential"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetUser::Type value; value.userIndex = 1U; @@ -77587,8 +77754,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 90: { - LogStep(90, "Read the user related with second RFID back and make sure it is deleted"); + case 95: { + LogStep(95, "Read the user related with second RFID back and make sure it is deleted"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetUser::Type value; value.userIndex = 2U; @@ -77597,8 +77764,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 91: { - LogStep(91, "Create new PIN credential with user"); + case 96: { + LogStep(96, "Create new PIN credential with user"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77615,8 +77782,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 92: { - LogStep(92, "Create new RFID credential with user"); + case 97: { + LogStep(97, "Create new RFID credential with user"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77634,8 +77801,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 93: { - LogStep(93, "Create another RFID credential with user"); + case 98: { + LogStep(98, "Create another RFID credential with user"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77653,8 +77820,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 94: { - LogStep(94, "Clear all the credentials"); + case 99: { + LogStep(99, "Clear all the credentials"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; value.credential.SetNull(); @@ -77663,8 +77830,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 95: { - LogStep(95, "Read back the first PIN credential and make sure it is deleted"); + case 100: { + LogStep(100, "Read back the first PIN credential and make sure it is deleted"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; @@ -77676,8 +77843,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 96: { - LogStep(96, "Read back the first RFID credential and make sure it is deleted"); + case 101: { + LogStep(101, "Read back the first RFID credential and make sure it is deleted"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; @@ -77689,8 +77856,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 97: { - LogStep(97, "Read back the second PIN credential and make sure it is deleted"); + case 102: { + LogStep(102, "Read back the second PIN credential and make sure it is deleted"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; @@ -77702,8 +77869,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 98: { - LogStep(98, "Read the user related with first PIN back and make sure it is deleted"); + case 103: { + LogStep(103, "Read the user related with first PIN back and make sure it is deleted"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetUser::Type value; value.userIndex = 1U; @@ -77712,8 +77879,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 99: { - LogStep(99, "Read the user related with first RFID back and make sure it is deleted"); + case 104: { + LogStep(104, "Read the user related with first RFID back and make sure it is deleted"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetUser::Type value; value.userIndex = 2U; @@ -77722,8 +77889,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 100: { - LogStep(100, "Read the user related with second PIN back and make sure it is deleted"); + case 105: { + LogStep(105, "Read the user related with second PIN back and make sure it is deleted"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetUser::Type value; value.userIndex = 3U; @@ -77732,8 +77899,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 101: { - LogStep(101, "Read the user related with last RFID back and make sure it is deleted"); + case 106: { + LogStep(106, "Read the user related with last RFID back and make sure it is deleted"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetUser::Type value; value.userIndex = 4U; @@ -77742,8 +77909,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 102: { - LogStep(102, "Create new Programming PIN credential with invalid index"); + case 107: { + LogStep(107, "Create new Programming PIN credential with invalid index"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77760,8 +77927,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 103: { - LogStep(103, "Create new Programming PIN credential with valid index"); + case 108: { + LogStep(108, "Create new Programming PIN credential with valid index"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77778,8 +77945,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 104: { - LogStep(104, "Verify created user"); + case 109: { + LogStep(109, "Verify created user"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetUser::Type value; value.userIndex = 1U; @@ -77788,8 +77955,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 105: { - LogStep(105, "Verify created programming PIN credential"); + case 110: { + LogStep(110, "Verify created programming PIN credential"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; @@ -77801,8 +77968,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 106: { - LogStep(106, "Modify the Programming PIN credential"); + case 111: { + LogStep(111, "Modify the Programming PIN credential"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(2); @@ -77819,8 +77986,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 107: { - LogStep(107, "Clearing Programming PIN fails"); + case 112: { + LogStep(112, "Clearing Programming PIN fails"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; value.credential.SetNonNull(); @@ -77833,8 +78000,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 108: { - LogStep(108, "Clearing Programming PIN with invalid index fails"); + case 113: { + LogStep(113, "Clearing Programming PIN with invalid index fails"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; value.credential.SetNonNull(); @@ -77847,8 +78014,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 109: { - LogStep(109, "Clearing PIN credential with zero index fails"); + case 114: { + LogStep(114, "Clearing PIN credential with zero index fails"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; value.credential.SetNonNull(); @@ -77861,8 +78028,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 110: { - LogStep(110, "Clearing PIN credential with out-of-bound index fails"); + case 115: { + LogStep(115, "Clearing PIN credential with out-of-bound index fails"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; value.credential.SetNonNull(); @@ -77875,8 +78042,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 111: { - LogStep(111, "Clearing RFID credential with zero index fails"); + case 116: { + LogStep(116, "Clearing RFID credential with zero index fails"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; value.credential.SetNonNull(); @@ -77889,8 +78056,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 112: { - LogStep(112, "Clearing RFID credential with out-of-bound index fails"); + case 117: { + LogStep(117, "Clearing RFID credential with out-of-bound index fails"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearCredential::Type value; value.credential.SetNonNull(); @@ -77903,8 +78070,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 113: { - LogStep(113, "Clear the Programming PIN user"); + case 118: { + LogStep(118, "Clear the Programming PIN user"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; value.userIndex = 1U; @@ -77913,8 +78080,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 114: { - LogStep(114, "Make sure Programming PIN user is deleted"); + case 119: { + LogStep(119, "Make sure Programming PIN user is deleted"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetUser::Type value; value.userIndex = 1U; @@ -77923,8 +78090,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 115: { - LogStep(115, "Make sure programming PIN credential is deleted"); + case 120: { + LogStep(120, "Make sure programming PIN credential is deleted"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::GetCredentialStatus::Type value; @@ -77936,8 +78103,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 116: { - LogStep(116, "Create new PIN credential and user"); + case 121: { + LogStep(121, "Create new PIN credential and user"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77954,8 +78121,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 117: { - LogStep(117, "Create second PIN credential and add it to existing user"); + case 122: { + LogStep(122, "Create second PIN credential and add it to existing user"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77973,8 +78140,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 118: { - LogStep(118, "Create third PIN credential and add it to existing user"); + case 123: { + LogStep(123, "Create third PIN credential and add it to existing user"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -77992,8 +78159,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 119: { - LogStep(119, "Create fourth PIN credential and add it to existing user"); + case 124: { + LogStep(124, "Create fourth PIN credential and add it to existing user"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -78011,8 +78178,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 120: { - LogStep(120, "Create fifth PIN credential and add it to existing user"); + case 125: { + LogStep(125, "Create fifth PIN credential and add it to existing user"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -78030,8 +78197,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 121: { - LogStep(121, "Try to create sixth PIN credential and make sure it fails"); + case 126: { + LogStep(126, "Try to create sixth PIN credential and make sure it fails"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -78049,8 +78216,8 @@ class DL_UsersAndCredentialsSuite : public TestCommand ); } - case 122: { - LogStep(122, "Final clean-up"); + case 127: { + LogStep(127, "Final clean-up"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; value.userIndex = 1U; 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 0adb138092b7e4..2086b60ee4a013 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -109953,290 +109953,319 @@ class DL_UsersAndCredentials : public TestCommandBridge { err = TestReadingRfidCredentialWithIndex0ReturnsNoCredential_53(); break; case 54: - ChipLogProgress(chipTool, - " ***** Test Step 54 : Reading RFID credential with index 0 returns no credential duplicate with bug workaround\n"); - err = TestReadingRfidCredentialWithIndex0ReturnsNoCredentialDuplicateWithBugWorkaround_54(); + ChipLogProgress( + chipTool, " ***** Test Step 54 : Reading RFID credential with out-of-bounds index returns no credential\n"); + err = TestReadingRfidCredentialWithOutOfBoundsIndexReturnsNoCredential_54(); break; case 55: - ChipLogProgress( - chipTool, " ***** Test Step 55 : Reading RFID credential with out-of-bounds index returns no credential\n"); - err = TestReadingRfidCredentialWithOutOfBoundsIndexReturnsNoCredential_55(); + ChipLogProgress(chipTool, " ***** Test Step 55 : Check that RFID credential does not exist\n"); + err = TestCheckThatRfidCredentialDoesNotExist_55(); break; case 56: - ChipLogProgress(chipTool, " ***** Test Step 56 : Check that RFID credential does not exist\n"); - err = TestCheckThatRfidCredentialDoesNotExist_56(); + ChipLogProgress(chipTool, + " ***** Test Step 56 : Create new RFID credential and add it to existing user with non-null UserStatus should " + "fail\n"); + err = TestCreateNewRfidCredentialAndAddItToExistingUserWithNonNullUserStatusShouldFail_56(); break; case 57: - ChipLogProgress(chipTool, " ***** Test Step 57 : Create new RFID credential and add it to existing user\n"); - err = TestCreateNewRfidCredentialAndAddItToExistingUser_57(); + ChipLogProgress(chipTool, + " ***** Test Step 57 : Create new RFID credential and add it to existing user with non-null UserType should " + "fail\n"); + err = TestCreateNewRfidCredentialAndAddItToExistingUserWithNonNullUserTypeShouldFail_57(); break; case 58: - ChipLogProgress(chipTool, " ***** Test Step 58 : Verify modified user\n"); - err = TestVerifyModifiedUser_58(); + ChipLogProgress(chipTool, + " ***** Test Step 58 : Create new RFID credential and add it to existing user with non-null UserType and " + "UserStatus should fail\n"); + err = TestCreateNewRfidCredentialAndAddItToExistingUserWithNonNullUserTypeAndUserStatusShouldFail_58(); break; case 59: - ChipLogProgress(chipTool, " ***** Test Step 59 : Verify created credential\n"); - err = TestVerifyCreatedCredential_59(); + ChipLogProgress(chipTool, " ***** Test Step 59 : Create new RFID credential and add it to existing user\n"); + err = TestCreateNewRfidCredentialAndAddItToExistingUser_59(); break; case 60: - ChipLogProgress(chipTool, " ***** Test Step 60 : Create new RFID credential and user with index 0 fails\n"); - err = TestCreateNewRfidCredentialAndUserWithIndex0Fails_60(); + ChipLogProgress(chipTool, " ***** Test Step 60 : Verify modified user\n"); + err = TestVerifyModifiedUser_60(); break; case 61: - ChipLogProgress(chipTool, " ***** Test Step 61 : Create new RFID credential and user with out-of-bounds index fails\n"); - err = TestCreateNewRfidCredentialAndUserWithOutOfBoundsIndexFails_61(); + ChipLogProgress(chipTool, " ***** Test Step 61 : Verify created credential\n"); + err = TestVerifyCreatedCredential_61(); break; case 62: - ChipLogProgress(chipTool, " ***** Test Step 62 : Create new credential and try to add it to 0 user\n"); - err = TestCreateNewCredentialAndTryToAddItTo0User_62(); + ChipLogProgress(chipTool, " ***** Test Step 62 : Create new RFID credential and user with index 0 fails\n"); + err = TestCreateNewRfidCredentialAndUserWithIndex0Fails_62(); break; case 63: - ChipLogProgress(chipTool, " ***** Test Step 63 : Create new credential and try to add it to out-of-bounds user\n"); - err = TestCreateNewCredentialAndTryToAddItToOutOfBoundsUser_63(); + ChipLogProgress(chipTool, " ***** Test Step 63 : Create new RFID credential and user with out-of-bounds index fails\n"); + err = TestCreateNewRfidCredentialAndUserWithOutOfBoundsIndexFails_63(); break; case 64: - ChipLogProgress(chipTool, " ***** Test Step 64 : Create new PIN with too short data\n"); - err = TestCreateNewPinWithTooShortData_64(); + ChipLogProgress(chipTool, " ***** Test Step 64 : Create new credential and try to add it to 0 user\n"); + err = TestCreateNewCredentialAndTryToAddItTo0User_64(); break; case 65: - ChipLogProgress(chipTool, " ***** Test Step 65 : Create new PIN with too long data\n"); - err = TestCreateNewPinWithTooLongData_65(); + ChipLogProgress(chipTool, " ***** Test Step 65 : Create new credential and try to add it to out-of-bounds user\n"); + err = TestCreateNewCredentialAndTryToAddItToOutOfBoundsUser_65(); break; case 66: - ChipLogProgress(chipTool, " ***** Test Step 66 : Create new RFID with too short data\n"); - err = TestCreateNewRfidWithTooShortData_66(); + ChipLogProgress(chipTool, " ***** Test Step 66 : Create new PIN with too short data\n"); + err = TestCreateNewPinWithTooShortData_66(); break; case 67: - ChipLogProgress(chipTool, " ***** Test Step 67 : Create new PIN with Programming user type fails\n"); - err = TestCreateNewPinWithProgrammingUserTypeFails_67(); + ChipLogProgress(chipTool, " ***** Test Step 67 : Create new PIN with too long data\n"); + err = TestCreateNewPinWithTooLongData_67(); break; case 68: ChipLogProgress(chipTool, " ***** Test Step 68 : Create new RFID with too short data\n"); err = TestCreateNewRfidWithTooShortData_68(); break; case 69: - ChipLogProgress(chipTool, " ***** Test Step 69 : Create new PIN credential with data the would cause duplicate\n"); - err = TestCreateNewPinCredentialWithDataTheWouldCauseDuplicate_69(); + ChipLogProgress(chipTool, " ***** Test Step 69 : Create new PIN with Programming user type fails\n"); + err = TestCreateNewPinWithProgrammingUserTypeFails_69(); break; case 70: - ChipLogProgress(chipTool, " ***** Test Step 70 : Create new RFID credential with data the would cause duplicate\n"); - err = TestCreateNewRfidCredentialWithDataTheWouldCauseDuplicate_70(); + ChipLogProgress(chipTool, " ***** Test Step 70 : Create new RFID with too short data\n"); + err = TestCreateNewRfidWithTooShortData_70(); break; case 71: - ChipLogProgress(chipTool, " ***** Test Step 71 : Modify credentialData of existing PIN credential\n"); - err = TestModifyCredentialDataOfExistingPinCredential_71(); + ChipLogProgress(chipTool, " ***** Test Step 71 : Create new PIN credential with data the would cause duplicate\n"); + err = TestCreateNewPinCredentialWithDataTheWouldCauseDuplicate_71(); break; case 72: - ChipLogProgress( - chipTool, " ***** Test Step 72 : Verify that credential was changed by creating new credential with old data\n"); - err = TestVerifyThatCredentialWasChangedByCreatingNewCredentialWithOldData_72(); + ChipLogProgress(chipTool, " ***** Test Step 72 : Create new RFID credential with data the would cause duplicate\n"); + err = TestCreateNewRfidCredentialWithDataTheWouldCauseDuplicate_72(); break; case 73: - ChipLogProgress( - chipTool, " ***** Test Step 73 : Verify that credential was changed by creating new credential with new data\n"); - err = TestVerifyThatCredentialWasChangedByCreatingNewCredentialWithNewData_73(); + ChipLogProgress(chipTool, + " ***** Test Step 73 : Modify credentialData of existing PIN credential with non-null UserStatus should fail\n"); + err = TestModifyCredentialDataOfExistingPinCredentialWithNonNullUserStatusShouldFail_73(); break; case 74: - ChipLogProgress(chipTool, " ***** Test Step 74 : Create new RFID credential and add it to existing user\n"); - err = TestCreateNewRfidCredentialAndAddItToExistingUser_74(); + ChipLogProgress(chipTool, + " ***** Test Step 74 : Modify credentialData of existing PIN credential with non-null UserType should fail\n"); + err = TestModifyCredentialDataOfExistingPinCredentialWithNonNullUserTypeShouldFail_74(); break; case 75: - ChipLogProgress(chipTool, " ***** Test Step 75 : Verify modified user\n"); - err = TestVerifyModifiedUser_75(); + ChipLogProgress(chipTool, + " ***** Test Step 75 : Modify credentialData of existing PIN credential with non-null UserStatus and UserType " + "should fail\n"); + err = TestModifyCredentialDataOfExistingPinCredentialWithNonNullUserStatusAndUserTypeShouldFail_75(); break; case 76: - ChipLogProgress(chipTool, " ***** Test Step 76 : Create new RFID credential and add it to existing user\n"); - err = TestCreateNewRfidCredentialAndAddItToExistingUser_76(); + ChipLogProgress(chipTool, " ***** Test Step 76 : Modify credentialData of existing PIN credential\n"); + err = TestModifyCredentialDataOfExistingPinCredential_76(); break; case 77: - ChipLogProgress(chipTool, " ***** Test Step 77 : Verify modified user\n"); - err = TestVerifyModifiedUser_77(); + ChipLogProgress( + chipTool, " ***** Test Step 77 : Verify that credential was changed by creating new credential with old data\n"); + err = TestVerifyThatCredentialWasChangedByCreatingNewCredentialWithOldData_77(); break; case 78: - ChipLogProgress(chipTool, " ***** Test Step 78 : Clear first PIN credential\n"); - err = TestClearFirstPinCredential_78(); + ChipLogProgress( + chipTool, " ***** Test Step 78 : Verify that credential was changed by creating new credential with new data\n"); + err = TestVerifyThatCredentialWasChangedByCreatingNewCredentialWithNewData_78(); break; case 79: - ChipLogProgress(chipTool, " ***** Test Step 79 : Read back the credential and make sure it is deleted\n"); - err = TestReadBackTheCredentialAndMakeSureItIsDeleted_79(); + ChipLogProgress(chipTool, " ***** Test Step 79 : Create new RFID credential and add it to existing user\n"); + err = TestCreateNewRfidCredentialAndAddItToExistingUser_79(); break; case 80: - ChipLogProgress(chipTool, " ***** Test Step 80 : Read the user back and make sure PIN credential is deleted\n"); - err = TestReadTheUserBackAndMakeSurePinCredentialIsDeleted_80(); + ChipLogProgress(chipTool, " ***** Test Step 80 : Verify modified user\n"); + err = TestVerifyModifiedUser_80(); break; case 81: - ChipLogProgress(chipTool, " ***** Test Step 81 : Clear the second PIN credential\n"); - err = TestClearTheSecondPinCredential_81(); + ChipLogProgress(chipTool, " ***** Test Step 81 : Create new RFID credential and add it to existing user\n"); + err = TestCreateNewRfidCredentialAndAddItToExistingUser_81(); break; case 82: - ChipLogProgress(chipTool, " ***** Test Step 82 : Read back the credential and make sure it is deleted\n"); - err = TestReadBackTheCredentialAndMakeSureItIsDeleted_82(); + ChipLogProgress(chipTool, " ***** Test Step 82 : Verify modified user\n"); + err = TestVerifyModifiedUser_82(); break; case 83: - ChipLogProgress(chipTool, " ***** Test Step 83 : Read the user back and make sure related user is deleted\n"); - err = TestReadTheUserBackAndMakeSureRelatedUserIsDeleted_83(); + ChipLogProgress(chipTool, " ***** Test Step 83 : Clear first PIN credential\n"); + err = TestClearFirstPinCredential_83(); break; case 84: - ChipLogProgress(chipTool, " ***** Test Step 84 : Create new RFID credential with user\n"); - err = TestCreateNewRfidCredentialWithUser_84(); + ChipLogProgress(chipTool, " ***** Test Step 84 : Read back the credential and make sure it is deleted\n"); + err = TestReadBackTheCredentialAndMakeSureItIsDeleted_84(); break; case 85: - ChipLogProgress(chipTool, " ***** Test Step 85 : Clear all the RFID credentials\n"); - err = TestClearAllTheRfidCredentials_85(); + ChipLogProgress(chipTool, " ***** Test Step 85 : Read the user back and make sure PIN credential is deleted\n"); + err = TestReadTheUserBackAndMakeSurePinCredentialIsDeleted_85(); break; case 86: - ChipLogProgress(chipTool, " ***** Test Step 86 : Read back the fist RFID credential and make sure it is deleted\n"); - err = TestReadBackTheFistRfidCredentialAndMakeSureItIsDeleted_86(); + ChipLogProgress(chipTool, " ***** Test Step 86 : Clear the second PIN credential\n"); + err = TestClearTheSecondPinCredential_86(); break; case 87: - ChipLogProgress(chipTool, " ***** Test Step 87 : Read back the second RFID credential and make sure it is deleted\n"); - err = TestReadBackTheSecondRfidCredentialAndMakeSureItIsDeleted_87(); + ChipLogProgress(chipTool, " ***** Test Step 87 : Read back the credential and make sure it is deleted\n"); + err = TestReadBackTheCredentialAndMakeSureItIsDeleted_87(); break; case 88: - ChipLogProgress(chipTool, " ***** Test Step 88 : Read back the third RFID credential and make sure it is deleted\n"); - err = TestReadBackTheThirdRfidCredentialAndMakeSureItIsDeleted_88(); + ChipLogProgress(chipTool, " ***** Test Step 88 : Read the user back and make sure related user is deleted\n"); + err = TestReadTheUserBackAndMakeSureRelatedUserIsDeleted_88(); break; case 89: - ChipLogProgress(chipTool, - " ***** Test Step 89 : Read the user related with first RFID back and make sure it has only PIN credential\n"); - err = TestReadTheUserRelatedWithFirstRfidBackAndMakeSureItHasOnlyPinCredential_89(); + ChipLogProgress(chipTool, " ***** Test Step 89 : Create new RFID credential with user\n"); + err = TestCreateNewRfidCredentialWithUser_89(); break; case 90: - ChipLogProgress( - chipTool, " ***** Test Step 90 : Read the user related with second RFID back and make sure it is deleted\n"); - err = TestReadTheUserRelatedWithSecondRfidBackAndMakeSureItIsDeleted_90(); + ChipLogProgress(chipTool, " ***** Test Step 90 : Clear all the RFID credentials\n"); + err = TestClearAllTheRfidCredentials_90(); break; case 91: - ChipLogProgress(chipTool, " ***** Test Step 91 : Create new PIN credential with user\n"); - err = TestCreateNewPinCredentialWithUser_91(); + ChipLogProgress(chipTool, " ***** Test Step 91 : Read back the fist RFID credential and make sure it is deleted\n"); + err = TestReadBackTheFistRfidCredentialAndMakeSureItIsDeleted_91(); break; case 92: - ChipLogProgress(chipTool, " ***** Test Step 92 : Create new RFID credential with user\n"); - err = TestCreateNewRfidCredentialWithUser_92(); + ChipLogProgress(chipTool, " ***** Test Step 92 : Read back the second RFID credential and make sure it is deleted\n"); + err = TestReadBackTheSecondRfidCredentialAndMakeSureItIsDeleted_92(); break; case 93: - ChipLogProgress(chipTool, " ***** Test Step 93 : Create another RFID credential with user\n"); - err = TestCreateAnotherRfidCredentialWithUser_93(); + ChipLogProgress(chipTool, " ***** Test Step 93 : Read back the third RFID credential and make sure it is deleted\n"); + err = TestReadBackTheThirdRfidCredentialAndMakeSureItIsDeleted_93(); break; case 94: - ChipLogProgress(chipTool, " ***** Test Step 94 : Clear all the credentials\n"); - err = TestClearAllTheCredentials_94(); + ChipLogProgress(chipTool, + " ***** Test Step 94 : Read the user related with first RFID back and make sure it has only PIN credential\n"); + err = TestReadTheUserRelatedWithFirstRfidBackAndMakeSureItHasOnlyPinCredential_94(); break; case 95: - ChipLogProgress(chipTool, " ***** Test Step 95 : Read back the first PIN credential and make sure it is deleted\n"); - err = TestReadBackTheFirstPinCredentialAndMakeSureItIsDeleted_95(); + ChipLogProgress( + chipTool, " ***** Test Step 95 : Read the user related with second RFID back and make sure it is deleted\n"); + err = TestReadTheUserRelatedWithSecondRfidBackAndMakeSureItIsDeleted_95(); break; case 96: - ChipLogProgress(chipTool, " ***** Test Step 96 : Read back the first RFID credential and make sure it is deleted\n"); - err = TestReadBackTheFirstRfidCredentialAndMakeSureItIsDeleted_96(); + ChipLogProgress(chipTool, " ***** Test Step 96 : Create new PIN credential with user\n"); + err = TestCreateNewPinCredentialWithUser_96(); break; case 97: - ChipLogProgress(chipTool, " ***** Test Step 97 : Read back the second PIN credential and make sure it is deleted\n"); - err = TestReadBackTheSecondPinCredentialAndMakeSureItIsDeleted_97(); + ChipLogProgress(chipTool, " ***** Test Step 97 : Create new RFID credential with user\n"); + err = TestCreateNewRfidCredentialWithUser_97(); break; case 98: - ChipLogProgress( - chipTool, " ***** Test Step 98 : Read the user related with first PIN back and make sure it is deleted\n"); - err = TestReadTheUserRelatedWithFirstPinBackAndMakeSureItIsDeleted_98(); + ChipLogProgress(chipTool, " ***** Test Step 98 : Create another RFID credential with user\n"); + err = TestCreateAnotherRfidCredentialWithUser_98(); break; case 99: - ChipLogProgress( - chipTool, " ***** Test Step 99 : Read the user related with first RFID back and make sure it is deleted\n"); - err = TestReadTheUserRelatedWithFirstRfidBackAndMakeSureItIsDeleted_99(); + ChipLogProgress(chipTool, " ***** Test Step 99 : Clear all the credentials\n"); + err = TestClearAllTheCredentials_99(); break; case 100: - ChipLogProgress( - chipTool, " ***** Test Step 100 : Read the user related with second PIN back and make sure it is deleted\n"); - err = TestReadTheUserRelatedWithSecondPinBackAndMakeSureItIsDeleted_100(); + ChipLogProgress(chipTool, " ***** Test Step 100 : Read back the first PIN credential and make sure it is deleted\n"); + err = TestReadBackTheFirstPinCredentialAndMakeSureItIsDeleted_100(); break; case 101: - ChipLogProgress( - chipTool, " ***** Test Step 101 : Read the user related with last RFID back and make sure it is deleted\n"); - err = TestReadTheUserRelatedWithLastRfidBackAndMakeSureItIsDeleted_101(); + ChipLogProgress(chipTool, " ***** Test Step 101 : Read back the first RFID credential and make sure it is deleted\n"); + err = TestReadBackTheFirstRfidCredentialAndMakeSureItIsDeleted_101(); break; case 102: - ChipLogProgress(chipTool, " ***** Test Step 102 : Create new Programming PIN credential with invalid index\n"); - err = TestCreateNewProgrammingPinCredentialWithInvalidIndex_102(); + ChipLogProgress(chipTool, " ***** Test Step 102 : Read back the second PIN credential and make sure it is deleted\n"); + err = TestReadBackTheSecondPinCredentialAndMakeSureItIsDeleted_102(); break; case 103: - ChipLogProgress(chipTool, " ***** Test Step 103 : Create new Programming PIN credential with valid index\n"); - err = TestCreateNewProgrammingPinCredentialWithValidIndex_103(); + ChipLogProgress( + chipTool, " ***** Test Step 103 : Read the user related with first PIN back and make sure it is deleted\n"); + err = TestReadTheUserRelatedWithFirstPinBackAndMakeSureItIsDeleted_103(); break; case 104: - ChipLogProgress(chipTool, " ***** Test Step 104 : Verify created user\n"); - err = TestVerifyCreatedUser_104(); + ChipLogProgress( + chipTool, " ***** Test Step 104 : Read the user related with first RFID back and make sure it is deleted\n"); + err = TestReadTheUserRelatedWithFirstRfidBackAndMakeSureItIsDeleted_104(); break; case 105: - ChipLogProgress(chipTool, " ***** Test Step 105 : Verify created programming PIN credential\n"); - err = TestVerifyCreatedProgrammingPinCredential_105(); + ChipLogProgress( + chipTool, " ***** Test Step 105 : Read the user related with second PIN back and make sure it is deleted\n"); + err = TestReadTheUserRelatedWithSecondPinBackAndMakeSureItIsDeleted_105(); break; case 106: - ChipLogProgress(chipTool, " ***** Test Step 106 : Modify the Programming PIN credential\n"); - err = TestModifyTheProgrammingPinCredential_106(); + ChipLogProgress( + chipTool, " ***** Test Step 106 : Read the user related with last RFID back and make sure it is deleted\n"); + err = TestReadTheUserRelatedWithLastRfidBackAndMakeSureItIsDeleted_106(); break; case 107: - ChipLogProgress(chipTool, " ***** Test Step 107 : Clearing Programming PIN fails\n"); - err = TestClearingProgrammingPinFails_107(); + ChipLogProgress(chipTool, " ***** Test Step 107 : Create new Programming PIN credential with invalid index\n"); + err = TestCreateNewProgrammingPinCredentialWithInvalidIndex_107(); break; case 108: - ChipLogProgress(chipTool, " ***** Test Step 108 : Clearing Programming PIN with invalid index fails\n"); - err = TestClearingProgrammingPinWithInvalidIndexFails_108(); + ChipLogProgress(chipTool, " ***** Test Step 108 : Create new Programming PIN credential with valid index\n"); + err = TestCreateNewProgrammingPinCredentialWithValidIndex_108(); break; case 109: - ChipLogProgress(chipTool, " ***** Test Step 109 : Clearing PIN credential with zero index fails\n"); - err = TestClearingPinCredentialWithZeroIndexFails_109(); + ChipLogProgress(chipTool, " ***** Test Step 109 : Verify created user\n"); + err = TestVerifyCreatedUser_109(); break; case 110: - ChipLogProgress(chipTool, " ***** Test Step 110 : Clearing PIN credential with out-of-bound index fails\n"); - err = TestClearingPinCredentialWithOutOfBoundIndexFails_110(); + ChipLogProgress(chipTool, " ***** Test Step 110 : Verify created programming PIN credential\n"); + err = TestVerifyCreatedProgrammingPinCredential_110(); break; case 111: - ChipLogProgress(chipTool, " ***** Test Step 111 : Clearing RFID credential with zero index fails\n"); - err = TestClearingRfidCredentialWithZeroIndexFails_111(); + ChipLogProgress(chipTool, " ***** Test Step 111 : Modify the Programming PIN credential\n"); + err = TestModifyTheProgrammingPinCredential_111(); break; case 112: - ChipLogProgress(chipTool, " ***** Test Step 112 : Clearing RFID credential with out-of-bound index fails\n"); - err = TestClearingRfidCredentialWithOutOfBoundIndexFails_112(); + ChipLogProgress(chipTool, " ***** Test Step 112 : Clearing Programming PIN fails\n"); + err = TestClearingProgrammingPinFails_112(); break; case 113: - ChipLogProgress(chipTool, " ***** Test Step 113 : Clear the Programming PIN user\n"); - err = TestClearTheProgrammingPinUser_113(); + ChipLogProgress(chipTool, " ***** Test Step 113 : Clearing Programming PIN with invalid index fails\n"); + err = TestClearingProgrammingPinWithInvalidIndexFails_113(); break; case 114: - ChipLogProgress(chipTool, " ***** Test Step 114 : Make sure Programming PIN user is deleted\n"); - err = TestMakeSureProgrammingPinUserIsDeleted_114(); + ChipLogProgress(chipTool, " ***** Test Step 114 : Clearing PIN credential with zero index fails\n"); + err = TestClearingPinCredentialWithZeroIndexFails_114(); break; case 115: - ChipLogProgress(chipTool, " ***** Test Step 115 : Make sure programming PIN credential is deleted\n"); - err = TestMakeSureProgrammingPinCredentialIsDeleted_115(); + ChipLogProgress(chipTool, " ***** Test Step 115 : Clearing PIN credential with out-of-bound index fails\n"); + err = TestClearingPinCredentialWithOutOfBoundIndexFails_115(); break; case 116: - ChipLogProgress(chipTool, " ***** Test Step 116 : Create new PIN credential and user\n"); - err = TestCreateNewPinCredentialAndUser_116(); + ChipLogProgress(chipTool, " ***** Test Step 116 : Clearing RFID credential with zero index fails\n"); + err = TestClearingRfidCredentialWithZeroIndexFails_116(); break; case 117: - ChipLogProgress(chipTool, " ***** Test Step 117 : Create second PIN credential and add it to existing user\n"); - err = TestCreateSecondPinCredentialAndAddItToExistingUser_117(); + ChipLogProgress(chipTool, " ***** Test Step 117 : Clearing RFID credential with out-of-bound index fails\n"); + err = TestClearingRfidCredentialWithOutOfBoundIndexFails_117(); break; case 118: - ChipLogProgress(chipTool, " ***** Test Step 118 : Create third PIN credential and add it to existing user\n"); - err = TestCreateThirdPinCredentialAndAddItToExistingUser_118(); + ChipLogProgress(chipTool, " ***** Test Step 118 : Clear the Programming PIN user\n"); + err = TestClearTheProgrammingPinUser_118(); break; case 119: - ChipLogProgress(chipTool, " ***** Test Step 119 : Create fourth PIN credential and add it to existing user\n"); - err = TestCreateFourthPinCredentialAndAddItToExistingUser_119(); + ChipLogProgress(chipTool, " ***** Test Step 119 : Make sure Programming PIN user is deleted\n"); + err = TestMakeSureProgrammingPinUserIsDeleted_119(); break; case 120: - ChipLogProgress(chipTool, " ***** Test Step 120 : Create fifth PIN credential and add it to existing user\n"); - err = TestCreateFifthPinCredentialAndAddItToExistingUser_120(); + ChipLogProgress(chipTool, " ***** Test Step 120 : Make sure programming PIN credential is deleted\n"); + err = TestMakeSureProgrammingPinCredentialIsDeleted_120(); break; case 121: - ChipLogProgress(chipTool, " ***** Test Step 121 : Try to create sixth PIN credential and make sure it fails\n"); - err = TestTryToCreateSixthPinCredentialAndMakeSureItFails_121(); + ChipLogProgress(chipTool, " ***** Test Step 121 : Create new PIN credential and user\n"); + err = TestCreateNewPinCredentialAndUser_121(); break; case 122: - ChipLogProgress(chipTool, " ***** Test Step 122 : Final clean-up\n"); - err = TestFinalCleanUp_122(); + ChipLogProgress(chipTool, " ***** Test Step 122 : Create second PIN credential and add it to existing user\n"); + err = TestCreateSecondPinCredentialAndAddItToExistingUser_122(); + break; + case 123: + ChipLogProgress(chipTool, " ***** Test Step 123 : Create third PIN credential and add it to existing user\n"); + err = TestCreateThirdPinCredentialAndAddItToExistingUser_123(); + break; + case 124: + ChipLogProgress(chipTool, " ***** Test Step 124 : Create fourth PIN credential and add it to existing user\n"); + err = TestCreateFourthPinCredentialAndAddItToExistingUser_124(); + break; + case 125: + ChipLogProgress(chipTool, " ***** Test Step 125 : Create fifth PIN credential and add it to existing user\n"); + err = TestCreateFifthPinCredentialAndAddItToExistingUser_125(); + break; + case 126: + ChipLogProgress(chipTool, " ***** Test Step 126 : Try to create sixth PIN credential and make sure it fails\n"); + err = TestTryToCreateSixthPinCredentialAndMakeSureItFails_126(); + break; + case 127: + ChipLogProgress(chipTool, " ***** Test Step 127 : Final clean-up\n"); + err = TestFinalCleanUp_127(); break; } @@ -110571,37 +110600,37 @@ class DL_UsersAndCredentials : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 107: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 108: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 109: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 110: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 111: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 112: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 113: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 114: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 115: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 116: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 117: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 118: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -110618,6 +110647,21 @@ class DL_UsersAndCredentials : public TestCommandBridge { case 122: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 123: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 124: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 125: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 126: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 127: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -110631,7 +110675,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 123; + const uint16_t mTestCount = 128; chip::Optional mNodeId; chip::Optional mCluster; @@ -113166,54 +113210,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadingRfidCredentialWithIndex0ReturnsNoCredentialDuplicateWithBugWorkaround_54() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRDoorLockClusterGetCredentialStatusParams alloc] init]; - params.credential = [[MTRDoorLockClusterCredentialStruct alloc] init]; - ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:2U]; - ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:0U]; - - [cluster getCredentialStatusWithParams:params - completion:^(MTRDoorLockClusterGetCredentialStatusResponseParams * _Nullable values, - NSError * _Nullable err) { - NSLog(@"Reading RFID credential with index 0 returns no credential duplicate with bug " - @"workaround Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = values.credentialExists; - VerifyOrReturn(CheckValue("CredentialExists", actualValue, false)); - } - - { - id actualValue = values.userIndex; - VerifyOrReturn(CheckValueNull("UserIndex", actualValue)); - } - - { - id actualValue = values.creatorFabricIndex; - VerifyOrReturn(CheckValueNull("CreatorFabricIndex", actualValue)); - } - - { - id actualValue = values.lastModifiedFabricIndex; - VerifyOrReturn(CheckValueNull("LastModifiedFabricIndex", actualValue)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadingRfidCredentialWithOutOfBoundsIndexReturnsNoCredential_55() + CHIP_ERROR TestReadingRfidCredentialWithOutOfBoundsIndexReturnsNoCredential_54() { MTRBaseDevice * device = GetDevice("alpha"); @@ -113265,7 +113262,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCheckThatRfidCredentialDoesNotExist_56() + CHIP_ERROR TestCheckThatRfidCredentialDoesNotExist_55() { MTRBaseDevice * device = GetDevice("alpha"); @@ -113315,7 +113312,151 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewRfidCredentialAndAddItToExistingUser_57() + CHIP_ERROR TestCreateNewRfidCredentialAndAddItToExistingUserWithNonNullUserStatusShouldFail_56() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetCredentialParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0U]; + params.credential = [[MTRDoorLockClusterCredentialStruct alloc] init]; + ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:2U]; + ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + params.credentialData = [[NSData alloc] initWithBytes:"rfid_data_123456" length:16]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.userStatus = [NSNumber numberWithUnsignedChar:1U]; + params.userType = nil; + [cluster + setCredentialWithParams:params + completion:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Create new RFID credential and add it to existing user with non-null UserStatus should fail " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 133U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNull("UserIndex", actualValue)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("NextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("NextCredentialIndex", actualValue, 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateNewRfidCredentialAndAddItToExistingUserWithNonNullUserTypeShouldFail_57() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetCredentialParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0U]; + params.credential = [[MTRDoorLockClusterCredentialStruct alloc] init]; + ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:2U]; + ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + params.credentialData = [[NSData alloc] initWithBytes:"rfid_data_123456" length:16]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.userStatus = nil; + params.userType = [NSNumber numberWithUnsignedChar:0U]; + [cluster + setCredentialWithParams:params + completion:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Create new RFID credential and add it to existing user with non-null UserType should fail " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 133U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNull("UserIndex", actualValue)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("NextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("NextCredentialIndex", actualValue, 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateNewRfidCredentialAndAddItToExistingUserWithNonNullUserTypeAndUserStatusShouldFail_58() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetCredentialParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:0U]; + params.credential = [[MTRDoorLockClusterCredentialStruct alloc] init]; + ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:2U]; + ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + params.credentialData = [[NSData alloc] initWithBytes:"rfid_data_123456" length:16]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.userStatus = [NSNumber numberWithUnsignedChar:1U]; + params.userType = [NSNumber numberWithUnsignedChar:0U]; + [cluster + setCredentialWithParams:params + completion:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Create new RFID credential and add it to existing user with non-null UserType and UserStatus " + @"should fail Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 133U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNull("UserIndex", actualValue)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("NextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("NextCredentialIndex", actualValue, 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateNewRfidCredentialAndAddItToExistingUser_59() { MTRBaseDevice * device = GetDevice("alpha"); @@ -113361,7 +113502,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyModifiedUser_58() + CHIP_ERROR TestVerifyModifiedUser_60() { MTRBaseDevice * device = GetDevice("alpha"); @@ -113447,7 +113588,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyCreatedCredential_59() + CHIP_ERROR TestVerifyCreatedCredential_61() { MTRBaseDevice * device = GetDevice("alpha"); @@ -113500,7 +113641,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewRfidCredentialAndUserWithIndex0Fails_60() + CHIP_ERROR TestCreateNewRfidCredentialAndUserWithIndex0Fails_62() { MTRBaseDevice * device = GetDevice("alpha"); @@ -113546,7 +113687,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewRfidCredentialAndUserWithOutOfBoundsIndexFails_61() + CHIP_ERROR TestCreateNewRfidCredentialAndUserWithOutOfBoundsIndexFails_63() { MTRBaseDevice * device = GetDevice("alpha"); @@ -113592,7 +113733,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewCredentialAndTryToAddItTo0User_62() + CHIP_ERROR TestCreateNewCredentialAndTryToAddItTo0User_64() { MTRBaseDevice * device = GetDevice("alpha"); @@ -113638,7 +113779,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewCredentialAndTryToAddItToOutOfBoundsUser_63() + CHIP_ERROR TestCreateNewCredentialAndTryToAddItToOutOfBoundsUser_65() { MTRBaseDevice * device = GetDevice("alpha"); @@ -113684,7 +113825,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewPinWithTooShortData_64() + CHIP_ERROR TestCreateNewPinWithTooShortData_66() { MTRBaseDevice * device = GetDevice("alpha"); @@ -113730,7 +113871,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewPinWithTooLongData_65() + CHIP_ERROR TestCreateNewPinWithTooLongData_67() { MTRBaseDevice * device = GetDevice("alpha"); @@ -113776,7 +113917,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewRfidWithTooShortData_66() + CHIP_ERROR TestCreateNewRfidWithTooShortData_68() { MTRBaseDevice * device = GetDevice("alpha"); @@ -113822,7 +113963,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewPinWithProgrammingUserTypeFails_67() + CHIP_ERROR TestCreateNewPinWithProgrammingUserTypeFails_69() { MTRBaseDevice * device = GetDevice("alpha"); @@ -113868,7 +114009,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewRfidWithTooShortData_68() + CHIP_ERROR TestCreateNewRfidWithTooShortData_70() { MTRBaseDevice * device = GetDevice("alpha"); @@ -113914,7 +114055,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewPinCredentialWithDataTheWouldCauseDuplicate_69() + CHIP_ERROR TestCreateNewPinCredentialWithDataTheWouldCauseDuplicate_71() { MTRBaseDevice * device = GetDevice("alpha"); @@ -113960,7 +114101,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewRfidCredentialWithDataTheWouldCauseDuplicate_70() + CHIP_ERROR TestCreateNewRfidCredentialWithDataTheWouldCauseDuplicate_72() { MTRBaseDevice * device = GetDevice("alpha"); @@ -114006,7 +114147,150 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestModifyCredentialDataOfExistingPinCredential_71() + CHIP_ERROR TestModifyCredentialDataOfExistingPinCredentialWithNonNullUserStatusShouldFail_73() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetCredentialParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:2U]; + params.credential = [[MTRDoorLockClusterCredentialStruct alloc] init]; + ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; + ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.userStatus = [NSNumber numberWithUnsignedChar:1U]; + params.userType = nil; + [cluster + setCredentialWithParams:params + completion:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog( + @"Modify credentialData of existing PIN credential with non-null UserStatus should fail Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 133U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNull("UserIndex", actualValue)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("NextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("NextCredentialIndex", actualValue, 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestModifyCredentialDataOfExistingPinCredentialWithNonNullUserTypeShouldFail_74() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetCredentialParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:2U]; + params.credential = [[MTRDoorLockClusterCredentialStruct alloc] init]; + ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; + ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.userStatus = nil; + params.userType = [NSNumber numberWithUnsignedChar:0U]; + [cluster + setCredentialWithParams:params + completion:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Modify credentialData of existing PIN credential with non-null UserType should fail Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 133U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNull("UserIndex", actualValue)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("NextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("NextCredentialIndex", actualValue, 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestModifyCredentialDataOfExistingPinCredentialWithNonNullUserStatusAndUserTypeShouldFail_75() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetCredentialParams alloc] init]; + params.operationType = [NSNumber numberWithUnsignedChar:2U]; + params.credential = [[MTRDoorLockClusterCredentialStruct alloc] init]; + ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; + ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:1U]; + + params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + params.userStatus = [NSNumber numberWithUnsignedChar:1U]; + params.userType = [NSNumber numberWithUnsignedChar:0U]; + [cluster + setCredentialWithParams:params + completion:^(MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Modify credentialData of existing PIN credential with non-null UserStatus and UserType should " + @"fail Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 133U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValueNull("UserIndex", actualValue)); + } + + { + id actualValue = values.nextCredentialIndex; + VerifyOrReturn(CheckValueNonNull("NextCredentialIndex", actualValue)); + VerifyOrReturn(CheckValue("NextCredentialIndex", actualValue, 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestModifyCredentialDataOfExistingPinCredential_76() { MTRBaseDevice * device = GetDevice("alpha"); @@ -114052,7 +114336,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyThatCredentialWasChangedByCreatingNewCredentialWithOldData_72() + CHIP_ERROR TestVerifyThatCredentialWasChangedByCreatingNewCredentialWithOldData_77() { MTRBaseDevice * device = GetDevice("alpha"); @@ -114099,7 +114383,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyThatCredentialWasChangedByCreatingNewCredentialWithNewData_73() + CHIP_ERROR TestVerifyThatCredentialWasChangedByCreatingNewCredentialWithNewData_78() { MTRBaseDevice * device = GetDevice("alpha"); @@ -114145,7 +114429,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewRfidCredentialAndAddItToExistingUser_74() + CHIP_ERROR TestCreateNewRfidCredentialAndAddItToExistingUser_79() { MTRBaseDevice * device = GetDevice("alpha"); @@ -114191,7 +114475,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyModifiedUser_75() + CHIP_ERROR TestVerifyModifiedUser_80() { MTRBaseDevice * device = GetDevice("alpha"); @@ -114282,7 +114566,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewRfidCredentialAndAddItToExistingUser_76() + CHIP_ERROR TestCreateNewRfidCredentialAndAddItToExistingUser_81() { MTRBaseDevice * device = GetDevice("alpha"); @@ -114328,7 +114612,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyModifiedUser_77() + CHIP_ERROR TestVerifyModifiedUser_82() { MTRBaseDevice * device = GetDevice("alpha"); @@ -114423,7 +114707,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearFirstPinCredential_78() + CHIP_ERROR TestClearFirstPinCredential_83() { MTRBaseDevice * device = GetDevice("alpha"); @@ -114447,7 +114731,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadBackTheCredentialAndMakeSureItIsDeleted_79() + CHIP_ERROR TestReadBackTheCredentialAndMakeSureItIsDeleted_84() { MTRBaseDevice * device = GetDevice("alpha"); @@ -114498,7 +114782,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheUserBackAndMakeSurePinCredentialIsDeleted_80() + CHIP_ERROR TestReadTheUserBackAndMakeSurePinCredentialIsDeleted_85() { MTRBaseDevice * device = GetDevice("alpha"); @@ -114589,7 +114873,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearTheSecondPinCredential_81() + CHIP_ERROR TestClearTheSecondPinCredential_86() { MTRBaseDevice * device = GetDevice("alpha"); @@ -114613,7 +114897,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadBackTheCredentialAndMakeSureItIsDeleted_82() + CHIP_ERROR TestReadBackTheCredentialAndMakeSureItIsDeleted_87() { MTRBaseDevice * device = GetDevice("alpha"); @@ -114664,7 +114948,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheUserBackAndMakeSureRelatedUserIsDeleted_83() + CHIP_ERROR TestReadTheUserBackAndMakeSureRelatedUserIsDeleted_88() { MTRBaseDevice * device = GetDevice("alpha"); @@ -114735,7 +115019,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewRfidCredentialWithUser_84() + CHIP_ERROR TestCreateNewRfidCredentialWithUser_89() { MTRBaseDevice * device = GetDevice("alpha"); @@ -114782,7 +115066,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearAllTheRfidCredentials_85() + CHIP_ERROR TestClearAllTheRfidCredentials_90() { MTRBaseDevice * device = GetDevice("alpha"); @@ -114806,7 +115090,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadBackTheFistRfidCredentialAndMakeSureItIsDeleted_86() + CHIP_ERROR TestReadBackTheFistRfidCredentialAndMakeSureItIsDeleted_91() { MTRBaseDevice * device = GetDevice("alpha"); @@ -114856,7 +115140,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadBackTheSecondRfidCredentialAndMakeSureItIsDeleted_87() + CHIP_ERROR TestReadBackTheSecondRfidCredentialAndMakeSureItIsDeleted_92() { MTRBaseDevice * device = GetDevice("alpha"); @@ -114906,7 +115190,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadBackTheThirdRfidCredentialAndMakeSureItIsDeleted_88() + CHIP_ERROR TestReadBackTheThirdRfidCredentialAndMakeSureItIsDeleted_93() { MTRBaseDevice * device = GetDevice("alpha"); @@ -114956,7 +115240,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheUserRelatedWithFirstRfidBackAndMakeSureItHasOnlyPinCredential_89() + CHIP_ERROR TestReadTheUserRelatedWithFirstRfidBackAndMakeSureItHasOnlyPinCredential_94() { MTRBaseDevice * device = GetDevice("alpha"); @@ -115039,7 +115323,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheUserRelatedWithSecondRfidBackAndMakeSureItIsDeleted_90() + CHIP_ERROR TestReadTheUserRelatedWithSecondRfidBackAndMakeSureItIsDeleted_95() { MTRBaseDevice * device = GetDevice("alpha"); @@ -115110,7 +115394,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewPinCredentialWithUser_91() + CHIP_ERROR TestCreateNewPinCredentialWithUser_96() { MTRBaseDevice * device = GetDevice("alpha"); @@ -115157,7 +115441,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewRfidCredentialWithUser_92() + CHIP_ERROR TestCreateNewRfidCredentialWithUser_97() { MTRBaseDevice * device = GetDevice("alpha"); @@ -115204,7 +115488,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateAnotherRfidCredentialWithUser_93() + CHIP_ERROR TestCreateAnotherRfidCredentialWithUser_98() { MTRBaseDevice * device = GetDevice("alpha"); @@ -115251,7 +115535,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearAllTheCredentials_94() + CHIP_ERROR TestClearAllTheCredentials_99() { MTRBaseDevice * device = GetDevice("alpha"); @@ -115272,7 +115556,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadBackTheFirstPinCredentialAndMakeSureItIsDeleted_95() + CHIP_ERROR TestReadBackTheFirstPinCredentialAndMakeSureItIsDeleted_100() { MTRBaseDevice * device = GetDevice("alpha"); @@ -115322,7 +115606,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadBackTheFirstRfidCredentialAndMakeSureItIsDeleted_96() + CHIP_ERROR TestReadBackTheFirstRfidCredentialAndMakeSureItIsDeleted_101() { MTRBaseDevice * device = GetDevice("alpha"); @@ -115372,7 +115656,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadBackTheSecondPinCredentialAndMakeSureItIsDeleted_97() + CHIP_ERROR TestReadBackTheSecondPinCredentialAndMakeSureItIsDeleted_102() { MTRBaseDevice * device = GetDevice("alpha"); @@ -115422,7 +115706,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheUserRelatedWithFirstPinBackAndMakeSureItIsDeleted_98() + CHIP_ERROR TestReadTheUserRelatedWithFirstPinBackAndMakeSureItIsDeleted_103() { MTRBaseDevice * device = GetDevice("alpha"); @@ -115493,7 +115777,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheUserRelatedWithFirstRfidBackAndMakeSureItIsDeleted_99() + CHIP_ERROR TestReadTheUserRelatedWithFirstRfidBackAndMakeSureItIsDeleted_104() { MTRBaseDevice * device = GetDevice("alpha"); @@ -115564,7 +115848,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheUserRelatedWithSecondPinBackAndMakeSureItIsDeleted_100() + CHIP_ERROR TestReadTheUserRelatedWithSecondPinBackAndMakeSureItIsDeleted_105() { MTRBaseDevice * device = GetDevice("alpha"); @@ -115635,7 +115919,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheUserRelatedWithLastRfidBackAndMakeSureItIsDeleted_101() + CHIP_ERROR TestReadTheUserRelatedWithLastRfidBackAndMakeSureItIsDeleted_106() { MTRBaseDevice * device = GetDevice("alpha"); @@ -115706,7 +115990,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewProgrammingPinCredentialWithInvalidIndex_102() + CHIP_ERROR TestCreateNewProgrammingPinCredentialWithInvalidIndex_107() { MTRBaseDevice * device = GetDevice("alpha"); @@ -115751,7 +116035,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewProgrammingPinCredentialWithValidIndex_103() + CHIP_ERROR TestCreateNewProgrammingPinCredentialWithValidIndex_108() { MTRBaseDevice * device = GetDevice("alpha"); @@ -115797,7 +116081,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyCreatedUser_104() + CHIP_ERROR TestVerifyCreatedUser_109() { MTRBaseDevice * device = GetDevice("alpha"); @@ -115879,7 +116163,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyCreatedProgrammingPinCredential_105() + CHIP_ERROR TestVerifyCreatedProgrammingPinCredential_110() { MTRBaseDevice * device = GetDevice("alpha"); @@ -115932,7 +116216,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestModifyTheProgrammingPinCredential_106() + CHIP_ERROR TestModifyTheProgrammingPinCredential_111() { MTRBaseDevice * device = GetDevice("alpha"); @@ -115977,7 +116261,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearingProgrammingPinFails_107() + CHIP_ERROR TestClearingProgrammingPinFails_112() { MTRBaseDevice * device = GetDevice("alpha"); @@ -116004,7 +116288,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearingProgrammingPinWithInvalidIndexFails_108() + CHIP_ERROR TestClearingProgrammingPinWithInvalidIndexFails_113() { MTRBaseDevice * device = GetDevice("alpha"); @@ -116031,7 +116315,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearingPinCredentialWithZeroIndexFails_109() + CHIP_ERROR TestClearingPinCredentialWithZeroIndexFails_114() { MTRBaseDevice * device = GetDevice("alpha"); @@ -116058,7 +116342,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearingPinCredentialWithOutOfBoundIndexFails_110() + CHIP_ERROR TestClearingPinCredentialWithOutOfBoundIndexFails_115() { MTRBaseDevice * device = GetDevice("alpha"); @@ -116086,7 +116370,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearingRfidCredentialWithZeroIndexFails_111() + CHIP_ERROR TestClearingRfidCredentialWithZeroIndexFails_116() { MTRBaseDevice * device = GetDevice("alpha"); @@ -116113,7 +116397,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearingRfidCredentialWithOutOfBoundIndexFails_112() + CHIP_ERROR TestClearingRfidCredentialWithOutOfBoundIndexFails_117() { MTRBaseDevice * device = GetDevice("alpha"); @@ -116141,7 +116425,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearTheProgrammingPinUser_113() + CHIP_ERROR TestClearTheProgrammingPinUser_118() { MTRBaseDevice * device = GetDevice("alpha"); @@ -116162,7 +116446,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureProgrammingPinUserIsDeleted_114() + CHIP_ERROR TestMakeSureProgrammingPinUserIsDeleted_119() { MTRBaseDevice * device = GetDevice("alpha"); @@ -116233,7 +116517,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestMakeSureProgrammingPinCredentialIsDeleted_115() + CHIP_ERROR TestMakeSureProgrammingPinCredentialIsDeleted_120() { MTRBaseDevice * device = GetDevice("alpha"); @@ -116283,7 +116567,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateNewPinCredentialAndUser_116() + CHIP_ERROR TestCreateNewPinCredentialAndUser_121() { MTRBaseDevice * device = GetDevice("alpha"); @@ -116330,7 +116614,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateSecondPinCredentialAndAddItToExistingUser_117() + CHIP_ERROR TestCreateSecondPinCredentialAndAddItToExistingUser_122() { MTRBaseDevice * device = GetDevice("alpha"); @@ -116376,7 +116660,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateThirdPinCredentialAndAddItToExistingUser_118() + CHIP_ERROR TestCreateThirdPinCredentialAndAddItToExistingUser_123() { MTRBaseDevice * device = GetDevice("alpha"); @@ -116422,7 +116706,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateFourthPinCredentialAndAddItToExistingUser_119() + CHIP_ERROR TestCreateFourthPinCredentialAndAddItToExistingUser_124() { MTRBaseDevice * device = GetDevice("alpha"); @@ -116468,7 +116752,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateFifthPinCredentialAndAddItToExistingUser_120() + CHIP_ERROR TestCreateFifthPinCredentialAndAddItToExistingUser_125() { MTRBaseDevice * device = GetDevice("alpha"); @@ -116514,7 +116798,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTryToCreateSixthPinCredentialAndMakeSureItFails_121() + CHIP_ERROR TestTryToCreateSixthPinCredentialAndMakeSureItFails_126() { MTRBaseDevice * device = GetDevice("alpha"); @@ -116560,7 +116844,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestFinalCleanUp_122() + CHIP_ERROR TestFinalCleanUp_127() { MTRBaseDevice * device = GetDevice("alpha");