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..d34f206e97af67 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,83 @@ 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 +1690,84 @@ 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 284505b8973e85..867ad2054d6044 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -74747,7 +74747,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); @@ -75446,6 +75446,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: @@ -75463,13 +75464,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: @@ -75477,13 +75477,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; @@ -75516,7 +75538,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; @@ -75531,7 +75553,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; @@ -75542,7 +75564,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; @@ -75552,7 +75574,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; @@ -75563,7 +75585,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; @@ -75574,7 +75596,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; @@ -75585,7 +75607,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; @@ -75596,7 +75618,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; @@ -75607,7 +75629,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; @@ -75618,7 +75640,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; @@ -75629,7 +75651,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; @@ -75640,7 +75662,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; @@ -75651,7 +75673,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; @@ -75662,7 +75717,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; @@ -75674,7 +75729,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; @@ -75685,7 +75740,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; @@ -75696,7 +75751,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; @@ -75733,7 +75788,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; @@ -75744,7 +75799,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; @@ -75784,10 +75839,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; @@ -75800,7 +75855,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; @@ -75837,10 +75892,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; @@ -75853,7 +75908,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; @@ -75870,7 +75925,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; @@ -75882,10 +75937,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; @@ -75897,7 +75952,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; @@ -75909,7 +75964,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; @@ -75921,7 +75976,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; @@ -75951,7 +76006,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; @@ -75968,7 +76023,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; @@ -75980,7 +76035,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; @@ -75992,7 +76047,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; @@ -76004,10 +76059,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; @@ -76019,7 +76074,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; @@ -76031,7 +76086,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; @@ -76043,7 +76098,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; @@ -76060,7 +76115,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; @@ -76077,7 +76132,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; @@ -76094,7 +76149,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; @@ -76111,7 +76166,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; @@ -76121,7 +76176,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; @@ -76132,7 +76187,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; @@ -76162,7 +76217,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; @@ -76177,7 +76232,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; @@ -76187,28 +76242,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; @@ -76225,7 +76280,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; @@ -76237,7 +76292,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; @@ -76249,7 +76304,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; @@ -76260,7 +76315,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; @@ -76271,7 +76326,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; @@ -76282,7 +76337,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; @@ -76293,7 +76348,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; @@ -76304,7 +76359,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: @@ -77023,12 +77078,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 @@ -77036,12 +77091,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 @@ -77049,20 +77104,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); @@ -77075,14 +77138,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; @@ -77091,8 +77197,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; @@ -77104,8 +77210,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); @@ -77123,8 +77229,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); @@ -77142,8 +77248,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); @@ -77161,8 +77267,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); @@ -77180,8 +77286,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); @@ -77199,8 +77305,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); @@ -77218,8 +77324,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); @@ -77237,8 +77343,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); @@ -77257,8 +77363,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); @@ -77277,8 +77383,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); @@ -77295,8 +77401,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); @@ -77314,8 +77420,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); @@ -77333,8 +77500,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); @@ -77351,8 +77518,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); @@ -77369,8 +77536,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); @@ -77389,8 +77556,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; @@ -77399,8 +77566,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); @@ -77418,8 +77585,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; @@ -77428,8 +77595,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(); @@ -77442,8 +77609,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; @@ -77455,8 +77622,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; @@ -77465,8 +77632,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(); @@ -77479,8 +77646,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; @@ -77492,8 +77659,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; @@ -77502,8 +77669,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); @@ -77521,8 +77688,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(); @@ -77535,8 +77702,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; @@ -77548,8 +77715,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; @@ -77561,8 +77728,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; @@ -77574,8 +77741,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; @@ -77584,8 +77751,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; @@ -77594,8 +77761,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); @@ -77612,8 +77779,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); @@ -77631,8 +77798,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); @@ -77650,8 +77817,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(); @@ -77660,8 +77827,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; @@ -77673,8 +77840,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; @@ -77686,8 +77853,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; @@ -77699,8 +77866,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; @@ -77709,8 +77876,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; @@ -77719,8 +77886,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; @@ -77729,8 +77896,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; @@ -77739,8 +77906,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); @@ -77757,8 +77924,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); @@ -77775,8 +77942,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; @@ -77785,8 +77952,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; @@ -77798,8 +77965,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); @@ -77816,8 +77983,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(); @@ -77830,8 +77997,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(); @@ -77844,8 +78011,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(); @@ -77858,8 +78025,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(); @@ -77872,8 +78039,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(); @@ -77886,8 +78053,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(); @@ -77900,8 +78067,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; @@ -77910,8 +78077,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; @@ -77920,8 +78087,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; @@ -77933,8 +78100,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); @@ -77951,8 +78118,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); @@ -77970,8 +78137,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); @@ -77989,8 +78156,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); @@ -78008,8 +78175,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); @@ -78027,8 +78194,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); @@ -78046,8 +78213,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");