diff --git a/examples/chef/common/stubs.cpp b/examples/chef/common/stubs.cpp index 2a04a980a419a7..6fd7713bfdcfd2 100644 --- a/examples/chef/common/stubs.cpp +++ b/examples/chef/common/stubs.cpp @@ -4,6 +4,9 @@ #include #include #include + +// Include door lock callbacks only when the server is enabled +#ifdef EMBER_AF_PLUGIN_DOOR_LOCK_SERVER #include bool emberAfPluginDoorLockOnDoorLockCommand(chip::EndpointId endpointId, const chip::Optional & pinCode, @@ -19,3 +22,4 @@ bool emberAfPluginDoorLockOnDoorUnlockCommand(chip::EndpointId endpointId, const err = DlOperationError::kUnspecified; return true; } +#endif /* EMBER_AF_PLUGIN_DOOR_LOCK_SERVER */ diff --git a/examples/lock-app/linux/src/LockEndpoint.cpp b/examples/lock-app/linux/src/LockEndpoint.cpp index 396eab9cdbd893..7c8518c09d181a 100644 --- a/examples/lock-app/linux/src/LockEndpoint.cpp +++ b/examples/lock-app/linux/src/LockEndpoint.cpp @@ -366,7 +366,10 @@ bool LockEndpoint::setLockState(DlLockState lockState, const OptionalwrongCodeEntryAttempts >= wrongCodeEntryLimit) + { + emberAfDoorLockClusterPrintln("Too many wrong code entry attempts, engaging lockout [endpoint=%d,wrongCodeAttempts=%d]", + endpointId, endpointContext->wrongCodeEntryAttempts); + engageLockout(endpointId); + } + } + else if (EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE != status) + { + ChipLogError(Zcl, "Failed to read Wrong Code Entry Limit attribute, status=0x%x", to_underlying(status)); + return false; + } + return true; +} + +bool DoorLockServer::engageLockout(chip::EndpointId endpointId) +{ + uint8_t lockoutTimeout; + + auto endpointContext = getContext(endpointId); + if (nullptr == endpointContext) + { + ChipLogError(Zcl, "Failed to get endpoint index for cluster [endpoint=%d]", endpointId); + return false; + } + + auto status = Attributes::UserCodeTemporaryDisableTime::Get(endpointId, &lockoutTimeout); + if (EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE == status) + { + return false; + } + if (EMBER_ZCL_STATUS_SUCCESS != status) + { + ChipLogError(Zcl, "Unable to read the UserCodeTemporaryDisableTime attribute [status=%d]", to_underlying(status)); + return false; + } + + endpointContext->wrongCodeEntryAttempts = 0; + endpointContext->lockoutEndTimestamp = + chip::System::SystemClock().GetMonotonicTimestamp() + chip::System::Clock::Seconds32(lockoutTimeout); + + emberAfDoorLockClusterPrintln("Lockout engaged [endpointId=%d,lockoutTimeout=%d]", endpointId, lockoutTimeout); + + emberAfPluginDoorLockLockoutStarted(endpointId, endpointContext->lockoutEndTimestamp); + + return true; +} + bool DoorLockServer::GetAutoRelockTime(chip::EndpointId endpointId, uint32_t & autoRelockTime) { return GetAttribute(endpointId, Attributes::AutoRelockTime::Id, Attributes::AutoRelockTime::Get, autoRelockTime); @@ -3136,6 +3203,16 @@ CHIP_ERROR DoorLockServer::sendClusterResponse(chip::app::CommandHandler * comma return err; } +EmberAfDoorLockEndpointContext * DoorLockServer::getContext(chip::EndpointId endpointId) +{ + auto index = emberAfFindClusterServerEndpointIndex(endpointId, ::Id); + if (index != 0xFFFF) + { + return &mEndpointCtx[index]; + } + return nullptr; +} + bool DoorLockServer::HandleRemoteLockOperation(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, DlLockOperationType opType, RemoteLockOpHandler opHandler, const Optional & pinCode) @@ -3143,13 +3220,16 @@ bool DoorLockServer::HandleRemoteLockOperation(chip::app::CommandHandler * comma VerifyOrDie(DlLockOperationType::kLock == opType || DlLockOperationType::kUnlock == opType); VerifyOrDie(nullptr != opHandler); - DlLockState newLockState = (DlLockOperationType::kLock == opType) ? DlLockState::kLocked : DlLockState::kUnlocked; - EndpointId endpoint = commandPath.mEndpointId; - DlOperationError reason = DlOperationError::kUnspecified; - uint16_t pinUserIdx = 0; - uint16_t pinCredIdx = 0; - bool credentialsOk = false; - bool success = false; + EndpointId endpoint = commandPath.mEndpointId; + DlOperationError reason = DlOperationError::kUnspecified; + uint16_t pinUserIdx = 0; + uint16_t pinCredIdx = 0; + bool success = false; + bool sendEvent = true; + + auto currentTime = chip::System::SystemClock().GetMonotonicTimestamp(); + + EmberAfDoorLockEndpointContext * endpointContext; VerifyOrExit(RemoteOperationEnabled(endpoint), reason = DlOperationError::kUnspecified); @@ -3157,7 +3237,16 @@ bool DoorLockServer::HandleRemoteLockOperation(chip::app::CommandHandler * comma // When the PINCode field is provided an invalid PIN will count towards the WrongCodeEntryLimit and the // UserCodeTemporaryDisableTime will be triggered if the WrongCodeEntryLimit is exceeded. The lock SHALL ignore any attempts // to lock/unlock the door until the UserCodeTemporaryDisableTime expires. - // TODO: check whether UserCodeTemporaryDisableTime expired or not. + endpointContext = getContext(endpoint); + VerifyOrExit(nullptr != endpointContext, ChipLogError(Zcl, "Failed to get endpoint index for cluster [endpoint=%d]", endpoint)); + if (endpointContext->lockoutEndTimestamp >= currentTime) + { + emberAfDoorLockClusterPrintln("Rejecting unlock command -- lockout is in action [endpoint=%d,lockoutEnd=%u,currentTime=%u]", + endpoint, static_cast(endpointContext->lockoutEndTimestamp.count()), + static_cast(currentTime.count())); + sendEvent = false; + goto exit; + } if (pinCode.HasValue()) { @@ -3180,12 +3269,6 @@ bool DoorLockServer::HandleRemoteLockOperation(chip::app::CommandHandler * comma "Unable to perform remote lock operation: user is disabled [endpoint=%d, lock_op=%d, userIndex=%d]", endpoint, to_underlying(opType), pinUserIdx); }); - - // [EM]: I don't think we should prevent door lock/unlocking if we couldn't find credential associated with user. I - // think if the app thinks that PIN is correct the door should be unlocked. - // - // [DV]: let app decide on PIN correctness, we will fail only if 'opHandler' returns false. - credentialsOk = true; } else { @@ -3202,27 +3285,30 @@ bool DoorLockServer::HandleRemoteLockOperation(chip::app::CommandHandler * comma EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE == status || EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Failed to read Require PIN For Remote Operation attribute, status=0x%x", to_underlying(status))); } - credentialsOk = !requirePin; + // If the PIN is required but not provided we should exit + VerifyOrExit(!requirePin, { + reason = DlOperationError::kInvalidCredential; + emberAfDoorLockClusterPrintln("Checking credentials failed: PIN is not provided when it is required"); + }); } - // TODO: increase WrongCodeEntryLimit if credentialsOk == false. - // TODO: If limit is exceeded, lock remote operations for UserCodeTemporaryDisableTime. - VerifyOrExit(credentialsOk, { - reason = DlOperationError::kInvalidCredential; - emberAfDoorLockClusterPrintln("Checking credentials failed: either PIN is invalid or not provided"); - }); - // credentials check succeeded, try to lock/unlock door success = opHandler(endpoint, pinCode, reason); - VerifyOrExit(success, /* reason is set by the above call */); - - // door locked, set cluster attribute - VerifyOrDie(SetLockState(endpoint, newLockState, DlOperationSource::kRemote)); - + if (!success && reason == DlOperationError::kInvalidCredential) + { + TrackWrongCodeEntry(endpoint); + } + // The app should trigger the lock state change as it may take a while before the lock actually locks/unlocks exit: // Send command response emberAfSendImmediateDefaultResponse(success ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE); + // Most of the time we want to send the lock operation event but sometimes (when the lockout is active) we don't want it. + if (!sendEvent) + { + return success; + } + // Send LockOperation/LockOperationError event LockOpCredentials foundCred[] = { { DlCredentialType::kPin, pinCredIdx } }; LockOpCredentials * credList = nullptr; diff --git a/src/app/clusters/door-lock-server/door-lock-server.h b/src/app/clusters/door-lock-server/door-lock-server.h index 16879c5822b111..e247622ef6ef70 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.h +++ b/src/app/clusters/door-lock-server/door-lock-server.h @@ -29,6 +29,7 @@ #include #include #include +#include #ifndef DOOR_LOCK_SERVER_ENDPOINT #define DOOR_LOCK_SERVER_ENDPOINT 1 @@ -65,6 +66,12 @@ static constexpr size_t DOOR_LOCK_USER_NAME_BUFFER_SIZE = struct EmberAfPluginDoorLockCredentialInfo; struct EmberAfPluginDoorLockUserInfo; +struct EmberAfDoorLockEndpointContext +{ + chip::System::Clock::Timestamp lockoutEndTimestamp; + int wrongCodeEntryAttempts; +}; + /** * @brief Door Lock Server Plugin class. */ @@ -109,6 +116,8 @@ class DoorLockServer bool SetOneTouchLocking(chip::EndpointId endpointId, bool isEnabled); bool SetPrivacyModeButton(chip::EndpointId endpointId, bool isEnabled); + bool TrackWrongCodeEntry(chip::EndpointId endpointId); + bool GetAutoRelockTime(chip::EndpointId endpointId, uint32_t & autoRelockTime); bool GetNumberOfUserSupported(chip::EndpointId endpointId, uint16_t & numberOfUsersSupported); bool GetNumberOfPINCredentialsSupported(chip::EndpointId endpointId, uint16_t & numberOfPINCredentials); @@ -348,6 +357,10 @@ class DoorLockServer bool RemoteOperationEnabled(chip::EndpointId endpointId) const; + EmberAfDoorLockEndpointContext * getContext(chip::EndpointId endpointId); + + bool engageLockout(chip::EndpointId endpointId); + static CHIP_ERROR sendClusterResponse(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, EmberAfStatus status); @@ -513,6 +526,8 @@ class DoorLockServer EmberEventControl AutolockEvent; /**< for automatic relock scheduling */ + std::array mEndpointCtx; + static DoorLockServer instance; }; @@ -954,3 +969,11 @@ bool emberAfPluginDoorLockGetCredential(chip::EndpointId endpointId, uint16_t cr bool emberAfPluginDoorLockSetCredential(chip::EndpointId endpointId, uint16_t credentialIndex, chip::FabricIndex creator, chip::FabricIndex modifier, DlCredentialStatus credentialStatus, DlCredentialType credentialType, const chip::ByteSpan & credentialData); + +/** + * @brief This callback is called when the Door Lock server starts the lockout so the app could be notified about it. + * + * @param endpointId ID of the endpoint that contains the door lock to be locked out. + * @param lockoutEndTime Monotonic time of when lockout ends. + */ +void emberAfPluginDoorLockLockoutStarted(chip::EndpointId endpointId, chip::System::Clock::Timestamp lockoutEndTime); diff --git a/src/app/tests/suites/DL_LockUnlock.yaml b/src/app/tests/suites/DL_LockUnlock.yaml index 526ae34ce35da8..ecc3214a2431bf 100644 --- a/src/app/tests/suites/DL_LockUnlock.yaml +++ b/src/app/tests/suites/DL_LockUnlock.yaml @@ -74,6 +74,14 @@ tests: - name: "nextCredentialIndex" value: 2 + - label: + "Set the WrongCodeEntryLimit to big value so that we can test + incorrect PIN entry" + command: "writeAttribute" + attribute: "WrongCodeEntryLimit" + arguments: + value: 20 + - label: "Try to unlock the door with invalid PIN" command: "UnlockDoor" timedInteractionTimeoutMs: 10000 @@ -141,7 +149,7 @@ tests: value: 3 - label: "Try to unlock the door when OperatingMode is NoRemoteLockUnlock" - command: "LockDoor" + command: "UnlockDoor" timedInteractionTimeoutMs: 10000 response: error: FAILURE @@ -152,6 +160,92 @@ tests: arguments: value: 0 + - label: "Read the lockout timeout" + command: "readAttribute" + attribute: "UserCodeTemporaryDisableTime" + response: + value: 10 + + - label: "Set the WrongCodeEntryLimit to small value so we can test lockout" + command: "writeAttribute" + attribute: "WrongCodeEntryLimit" + arguments: + value: 3 + + - label: "Try to unlock the door with invalid PIN for the first time" + command: "UnlockDoor" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "pinCode" + value: "000000" + response: + error: FAILURE + + - label: "Try to unlock the door with invalid PIN for the second time" + command: "UnlockDoor" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "pinCode" + value: "000000" + response: + error: FAILURE + + - label: "Try to unlock the door with invalid PIN for the third time" + command: "UnlockDoor" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "pinCode" + value: "000000" + response: + error: FAILURE + + - label: + "Try to unlock the door with valid PIN and make sure it fails due to + lockout" + command: "UnlockDoor" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "pinCode" + value: "123456" + response: + error: FAILURE + + - label: "Wait for the lockout to end" + cluster: "DelayCommands" + command: "WaitForMs" + # We know the lockout value, but it's in seconds. Previous read from UserCodeTemporaryDisableTime verified that + # the lockout time is 10 seconds, so we can just put 10000ms here. + arguments: + values: + - name: "ms" + value: 10000 + + - label: "Try to unlock the door with valid PIN and make sure it succeeds" + command: "UnlockDoor" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "pinCode" + value: "123456" + + - label: "Verify that lock state attribute value is set to Unlocked" + command: "readAttribute" + attribute: "LockState" + response: + value: 2 + + - label: "Lock the door back prior to next tests" + command: "LockDoor" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "pinCode" + value: "123456" + - label: "Create a disabled user and 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 bf693062cb1650..f83c080f10edf5 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -60869,7 +60869,7 @@ class DL_UsersAndCredentialsSuite : public TestCommand class DL_LockUnlockSuite : public TestCommand { public: - DL_LockUnlockSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("DL_LockUnlock", 27, credsIssuerConfig) + DL_LockUnlockSuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("DL_LockUnlock", 38, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -60943,9 +60943,12 @@ class DL_LockUnlockSuite : public TestCommand } break; case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -60954,10 +60957,10 @@ class DL_LockUnlockSuite : public TestCommand VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 1U)); } break; - case 8: + case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 9: + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -60966,10 +60969,10 @@ class DL_LockUnlockSuite : public TestCommand VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 2U)); } break; - case 10: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; - case 11: + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -60978,10 +60981,10 @@ class DL_LockUnlockSuite : public TestCommand VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 2U)); } break; - case 12: + case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 13: + case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -60990,16 +60993,58 @@ class DL_LockUnlockSuite : public TestCommand VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 1U)); } break; - case 14: + case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 15: + case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; - case 16: + case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 17: + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("userCodeTemporaryDisableTime", value, 10U)); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueNonNull("lockState", value)); + VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 2U)); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType value; @@ -61011,10 +61056,10 @@ class DL_LockUnlockSuite : public TestCommand VerifyOrReturn(CheckValue("nextCredentialIndex.Value()", value.nextCredentialIndex.Value(), 3U)); } break; - case 18: + case 29: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; - case 19: + case 30: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -61023,10 +61068,10 @@ class DL_LockUnlockSuite : public TestCommand VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 1U)); } break; - case 20: + case 31: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 21: + case 32: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -61035,10 +61080,10 @@ class DL_LockUnlockSuite : public TestCommand VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 2U)); } break; - case 22: + case 33: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; - case 23: + case 34: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -61047,10 +61092,10 @@ class DL_LockUnlockSuite : public TestCommand VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 2U)); } break; - case 24: + case 35: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 25: + case 36: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::Nullable value; @@ -61059,7 +61104,7 @@ class DL_LockUnlockSuite : public TestCommand VerifyOrReturn(CheckValue("lockState.Value()", value.Value(), 1U)); } break; - case 26: + case 37: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; default: @@ -61131,7 +61176,15 @@ class DL_LockUnlockSuite : public TestCommand ); } case 6: { - LogStep(6, "Try to unlock the door with invalid PIN"); + LogStep(6, "Set the WrongCodeEntryLimit to big value so that we can test incorrect PIN entry"); + ListFreer listFreer; + uint8_t value; + value = 20U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::WrongCodeEntryLimit::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 7: { + LogStep(7, "Try to unlock the door with invalid PIN"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; value.pinCode.Emplace(); @@ -61141,13 +61194,13 @@ class DL_LockUnlockSuite : public TestCommand ); } - case 7: { - LogStep(7, "Verify that lock state attribute value is set to Locked"); + case 8: { + LogStep(8, "Verify that lock state attribute value is set to Locked"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, chip::NullOptional); } - case 8: { - LogStep(8, "Try to unlock the door with valid PIN"); + case 9: { + LogStep(9, "Try to unlock the door with valid PIN"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; value.pinCode.Emplace(); @@ -61157,13 +61210,13 @@ class DL_LockUnlockSuite : public TestCommand ); } - case 9: { - LogStep(9, "Verify that lock state attribute value is set to Unlocked"); + case 10: { + LogStep(10, "Verify that lock state attribute value is set to Unlocked"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, chip::NullOptional); } - case 10: { - LogStep(10, "Try to lock the door with invalid PIN"); + case 11: { + LogStep(11, "Try to lock the door with invalid PIN"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; value.pinCode.Emplace(); @@ -61173,13 +61226,13 @@ class DL_LockUnlockSuite : public TestCommand ); } - case 11: { - LogStep(11, "Verify that lock state attribute value is set to Unlocked"); + case 12: { + LogStep(12, "Verify that lock state attribute value is set to Unlocked"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, chip::NullOptional); } - case 12: { - LogStep(12, "Try to lock the door with valid PIN"); + case 13: { + LogStep(13, "Try to lock the door with valid PIN"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; value.pinCode.Emplace(); @@ -61189,38 +61242,129 @@ class DL_LockUnlockSuite : public TestCommand ); } - case 13: { - LogStep(13, "Verify that lock state attribute value is set to Locked"); + case 14: { + LogStep(14, "Verify that lock state attribute value is set to Locked"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, chip::NullOptional); } - case 14: { - LogStep(14, "Set OperatingMode to NoRemoteLockUnlock"); + case 15: { + LogStep(15, "Set OperatingMode to NoRemoteLockUnlock"); ListFreer listFreer; chip::app::Clusters::DoorLock::DlOperatingMode value; value = static_cast(3); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::OperatingMode::Id, value, chip::NullOptional, chip::NullOptional); } - case 15: { - LogStep(15, "Try to unlock the door when OperatingMode is NoRemoteLockUnlock"); + case 16: { + LogStep(16, "Try to unlock the door when OperatingMode is NoRemoteLockUnlock"); ListFreer listFreer; - chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; - return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, chip::Optional(10000), chip::NullOptional ); } - case 16: { - LogStep(16, "Set OperatingMode to Normal"); + case 17: { + LogStep(17, "Set OperatingMode to Normal"); ListFreer listFreer; chip::app::Clusters::DoorLock::DlOperatingMode value; value = static_cast(0); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::OperatingMode::Id, value, chip::NullOptional, chip::NullOptional); } - case 17: { - LogStep(17, "Create a disabled user and credential"); + case 18: { + LogStep(18, "Read the lockout timeout"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::UserCodeTemporaryDisableTime::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, "Set the WrongCodeEntryLimit to small value so we can test lockout"); + ListFreer listFreer; + uint8_t value; + value = 3U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::WrongCodeEntryLimit::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 20: { + LogStep(20, "Try to unlock the door with invalid PIN for the first time"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + value.pinCode.Emplace(); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("000000garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 21: { + LogStep(21, "Try to unlock the door with invalid PIN for the second time"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + value.pinCode.Emplace(); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("000000garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 22: { + LogStep(22, "Try to unlock the door with invalid PIN for the third time"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + value.pinCode.Emplace(); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("000000garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 23: { + LogStep(23, "Try to unlock the door with valid PIN and make sure it fails due to lockout"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + value.pinCode.Emplace(); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 24: { + LogStep(24, "Wait for the lockout to end"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs(kIdentityAlpha, value); + } + case 25: { + LogStep(25, "Try to unlock the door with valid PIN and make sure it succeeds"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; + value.pinCode.Emplace(); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::UnlockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 26: { + LogStep(26, "Verify that lock state attribute value is set to Unlocked"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, + chip::NullOptional); + } + case 27: { + LogStep(27, "Lock the door back prior to next tests"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; + value.pinCode.Emplace(); + value.pinCode.Value() = chip::ByteSpan(chip::Uint8::from_const_char("123456garbage: not in length on purpose"), 6); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::LockDoor::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + case 28: { + LogStep(28, "Create a disabled user and credential"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::SetCredential::Type value; value.operationType = static_cast(0); @@ -61238,8 +61382,8 @@ class DL_LockUnlockSuite : public TestCommand ); } - case 18: { - LogStep(18, "Try to unlock the door with disabled user PIN"); + case 29: { + LogStep(29, "Try to unlock the door with disabled user PIN"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; value.pinCode.Emplace(); @@ -61249,13 +61393,13 @@ class DL_LockUnlockSuite : public TestCommand ); } - case 19: { - LogStep(19, "Verify that lock state attribute value is set to Locked"); + case 30: { + LogStep(30, "Verify that lock state attribute value is set to Locked"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, chip::NullOptional); } - case 20: { - LogStep(20, "Unlock the door with enabled user PIN"); + case 31: { + LogStep(31, "Unlock the door with enabled user PIN"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::UnlockDoor::Type value; value.pinCode.Emplace(); @@ -61265,13 +61409,13 @@ class DL_LockUnlockSuite : public TestCommand ); } - case 21: { - LogStep(21, "Verify that lock state attribute value is set to Unlocked"); + case 32: { + LogStep(32, "Verify that lock state attribute value is set to Unlocked"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, chip::NullOptional); } - case 22: { - LogStep(22, "Try to lock the door with disabled user PIN"); + case 33: { + LogStep(33, "Try to lock the door with disabled user PIN"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; value.pinCode.Emplace(); @@ -61281,13 +61425,13 @@ class DL_LockUnlockSuite : public TestCommand ); } - case 23: { - LogStep(23, "Verify that lock state attribute value stays Unlocked"); + case 34: { + LogStep(34, "Verify that lock state attribute value stays Unlocked"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, chip::NullOptional); } - case 24: { - LogStep(24, "Lock the door with enabled user PIN"); + case 35: { + LogStep(35, "Lock the door with enabled user PIN"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::LockDoor::Type value; value.pinCode.Emplace(); @@ -61297,13 +61441,13 @@ class DL_LockUnlockSuite : public TestCommand ); } - case 25: { - LogStep(25, "Verify that lock state attribute value is set to Locked"); + case 36: { + LogStep(36, "Verify that lock state attribute value is set to Locked"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Attributes::LockState::Id, true, chip::NullOptional); } - case 26: { - LogStep(26, "Clean all the users and credentials"); + case 37: { + LogStep(37, "Clean all the users and credentials"); ListFreer listFreer; chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; value.userIndex = 65534U; 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 d7d860761cad82..bde48114310e85 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -106192,88 +106192,134 @@ class DL_LockUnlock : public TestCommandBridge { err = TestCreateNewPinCredentialAndLockUnlockUser_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Try to unlock the door with invalid PIN\n"); - err = TestTryToUnlockTheDoorWithInvalidPin_6(); + ChipLogProgress(chipTool, + " ***** Test Step 6 : Set the WrongCodeEntryLimit to big value so that we can test incorrect PIN entry\n"); + err = TestSetTheWrongCodeEntryLimitToBigValueSoThatWeCanTestIncorrectPinEntry_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Verify that lock state attribute value is set to Locked\n"); - err = TestVerifyThatLockStateAttributeValueIsSetToLocked_7(); + ChipLogProgress(chipTool, " ***** Test Step 7 : Try to unlock the door with invalid PIN\n"); + err = TestTryToUnlockTheDoorWithInvalidPin_7(); break; case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Try to unlock the door with valid PIN\n"); - err = TestTryToUnlockTheDoorWithValidPin_8(); + ChipLogProgress(chipTool, " ***** Test Step 8 : Verify that lock state attribute value is set to Locked\n"); + err = TestVerifyThatLockStateAttributeValueIsSetToLocked_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Verify that lock state attribute value is set to Unlocked\n"); - err = TestVerifyThatLockStateAttributeValueIsSetToUnlocked_9(); + ChipLogProgress(chipTool, " ***** Test Step 9 : Try to unlock the door with valid PIN\n"); + err = TestTryToUnlockTheDoorWithValidPin_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Try to lock the door with invalid PIN\n"); - err = TestTryToLockTheDoorWithInvalidPin_10(); + ChipLogProgress(chipTool, " ***** Test Step 10 : Verify that lock state attribute value is set to Unlocked\n"); + err = TestVerifyThatLockStateAttributeValueIsSetToUnlocked_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Verify that lock state attribute value is set to Unlocked\n"); - err = TestVerifyThatLockStateAttributeValueIsSetToUnlocked_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Try to lock the door with invalid PIN\n"); + err = TestTryToLockTheDoorWithInvalidPin_11(); break; case 12: - ChipLogProgress(chipTool, " ***** Test Step 12 : Try to lock the door with valid PIN\n"); - err = TestTryToLockTheDoorWithValidPin_12(); + ChipLogProgress(chipTool, " ***** Test Step 12 : Verify that lock state attribute value is set to Unlocked\n"); + err = TestVerifyThatLockStateAttributeValueIsSetToUnlocked_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Verify that lock state attribute value is set to Locked\n"); - err = TestVerifyThatLockStateAttributeValueIsSetToLocked_13(); + ChipLogProgress(chipTool, " ***** Test Step 13 : Try to lock the door with valid PIN\n"); + err = TestTryToLockTheDoorWithValidPin_13(); break; case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Set OperatingMode to NoRemoteLockUnlock\n"); - err = TestSetOperatingModeToNoRemoteLockUnlock_14(); + ChipLogProgress(chipTool, " ***** Test Step 14 : Verify that lock state attribute value is set to Locked\n"); + err = TestVerifyThatLockStateAttributeValueIsSetToLocked_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Try to unlock the door when OperatingMode is NoRemoteLockUnlock\n"); - err = TestTryToUnlockTheDoorWhenOperatingModeIsNoRemoteLockUnlock_15(); + ChipLogProgress(chipTool, " ***** Test Step 15 : Set OperatingMode to NoRemoteLockUnlock\n"); + err = TestSetOperatingModeToNoRemoteLockUnlock_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Set OperatingMode to Normal\n"); - err = TestSetOperatingModeToNormal_16(); + ChipLogProgress(chipTool, " ***** Test Step 16 : Try to unlock the door when OperatingMode is NoRemoteLockUnlock\n"); + err = TestTryToUnlockTheDoorWhenOperatingModeIsNoRemoteLockUnlock_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Create a disabled user and credential\n"); - err = TestCreateADisabledUserAndCredential_17(); + ChipLogProgress(chipTool, " ***** Test Step 17 : Set OperatingMode to Normal\n"); + err = TestSetOperatingModeToNormal_17(); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Try to unlock the door with disabled user PIN\n"); - err = TestTryToUnlockTheDoorWithDisabledUserPin_18(); + ChipLogProgress(chipTool, " ***** Test Step 18 : Read the lockout timeout\n"); + err = TestReadTheLockoutTimeout_18(); break; case 19: - ChipLogProgress(chipTool, " ***** Test Step 19 : Verify that lock state attribute value is set to Locked\n"); - err = TestVerifyThatLockStateAttributeValueIsSetToLocked_19(); + ChipLogProgress(chipTool, " ***** Test Step 19 : Set the WrongCodeEntryLimit to small value so we can test lockout\n"); + err = TestSetTheWrongCodeEntryLimitToSmallValueSoWeCanTestLockout_19(); break; case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Unlock the door with enabled user PIN\n"); - err = TestUnlockTheDoorWithEnabledUserPin_20(); + ChipLogProgress(chipTool, " ***** Test Step 20 : Try to unlock the door with invalid PIN for the first time\n"); + err = TestTryToUnlockTheDoorWithInvalidPinForTheFirstTime_20(); break; case 21: - ChipLogProgress(chipTool, " ***** Test Step 21 : Verify that lock state attribute value is set to Unlocked\n"); - err = TestVerifyThatLockStateAttributeValueIsSetToUnlocked_21(); + ChipLogProgress(chipTool, " ***** Test Step 21 : Try to unlock the door with invalid PIN for the second time\n"); + err = TestTryToUnlockTheDoorWithInvalidPinForTheSecondTime_21(); break; case 22: - ChipLogProgress(chipTool, " ***** Test Step 22 : Try to lock the door with disabled user PIN\n"); - err = TestTryToLockTheDoorWithDisabledUserPin_22(); + ChipLogProgress(chipTool, " ***** Test Step 22 : Try to unlock the door with invalid PIN for the third time\n"); + err = TestTryToUnlockTheDoorWithInvalidPinForTheThirdTime_22(); break; case 23: - ChipLogProgress(chipTool, " ***** Test Step 23 : Verify that lock state attribute value stays Unlocked\n"); - err = TestVerifyThatLockStateAttributeValueStaysUnlocked_23(); + ChipLogProgress( + chipTool, " ***** Test Step 23 : Try to unlock the door with valid PIN and make sure it fails due to lockout\n"); + err = TestTryToUnlockTheDoorWithValidPinAndMakeSureItFailsDueToLockout_23(); break; case 24: - ChipLogProgress(chipTool, " ***** Test Step 24 : Lock the door with enabled user PIN\n"); - err = TestLockTheDoorWithEnabledUserPin_24(); + ChipLogProgress(chipTool, " ***** Test Step 24 : Wait for the lockout to end\n"); + err = TestWaitForTheLockoutToEnd_24(); break; case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Verify that lock state attribute value is set to Locked\n"); - err = TestVerifyThatLockStateAttributeValueIsSetToLocked_25(); + ChipLogProgress(chipTool, " ***** Test Step 25 : Try to unlock the door with valid PIN and make sure it succeeds\n"); + err = TestTryToUnlockTheDoorWithValidPinAndMakeSureItSucceeds_25(); break; case 26: - ChipLogProgress(chipTool, " ***** Test Step 26 : Clean all the users and credentials\n"); - err = TestCleanAllTheUsersAndCredentials_26(); + ChipLogProgress(chipTool, " ***** Test Step 26 : Verify that lock state attribute value is set to Unlocked\n"); + err = TestVerifyThatLockStateAttributeValueIsSetToUnlocked_26(); + break; + case 27: + ChipLogProgress(chipTool, " ***** Test Step 27 : Lock the door back prior to next tests\n"); + err = TestLockTheDoorBackPriorToNextTests_27(); + break; + case 28: + ChipLogProgress(chipTool, " ***** Test Step 28 : Create a disabled user and credential\n"); + err = TestCreateADisabledUserAndCredential_28(); + break; + case 29: + ChipLogProgress(chipTool, " ***** Test Step 29 : Try to unlock the door with disabled user PIN\n"); + err = TestTryToUnlockTheDoorWithDisabledUserPin_29(); + break; + case 30: + ChipLogProgress(chipTool, " ***** Test Step 30 : Verify that lock state attribute value is set to Locked\n"); + err = TestVerifyThatLockStateAttributeValueIsSetToLocked_30(); + break; + case 31: + ChipLogProgress(chipTool, " ***** Test Step 31 : Unlock the door with enabled user PIN\n"); + err = TestUnlockTheDoorWithEnabledUserPin_31(); + break; + case 32: + ChipLogProgress(chipTool, " ***** Test Step 32 : Verify that lock state attribute value is set to Unlocked\n"); + err = TestVerifyThatLockStateAttributeValueIsSetToUnlocked_32(); + break; + case 33: + ChipLogProgress(chipTool, " ***** Test Step 33 : Try to lock the door with disabled user PIN\n"); + err = TestTryToLockTheDoorWithDisabledUserPin_33(); + break; + case 34: + ChipLogProgress(chipTool, " ***** Test Step 34 : Verify that lock state attribute value stays Unlocked\n"); + err = TestVerifyThatLockStateAttributeValueStaysUnlocked_34(); + break; + case 35: + ChipLogProgress(chipTool, " ***** Test Step 35 : Lock the door with enabled user PIN\n"); + err = TestLockTheDoorWithEnabledUserPin_35(); + break; + case 36: + ChipLogProgress(chipTool, " ***** Test Step 36 : Verify that lock state attribute value is set to Locked\n"); + err = TestVerifyThatLockStateAttributeValueIsSetToLocked_36(); + break; + case 37: + ChipLogProgress(chipTool, " ***** Test Step 37 : Clean all the users and credentials\n"); + err = TestCleanAllTheUsersAndCredentials_37(); break; } @@ -106305,10 +106351,10 @@ class DL_LockUnlock : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -106317,10 +106363,10 @@ class DL_LockUnlock : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -106332,31 +106378,31 @@ class DL_LockUnlock : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 18: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 20: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 21: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 22: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 23: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); break; case 24: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -106367,6 +106413,39 @@ class DL_LockUnlock : public TestCommandBridge { case 26: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_FAILURE)); + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -106380,7 +106459,7 @@ class DL_LockUnlock : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 27; + const uint16_t mTestCount = 38; chip::Optional mNodeId; chip::Optional mCluster; @@ -106524,7 +106603,29 @@ class DL_LockUnlock : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTryToUnlockTheDoorWithInvalidPin_6() + CHIP_ERROR TestSetTheWrongCodeEntryLimitToBigValueSoThatWeCanTestIncorrectPinEntry_6() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id wrongCodeEntryLimitArgument; + wrongCodeEntryLimitArgument = [NSNumber numberWithUnsignedChar:20U]; + [cluster writeAttributeWrongCodeEntryLimitWithValue:wrongCodeEntryLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Set the WrongCodeEntryLimit to big value so that we can test incorrect PIN " + @"entry Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTryToUnlockTheDoorWithInvalidPin_7() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106546,7 +106647,7 @@ class DL_LockUnlock : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToLocked_7() + CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToLocked_8() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106569,7 +106670,7 @@ class DL_LockUnlock : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTryToUnlockTheDoorWithValidPin_8() + CHIP_ERROR TestTryToUnlockTheDoorWithValidPin_9() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106589,7 +106690,7 @@ class DL_LockUnlock : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToUnlocked_9() + CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToUnlocked_10() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106612,7 +106713,7 @@ class DL_LockUnlock : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTryToLockTheDoorWithInvalidPin_10() + CHIP_ERROR TestTryToLockTheDoorWithInvalidPin_11() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106633,7 +106734,7 @@ class DL_LockUnlock : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToUnlocked_11() + CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToUnlocked_12() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106656,7 +106757,7 @@ class DL_LockUnlock : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTryToLockTheDoorWithValidPin_12() + CHIP_ERROR TestTryToLockTheDoorWithValidPin_13() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106676,7 +106777,7 @@ class DL_LockUnlock : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToLocked_13() + CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToLocked_14() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106699,7 +106800,7 @@ class DL_LockUnlock : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSetOperatingModeToNoRemoteLockUnlock_14() + CHIP_ERROR TestSetOperatingModeToNoRemoteLockUnlock_15() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106719,27 +106820,28 @@ class DL_LockUnlock : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTryToUnlockTheDoorWhenOperatingModeIsNoRemoteLockUnlock_15() + CHIP_ERROR TestTryToUnlockTheDoorWhenOperatingModeIsNoRemoteLockUnlock_16() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRDoorLockClusterLockDoorParams alloc] init]; - [cluster lockDoorWithParams:params - completionHandler:^(NSError * _Nullable err) { - NSLog(@"Try to unlock the door when OperatingMode is NoRemoteLockUnlock Error: %@", err); + __auto_type * params = [[MTRDoorLockClusterUnlockDoorParams alloc] init]; + [cluster + unlockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Try to unlock the door when OperatingMode is NoRemoteLockUnlock Error: %@", err); - VerifyOrReturn(CheckValue("status", - err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) : 0, - EMBER_ZCL_STATUS_FAILURE)); - NextTest(); - }]; + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) : 0, + EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestSetOperatingModeToNormal_16() + CHIP_ERROR TestSetOperatingModeToNormal_17() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106759,7 +106861,209 @@ class DL_LockUnlock : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCreateADisabledUserAndCredential_17() + CHIP_ERROR TestReadTheLockoutTimeout_18() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster + readAttributeUserCodeTemporaryDisableTimeWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the lockout timeout Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("UserCodeTemporaryDisableTime", actualValue, 10U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSetTheWrongCodeEntryLimitToSmallValueSoWeCanTestLockout_19() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id wrongCodeEntryLimitArgument; + wrongCodeEntryLimitArgument = [NSNumber numberWithUnsignedChar:3U]; + [cluster + writeAttributeWrongCodeEntryLimitWithValue:wrongCodeEntryLimitArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Set the WrongCodeEntryLimit to small value so we can test lockout Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTryToUnlockTheDoorWithInvalidPinForTheFirstTime_20() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterUnlockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"000000" length:6]; + [cluster + unlockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Try to unlock the door with invalid PIN for the first time Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) : 0, + EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTryToUnlockTheDoorWithInvalidPinForTheSecondTime_21() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterUnlockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"000000" length:6]; + [cluster + unlockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Try to unlock the door with invalid PIN for the second time Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) : 0, + EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTryToUnlockTheDoorWithInvalidPinForTheThirdTime_22() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterUnlockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"000000" length:6]; + [cluster + unlockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Try to unlock the door with invalid PIN for the third time Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) : 0, + EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTryToUnlockTheDoorWithValidPinAndMakeSureItFailsDueToLockout_23() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterUnlockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster + unlockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Try to unlock the door with valid PIN and make sure it fails due to lockout Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code : EMBER_ZCL_STATUS_FAILURE) : 0, + EMBER_ZCL_STATUS_FAILURE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWaitForTheLockoutToEnd_24() + { + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 10000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestTryToUnlockTheDoorWithValidPinAndMakeSureItSucceeds_25() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterUnlockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster unlockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Try to unlock the door with valid PIN and make sure it succeeds Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToUnlocked_26() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLockStateWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Verify that lock state attribute value is set to Unlocked Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("LockState", actualValue)); + VerifyOrReturn(CheckValue("LockState", actualValue, 2U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestLockTheDoorBackPriorToNextTests_27() + { + MTRBaseDevice * device = GetDevice("alpha"); + MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterLockDoorParams alloc] init]; + params.pinCode = [[NSData alloc] initWithBytes:"123456" length:6]; + [cluster lockDoorWithParams:params + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Lock the door back prior to next tests Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateADisabledUserAndCredential_28() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106805,7 +107109,7 @@ class DL_LockUnlock : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTryToUnlockTheDoorWithDisabledUserPin_18() + CHIP_ERROR TestTryToUnlockTheDoorWithDisabledUserPin_29() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106827,7 +107131,7 @@ class DL_LockUnlock : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToLocked_19() + CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToLocked_30() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106850,7 +107154,7 @@ class DL_LockUnlock : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestUnlockTheDoorWithEnabledUserPin_20() + CHIP_ERROR TestUnlockTheDoorWithEnabledUserPin_31() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106870,7 +107174,7 @@ class DL_LockUnlock : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToUnlocked_21() + CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToUnlocked_32() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106893,7 +107197,7 @@ class DL_LockUnlock : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTryToLockTheDoorWithDisabledUserPin_22() + CHIP_ERROR TestTryToLockTheDoorWithDisabledUserPin_33() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106914,7 +107218,7 @@ class DL_LockUnlock : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyThatLockStateAttributeValueStaysUnlocked_23() + CHIP_ERROR TestVerifyThatLockStateAttributeValueStaysUnlocked_34() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106937,7 +107241,7 @@ class DL_LockUnlock : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestLockTheDoorWithEnabledUserPin_24() + CHIP_ERROR TestLockTheDoorWithEnabledUserPin_35() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106957,7 +107261,7 @@ class DL_LockUnlock : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToLocked_25() + CHIP_ERROR TestVerifyThatLockStateAttributeValueIsSetToLocked_36() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue]; @@ -106980,7 +107284,7 @@ class DL_LockUnlock : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCleanAllTheUsersAndCredentials_26() + CHIP_ERROR TestCleanAllTheUsersAndCredentials_37() { MTRBaseDevice * device = GetDevice("alpha"); MTRBaseClusterDoorLock * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpoint:1 queue:mCallbackQueue];