From 4da852f6bd7aa3542ea7d7a7f258eb679fcf45cc Mon Sep 17 00:00:00 2001 From: C Freeman Date: Thu, 15 Feb 2024 16:08:13 -0500 Subject: [PATCH 1/7] TC-PS-3.1: Remove yaml (#32104) This test is automated in python now, yaml is no longer required. Fixes: https://github.com/project-chip/matter-test-scripts/issues/127 --- .../suites/certification/Test_TC_PS_3_1.yaml | 85 ------------------- src/app/tests/suites/manualTests.json | 2 +- 2 files changed, 1 insertion(+), 86 deletions(-) delete mode 100644 src/app/tests/suites/certification/Test_TC_PS_3_1.yaml diff --git a/src/app/tests/suites/certification/Test_TC_PS_3_1.yaml b/src/app/tests/suites/certification/Test_TC_PS_3_1.yaml deleted file mode 100644 index d64c29714436f8..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_PS_3_1.yaml +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 63.2.3. [TC-PS-3.1] Endpoint composition and EndpointList - -PICS: - - PS.S - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: - "Step 1: TH performs a wildcard read of all attributes and endpoints" - verification: | - TH(chip-tool) sends the wildcard read command to read all attributes and endpoints from DUT(Reference app/all-clusters-app) - ./chip-tool any read-by-id 0xFFFFFFFF 0xFFFFFFFF 1 0xFFFF - disabled: true - - - label: - "Step 2: For each power source cluster with a non-empty EndpointsList - attribute, verify that the endpoint exists on the device; also verify - that the EndpointsList attribute includes the endpoint on which the - cluster is located" - verification: | - TH(chip-tool) sends the wildcard read command to read all attributes and endpoints from DUT(Reference app/all-clusters-app) - - ./chip-tool any read-by-id 0xFFFFFFFF 0xFFFFFFFF 1 0xFFFF - - [1690195509.133521][44004:44006] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_002F Attribute 0x0000_000F DataVersion: 2929707991 - [1690195509.133523][44004:44006] CHIP:TOO: BatReplacementNeeded: FALSE - [1690195509.133531][44004:44006] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_002F Attribute 0x0000_0010 DataVersion: 2929707991 - [1690195509.133534][44004:44006] CHIP:TOO: BatReplaceability: 0 - [1690195509.133549][44004:44006] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_002F Attribute 0x0000_001F DataVersion: 2929707991 - [1690195509.133556][44004:44006] CHIP:TOO: EndpointList: 0 entries - [1690195509.133558][44004:44006] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_002F Attribute 0x0000_FFFC DataVersion: 2929707991 - [1690195509.133560][44004:44006] CHIP:TOO: FeatureMap: 2 - - [1690195509.203569][44004:44006] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_002F Attribute 0x0000_0010 DataVersion: 1378119001 - [1690195509.203572][44004:44006] CHIP:TOO: BatReplaceability: 0 - [1690195509.203587][44004:44006] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_002F Attribute 0x0000_001F DataVersion: 1378119001 - [1690195509.203592][44004:44006] CHIP:TOO: EndpointList: 0 entries - [1690195509.203595][44004:44006] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_002F Attribute 0x0000_FFFC DataVersion: 1378119001 - [1690195509.203597][44004:44006] CHIP:TOO: FeatureMap: 2 - - - [1690195509.133531][44004:44006] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_002F Attribute 0x0000_0010 DataVersion: 2929707991 - [1690195509.133534][44004:44006] CHIP:TOO: BatReplaceability: 0 - [1690195509.133549][44004:44006] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_002F Attribute 0x0000_001F DataVersion: 2929707991 - [1690195509.133556][44004:44006] CHIP:TOO: EndpointList: 0 entries - [1690195509.133558][44004:44006] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_002F Attribute 0x0000_FFFC DataVersion: 2929707991 - [1690195509.133560][44004:44006] CHIP:TOO: FeatureMap: 2 - disabled: true - - - label: - "Step 3: For each power source cluster on an endpoint with the Bridged - Node device type, ensure the EndpointList in the Power Source cluster - includes all the endpoints listed in the PartsList of the Descriptor - cluster as well as its own endpoint id." - verification: | - - disabled: true - - - label: - "Step 4: For each power source cluster on an endpoint that is a child - endpoint of an endpoint with a Bridged Node device type, ensure the - EndpointList in the Power Source cluster contains a list with one - entry that lists its own endpoint id" - verification: | - - disabled: true diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index 1c66bfccfbb9b0..8f67fe1348a802 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -261,7 +261,7 @@ "FlowMeasurement": ["Test_TC_FLW_2_2"], "GroupKeyManagement": ["Test_TC_GRPKEY_5_4"], "OccupancySensing": ["Test_TC_OCC_3_1"], - "PowerSource": ["Test_TC_PS_2_2", "Test_TC_PS_3_1"], + "PowerSource": ["Test_TC_PS_2_2"], "BooleanState": ["Test_TC_BOOL_2_2"], "ColorControl": [ "Test_TC_CC_3_1", From a0f446bb731dcbbb18bf85d70ba657ce2989b42e Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Thu, 15 Feb 2024 16:14:03 -0500 Subject: [PATCH 2/7] Use FaultInjection to help with IDM_1_3 automation testing (#32045) * Add FaultInjection to help with IDM_1_3 automation testing * Restyled by whitespace * Restyled by clang-format * Small fixes * Small change * Fix CI * Quick fix CI * Address PR comments * Quick Fix * Restyled by clang-format * Fix CI * Fix CI * use maybe_unused instead of (void) * Apply suggestions from code review Co-authored-by: Boris Zbarsky * Address PR comments * Restyled by whitespace * Restyled by clang-format * Address PR comment --------- Co-authored-by: Restyled.io Co-authored-by: Boris Zbarsky --- scripts/build/build/targets.py | 1 + scripts/build/builders/host.py | 5 +- .../build/testdata/all_targets_linux_x64.txt | 2 +- src/app/CommandHandler.cpp | 130 ++++++++++++++++++ src/app/CommandHandler.h | 29 ++++ src/app/ConcreteCommandPath.h | 2 + src/app/InteractionModelEngine.cpp | 16 +++ src/lib/support/CHIPFaultInjection.cpp | 18 ++- src/lib/support/CHIPFaultInjection.h | 18 +++ 9 files changed, 216 insertions(+), 5 deletions(-) diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 771c92b99cabef..af1bd454b86ddb 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -152,6 +152,7 @@ def BuildHostTarget(): target.AppendModifier('nodeps', enable_ble=False, enable_wifi=False, enable_thread=False, crypto_library=HostCryptoLibrary.MBEDTLS, use_clang=True).ExceptIfRe('-(clang|noble|boringssl|mbedtls)') + target.AppendModifier('nlfaultinject', use_nl_fault_injection=True) target.AppendModifier('platform-mdns', use_platform_mdns=True) target.AppendModifier('minmdns-verbose', minmdns_high_verbosity=True) target.AppendModifier('libnl', minmdns_address_policy="libnl") diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py index 7b7a02d421f097..a6ad8f343e0b16 100644 --- a/scripts/build/builders/host.py +++ b/scripts/build/builders/host.py @@ -295,7 +295,7 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, enable_ipv4=True, enable_ble=True, enable_wifi=True, enable_thread=True, use_tsan=False, use_asan=False, use_ubsan=False, separate_event_loop=True, fuzzing_type: HostFuzzingType = HostFuzzingType.NONE, use_clang=False, - interactive_mode=True, extra_tests=False, use_platform_mdns=False, enable_rpcs=False, + interactive_mode=True, extra_tests=False, use_nl_fault_injection=False, use_platform_mdns=False, enable_rpcs=False, use_coverage=False, use_dmalloc=False, minmdns_address_policy=None, minmdns_high_verbosity=False, imgui_ui=False, crypto_library: HostCryptoLibrary = None, enable_test_event_triggers=None): @@ -368,6 +368,9 @@ def __init__(self, root, runner, app: HostApp, board=HostBoard.NATIVE, # so setting clang is not correct raise Exception('Fake host board is always gcc (not clang)') + if use_nl_fault_injection: + self.extra_gn_options.append('chip_with_nlfaultinjection=true') + if minmdns_address_policy: if use_platform_mdns: raise Exception('Address policy applies to minmdns only') diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 6a0b73362b8f5c..3c6a2d3b643d6b 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -10,7 +10,7 @@ efr32-{brd4161a,brd4187c,brd4186c,brd4163a,brd4164a,brd4166a,brd4170a,brd4186a,b esp32-{m5stack,c3devkit,devkitc,qemu}-{all-clusters,all-clusters-minimal,energy-management,ota-provider,ota-requestor,shell,light,lock,bridge,temperature-measurement,ota-requestor,tests}[-rpc][-ipv6only][-tracing] genio-lighting-app linux-fake-tests[-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-coverage][-dmalloc][-clang] -linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,kotlin-matter-controller,minmdns,light,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,tests,chip-cert,address-resolve-tool,contact-sensor,dishwasher,microwave-oven,refrigerator,rvc,air-purifier,lit-icd,air-quality-sensor,network-manager,energy-management}[-nodeps][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui][-evse-test-event] +linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,kotlin-matter-controller,minmdns,light,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,tests,chip-cert,address-resolve-tool,contact-sensor,dishwasher,microwave-oven,refrigerator,rvc,air-purifier,lit-icd,air-quality-sensor,network-manager,energy-management}[-nodeps][-nlfaultinject][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui][-evse-test-event] linux-x64-efr32-test-runner[-clang] imx-{chip-tool,lighting-app,thermostat,all-clusters-app,all-clusters-minimal-app,ota-provider-app}[-release] infineon-psoc6-{lock,light,all-clusters,all-clusters-minimal}[-ota][-updateimage] diff --git a/src/app/CommandHandler.cpp b/src/app/CommandHandler.cpp index 6831a8440606b2..d0e5db94197e0d 100644 --- a/src/app/CommandHandler.cpp +++ b/src/app/CommandHandler.cpp @@ -214,6 +214,7 @@ Status CommandHandler::ProcessInvokeRequest(System::PacketBufferHandle && payloa SetGroupRequest(true); } + // When updating this code, please remember to make corresponding changes to TestOnlyInvokeCommandRequestWithFaultsInjected. VerifyOrReturnError(invokeRequestMessage.GetSuppressResponse(&mSuppressResponse) == CHIP_NO_ERROR, Status::InvalidAction); VerifyOrReturnError(invokeRequestMessage.GetTimedRequest(&mTimedRequest) == CHIP_NO_ERROR, Status::InvalidAction); VerifyOrReturnError(invokeRequestMessage.GetInvokeRequests(&invokeRequests) == CHIP_NO_ERROR, Status::InvalidAction); @@ -911,6 +912,135 @@ void CommandHandler::MoveToState(const State aTargetState) ChipLogDetail(DataManagement, "Command handler moving to [%10.10s]", GetStateStr()); } +#if CHIP_WITH_NLFAULTINJECTION + +namespace { + +CHIP_ERROR TestOnlyExtractCommandPathFromNextInvokeRequest(TLV::TLVReader & invokeRequestsReader, + ConcreteCommandPath & concretePath) +{ + ReturnErrorOnFailure(invokeRequestsReader.Next(TLV::AnonymousTag())); + CommandDataIB::Parser commandData; + ReturnErrorOnFailure(commandData.Init(invokeRequestsReader)); + CommandPathIB::Parser commandPath; + ReturnErrorOnFailure(commandData.GetPath(&commandPath)); + return commandPath.GetConcreteCommandPath(concretePath); +} + +[[maybe_unused]] const char * GetFaultInjectionTypeStr(CommandHandler::NlFaultInjectionType faultType) +{ + switch (faultType) + { + case CommandHandler::NlFaultInjectionType::SeparateResponseMessages: + return "Each response will be sent in a separate InvokeResponseMessage. The order of responses will be the same as the " + "original request."; + case CommandHandler::NlFaultInjectionType::SeparateResponseMessagesAndInvertedResponseOrder: + return "Each response will be sent in a separate InvokeResponseMessage. The order of responses will be reversed from the " + "original request."; + case CommandHandler::NlFaultInjectionType::SkipSecondResponse: + return "Single InvokeResponseMessages. Dropping response to second request"; + } + VerifyOrDieWithMsg(false, DataManagement, "TH Failure: Unexpected fault type"); +} + +} // anonymous namespace + +// This method intentionally duplicates code from other sections. While code consolidation +// is generally preferred, here we prioritize generating a clear crash message to aid in +// troubleshooting test failures. +void CommandHandler::TestOnlyInvokeCommandRequestWithFaultsInjected(Messaging::ExchangeContext * ec, + System::PacketBufferHandle && payload, bool isTimedInvoke, + NlFaultInjectionType faultType) +{ + VerifyOrDieWithMsg(ec != nullptr, DataManagement, "TH Failure: Incoming exchange context should not be null"); + VerifyOrDieWithMsg(mState == State::Idle, DataManagement, "TH Failure: state should be Idle, issue with TH"); + + ChipLogProgress(DataManagement, "Response to InvokeRequestMessage overridden by fault injection"); + ChipLogProgress(DataManagement, " Injecting the following response:%s", GetFaultInjectionTypeStr(faultType)); + + mResponseSender.SetExchangeContext(ec); + Handle workHandle(this); + mResponseSender.WillSendMessage(); + VerifyOrDieWithMsg(!mResponseSender.IsForGroup(), DataManagement, "DUT Failure: Unexpected Group Command"); + + System::PacketBufferTLVReader reader; + InvokeRequestMessage::Parser invokeRequestMessage; + InvokeRequests::Parser invokeRequests; + reader.Init(std::move(payload)); + VerifyOrDieWithMsg(invokeRequestMessage.Init(reader) == CHIP_NO_ERROR, DataManagement, + "TH Failure: Failed 'invokeRequestMessage.Init(reader)'"); +#if CHIP_CONFIG_IM_PRETTY_PRINT + invokeRequestMessage.PrettyPrint(); +#endif + + VerifyOrDieWithMsg(invokeRequestMessage.GetSuppressResponse(&mSuppressResponse) == CHIP_NO_ERROR, DataManagement, + "DUT Failure: Mandatory SuppressResponse field missing"); + VerifyOrDieWithMsg(invokeRequestMessage.GetTimedRequest(&mTimedRequest) == CHIP_NO_ERROR, DataManagement, + "DUT Failure: Mandatory TimedRequest field missing"); + VerifyOrDieWithMsg(invokeRequestMessage.GetInvokeRequests(&invokeRequests) == CHIP_NO_ERROR, DataManagement, + "DUT Failure: Mandatory InvokeRequests field missing"); + VerifyOrDieWithMsg(mTimedRequest == isTimedInvoke, DataManagement, + "DUT Failure: TimedRequest value in message mismatches action"); + + { + InvokeRequestMessage::Parser validationInvokeRequestMessage = invokeRequestMessage; + VerifyOrDieWithMsg(ValidateInvokeRequestMessageAndBuildRegistry(validationInvokeRequestMessage) == CHIP_NO_ERROR, + DataManagement, "DUT Failure: InvokeRequestMessage contents were invalid"); + } + + TLV::TLVReader invokeRequestsReader; + invokeRequests.GetReader(&invokeRequestsReader); + + size_t commandCount = 0; + VerifyOrDieWithMsg(TLV::Utilities::Count(invokeRequestsReader, commandCount, false /* recurse */) == CHIP_NO_ERROR, + DataManagement, + "TH Failure: Failed to get the length of InvokeRequests after InvokeRequestMessage validation"); + + // The command count check (specifically for a count of 2) is tied to IDM_1_3. This may need adjustment for + // compatibility with future test plans. + VerifyOrDieWithMsg(commandCount == 2, DataManagement, "DUT failure: We were strictly expecting exactly 2 InvokeRequests"); + mReserveSpaceForMoreChunkMessages = true; + + { + // Response path is the same as request path since we are replying with a failure message. + ConcreteCommandPath concreteResponsePath1; + ConcreteCommandPath concreteResponsePath2; + VerifyOrDieWithMsg( + TestOnlyExtractCommandPathFromNextInvokeRequest(invokeRequestsReader, concreteResponsePath1) == CHIP_NO_ERROR, + DataManagement, "DUT Failure: Issues encountered while extracting the ConcreteCommandPath from the first request"); + VerifyOrDieWithMsg( + TestOnlyExtractCommandPathFromNextInvokeRequest(invokeRequestsReader, concreteResponsePath2) == CHIP_NO_ERROR, + DataManagement, "DUT Failure: Issues encountered while extracting the ConcreteCommandPath from the second request"); + + if (faultType == NlFaultInjectionType::SeparateResponseMessagesAndInvertedResponseOrder) + { + ConcreteCommandPath temp(concreteResponsePath1); + concreteResponsePath1 = concreteResponsePath2; + concreteResponsePath2 = temp; + } + + VerifyOrDieWithMsg(FallibleAddStatus(concreteResponsePath1, Status::Failure) == CHIP_NO_ERROR, DataManagement, + "TH Failure: Error adding the first InvokeResponse"); + if (faultType == NlFaultInjectionType::SeparateResponseMessages || + faultType == NlFaultInjectionType::SeparateResponseMessagesAndInvertedResponseOrder) + { + VerifyOrDieWithMsg(FinalizeInvokeResponseMessageAndPrepareNext() == CHIP_NO_ERROR, DataManagement, + "TH Failure: Failed to create second InvokeResponseMessage"); + } + if (faultType != NlFaultInjectionType::SkipSecondResponse) + { + VerifyOrDieWithMsg(FallibleAddStatus(concreteResponsePath2, Status::Failure) == CHIP_NO_ERROR, DataManagement, + "TH Failure: Error adding the second InvokeResponse"); + } + } + + VerifyOrDieWithMsg(invokeRequestsReader.Next() == CHIP_END_OF_TLV, DataManagement, + "DUT Failure: Unexpected TLV ending of InvokeRequests"); + VerifyOrDieWithMsg(invokeRequestMessage.ExitContainer() == CHIP_NO_ERROR, DataManagement, + "DUT Failure: InvokeRequestMessage TLV is not properly terminated"); +} +#endif // CHIP_WITH_NLFAULTINJECTION + } // namespace app } // namespace chip diff --git a/src/app/CommandHandler.h b/src/app/CommandHandler.h index b90cb821244336..f7acd709b26808 100644 --- a/src/app/CommandHandler.h +++ b/src/app/CommandHandler.h @@ -429,6 +429,35 @@ class CommandHandler return mResponseSender.GetSubjectDescriptor(); } +#if CHIP_WITH_NLFAULTINJECTION + + enum class NlFaultInjectionType : uint8_t + { + SeparateResponseMessages, + SeparateResponseMessagesAndInvertedResponseOrder, + SkipSecondResponse + }; + + /** + * @brief Sends InvokeResponseMessages with injected faults for certification testing. + * + * The Test Harness (TH) uses this to simulate various server response behaviors, + * ensuring the Device Under Test (DUT) handles responses per specification. + * + * This function strictly validates the DUT's InvokeRequestMessage against the test plan. + * If deviations occur, the TH terminates with a detailed error message. + * + * @param ec Exchange context for sending InvokeResponseMessages to the client. + * @param payload Payload of the incoming InvokeRequestMessage from the client. + * @param isTimedInvoke Indicates whether the interaction is timed. + * @param faultType The specific type of fault to inject into the response. + */ + // TODO(#30453): After refactoring CommandHandler for better unit testability, create a + // unit test specifically for the fault injection behavior. + void TestOnlyInvokeCommandRequestWithFaultsInjected(Messaging::ExchangeContext * ec, System::PacketBufferHandle && payload, + bool isTimedInvoke, NlFaultInjectionType faultType); +#endif // CHIP_WITH_NLFAULTINJECTION + private: friend class TestCommandInteraction; friend class CommandHandler::Handle; diff --git a/src/app/ConcreteCommandPath.h b/src/app/ConcreteCommandPath.h index 5020aa0ba6d2c0..42845b64241053 100644 --- a/src/app/ConcreteCommandPath.h +++ b/src/app/ConcreteCommandPath.h @@ -33,6 +33,8 @@ struct ConcreteCommandPath : public ConcreteClusterPath ConcreteClusterPath(aEndpointId, aClusterId), mCommandId(aCommandId) {} + ConcreteCommandPath() : ConcreteClusterPath(kInvalidEndpointId, kInvalidClusterId), mCommandId(kInvalidCommandId) {} + bool operator==(const ConcreteCommandPath & aOther) const { return ConcreteClusterPath::operator==(aOther) && (mCommandId == aOther.mCommandId); diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index 565cddd2381b71..ddc8a984f16b72 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -411,6 +412,21 @@ Status InteractionModelEngine::OnInvokeCommandRequest(Messaging::ExchangeContext ChipLogProgress(InteractionModel, "no resource for Invoke interaction"); return Status::Busy; } + CHIP_FAULT_INJECT( + FaultInjection::kFault_IMInvoke_SeparateResponses, + commandHandler->TestOnlyInvokeCommandRequestWithFaultsInjected( + apExchangeContext, std::move(aPayload), aIsTimedInvoke, CommandHandler::NlFaultInjectionType::SeparateResponseMessages); + return Status::Success;); + CHIP_FAULT_INJECT(FaultInjection::kFault_IMInvoke_SeparateResponsesInvertResponseOrder, + commandHandler->TestOnlyInvokeCommandRequestWithFaultsInjected( + apExchangeContext, std::move(aPayload), aIsTimedInvoke, + CommandHandler::NlFaultInjectionType::SeparateResponseMessagesAndInvertedResponseOrder); + return Status::Success;); + CHIP_FAULT_INJECT( + FaultInjection::kFault_IMInvoke_SkipSecondResponse, + commandHandler->TestOnlyInvokeCommandRequestWithFaultsInjected(apExchangeContext, std::move(aPayload), aIsTimedInvoke, + CommandHandler::NlFaultInjectionType::SkipSecondResponse); + return Status::Success;); commandHandler->OnInvokeCommandRequest(apExchangeContext, aPayloadHeader, std::move(aPayload), aIsTimedInvoke); return Status::Success; } diff --git a/src/lib/support/CHIPFaultInjection.cpp b/src/lib/support/CHIPFaultInjection.cpp index fc50021a6fe1e9..15cb5a40ec5b4d 100644 --- a/src/lib/support/CHIPFaultInjection.cpp +++ b/src/lib/support/CHIPFaultInjection.cpp @@ -35,9 +35,21 @@ static int32_t sFault_FuzzExchangeHeader_Arguments[1]; static class nl::FaultInjection::Manager sChipFaultInMgr; static const nl::FaultInjection::Name sManagerName = "chip"; static const nl::FaultInjection::Name sFaultNames[] = { - "AllocExchangeContext", "DropIncomingUDPMsg", "DropOutgoingUDPMsg", "AllocBinding", "SendAlarm", - "HandleAlarm", "FuzzExchangeHeaderTx", "RMPDoubleTx", "RMPSendError", "BDXBadBlockCounter", - "BDXAllocTransfer", "CASEKeyConfirm", "SecMgrBusy", + "AllocExchangeContext", + "DropIncomingUDPMsg", + "DropOutgoingUDPMsg", + "AllocBinding", + "SendAlarm", + "HandleAlarm", + "FuzzExchangeHeaderTx", + "RMPDoubleTx", + "RMPSendError", + "BDXBadBlockCounter", + "BDXAllocTransfer", + "SecMgrBusy", + "IMInvoke_SeparateResponses", + "IMInvoke_SeparateResponsesInvertResponseOrder", + "IMInvoke_SkipSecondResponse", #if CONFIG_NETWORK_LAYER_BLE "CHIPOBLESend", #endif // CONFIG_NETWORK_LAYER_BLE diff --git a/src/lib/support/CHIPFaultInjection.h b/src/lib/support/CHIPFaultInjection.h index 9fe78aed8c9ac9..44e582ba01d64d 100644 --- a/src/lib/support/CHIPFaultInjection.h +++ b/src/lib/support/CHIPFaultInjection.h @@ -26,6 +26,11 @@ #include #if CHIP_WITH_NLFAULTINJECTION +#ifdef NDEBUG +// TODO(#30453): After fixing the issue where CHIP_WITH_NLFAULTINJECTION is seemingly enabled on release builds, +// uncomment the line below. +// static_assert(false, "CHIP_WITH_NLFAULTINJECTION should NOT be enabled on release build"); +#endif #include @@ -57,12 +62,25 @@ typedef enum kFault_BDXBadBlockCounter, /**< Corrupt the BDX Block Counter in the BDX BlockSend or BlockEOF message about to be sent */ kFault_BDXAllocTransfer, /**< Fail the allocation of a BDXTransfer object */ kFault_SecMgrBusy, /**< Trigger a WEAVE_ERROR_SECURITY_MANAGER_BUSY when starting an authentication session */ + kFault_IMInvoke_SeparateResponses, /**< Validate incoming InvokeRequestMessage contains exactly 2 valid commands and respond + with 2 InvokeResponseMessages */ + kFault_IMInvoke_SeparateResponsesInvertResponseOrder, /**< Validate incoming InvokeRequestMessage contains exactly 2 valid + commands and respond with 2 InvokeResponseMessages where the response order is inverted + compared to the request order */ + kFault_IMInvoke_SkipSecondResponse, /**< Validate incoming InvokeRequestMessage contains exactly 2 valid commands and respond + with 1 InvokeResponseMessage, dropping the response to the second request */ #if CONFIG_NETWORK_LAYER_BLE kFault_CHIPOBLESend, /**< Inject a GATT error when sending the first fragment of a chip message over BLE */ #endif // CONFIG_NETWORK_LAYER_BLE kFault_NumItems, } Id; +static_assert(kFault_IMInvoke_SeparateResponses == 12, "Test plan specification and automation code relies on this value being 12"); +static_assert(kFault_IMInvoke_SeparateResponsesInvertResponseOrder == 13, + "Test plan specification and automation code relies on this value being 13"); +static_assert(kFault_IMInvoke_SkipSecondResponse == 14, + "Test plan specification and automation code relies on this value being 14"); + DLL_EXPORT nl::FaultInjection::Manager & GetManager(); /** From 49587468b1d27f0fe9c4c323dba9a91e68d4bb43 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Thu, 15 Feb 2024 17:16:23 -0500 Subject: [PATCH 3/7] Python testing: Fix spec parsing for derived cluster commands (#32028) * Pythin XML parsing: move some pieces out, add test Attemping to make some of this more testable in order to test derived cluster merging for commands. Commands handled separately in the next commit. * Add unknown clusters for derived Because the derived clusters may not have the direction noted in the table, we can't tell if they're accepted or generated commands until we match them to the base. Keep an unknown list until we merge. Also WARN on unknown clusters that persist after processing. * Fix linter * Update src/python_testing/TestSpecParsingSupport.py Co-authored-by: Terence Hampson * address review comments * Update src/python_testing/TestSpecParsingSupport.py Co-authored-by: Terence Hampson --------- Co-authored-by: Terence Hampson --- src/python_testing/TestSpecParsingSupport.py | 194 ++++++++++++- src/python_testing/spec_parsing_support.py | 281 +++++++++++-------- 2 files changed, 361 insertions(+), 114 deletions(-) diff --git a/src/python_testing/TestSpecParsingSupport.py b/src/python_testing/TestSpecParsingSupport.py index ed790fb4bf4629..2ff80e55244648 100644 --- a/src/python_testing/TestSpecParsingSupport.py +++ b/src/python_testing/TestSpecParsingSupport.py @@ -19,9 +19,10 @@ import chip.clusters as Clusters from global_attribute_ids import GlobalAttributeIds -from matter_testing_support import MatterBaseTest, default_matter_test_main +from matter_testing_support import MatterBaseTest, ProblemNotice, default_matter_test_main from mobly import asserts -from spec_parsing_support import ClusterParser, XmlCluster +from spec_parsing_support import (ClusterParser, XmlCluster, add_cluster_data_from_xml, check_clusters_for_unknown_commands, + combine_derived_clusters_with_base) # TODO: improve the test coverage here # https://github.com/project-chip/connectedhomeip/issues/30958 @@ -77,6 +78,120 @@ def get_access_enum_from_string(access_str: str) -> Clusters.AccessControl.Enums asserts.fail("Unknown access string") +BASE_CLUSTER_XML_STR = ( + '' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + '') + +DERIVED_CLUSTER_XML_STR = ( + '' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + '' +) + +CLUSTER_WITH_UNKNOWN_COMMAND = ( + '' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + '' +) + + class TestSpecParsingSupport(MatterBaseTest): def test_spec_parsing_access(self): strs = [None, 'view', 'operate', 'manage', 'admin'] @@ -106,6 +221,81 @@ def test_write_optional(self): asserts.assert_equal(xml_cluster.attributes[ATTRIBUTE_ID].write_optional, write_support == 'optional', "Unexpected write_optional value") + def test_derived_clusters(self): + clusters: dict[int, XmlCluster] = {} + pure_base_clusters: dict[str, XmlCluster] = {} + ids_by_name: dict[str, int] = {} + problems: list[ProblemNotice] = [] + base_cluster_xml = ElementTree.fromstring(BASE_CLUSTER_XML_STR) + derived_cluster_xml = ElementTree.fromstring(DERIVED_CLUSTER_XML_STR) + expected_global_attrs = [GlobalAttributeIds.FEATURE_MAP_ID, GlobalAttributeIds.ATTRIBUTE_LIST_ID, + GlobalAttributeIds.ACCEPTED_COMMAND_LIST_ID, GlobalAttributeIds.GENERATED_COMMAND_LIST_ID, GlobalAttributeIds.CLUSTER_REVISION_ID] + + add_cluster_data_from_xml(base_cluster_xml, clusters, pure_base_clusters, ids_by_name, problems) + add_cluster_data_from_xml(derived_cluster_xml, clusters, pure_base_clusters, ids_by_name, problems) + + asserts.assert_equal(len(clusters), 1, "Unexpected number of clusters") + asserts.assert_equal(len(pure_base_clusters), 1, "Unexpected number of pure base clusters") + asserts.assert_equal(len(ids_by_name), 1, "Unexpected number of IDs per name") + asserts.assert_equal(len(problems), 0, "Unexpected number of problems") + asserts.assert_equal(ids_by_name["Test Derived"], 0xFFFF, "Test derived name not added to IDs") + + asserts.assert_true(0xFFFF in clusters, "Derived ID not found in clusters") + asserts.assert_equal(set(clusters[0xFFFF].attributes.keys()), set( + [0, 2, 3] + expected_global_attrs), "Unexpected attribute list") + asserts.assert_equal(set(clusters[0xFFFF].accepted_commands.keys()), set([]), "Unexpected accepted commands") + asserts.assert_equal(set(clusters[0xFFFF].generated_commands.keys()), set([]), "Unexpected generated commands") + + asserts.assert_true("Test Base" in pure_base_clusters, "Base ID not found in derived clusters") + asserts.assert_equal(set(pure_base_clusters["Test Base"].attributes.keys()), set( + [0, 1, 2, 3] + expected_global_attrs), "Unexpected attribute list") + asserts.assert_equal(set(pure_base_clusters["Test Base"].accepted_commands.keys()), + set([0]), "Unexpected accepted commands") + asserts.assert_equal(set(pure_base_clusters["Test Base"].generated_commands.keys()), + set([1]), "Unexpected generated commands") + asserts.assert_equal(str(pure_base_clusters["Test Base"].accepted_commands[0].conformance), + "M", "Unexpected conformance on base accepted command") + asserts.assert_equal(str(pure_base_clusters["Test Base"].generated_commands[1].conformance), + "M", "Unexpected conformance on base generated command") + + asserts.assert_equal(len(pure_base_clusters["Test Base"].unknown_commands), + 0, "Unexpected number of unknown commands in base") + asserts.assert_equal(len(clusters[0xFFFF].unknown_commands), 2, "Unexpected number of unknown commands in derived cluster") + + combine_derived_clusters_with_base(clusters, pure_base_clusters, ids_by_name) + # Ensure the base-only attribute (1) was added to the derived cluster + asserts.assert_equal(set(clusters[0xFFFF].attributes.keys()), set( + [0, 1, 2, 3] + expected_global_attrs), "Unexpected attribute list") + # Ensure the conformance overrides from the derived cluster are on the attributes + asserts.assert_equal(str(clusters[0xFFFF].attributes[0].conformance), "M", "Unexpected conformance on attribute 0") + asserts.assert_equal(str(clusters[0xFFFF].attributes[1].conformance), "M", "Unexpected conformance on attribute 1") + asserts.assert_equal(str(clusters[0xFFFF].attributes[2].conformance), "X", "Unexpected conformance on attribute 2") + asserts.assert_equal(str(clusters[0xFFFF].attributes[3].conformance), "X", "Unexpected conformance on attribute 3") + + # Ensure both the accepted and generated command overrides work + asserts.assert_true(set(clusters[0xFFFF].accepted_commands.keys()), + set([0]), "Unexpected accepted command list after merge") + asserts.assert_true(set(clusters[0xFFFF].generated_commands.keys()), set([1]), + "Unexpected generated command list after merge") + asserts.assert_equal(str(clusters[0xFFFF].accepted_commands[0].conformance), + "X", "Unexpected conformance on accepted commands") + asserts.assert_equal(str(clusters[0xFFFF].generated_commands[1].conformance), + "X", "Unexpected conformance on generated commands") + asserts.assert_equal(len(clusters[0xFFFF].unknown_commands), 0, "Unexpected number of unknown commands after merge") + + def test_missing_command_direction(self): + clusters: dict[int, XmlCluster] = {} + pure_base_clusters: dict[str, XmlCluster] = {} + ids_by_name: dict[str, int] = {} + problems: list[ProblemNotice] = [] + cluster_xml = ElementTree.fromstring(CLUSTER_WITH_UNKNOWN_COMMAND) + + add_cluster_data_from_xml(cluster_xml, clusters, pure_base_clusters, ids_by_name, problems) + check_clusters_for_unknown_commands(clusters, problems) + asserts.assert_equal(len(problems), 1, "Unexpected number of problems found") + asserts.assert_equal(problems[0].location.cluster_id, 0xFFFE, "Unexpected problem location (cluster id)") + asserts.assert_equal(problems[0].location.command_id, 0, "Unexpected problem location (command id)") + if __name__ == "__main__": default_matter_test_main() diff --git a/src/python_testing/spec_parsing_support.py b/src/python_testing/spec_parsing_support.py index c58f38e9a5ac89..3a784178cdb880 100644 --- a/src/python_testing/spec_parsing_support.py +++ b/src/python_testing/spec_parsing_support.py @@ -76,6 +76,7 @@ def __str__(self): @dataclass class XmlCommand: + id: int name: str conformance: Callable[[uint], ConformanceDecision] @@ -100,6 +101,7 @@ class XmlCluster: attributes: dict[uint, XmlAttribute] accepted_commands: dict[uint, XmlCommand] generated_commands: dict[uint, XmlCommand] + unknown_commands: list[XmlCommand] events: dict[uint, XmlEvent] pics: str @@ -107,6 +109,35 @@ class XmlCluster: class CommandType(Enum): ACCEPTED = auto() GENERATED = auto() + # This will happen for derived clusters, where the direction isn't noted. On normal clusters, this is a problem. + UNKNOWN = auto() + + +# workaround for aliased clusters not appearing in the xml. Remove this once https://github.com/csa-data-model/projects/issues/373 is addressed +CONC_CLUSTERS = {0x040C: ('Carbon Monoxide Concentration Measurement', 'CMOCONC'), + 0x040D: ('Carbon Dioxide Concentration Measurement', 'CDOCONC'), + 0x0413: ('Nitrogen Dioxide Concentration Measurement', 'NDOCONC'), + 0x0415: ('Ozone Concentration Measurement', 'OZCONC'), + 0x042A: ('PM2.5 Concentration Measurement', 'PMICONC'), + 0x042B: ('Formaldehyde Concentration Measurement', 'FLDCONC'), + 0x042C: ('PM1 Concentration Measurement', 'PMHCONC'), + 0x042D: ('PM10 Concentration Measurement', 'PMKCONC'), + 0x042E: ('Total Volatile Organic Compounds Concentration Measurement', 'TVOCCONC'), + 0x042F: ('Radon Concentration Measurement', 'RNCONC')} +CONC_BASE_NAME = 'Concentration Measurement Clusters' +RESOURCE_CLUSTERS = {0x0071: ('HEPA Filter Monitoring', 'HEPAFREMON'), + 0x0072: ('Activated Carbon Filter Monitoring', 'ACFREMON')} +RESOURCE_BASE_NAME = 'Resource Monitoring Clusters' +WATER_CLUSTER = {0x0405: ('Relative Humidity Measurement', 'RH')} +WATER_BASE_NAME = 'Water Content Measurement Clusters' +CLUSTER_ALIASES = {CONC_BASE_NAME: CONC_CLUSTERS, RESOURCE_BASE_NAME: RESOURCE_CLUSTERS, WATER_BASE_NAME: WATER_CLUSTER} + + +def is_alias(id: uint): + for base, alias in CLUSTER_ALIASES.items(): + if id in alias: + return True + return False class ClusterParser: @@ -317,17 +348,29 @@ def parse_attributes(self) -> dict[uint, XmlAttribute]: ), read_access=Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kView, write_access=Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kUnknownEnumValue, write_optional=False) return attributes - def parse_commands(self, command_type: CommandType) -> dict[uint, XmlAttribute]: - commands = {} + def get_command_type(self, element: ElementTree.Element) -> CommandType: + try: + if element.attrib['direction'].lower() == 'responsefromserver': + return CommandType.GENERATED + if element.attrib['direction'].lower() == 'commandtoclient': + return CommandType.UNKNOWN + except KeyError: + return CommandType.ACCEPTED + + def parse_unknown_commands(self) -> list[XmlCommand]: + commands = [] for element, conformance_xml, access_xml in self.command_elements: + if self.get_command_type(element) != CommandType.UNKNOWN: + continue code = int(element.attrib['id'], 0) - dir = CommandType.ACCEPTED - try: - if element.attrib['direction'].lower() == 'responsefromserver': - dir = CommandType.GENERATED - except KeyError: - pass - if dir != command_type: + conformance = self.parse_conformance(conformance_xml) + commands.append(XmlCommand(id=code, name=element.attrib['name'], conformance=conformance)) + return commands + + def parse_commands(self, command_type: CommandType) -> dict[uint, XmlCommand]: + commands = {} + for element, conformance_xml, access_xml in self.command_elements: + if self.get_command_type(element) != command_type: continue code = int(element.attrib['id'], 0) conformance = self.parse_conformance(conformance_xml) @@ -335,7 +378,7 @@ def parse_commands(self, command_type: CommandType) -> dict[uint, XmlAttribute]: continue if code in commands: conformance = or_operation([conformance, commands[code].conformance]) - commands[code] = XmlCommand(name=element.attrib['name'], conformance=conformance) + commands[code] = XmlCommand(id=code, name=element.attrib['name'], conformance=conformance) return commands def parse_events(self) -> dict[uint, XmlAttribute]: @@ -362,96 +405,71 @@ def create_cluster(self) -> XmlCluster: attributes=self.parse_attributes(), accepted_commands=self.parse_commands(CommandType.ACCEPTED), generated_commands=self.parse_commands(CommandType.GENERATED), + unknown_commands=self.parse_unknown_commands(), events=self.parse_events(), pics=self._pics) def get_problems(self) -> list[ProblemNotice]: return self._problems -def build_xml_clusters() -> tuple[list[XmlCluster], list[ProblemNotice]]: - # workaround for aliased clusters not appearing in the xml. Remove this once https://github.com/csa-data-model/projects/issues/373 is addressed - conc_clusters = {0x040C: ('Carbon Monoxide Concentration Measurement', 'CMOCONC'), - 0x040D: ('Carbon Dioxide Concentration Measurement', 'CDOCONC'), - 0x0413: ('Nitrogen Dioxide Concentration Measurement', 'NDOCONC'), - 0x0415: ('Ozone Concentration Measurement', 'OZCONC'), - 0x042A: ('PM2.5 Concentration Measurement', 'PMICONC'), - 0x042B: ('Formaldehyde Concentration Measurement', 'FLDCONC'), - 0x042C: ('PM1 Concentration Measurement', 'PMHCONC'), - 0x042D: ('PM10 Concentration Measurement', 'PMKCONC'), - 0x042E: ('Total Volatile Organic Compounds Concentration Measurement', 'TVOCCONC'), - 0x042F: ('Radon Concentration Measurement', 'RNCONC')} - conc_base_name = 'Concentration Measurement Clusters' - resource_clusters = {0x0071: ('HEPA Filter Monitoring', 'HEPAFREMON'), - 0x0072: ('Activated Carbon Filter Monitoring', 'ACFREMON')} - resource_base_name = 'Resource Monitoring Clusters' - water_clusters = {0x0405: ('Relative Humidity Measurement', 'RH')} - water_base_name = 'Water Content Measurement Clusters' - aliases = {conc_base_name: conc_clusters, resource_base_name: resource_clusters, water_base_name: water_clusters} - - def is_alias(id: uint): - for base, alias in aliases.items(): - if id in alias: - return True - return False +def add_cluster_data_from_xml(xml: ElementTree.Element, clusters: dict[int, XmlCluster], pure_base_clusters: dict[str, XmlCluster], ids_by_name: dict[str, int], problems: list[ProblemNotice]) -> None: + ''' Adds cluster data to the supplied dicts as appropriate + + xml: XML element read from from the XML cluster file + clusters: dict of id -> XmlCluster. This function will append new clusters as appropriate to this dict. + pure_base_clusters: dict of base name -> XmlCluster. This data structure is used to hold pure base clusters that don't have + an ID. This function will append new pure base clusters as approrpriate to this dict. + ids_by_name: dict of cluster name -> ID. This function will append new IDs as appropriate to this dict. + problems: list of any problems encountered during spec parsing. This function will append problems as appropriate to this list. + ''' + cluster = xml.iter('cluster') + for c in cluster: + name = c.attrib['name'] + if not c.attrib['id']: + # Fully derived clusters have no id, but also shouldn't appear on a device. + # We do need to keep them, though, because we need to update the derived + # clusters. We keep them in a special dict by name, so they can be thrown + # away later. + cluster_id = None + else: + cluster_id = int(c.attrib['id'], 0) + ids_by_name[name] = cluster_id - def combine_attributes(base: dict[uint, XmlAttribute], derived: dict[uint, XmlAttribute], cluster_id: uint) -> dict[uint, XmlAttribute]: - ret = deepcopy(base) - extras = {k: v for k, v in derived.items() if k not in base.keys()} - overrides = {k: v for k, v in derived.items() if k in base.keys()} - ret.update(extras) - for id, override in overrides.items(): - if override.conformance: - ret[id].conformance = override.conformance - if override.read_access: - ret[id].read_access = override.read_access - if override.write_access: - ret[id].write_access = override.write_access - if ret[id].read_access is None and ret[id].write_access is None: - location = AttributePathLocation(endpoint_id=0, cluster_id=cluster_id, attribute_id=id) - problems.append(ProblemNotice(test_name='Spec XML parsing', location=location, - severity=ProblemSeverity.WARNING, problem='Unable to find access element')) - if ret[id].read_access is None: - ret[id].read_access == Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kUnknownEnumValue - if ret[id].write_access is None: - ret[id].write_access = Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kUnknownEnumValue - return ret + parser = ClusterParser(c, cluster_id, name, is_alias(cluster_id)) + new = parser.create_cluster() + problems = problems + parser.get_problems() + + if cluster_id: + clusters[cluster_id] = new + else: + pure_base_clusters[name] = new + + +def check_clusters_for_unknown_commands(clusters: dict[int, XmlCluster], problems: list[ProblemNotice]): + for id, cluster in clusters.items(): + for cmd in cluster.unknown_commands: + problems.append(ProblemNotice(test_name="Spec XML parsing", location=CommandPathLocation( + endpoint_id=0, cluster_id=id, command_id=cmd.id), severity=ProblemSeverity.WARNING, problem="Command with unknown direction")) + +def build_xml_clusters() -> tuple[list[XmlCluster], list[ProblemNotice]]: dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data_model', 'clusters') clusters: dict[int, XmlCluster] = {} - derived_clusters: dict[str, XmlCluster] = {} - ids_by_name = {} - problems = [] + pure_base_clusters: dict[str, XmlCluster] = {} + ids_by_name: dict[str, int] = {} + problems: list[ProblemNotice] = [] for xml in glob.glob(f"{dir}/*.xml"): logging.info(f'Parsing file {xml}') tree = ElementTree.parse(f'{xml}') root = tree.getroot() - cluster = root.iter('cluster') - for c in cluster: - name = c.attrib['name'] - if not c.attrib['id']: - # Fully derived clusters have no id, but also shouldn't appear on a device. - # We do need to keep them, though, because we need to update the derived - # clusters. We keep them in a special dict by name, so they can be thrown - # away later. - cluster_id = None - else: - cluster_id = int(c.attrib['id'], 0) - ids_by_name[name] = cluster_id - - parser = ClusterParser(c, cluster_id, name, is_alias(cluster_id)) - new = parser.create_cluster() - problems = problems + parser.get_problems() - - if cluster_id: - clusters[cluster_id] = new - else: - derived_clusters[name] = new + add_cluster_data_from_xml(root, clusters, pure_base_clusters, ids_by_name, problems) # There are a few clusters where the conformance columns are listed as desc. These clusters need specific, targeted tests # to properly assess conformance. Here, we list them as Optional to allow these for the general test. Targeted tests are described below. # Descriptor - TagList feature - this feature is mandated when the duplicate condition holds for the endpoint. It is tested in DESC-2.2 # Actions cluster - all commands - these need to be listed in the ActionsList attribute to be supported. # We do not currently have a test for this. Please see https://github.com/CHIP-Specifications/chip-test-plans/issues/3646. + def remove_problem(location: typing.Union[CommandPathLocation, FeaturePathLocation]): nonlocal problems problems = [p for p in problems if p.location != location] @@ -466,40 +484,11 @@ def remove_problem(location: typing.Union[CommandPathLocation, FeaturePathLocati clusters[action_id].accepted_commands[c].conformance = optional() remove_problem(CommandPathLocation(endpoint_id=0, cluster_id=action_id, command_id=c)) - # We have the information now about which clusters are derived, so we need to fix them up. Apply first the base cluster, - # then add the specific cluster overtop - for id, c in clusters.items(): - if c.derived: - base_name = c.derived - if base_name in ids_by_name: - base = clusters[ids_by_name[c.derived]] - else: - base = derived_clusters[base_name] - - feature_map = deepcopy(base.feature_map) - feature_map.update(c.feature_map) - attribute_map = deepcopy(base.attribute_map) - attribute_map.update(c.attribute_map) - command_map = deepcopy(base.command_map) - command_map.update(c.command_map) - features = deepcopy(base.features) - features.update(c.features) - attributes = combine_attributes(base.attributes, c.attributes, id) - accepted_commands = deepcopy(base.accepted_commands) - accepted_commands.update(c.accepted_commands) - generated_commands = deepcopy(base.generated_commands) - generated_commands.update(c.generated_commands) - events = deepcopy(base.events) - events.update(c.events) - new = XmlCluster(revision=c.revision, derived=c.derived, name=c.name, - feature_map=feature_map, attribute_map=attribute_map, command_map=command_map, - features=features, attributes=attributes, accepted_commands=accepted_commands, - generated_commands=generated_commands, events=events, pics=c.pics) - clusters[id] = new + combine_derived_clusters_with_base(clusters, pure_base_clusters, ids_by_name) - for alias_base_name, aliased_clusters in aliases.items(): + for alias_base_name, aliased_clusters in CLUSTER_ALIASES.items(): for id, (alias_name, pics) in aliased_clusters.items(): - base = derived_clusters[alias_base_name] + base = pure_base_clusters[alias_base_name] new = deepcopy(base) new.derived = alias_base_name new.name = alias_name @@ -529,4 +518,72 @@ def remove_problem(location: typing.Union[CommandPathLocation, FeaturePathLocati clusters[acl_id].attributes[Clusters.AccessControl.Attributes.Acl.attribute_id].write_access = Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kAdminister clusters[acl_id].attributes[Clusters.AccessControl.Attributes.Extension.attribute_id].write_access = Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kAdminister + check_clusters_for_unknown_commands(clusters, problems) + return clusters, problems + + +def combine_derived_clusters_with_base(xml_clusters: dict[int, XmlCluster], pure_base_clusters: dict[str, XmlCluster], ids_by_name: dict[str, int]) -> None: + ''' Overrides base elements with the derived cluster values for derived clusters. ''' + + def combine_attributes(base: dict[uint, XmlAttribute], derived: dict[uint, XmlAttribute], cluster_id: uint) -> dict[uint, XmlAttribute]: + ret = deepcopy(base) + extras = {k: v for k, v in derived.items() if k not in base.keys()} + overrides = {k: v for k, v in derived.items() if k in base.keys()} + ret.update(extras) + for id, override in overrides.items(): + if override.conformance: + ret[id].conformance = override.conformance + if override.read_access: + ret[id].read_access = override.read_access + if override.write_access: + ret[id].write_access = override.write_access + if ret[id].read_access is None and ret[id].write_access is None: + location = AttributePathLocation(endpoint_id=0, cluster_id=cluster_id, attribute_id=id) + problems.append(ProblemNotice(test_name='Spec XML parsing', location=location, + severity=ProblemSeverity.WARNING, problem='Unable to find access element')) + if ret[id].read_access is None: + ret[id].read_access == Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kUnknownEnumValue + if ret[id].write_access is None: + ret[id].write_access = Clusters.AccessControl.Enums.AccessControlEntryPrivilegeEnum.kUnknownEnumValue + return ret + + # We have the information now about which clusters are derived, so we need to fix them up. Apply first the base cluster, + # then add the specific cluster overtop + for id, c in xml_clusters.items(): + if c.derived: + base_name = c.derived + if base_name in ids_by_name: + base = xml_clusters[ids_by_name[c.derived]] + else: + base = pure_base_clusters[base_name] + + feature_map = deepcopy(base.feature_map) + feature_map.update(c.feature_map) + attribute_map = deepcopy(base.attribute_map) + attribute_map.update(c.attribute_map) + command_map = deepcopy(base.command_map) + command_map.update(c.command_map) + features = deepcopy(base.features) + features.update(c.features) + attributes = combine_attributes(base.attributes, c.attributes, id) + accepted_commands = deepcopy(base.accepted_commands) + accepted_commands.update(c.accepted_commands) + generated_commands = deepcopy(base.generated_commands) + generated_commands.update(c.generated_commands) + events = deepcopy(base.events) + events.update(c.events) + unknown_commands = deepcopy(base.unknown_commands) + for cmd in c.unknown_commands: + if cmd.id in accepted_commands.keys() and cmd.name == accepted_commands[cmd.id].name: + accepted_commands[cmd.id].conformance = cmd.conformance + elif cmd.id in generated_commands.keys() and cmd.name == generated_commands[cmd.id].name: + generated_commands[cmd.id].conformance = cmd.conformance + else: + unknown_commands.append(cmd) + + new = XmlCluster(revision=c.revision, derived=c.derived, name=c.name, + feature_map=feature_map, attribute_map=attribute_map, command_map=command_map, + features=features, attributes=attributes, accepted_commands=accepted_commands, + generated_commands=generated_commands, unknown_commands=unknown_commands, events=events, pics=c.pics) + xml_clusters[id] = new From a71f8145a1c1599e6979b3d664fb76ca94f18f3c Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Thu, 15 Feb 2024 23:34:23 +0100 Subject: [PATCH 4/7] Fix output read from the include-what-you-use tool (#31920) Reading one line and checking whether process is alive might lead to premature read termination in case when subprocess outputs lots of lines and terminates right away. --- scripts/helpers/iwyu-check.py | 4 ++-- scripts/helpers/platforms/iwyu.imp | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/helpers/iwyu-check.py b/scripts/helpers/iwyu-check.py index f4419ccd99ff10..822b85c184766d 100755 --- a/scripts/helpers/iwyu-check.py +++ b/scripts/helpers/iwyu-check.py @@ -172,8 +172,8 @@ def main(compile_commands_glob, scanning_destination, mapping_file_dir, logging.info("============== IWYU output start ================") logger = logging.info - while status.poll() is None: - line = status.stdout.readline().rstrip() + for line in status.stdout: + line = line.rstrip() if re.match(r"^warning:.*$", line): logger = logging.warning diff --git a/scripts/helpers/platforms/iwyu.imp b/scripts/helpers/platforms/iwyu.imp index c3d2210b2886dd..06637de3ad3ddb 100644 --- a/scripts/helpers/platforms/iwyu.imp +++ b/scripts/helpers/platforms/iwyu.imp @@ -32,7 +32,12 @@ ## lib/* { include: [ '"lib/core/CHIPError.h"', private, '', public ] }, { include: [ '"lib/dnssd/ServiceNaming.h"', private, '', public ] }, + + ## lib/support/logging/* + { include: [ '"lib/support/logging/BinaryLogging.h"', private, '', public ] }, { include: [ '"lib/support/logging/CHIPLogging.h"', private, '', public ] }, + { include: [ '"lib/support/logging/Constants.h"', private, '', public ] }, + { include: [ '"lib/support/logging/TextOnlyLogging.h"', private, '', public ] }, ## platform/* { include: [ '"platform/NetworkCommissioning.h"', private, '', public ] }, From 077d4fc73e835424b535618f2d0536f29aa9cbcf Mon Sep 17 00:00:00 2001 From: C Freeman Date: Thu, 15 Feb 2024 20:11:22 -0500 Subject: [PATCH 5/7] TC-IDM-10.1: Support write-only attributes (#32049) * TC-IDM-10.1: Support write-only attributes Write only attributes are not returned in the wildcard, but will return the UNSUPPORTED_READ error if we attempt to read them in a concrete path. We can detect their presence by probing for this error via a read. * remove random comment * Establish PASE session from code * fix node id * Catch KeyError on missing global This would have already been validated in the last step, so catch and release this error and move on. * Fix global attribute names * Fix attribute string * Restyled by clang-format * Update src/python_testing/TC_DeviceBasicComposition.py * Restyled by autopep8 * Make comment more verbose. --------- Co-authored-by: Restyled.io --- .../ChipDeviceController-ScriptBinding.cpp | 9 +++ src/controller/python/chip/ChipDeviceCtrl.py | 12 ++++ .../python/chip/clusters/ClusterObjects.py | 6 +- .../TC_DeviceBasicComposition.py | 64 ++++++++++++++++--- .../basic_composition_support.py | 22 ++----- src/python_testing/matter_testing_support.py | 4 ++ 6 files changed, 89 insertions(+), 28 deletions(-) diff --git a/src/controller/python/ChipDeviceController-ScriptBinding.cpp b/src/controller/python/ChipDeviceController-ScriptBinding.cpp index b4f2edb2955005..d78c9da8ed74d3 100644 --- a/src/controller/python/ChipDeviceController-ScriptBinding.cpp +++ b/src/controller/python/ChipDeviceController-ScriptBinding.cpp @@ -152,6 +152,8 @@ PyChipError pychip_DeviceController_EstablishPASESessionIP(chip::Controller::Dev uint32_t setupPINCode, chip::NodeId nodeid, uint16_t port); PyChipError pychip_DeviceController_EstablishPASESessionBLE(chip::Controller::DeviceCommissioner * devCtrl, uint32_t setupPINCode, uint16_t discriminator, chip::NodeId nodeid); +PyChipError pychip_DeviceController_EstablishPASESession(chip::Controller::DeviceCommissioner * devCtrl, const char * setUpCode, + chip::NodeId nodeid); PyChipError pychip_DeviceController_Commission(chip::Controller::DeviceCommissioner * devCtrl, chip::NodeId nodeid); PyChipError pychip_DeviceController_DiscoverCommissionableNodesLongDiscriminator(chip::Controller::DeviceCommissioner * devCtrl, @@ -600,6 +602,13 @@ PyChipError pychip_DeviceController_EstablishPASESessionBLE(chip::Controller::De return ToPyChipError(devCtrl->EstablishPASEConnection(nodeid, params)); } +PyChipError pychip_DeviceController_EstablishPASESession(chip::Controller::DeviceCommissioner * devCtrl, const char * setUpCode, + chip::NodeId nodeid) +{ + sPairingDelegate.SetExpectingPairingComplete(true); + return ToPyChipError(devCtrl->EstablishPASEConnection(nodeid, setUpCode)); +} + PyChipError pychip_DeviceController_Commission(chip::Controller::DeviceCommissioner * devCtrl, chip::NodeId nodeid) { CommissioningParameters params; diff --git a/src/controller/python/chip/ChipDeviceCtrl.py b/src/controller/python/chip/ChipDeviceCtrl.py index 2400d543f6d09e..318c2b56ef3d4d 100644 --- a/src/controller/python/chip/ChipDeviceCtrl.py +++ b/src/controller/python/chip/ChipDeviceCtrl.py @@ -500,6 +500,15 @@ def EstablishPASESessionIP(self, ipaddr: str, setupPinCode: int, nodeid: int, po self.devCtrl, ipaddr.encode("utf-8"), setupPinCode, nodeid, port) ) + def EstablishPASESession(self, setUpCode: str, nodeid: int): + self.CheckIsActive() + + self.state = DCState.RENDEZVOUS_ONGOING + return self._ChipStack.CallAsync( + lambda: self._dmLib.pychip_DeviceController_EstablishPASESession( + self.devCtrl, setUpCode.encode("utf-8"), nodeid) + ) + def GetTestCommissionerUsed(self): return self._ChipStack.Call( lambda: self._dmLib.pychip_TestCommissionerUsed() @@ -1588,6 +1597,9 @@ def _InitLib(self): self._dmLib.pychip_DeviceController_EstablishPASESessionBLE.argtypes = [ c_void_p, c_uint32, c_uint16, c_uint64] self._dmLib.pychip_DeviceController_EstablishPASESessionBLE.restype = PyChipError + self._dmLib.pychip_DeviceController_EstablishPASESession.argtypes = [ + c_void_p, c_char_p, c_uint64] + self._dmLib.pychip_DeviceController_EstablishPASESession.restype = PyChipError self._dmLib.pychip_DeviceController_DiscoverAllCommissionableNodes.argtypes = [ c_void_p] diff --git a/src/controller/python/chip/clusters/ClusterObjects.py b/src/controller/python/chip/clusters/ClusterObjects.py index 0aef317257014f..111274c884a8dd 100644 --- a/src/controller/python/chip/clusters/ClusterObjects.py +++ b/src/controller/python/chip/clusters/ClusterObjects.py @@ -301,7 +301,7 @@ def __init_subclass__(cls, *args, **kwargs) -> None: """Register a subclass.""" super().__init_subclass__(*args, **kwargs) try: - if cls.cluster_id not in ALL_ATTRIBUTES: + if cls.standard_attribute and cls.cluster_id not in ALL_ATTRIBUTES: ALL_ATTRIBUTES[cls.cluster_id] = {} # register this clusterattribute in the ALL_ATTRIBUTES dict for quick lookups ALL_ATTRIBUTES[cls.cluster_id][cls.attribute_id] = cls @@ -345,6 +345,10 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: def must_use_timed_write(cls) -> bool: return False + @ChipUtility.classproperty + def standard_attribute(cls) -> bool: + return True + @ChipUtility.classproperty def _cluster_object(cls) -> ClusterObject: return make_dataclass('InternalClass', diff --git a/src/python_testing/TC_DeviceBasicComposition.py b/src/python_testing/TC_DeviceBasicComposition.py index 409ae97c1a4106..5bfbc5c44e839b 100644 --- a/src/python_testing/TC_DeviceBasicComposition.py +++ b/src/python_testing/TC_DeviceBasicComposition.py @@ -23,7 +23,11 @@ import chip.clusters.ClusterObjects import chip.tlv from basic_composition_support import BasicCompositionTests +from chip import ChipUtility from chip.clusters.Attribute import ValueDecodeFailure +from chip.clusters.ClusterObjects import ClusterAttributeDescriptor, ClusterObjectFieldDescriptor +from chip.interaction_model import InteractionModelError, Status +from chip.tlv import uint from global_attribute_ids import GlobalAttributeIds from matter_testing_support import (AttributePathLocation, ClusterPathLocation, CommandPathLocation, MatterBaseTest, async_test_body, default_matter_test_main) @@ -165,7 +169,41 @@ def test_TC_DT_1_1(self): if not success: self.fail_current_test("At least one endpoint was missing the descriptor cluster.") - def test_TC_IDM_10_1(self): + async def _read_non_standard_attribute_check_unsupported_read(self, endpoint_id, cluster_id, attribute_id) -> bool: + @dataclass + class TempAttribute(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return cluster_id + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return attribute_id + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + @ChipUtility.classproperty + def standard_attribute(cls) -> bool: + return False + + value: 'uint' = 0 + + result = await self.default_controller.Read(nodeid=self.dut_node_id, attributes=[(endpoint_id, TempAttribute)]) + try: + attr_ret = result.tlvAttributes[endpoint_id][cluster_id][attribute_id] + except KeyError: + attr_ret = None + + error_type_ok = attr_ret is not None and isinstance( + attr_ret, Clusters.Attribute.ValueDecodeFailure) and isinstance(attr_ret.Reason, InteractionModelError) + + got_expected_error = error_type_ok and attr_ret.Reason.status == Status.UnsupportedRead + return got_expected_error + + @async_test_body + async def test_TC_IDM_10_1(self): self.print_step(1, "Perform a wildcard read of attributes on all endpoints - already done") @dataclass @@ -222,6 +260,10 @@ class RequiredMandatoryAttribute: problem=f"Failed validation of value on {location.as_string(self.cluster_mapper)}: {str(e)}", spec_location="Global Elements") success = False continue + except KeyError: + # A KeyError here means the attribute does not exist. This problem was already recorded in step 2, + # but we don't assert until the end of the test, so ignore this and don't re-record the error. + continue self.print_step(4, "Validate the attribute list exactly matches the set of reported attributes") if success: @@ -236,15 +278,19 @@ class RequiredMandatoryAttribute: logging.debug( f"Checking presence of claimed supported {attribute_string} on {location.as_cluster_string(self.cluster_mapper)}: {'found' if has_attribute else 'not_found'}") - # Check attribute is actually present. if not has_attribute: - # TODO: Handle detecting write-only attributes from schema. - if "WriteOnly" in attribute_string: - continue - - self.record_error(self.get_test_name(), location=location, - problem=f"Did not find {attribute_string} on {location.as_cluster_string(self.cluster_mapper)} when it was claimed in AttributeList ({attribute_list})", spec_location="AttributeList Attribute") - success = False + # Check if this is a write-only attribute by trying to read it. + # If it's present and write-only it should return an UNSUPPORTED_READ error. All other errors are a failure. + # Because these can be MEI attributes, we need to build the ClusterAttributeDescriptor manually since it's + # not guaranteed to be generated. Since we expect an error back anyway, the type doesn't matter. + + write_only_attribute = await self._read_non_standard_attribute_check_unsupported_read( + endpoint_id=endpoint_id, cluster_id=cluster_id, attribute_id=attribute_id) + + if not write_only_attribute: + self.record_error(self.get_test_name(), location=location, + problem=f"Did not find {attribute_string} on {location.as_cluster_string(self.cluster_mapper)} when it was claimed in AttributeList ({attribute_list})", spec_location="AttributeList Attribute") + success = False continue attribute_value = cluster[attribute_id] diff --git a/src/python_testing/basic_composition_support.py b/src/python_testing/basic_composition_support.py index 8a6494eccea42f..4a516f67ecbc97 100644 --- a/src/python_testing/basic_composition_support.py +++ b/src/python_testing/basic_composition_support.py @@ -105,24 +105,10 @@ async def setup_class_helper(self, default_to_pase: bool = True): dump_device_composition_path: Optional[str] = self.user_params.get("dump_device_composition_path", None) if do_test_over_pase: - info = self.get_setup_payload_info() - - commissionable_nodes = dev_ctrl.DiscoverCommissionableNodes( - info.filter_type, info.filter_value, stopOnFirst=True, timeoutSecond=15) - logging.info(f"Commissionable nodes: {commissionable_nodes}") - # TODO: Support BLE - if commissionable_nodes is not None and len(commissionable_nodes) > 0: - commissionable_node = commissionable_nodes[0] - instance_name = f"{commissionable_node.instanceName}._matterc._udp.local" - vid = f"{commissionable_node.vendorId}" - pid = f"{commissionable_node.productId}" - address = f"{commissionable_node.addresses[0]}" - logging.info(f"Found instance {instance_name}, VID={vid}, PID={pid}, Address={address}") - - node_id = 1 - dev_ctrl.EstablishPASESessionIP(address, info.passcode, node_id) - else: - asserts.fail("Failed to find the DUT according to command line arguments.") + setupCode = self.matter_test_config.qr_code_content if self.matter_test_config.qr_code_content is not None else self.matter_test_config.manual_code + asserts.assert_true(setupCode, "Require either --qr-code or --manual-code.") + node_id = self.dut_node_id + dev_ctrl.EstablishPASESession(setupCode, node_id) else: # Using the already commissioned node node_id = self.dut_node_id diff --git a/src/python_testing/matter_testing_support.py b/src/python_testing/matter_testing_support.py index 5a5e9db1820845..7efe5ab948966b 100644 --- a/src/python_testing/matter_testing_support.py +++ b/src/python_testing/matter_testing_support.py @@ -60,6 +60,7 @@ from chip.setup_payload import SetupPayload from chip.storage import PersistentStorage from chip.tracing import TracingContext +from global_attribute_ids import GlobalAttributeIds from mobly import asserts, base_test, signals, utils from mobly.config_parser import ENV_MOBLY_LOGPATH, TestRunConfig from mobly.test_runner import TestRunner @@ -412,6 +413,9 @@ def get_cluster_string(self, cluster_id: int) -> str: return f"Cluster {name} ({cluster_id}, 0x{cluster_id:04X})" def get_attribute_string(self, cluster_id: int, attribute_id) -> str: + global_attrs = [item.value for item in GlobalAttributeIds] + if attribute_id in global_attrs: + return f"Attribute {GlobalAttributeIds(attribute_id).to_name()} {attribute_id}, 0x{attribute_id:04X}" mapping = self._mapping._CLUSTER_ID_DICT.get(cluster_id, None) if not mapping: return f"Attribute Unknown ({attribute_id}, 0x{attribute_id:08X})" From cc5b41abc2f0aa60b7ce0039e4e0b8419d3d2604 Mon Sep 17 00:00:00 2001 From: Hasty Granbery Date: Thu, 15 Feb 2024 17:21:43 -0800 Subject: [PATCH 6/7] [Feature] Power Topology server & all-clusters-app stub (#31783) * Initial XML for Power Topology cluster * Regen * Restyled really wants newlines at the end of every JSON file * Rename LeafTopology to TreeTopology * [Feature] Power Topology server & all-clusters-app stub * Make endpointId a constructor arg for PowerTopologyDelegate * Change PowerTopologyDelegate to not return std::vectors * Remove unneeded entries in attributeAccessInterfaceAttributes for Power Topology cluster * Typo in python/chip/clusters/__init__.py * Format zcl.json * Add DynamicPowerFlow feature to PowerTopology stub * Updates based on comments * Remove unneeded using from power-topology-server.h * Regen * Regen * Undo submodule changes --------- Co-authored-by: Robert Szewczyk --- .../all-clusters-app.matter | 32 ++++ .../all-clusters-common/all-clusters-app.zap | 138 ++++++++++++++++++ .../src/power-topology-stub.cpp | 72 +++++++++ .../esp32/main/CMakeLists.txt | 1 + examples/all-clusters-app/linux/BUILD.gn | 1 + examples/all-clusters-app/tizen/BUILD.gn | 1 + .../power-topology-server.cpp | 129 ++++++++++++++++ .../power-topology-server.h | 91 ++++++++++++ src/app/util/util.cpp | 2 + src/app/zap-templates/zcl/data-model/all.xml | 1 + .../zcl/data-model/chip/matter-devices.xml | 1 + .../zcl/zcl-with-test-extensions.json | 1 + src/app/zap-templates/zcl/zcl.json | 1 + src/app/zap_cluster_list.json | 2 +- .../data_model/controller-clusters.zap | 42 ++++++ .../python/chip/clusters/__init__.py | 14 +- .../zap-generated/attributes/Accessors.cpp | 32 ---- .../zap-generated/attributes/Accessors.h | 5 - 18 files changed, 521 insertions(+), 45 deletions(-) create mode 100644 examples/all-clusters-app/all-clusters-common/src/power-topology-stub.cpp create mode 100644 src/app/clusters/power-topology-server/power-topology-server.cpp create mode 100644 src/app/clusters/power-topology-server/power-topology-server.h diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index ebb9b3da83929b..79367dbbf1075c 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -4455,6 +4455,27 @@ provisional cluster EnergyEvse = 153 { timed command ClearTargets(): DefaultSuccess = 7; } +/** The Power Topology Cluster provides a mechanism for expressing how power is flowing between endpoints. */ +provisional cluster PowerTopology = 156 { + revision 1; + + bitmap Feature : bitmap32 { + kNodeTopology = 0x1; + kTreeTopology = 0x2; + kSetTopology = 0x4; + kDynamicPowerFlow = 0x8; + } + + readonly attribute optional endpoint_no availableEndpoints[] = 0; + readonly attribute optional endpoint_no activeEndpoints[] = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + /** Attributes and commands for selecting a mode from a list of supported options. */ provisional cluster EnergyEvseMode = 157 { revision 1; @@ -8340,6 +8361,17 @@ endpoint 1 { handle command ClearTargets; } + server cluster PowerTopology { + callback attribute availableEndpoints; + callback attribute activeEndpoints; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 1; + } + server cluster EnergyEvseMode { callback attribute supportedModes; callback attribute currentMode; diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 1666cef4adc1b8..0a2a3faf1b37e8 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -14240,6 +14240,144 @@ } ] }, + { + "name": "Power Topology", + "code": 156, + "mfgCode": null, + "define": "POWER_TOPOLOGY_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "AvailableEndpoints", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveEndpoints", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Energy EVSE Mode", "code": 157, diff --git a/examples/all-clusters-app/all-clusters-common/src/power-topology-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/power-topology-stub.cpp new file mode 100644 index 00000000000000..af2042bd58504d --- /dev/null +++ b/examples/all-clusters-app/all-clusters-common/src/power-topology-stub.cpp @@ -0,0 +1,72 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using namespace chip; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::PowerTopology; + +namespace chip { +namespace app { +namespace Clusters { +namespace PowerTopology { + +class PowerTopologyDelegate : public Delegate +{ +public: + ~PowerTopologyDelegate() = default; + + CHIP_ERROR GetAvailableEndpointAtIndex(size_t index, EndpointId & endpointId) override; + CHIP_ERROR GetActiveEndpointAtIndex(size_t index, EndpointId & endpointId) override; +}; + +CHIP_ERROR PowerTopologyDelegate::GetAvailableEndpointAtIndex(size_t index, EndpointId & endpointId) +{ + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; +} + +CHIP_ERROR PowerTopologyDelegate::GetActiveEndpointAtIndex(size_t index, EndpointId & endpointId) +{ + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; +} + +} // namespace PowerTopology +} // namespace Clusters +} // namespace app +} // namespace chip + +static std::unique_ptr gDelegate; +static std::unique_ptr gInstance; + +void emberAfPowerTopologyClusterInitCallback(chip::EndpointId endpointId) +{ + VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. + VerifyOrDie(!gInstance); + + gDelegate = std::make_unique(); + if (gDelegate) + { + gInstance = std::make_unique( + endpointId, *gDelegate, BitMask(Feature::kSetTopology, Feature::kDynamicPowerFlow), + BitMask(OptionalAttributes::kOptionalAttributeAvailableEndpoints, + OptionalAttributes::kOptionalAttributeActiveEndpoints)); + + gInstance->Init(); + } +} diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 641cbca7b55af0..238f0e899c340d 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -90,6 +90,7 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/pump-configuration-and-control-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-configuration-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-topology-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/resource-monitoring-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/temperature-control-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-synchronization-server" diff --git a/examples/all-clusters-app/linux/BUILD.gn b/examples/all-clusters-app/linux/BUILD.gn index b0fdcd4e0af68f..998f98a19cd3de 100644 --- a/examples/all-clusters-app/linux/BUILD.gn +++ b/examples/all-clusters-app/linux/BUILD.gn @@ -48,6 +48,7 @@ source_set("chip-all-clusters-common") { "${chip_root}/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/oven-modes.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/oven-operational-state-delegate.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/power-topology-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/rvc-modes.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/rvc-operational-state-delegate-impl.cpp", diff --git a/examples/all-clusters-app/tizen/BUILD.gn b/examples/all-clusters-app/tizen/BUILD.gn index 4a60be79bc1e49..364e9ce857d5da 100644 --- a/examples/all-clusters-app/tizen/BUILD.gn +++ b/examples/all-clusters-app/tizen/BUILD.gn @@ -33,6 +33,7 @@ source_set("chip-all-clusters-common") { "${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/oven-modes.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/power-topology-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", diff --git a/src/app/clusters/power-topology-server/power-topology-server.cpp b/src/app/clusters/power-topology-server/power-topology-server.cpp new file mode 100644 index 00000000000000..3aff74760343bc --- /dev/null +++ b/src/app/clusters/power-topology-server/power-topology-server.cpp @@ -0,0 +1,129 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "power-topology-server.h" + +#include + +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::DataModel; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::PowerTopology; +using namespace chip::app::Clusters::PowerTopology::Attributes; + +using chip::Protocols::InteractionModel::Status; + +namespace chip { +namespace app { +namespace Clusters { +namespace PowerTopology { + +CHIP_ERROR Instance::Init() +{ + VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); + return CHIP_NO_ERROR; +} + +void Instance::Shutdown() +{ + unregisterAttributeAccessOverride(this); +} + +bool Instance::HasFeature(Feature aFeature) const +{ + return mFeature.Has(aFeature); +} + +bool Instance::SupportsOptAttr(OptionalAttributes aOptionalAttrs) const +{ + return mOptionalAttrs.Has(aOptionalAttrs); +} + +// AttributeAccessInterface +CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +{ + switch (aPath.mAttributeId) + { + case FeatureMap::Id: + ReturnErrorOnFailure(aEncoder.Encode(mFeature)); + break; + case AvailableEndpoints::Id: + return ReadAvailableEndpoints(aEncoder); + case ActiveEndpoints::Id: + return ReadActiveEndpoints(aEncoder); + } + return CHIP_NO_ERROR; +} + +CHIP_ERROR Instance::ReadAvailableEndpoints(AttributeValueEncoder & aEncoder) +{ + if (!SupportsOptAttr(OptionalAttributes::kOptionalAttributeAvailableEndpoints)) + { + return CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute); + } + VerifyOrReturnError(HasFeature(Feature::kSetTopology), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "Power Topology: can not get AvailableEndpoints, feature is not supported")); + + return aEncoder.EncodeList([this](const auto & encoder) -> CHIP_ERROR { + for (uint8_t i = 0; true; i++) + { + EndpointId endpointId; + auto err = mDelegate.GetAvailableEndpointAtIndex(i, endpointId); + if (err == CHIP_ERROR_PROVIDER_LIST_EXHAUSTED) + { + return CHIP_NO_ERROR; + } + ReturnErrorOnFailure(err); + ReturnErrorOnFailure(encoder.Encode(endpointId)); + } + }); +} + +CHIP_ERROR Instance::ReadActiveEndpoints(AttributeValueEncoder & aEncoder) +{ + if (!SupportsOptAttr(OptionalAttributes::kOptionalAttributeActiveEndpoints)) + { + return CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute); + } + VerifyOrReturnError(HasFeature(Feature::kDynamicPowerFlow), CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE, + ChipLogError(Zcl, "Power Topology: can not get ActiveEndpoints, feature is not supported")); + + return aEncoder.EncodeList([this](const auto & encoder) -> CHIP_ERROR { + for (uint8_t i = 0; true; i++) + { + EndpointId endpointId; + auto err = mDelegate.GetActiveEndpointAtIndex(i, endpointId); + if (err == CHIP_ERROR_PROVIDER_LIST_EXHAUSTED) + { + return CHIP_NO_ERROR; + } + ReturnErrorOnFailure(err); + ReturnErrorOnFailure(encoder.Encode(endpointId)); + } + }); +} + +} // namespace PowerTopology +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/power-topology-server/power-topology-server.h b/src/app/clusters/power-topology-server/power-topology-server.h new file mode 100644 index 00000000000000..4d34b951ea6650 --- /dev/null +++ b/src/app/clusters/power-topology-server/power-topology-server.h @@ -0,0 +1,91 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#pragma once + +#include + +#include +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace PowerTopology { + +class Delegate +{ +public: + virtual ~Delegate() = default; + + /** + * Get the Nth EndpointId in the list of available endpoints. + * @param index The index of the EndpointId to be returned. + * @param endpointId A reference to the EndpointId. + * @return Returns a CHIP_NO_ERROR if there was no error and the EndpointId was returned successfully. + * CHIP_ERROR_PROVIDER_LIST_EXHAUSTED if the index is greater than or equal to the length of the list of available endpoints. + */ + virtual CHIP_ERROR GetAvailableEndpointAtIndex(size_t index, EndpointId & endpointId) = 0; + + /** + * Get the Nth EndpointId in the list of active endpoints. + * @param index The index of the EndpointId to be returned. + * @param endpointId A reference to the EndpointId. + * @return Returns a CHIP_NO_ERROR if there was no error and the EndpointId was returned successfully. + * CHIP_ERROR_PROVIDER_LIST_EXHAUSTED if the index is greater than or equal to the length of the list of active endpoints. + */ + virtual CHIP_ERROR GetActiveEndpointAtIndex(size_t index, EndpointId & endpointId) = 0; +}; + +enum class OptionalAttributes : uint32_t +{ + kOptionalAttributeAvailableEndpoints = 0x1, + kOptionalAttributeActiveEndpoints = 0x2, +}; + +class Instance : public AttributeAccessInterface +{ +public: + Instance(EndpointId aEndpointId, Delegate & aDelegate, BitMask aFeature, + BitMask aOptionalAttributes) : + AttributeAccessInterface(MakeOptional(aEndpointId), Id), + mDelegate(aDelegate), mFeature(aFeature), mOptionalAttrs(aOptionalAttributes) + {} + ~Instance() { Shutdown(); } + + CHIP_ERROR Init(); + void Shutdown(); + + bool HasFeature(Feature aFeature) const; + bool SupportsOptAttr(OptionalAttributes aOptionalAttrs) const; + +private: + Delegate & mDelegate; + BitMask mFeature; + BitMask mOptionalAttrs; + + // AttributeAccessInterface + CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR ReadAvailableEndpoints(AttributeValueEncoder & aEncoder); + CHIP_ERROR ReadActiveEndpoints(AttributeValueEncoder & aEncoder); +}; + +} // namespace PowerTopology +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp index 267da8921574d8..e327673fc3cbf4 100644 --- a/src/app/util/util.cpp +++ b/src/app/util/util.cpp @@ -167,8 +167,10 @@ void MatterDishwasherAlarmPluginServerInitCallback() {} void MatterMicrowaveOvenModePluginServerInitCallback() {} void MatterDeviceEnergyManagementModePluginServerInitCallback() {} void MatterEnergyEvseModePluginServerInitCallback() {} +void MatterPowerTopologyPluginServerInitCallback() {} void MatterElectricalEnergyMeasurementPluginServerInitCallback() {} void MatterElectricalPowerMeasurementPluginServerInitCallback() {} + // **************************************** // Print out information about each cluster // **************************************** diff --git a/src/app/zap-templates/zcl/data-model/all.xml b/src/app/zap-templates/zcl/data-model/all.xml index 255be8b0328e1b..86d2085718291d 100644 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ b/src/app/zap-templates/zcl/data-model/all.xml @@ -72,6 +72,7 @@ + diff --git a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml index 037c660d1d6f8c..259a59dae3ead5 100644 --- a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml +++ b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml @@ -117,6 +117,7 @@ limitations under the License. Node + diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 2800e14197008c..5bae212dc6d50c 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -630,6 +630,7 @@ "NeutralCurrent", "FeatureMap" ], + "Power Topology": ["FeatureMap"], "Valve Configuration and Control": ["RemainingDuration"], "Boolean State Configuration": ["CurrentSensitivityLevel"] }, diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index b9e0142011022a..dcfbaf6986c23c 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -628,6 +628,7 @@ "NeutralCurrent", "FeatureMap" ], + "Power Topology": ["FeatureMap"], "Valve Configuration and Control": ["RemainingDuration"], "Boolean State Configuration": ["CurrentSensitivityLevel"] }, diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index db22d6c2ab5e77..b3993634639869 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -228,7 +228,7 @@ "SAMPLE_MEI_CLUSTER": ["sample-mei-server"], "OCCUPANCY_SENSING_CLUSTER": ["occupancy-sensor-server"], "ON_OFF_CLUSTER": ["on-off-server"], - "POWER_TOPOLOGY_CLUSTER": [], + "POWER_TOPOLOGY_CLUSTER": ["power-topology-server"], "ON_OFF_SWITCH_CONFIGURATION_CLUSTER": [], "OPERATIONAL_CREDENTIALS_CLUSTER": ["operational-credentials-server"], "OPERATIONAL_STATE_CLUSTER": ["operational-state-server"], diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 02a58c61ee3c09..42753ed88f84b4 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -3314,6 +3314,48 @@ } ] }, + { + "name": "Power Topology", + "code": 156, + "mfgCode": null, + "define": "POWER_TOPOLOGY_CLUSTER", + "side": "client", + "enabled": 1, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Energy EVSE Mode", "code": 157, diff --git a/src/controller/python/chip/clusters/__init__.py b/src/controller/python/chip/clusters/__init__.py index bd15d261d8962a..85048384d8a81c 100644 --- a/src/controller/python/chip/clusters/__init__.py +++ b/src/controller/python/chip/clusters/__init__.py @@ -38,12 +38,12 @@ OccupancySensing, OnOff, OnOffSwitchConfiguration, OperationalCredentials, OperationalState, OtaSoftwareUpdateProvider, OtaSoftwareUpdateRequestor, OvenCavityOperationalState, OvenMode, OzoneConcentrationMeasurement, Pm1ConcentrationMeasurement, Pm10ConcentrationMeasurement, - Pm25ConcentrationMeasurement, PowerSource, PowerSourceConfiguration, PressureMeasurement, ProxyConfiguration, - ProxyDiscovery, ProxyValid, PulseWidthModulation, PumpConfigurationAndControl, RadonConcentrationMeasurement, - RefrigeratorAlarm, RefrigeratorAndTemperatureControlledCabinetMode, RelativeHumidityMeasurement, RvcCleanMode, - RvcOperationalState, RvcRunMode, ScenesManagement, SmokeCoAlarm, SoftwareDiagnostics, Switch, TargetNavigator, - TemperatureControl, TemperatureMeasurement, Thermostat, ThermostatUserInterfaceConfiguration, - ThreadNetworkDiagnostics, TimeFormatLocalization, TimeSynchronization, + Pm25ConcentrationMeasurement, PowerSource, PowerSourceConfiguration, PowerTopology, PressureMeasurement, + ProxyConfiguration, ProxyDiscovery, ProxyValid, PulseWidthModulation, PumpConfigurationAndControl, + RadonConcentrationMeasurement, RefrigeratorAlarm, RefrigeratorAndTemperatureControlledCabinetMode, + RelativeHumidityMeasurement, RvcCleanMode, RvcOperationalState, RvcRunMode, ScenesManagement, SmokeCoAlarm, + SoftwareDiagnostics, Switch, TargetNavigator, TemperatureControl, TemperatureMeasurement, Thermostat, + ThermostatUserInterfaceConfiguration, ThreadNetworkDiagnostics, TimeFormatLocalization, TimeSynchronization, TotalVolatileOrganicCompoundsConcentrationMeasurement, UnitLocalization, UnitTesting, UserLabel, ValveConfigurationAndControl, WakeOnLan, WiFiNetworkDiagnostics, WindowCovering) @@ -61,7 +61,7 @@ OccupancySensing, OnOff, OnOffSwitchConfiguration, OperationalCredentials, OperationalState, OtaSoftwareUpdateProvider, OtaSoftwareUpdateRequestor, OvenCavityOperationalState, OvenMode, OzoneConcentrationMeasurement, Pm1ConcentrationMeasurement, Pm10ConcentrationMeasurement, - Pm25ConcentrationMeasurement, PowerSource, PowerSourceConfiguration, PressureMeasurement, ProxyConfiguration, + Pm25ConcentrationMeasurement, PowerSource, PowerSourceConfiguration, PowerTopology, PressureMeasurement, ProxyConfiguration, ProxyDiscovery, ProxyValid, PulseWidthModulation, PumpConfigurationAndControl, RadonConcentrationMeasurement, RefrigeratorAlarm, RefrigeratorAndTemperatureControlledCabinetMode, RelativeHumidityMeasurement, RvcCleanMode, RvcOperationalState, RvcRunMode, ScenesManagement, SmokeCoAlarm, SoftwareDiagnostics, diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 686147de371a61..a3e74424d0768b 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -10726,38 +10726,6 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu namespace PowerTopology { namespace Attributes { -namespace FeatureMap { - -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::PowerTopology::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::PowerTopology::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); -} - -} // namespace FeatureMap - namespace ClusterRevision { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index fe7cc9a9c4922d..51e19658e9d99d 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -2113,11 +2113,6 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu namespace PowerTopology { namespace Attributes { -namespace FeatureMap { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value); -} // namespace FeatureMap - namespace ClusterRevision { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value); // int16u Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value); From de5c6d5ce8b6da6af48fe12c691037d9b4c93d4e Mon Sep 17 00:00:00 2001 From: Gibran Vargas <131407127+gvargas-csa@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:41:13 -0800 Subject: [PATCH 7/7] Copy media cluster new automated tests (#32155) * Newly added Media cluster automated tests: TC_APPOBSERVER_1_13 TC_APPOBSERVER_13_2 TC_MEDIAPLAYBACK_6_8 TC_MEDIAPLAYBACK_6_9 ICDM semi-automated test: TC_ICDM_3_4 * Auto generated files * Restyled by whitespace * Automated tests: TC_DEMM_1_1 TC_DEMM_2_1 TC_EEVSE_1_1 TC_EEVSE_2_1 TC_REFALM_2_2 TC_EEVSEM_1_1 TC_EEVSEM_2_1 TC_EEVSEM_3_1 TC_EEVSEM_3_2 TC_EEVSEM_3_3 Manual tests: TC_DEMM_1_2 TC_EEVSEM_1_2 * Fix CI failure for Darwin check. * Fix Mediaplayback script issue in CLI * Fix CI failure --------- Co-authored-by: manjunath-grl Co-authored-by: Restyled.io --- scripts/tests/chiptest/__init__.py | 5 + src/app/tests/suites/certification/PICS.yaml | 93 ++++ .../Test_TC_APPOBSERVER_13_2.yaml | 53 +- .../Test_TC_APPOBSERVER_1_13.yaml | 116 ++--- .../certification/Test_TC_DEMM_1_1.yaml | 116 +++++ .../certification/Test_TC_DEMM_1_2.yaml | 112 ++++ .../certification/Test_TC_DEMM_2_1.yaml | 219 ++++++++ .../certification/Test_TC_EEVSEM_1_1.yaml | 116 +++++ .../certification/Test_TC_EEVSEM_1_2.yaml | 95 ++++ .../certification/Test_TC_EEVSEM_2_1.yaml | 219 ++++++++ .../certification/Test_TC_EEVSEM_3_1.yaml | 134 +++++ .../certification/Test_TC_EEVSEM_3_2.yaml | 172 ++++++ .../certification/Test_TC_EEVSEM_3_3.yaml | 189 +++++++ .../certification/Test_TC_EEVSE_1_1.yaml | 396 +++++++++----- .../certification/Test_TC_EEVSE_2_1.yaml | 489 ++++++++---------- .../certification/Test_TC_ICDM_3_4.yaml | 210 +++++--- .../suites/certification/Test_TC_IDM_1_3.yaml | 5 - .../suites/certification/Test_TC_LWM_2_1.yaml | 2 +- .../Test_TC_MEDIAPLAYBACK_6_8.yaml | 144 ++---- .../Test_TC_MEDIAPLAYBACK_6_9.yaml | 116 ++--- .../certification/Test_TC_REFALM_2_2.yaml | 227 +++++--- .../tests/suites/certification/ci-pics-values | 137 +++-- src/app/tests/suites/ciTests.json | 18 +- src/app/tests/suites/manualTests.json | 5 +- 24 files changed, 2546 insertions(+), 842 deletions(-) create mode 100644 src/app/tests/suites/certification/Test_TC_DEMM_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DEMM_1_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_DEMM_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_EEVSEM_1_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_EEVSEM_1_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_EEVSEM_2_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_EEVSEM_3_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_EEVSEM_3_2.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_EEVSEM_3_3.yaml diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index fd4ad6f52867b5..505a5e163cc5c4 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -236,6 +236,7 @@ def _GetChipReplUnsupportedTests() -> Set[str]: "Test_TC_IDM_1_2.yaml", # chip-repl does not support AnyCommands (19/07/2023) "TestGroupKeyManagementCluster.yaml", # chip-repl does not support EqualityCommands (2023-08-04) "TestIcdManagementCluster.yaml", # TODO(#30430): add ICD registration support in chip-repl + "Test_TC_ICDM_3_4.yaml", # chip-repl does not support ICD registration "Test_TC_S_2_2.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "Test_TC_MOD_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "Test_TC_MOD_3_2.yaml", # chip-repl does not support EqualityCommands pseudo-cluster @@ -264,6 +265,10 @@ def _GetChipReplUnsupportedTests() -> Set[str]: "Test_TC_RVCCLEANM_3_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "Test_TC_BINFO_2_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "TestDiagnosticLogs.yaml", # chip-repl does not implement a BDXTransferServerDelegate + "Test_TC_EEVSEM_2_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + "Test_TC_EEVSEM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + "Test_TC_EEVSEM_3_2.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + "Test_TC_EEVSEM_3_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "TestDiagnosticLogsDownloadCommand.yaml", # chip-repl does not implement the bdx download command } diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 407851320ca31c..5096e6e544022b 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -4665,6 +4665,21 @@ PICS: "Does the DUT support the Media Playback server cluster, Seek command?" id: MEDIAPLAYBACK.S.C0b.Rsp + - label: + "Does the DUT support the Media Playback server cluster, + ActivateAudioTrack command?" + id: MEDIAPLAYBACK.S.C0c.Rsp + + - label: + "Does the DUT support the Media Playback server cluster, + ActivateTextTrack command?" + id: MEDIAPLAYBACK.S.C0d.Rsp + + - label: + "Does the DUT support the Media Playback server cluster, + DeactivateTextTrack command?" + id: MEDIAPLAYBACK.S.C0e.Rsp + - label: "Does the DUT support the Audio Output server cluster, SelectOutput command?" @@ -10064,3 +10079,81 @@ PICS: # Commands generated - label: "Does the device implement sending the GetTargetsResponse command?" id: EEVSE.S.C00.Tx + + # Energy EVSE Mode Cluster + # server / attributes + - label: "Does the device implement the Energy EVSE cluster as a server?" + id: EEVSEM.S + + - label: "Does the device implement the SupportedModes attribute?" + id: EEVSEM.S.A0000 + + - label: "Does the device implement the CurrentMode attribute?" + id: EEVSEM.S.A0001 + + - label: "Does the device implement the StartUpMode attribute?" + id: EEVSEM.S.A0002 + + - label: "Does the device implement the OnMode attribute?" + id: EEVSEM.S.A0003 + + # Commands received + - label: "Does the device implement sending the ChangeToMode command?" + id: EEVSEM.S.C00.Rsp + + # Commands generated + - label: + "Does the device implement sending the ChangeToModeResponse command?" + id: EEVSEM.S.C01.Tx + + # Manual controllable + - label: "Does the DUT support testing the failed ChangeToMode command?" + id: EEVSEM.S.M.CAN_TEST_MODE_FAILURE + + - label: "Can the mode change be manually controlled?" + id: EEVSEM.S.M.CAN_MANUALLY_CONTROLLED + + #Feature + - label: "Does the DUT(server) support the Hue/Saturation feature?" + id: EEVSEM.S.F00 + + # + # Device Energy Management Mode Cluster + # server / attributes + + - label: "Does the device implement the DEMM cluster as a server?" + id: DEMM.S + + - label: "Does the device implement the SupportedModes attribute?" + id: DEMM.S.A0000 + + - label: "Does the device implement the CurrentMode attribute?" + id: DEMM.S.A0001 + + - label: "Does the device implement the StartUpMode attribute?" + id: DEMM.S.A0002 + + - label: "Does the device implement the OnMode attribute?" + id: DEMM.S.A0003 + + # Commands received + - label: "Does the device implement sending the ChangeToMode command?" + id: DEMM.S.C00.Rsp + + # Commands generated + - label: + "Does the device implement sending the ChangeToModeResponse command?" + id: DEMM.S.C01.Tx + + - label: "Does the DUT support testing the failed ChangeToMode command?" + id: DEMM.S.M.CAN_TEST_MODE_FAILURE + + - label: "Can the mode change be manually controlled?" + id: DEMM.S.M.CAN_MANUALLY_CONTROLLED + + # Manual controllable + - label: "Does the DUT support testing the failed ChangeToMode command?" + id: EEVSEM.S.M.CAN_TEST_MODE_FAILURE + + - label: "Can the mode change be manually controlled?" + id: EEVSEM.S.M.CAN_MANUALLY_CONTROLLED diff --git a/src/app/tests/suites/certification/Test_TC_APPOBSERVER_13_2.yaml b/src/app/tests/suites/certification/Test_TC_APPOBSERVER_13_2.yaml index b8c3b77fb08a7e..1dcf5b36fef83a 100644 --- a/src/app/tests/suites/certification/Test_TC_APPOBSERVER_13_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_APPOBSERVER_13_2.yaml @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 19.15.2. [TC-APPOBSERVER-13.2] Content App Message Verification (DUT as @@ -22,27 +21,41 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Content App Observer" + endpoint: 1 + + DataValue: + type: char_string + defaultValue: "exampleData" + EncodingHintValue: + type: char_string + defaultValue: "Zoo" tests: + - label: "Step 1: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + - label: - "Step 1: TH sends a ContentAppMessage command to the DUT with dummy + "Step 2: TH sends a ContentAppMessage command to the DUT with dummy data and encodingHint strings" PICS: APPOBSERVER.S.C00.Rsp - verification: | - ./chip-tool contentappobserver content-app-message foo 1234 1 --Data bar - On TH(chip-tool), The DUT should respond with a ContentAppMessageResponse response with status 0 (success) and optional data and encodingHint strings. - [1705666572.972558][4778:4780] CHIP:DMG: InteractionModelRevision = 11 - [1705666572.972584][4778:4780] CHIP:DMG: }, - [1705666572.972667][4778:4780] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0510 Command=0x0000_0001 - [1705666572.972720][4778:4780] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0510 Command 0x0000_0001 - [1705666572.972820][4778:4780] CHIP:TOO: ContentAppMessageResponse: { - [1705666572.972862][4778:4780] CHIP:TOO: status: 0 - [1705666572.972888][4778:4780] CHIP:TOO: data: exampleData - [1705666572.972912][4778:4780] CHIP:TOO: encodingHint: foo - [1705666572.972936][4778:4780] CHIP:TOO: } - [1705666572.972989][4778:4780] CHIP:DMG: ICR moving to [AwaitingDe] - [1705666572.973210][4778:4780] CHIP:EM: <<< [E:743i S:54358 M:87646250 (Ack:136640189)] (S) Msg TX to 1:0000000000000001 [A5ED] [UDP:[fe80::e65f:1ff:fe0f:1a01%wlan0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1705666572.973340][4778:4780] CHIP:EM: Flushed pending ack for MessageCounter:136640189 on exchange 743i - disabled: true + command: "ContentAppMessage" + arguments: + values: + - name: "Data" + value: DataValue + - name: "EncodingHint" + value: EncodingHintValue + response: + values: + - name: "Status" + value: 0 + - name: "Data" + value: DataValue + - name: "EncodingHint" + value: EncodingHintValue diff --git a/src/app/tests/suites/certification/Test_TC_APPOBSERVER_1_13.yaml b/src/app/tests/suites/certification/Test_TC_APPOBSERVER_1_13.yaml index 046e07a61dde62..509b0232e88ec6 100644 --- a/src/app/tests/suites/certification/Test_TC_APPOBSERVER_1_13.yaml +++ b/src/app/tests/suites/certification/Test_TC_APPOBSERVER_1_13.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Project CHIP Authors +# Copyright (c) 2023 Project CHIP Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,73 +22,73 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "ContentAppObserver" + endpoint: 1 tests: + - label: "Step 0: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + - label: "Step 1: TH reads the ClusterRevision attribute from the DUT" - verification: | - ./chip-tool contentappobserver read cluster-revision 1 1 - Verify " ClusterRevision " value is of unit16 and reflects the highest revision number on the TH(Chip-tool) Log, in RPI the value of ClusterRevision is 1 - [1702624923.223245][5892:5894] CHIP:DMG: InteractionModelRevision = 11 - [1702624923.223299][5892:5894] CHIP:DMG: } - [1702624923.223652][5892:5894] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0510 Attribute 0x0000_FFFD DataVersion: 2272699478 - [1702624923.223820][5892:5894] CHIP:TOO: ClusterRevision: 1 - [1702624923.224324][5892:5894] CHIP:EM: <<< [E:5445i S:15084 M:255037238 (Ack:113660697)] (S) Msg TX to 1:0000000000000001 [EDAD] [UDP:[fe80::e65f:1ff:fe49:ae1a%wlan0]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1702624923.224578][5892:5894] CHIP:EM: Flushed pending ack for MessageCounter:113660697 on exchange 5445i - disabled: true + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + type: int16u - label: "Step 2: TH reads the FeatureMap attribute from the DUT" - verification: | - ./chip-tool contentappobserver read feature-map 1 1 - On TH, verify that DUT sends the FeatureMap attribute has the value 0 or returns a general error that the attribute is not supported - [1702624956.728609][5896:5898] CHIP:DMG: SuppressResponse = true, - [1702624956.728667][5896:5898] CHIP:DMG: InteractionModelRevision = 11 - [1702624956.728720][5896:5898] CHIP:DMG: } - [1702624956.729021][5896:5898] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0510 Attribute 0x0000_FFFC DataVersion: 2272699478 - [1702624956.729138][5896:5898] CHIP:TOO: FeatureMap: 0 - [1702624956.729564][5896:5898] CHIP:EM: <<< [E:26717i S:26806 M:11352307 (Ack:31492418)] (S) Msg TX to 1:0000000000000001 [EDAD] [UDP:[fe80::e65f:1ff:fe49:ae1a%wlan0]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + constraints: + type: bitmap32 + + - label: "Step 3: TH reads the AttributeList attribute from the DUT" + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [65528, 65529, 65530, 65531, 65532, 65533] - label: "Step 3: TH reads the AttributeList attribute from the DUT" - verification: | - ./chip-tool contentappobserver read attribute-list 1 1 - Verify " AttributeList " value consists the list of mandatory attributes (65533, 65532, 65531, 65529, 65528) on the TH(Chip-tool) Log: - [1702624983.367693][5900:5902] CHIP:DMG: } - [1702624983.368044][5900:5902] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0510 Attribute 0x0000_FFFB DataVersion: 2272699478 - [1702624983.368485][5900:5902] CHIP:TOO: AttributeList: 5 entries - [1702624983.368564][5900:5902] CHIP:TOO: [1]: 65528 - [1702624983.368624][5900:5902] CHIP:TOO: [2]: 65529 - [1702624983.368683][5900:5902] CHIP:TOO: [3]: 65531 - [1702624983.368741][5900:5902] CHIP:TOO: [4]: 65532 - [1702624983.368798][5900:5902] CHIP:TOO: [5]: 65533 - [1702624983.369236][5900:5902] CHIP:EM: <<< [E:55491i S:35892 M:103959395 (Ack:145764997)] (S) Msg TX to 1:0000000000000001 [EDAD] [UDP:[fe80::e65f:1ff:fe49:ae1a%wlan0]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + PICS: "!PICS_EVENT_LIST_ENABLED" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [65528, 65529, 65531, 65532, 65533] - label: "Step 4: TH reads the AcceptedCommandList attribute from the DUT" - verification: | - ./chip-tool contentappobserver read accepted-command-list 1 1 - Verify " AcceptedCommandList " consists the list of mandatory commands(0)on the TH(Chip-tool) Log: - [1702625012.494394][5905:5907] CHIP:DMG: } - [1702625012.494619][5905:5907] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0510 Attribute 0x0000_FFF9 DataVersion: 2272699478 - [1702625012.494697][5905:5907] CHIP:TOO: AcceptedCommandList: 1 entries - [1702625012.494725][5905:5907] CHIP:TOO: [1]: 0 - [1702625012.494981][5905:5907] CHIP:EM: <<< [E:43961i S:9805 M:165451447 (Ack:180558712)] (S) Msg TX to 1:0000000000000001 [EDAD] [UDP:[fe80::e65f:1ff:fe49:ae1a%wlan0]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0] - label: "Step 5: TH reads the GeneratedCommandList attribute from the DUT" - verification: | - ./chip-tool contentappobserver read generated-command-list 1 1 - Verify " GeneratedCommandList " consists the list of mandatory commands(1) on the TH(Chip-tool) Log: - [1702625044.200661][5910:5912] CHIP:DMG: } - [1702625044.201052][5910:5912] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0510 Attribute 0x0000_FFF8 DataVersion: 2272699478 - [1702625044.201230][5910:5912] CHIP:TOO: GeneratedCommandList: 1 entries - [1702625044.201298][5910:5912] CHIP:TOO: [1]: 1 - [1702625044.201724][5910:5912] CHIP:EM: <<< [E:33891i S:27945 M:56965554 (Ack:52573112)] (S) Msg TX to 1:0000000000000001 [EDAD] [UDP:[fe80::e65f:1ff:fe49:ae1a%wlan0]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1702625044.201956][5910:5912] CHIP:EM: Flushed pending ack for MessageCounter:52573112 on exchange 33891i - disabled: true + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + constraints: + type: list + contains: [1] - label: "Step 6: TH reads the EventList attribute from the DUT" - verification: | - ./chip-tool contentappobserver read event-list 1 1 - disabled: true + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_DEMM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DEMM_1_1.yaml new file mode 100644 index 00000000000000..832b21e12ac63b --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DEMM_1_1.yaml @@ -0,0 +1,116 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 241.1.1. [TC-DEMM-1.1] Global attributes with DUT as Server + +PICS: + - DEMM.S + +config: + nodeId: 0x12344321 + cluster: "Device Energy Management Mode" + endpoint: 1 + +tests: + - label: + "Step 1: Commission DUT to TH (can be skipped if done in a preceding + test)." + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 2: TH reads from the DUT the ClusterRevision attribute" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + type: int16u + + #https://github.com/project-chip/connectedhomeip/issues/31599 + - label: "Step 3: TH reads from the DUT the FeatureMap attribute" + verification: | + ./chip-tool deviceenergymanagementmode read feature-map 1 1 + + On the TH(Chip-tool) Log, Verify featureMap value is 0 and below is the sample log provided for the raspi platform: + + [1705923720.577354][23553:23555] CHIP:DMG: } + [1705923720.577393][23553:23555] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_009F Attribute 0x0000_FFFC DataVersion: 2217281174 + [1705923720.577412][23553:23555] CHIP:TOO: FeatureMap: 1 + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: "Step 4: TH reads from the DUT the AttributeList attribute." + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Step 4a: TH reads from the DUT the AttributeList attribute." + PICS: "!PICS_EVENT_LIST_ENABLED" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1, 65528, 65529, 65531, 65532, 65533] + + - label: + "Step 4b: TH reads optional attribute (StartUpMode) in AttributeList + from DUT" + PICS: DEMM.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2] + + - label: "Step 5: TH reads from the DUT the EventList attribute." + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list + + - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + value: [0] + constraints: + type: list + + - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [1] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_DEMM_1_2.yaml b/src/app/tests/suites/certification/Test_TC_DEMM_1_2.yaml new file mode 100644 index 00000000000000..55aa1400ec1ac5 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DEMM_1_2.yaml @@ -0,0 +1,112 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 241.1.2. [TC-DEMM-1.2] Cluster attributes with DUT as Server + +PICS: + - DEMM.S + +config: + nodeId: 0x12344321 + cluster: "Basic Information" + endpoint: 1 + +tests: + - label: "Step 1: TH reads from the DUT the SupportedModes attribute" + PICS: DEMM.S.A0000 + verification: | + ./chip-tool deviceenergymanagementmode read supported-modes 1 1 + + - Verify that the DUT response contains a list of ModeOptionsStruct entries + - Verify that the list has at least 2 and at most 255 entries + - Verify that each ModeOptionsStruct entry has a unique Mode field value + - Verify that each ModeOptionsStruct entry has a unique Label field value + - Verify that each ModeOptionsStruct entry’s ModeTags field has: + at least one entry the values of the Value fields that are not larger than 16 bits + - for each Value field: Is the mode tag value a defined common tag value (Auto(0x0000), Quick(0x0001), Quiet(0x0002), LowNoise(0x0003), LowEnergy(0x0004), Vacation(0x0005), Min(0x0006), Max(0x0007), Night(0x0008), Day(0x0009)) or a defined cluster-derived tag value (No Optimization, Device Optimization, Local Optimization, Grid Optimization) or in the MfgTags (0x8000 to 0xBFFF) range + - for at least one Value field: Is the mode tag value a defined common tag value (Auto(0x0000), Quick(0x0001), Quiet(0x0002), LowNoise(0x0003), LowEnergy(0x0004), Vacation(0x0005), Min(0x0006), Max(0x0007), Night(0x0008), Day(0x0009)) or a derived cluster value (RapidCool, RapidFreeze) + - if the Value field is in the MfgTags (0x8000 to 0xBFFF) range, the TagName field is a string with a length between 1 and 64 + - Verify that at least one ModeOptionsStruct entry includes either the RapidCool semantic tag or the RapidFreeze semantic tag in the SemanticTags field + - Save the Mode field values as supported_modes_dut on the TH (Chip-tool) and below is the sample log provided for the raspi platform: + + + [1705923890.093456][23589:23591] CHIP:DMG: } + [1705923890.094137][23589:23591] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_009F Attribute 0x0000_0000 DataVersion: 2217281174 + [1705923890.094312][23589:23591] CHIP:TOO: SupportedModes: 5 entries + [1705923890.094403][23589:23591] CHIP:TOO: [1]: { + [1705923890.094423][23589:23591] CHIP:TOO: Label: No energy management (forecast only) + [1705923890.094458][23589:23591] CHIP:TOO: Mode: 0 + [1705923890.094483][23589:23591] CHIP:TOO: ModeTags: 1 entries + [1705923890.094513][23589:23591] CHIP:TOO: [1]: { + [1705923890.094531][23589:23591] CHIP:TOO: Value: 16384 + [1705923890.094542][23589:23591] CHIP:TOO: } + [1705923890.094552][23589:23591] CHIP:TOO: } + [1705923890.094579][23589:23591] CHIP:TOO: [2]: { + [1705923890.094590][23589:23591] CHIP:TOO: Label: Device optimizes (no local or grid control) + [1705923890.094601][23589:23591] CHIP:TOO: Mode: 1 + [1705923890.094615][23589:23591] CHIP:TOO: ModeTags: 1 entries + [1705923890.094632][23589:23591] CHIP:TOO: [1]: { + [1705923890.094642][23589:23591] CHIP:TOO: Value: 16385 + [1705923890.094653][23589:23591] CHIP:TOO: } + [1705923890.094664][23589:23591] CHIP:TOO: } + [1705923890.094687][23589:23591] CHIP:TOO: [3]: { + [1705923890.094697][23589:23591] CHIP:TOO: Label: Optimized within building + [1705923890.094706][23589:23591] CHIP:TOO: Mode: 2 + [1705923890.094722][23589:23591] CHIP:TOO: ModeTags: 2 entries + [1705923890.094738][23589:23591] CHIP:TOO: [1]: { + [1705923890.094748][23589:23591] CHIP:TOO: Value: 16386 + [1705923890.094759][23589:23591] CHIP:TOO: } + [1705923890.094773][23589:23591] CHIP:TOO: [2]: { + [1705923890.094784][23589:23591] CHIP:TOO: Value: 16385 + [1705923890.094794][23589:23591] CHIP:TOO: } + [1705923890.094804][23589:23591] CHIP:TOO: } + [1705923890.094827][23589:23591] CHIP:TOO: [4]: { + [1705923890.094836][23589:23591] CHIP:TOO: Label: Optimized for grid + [1705923890.094846][23589:23591] CHIP:TOO: Mode: 3 + [1705923890.094861][23589:23591] CHIP:TOO: ModeTags: 2 entries + [1705923890.094876][23589:23591] CHIP:TOO: [1]: { + [1705923890.094886][23589:23591] CHIP:TOO: Value: 16385 + [1705923890.094893][23589:23591] CHIP:TOO: } + [1705923890.094908][23589:23591] CHIP:TOO: [2]: { + [1705923890.094917][23589:23591] CHIP:TOO: Value: 16387 + [1705923890.094927][23589:23591] CHIP:TOO: } + [1705923890.094935][23589:23591] CHIP:TOO: } + [1705923890.094960][23589:23591] CHIP:TOO: [5]: { + [1705923890.094971][23589:23591] CHIP:TOO: Label: Optimized for grid and building + [1705923890.094980][23589:23591] CHIP:TOO: Mode: 4 + [1705923890.094998][23589:23591] CHIP:TOO: ModeTags: 3 entries + [1705923890.095013][23589:23591] CHIP:TOO: [1]: { + [1705923890.095022][23589:23591] CHIP:TOO: Value: 16386 + [1705923890.095032][23589:23591] CHIP:TOO: } + [1705923890.095047][23589:23591] CHIP:TOO: [2]: { + [1705923890.095057][23589:23591] CHIP:TOO: Value: 16385 + [1705923890.095066][23589:23591] CHIP:TOO: } + [1705923890.095080][23589:23591] CHIP:TOO: [3]: { + [1705923890.095090][23589:23591] CHIP:TOO: Value: 16387 + [1705923890.095099][23589:23591] CHIP:TOO: } + [1705923890.095109][23589:23591] CHIP:TOO: } + disabled: true + + - label: "Step 2: TH reads from the DUT the CurrentMode attribute" + PICS: DEMM.S.A0001 + verification: | + ./chip-tool deviceenergymanagementmode read current-mode 1 1 + + Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value from supported_modes_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 + + [1705923927.418159][23602:23604] CHIP:DMG: } + [1705923927.418327][23602:23604] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_009F Attribute 0x0000_0001 DataVersion: 2217281174 + [1705923927.418389][23602:23604] CHIP:TOO: CurrentMode: 0 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DEMM_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DEMM_2_1.yaml new file mode 100644 index 00000000000000..a6141163a115fe --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_DEMM_2_1.yaml @@ -0,0 +1,219 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 241.2.1. [TC-DEMM-2.1] Change to Mode functionality with DUT as Server + +PICS: + - DEMM.S + +config: + nodeId: 0x12344321 + cluster: "Device Energy Management Mode" + endpoint: 1 + + #PIXIT.DEMM.MODE_CHANGE_OK + PIXIT.DEMM.MODE_CHANGE_OK: + type: int8u + defaultValue: 2 + #PIXIT.DEMM.MODE_CHANGE_FAIL + PIXIT.DEMM.MODE_CHANGE_FAIL: + type: int8u + defaultValue: 10 + invalid_mode_th: + type: int8u + defaultValue: 15 + +tests: + - label: "Step 1: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 2: TH reads from the DUT the SupportedModes attribute." + PICS: DEMM.S.A0000 + command: "readAttribute" + attribute: "SupportedModes" + response: + saveAs: supported_mode_dut + constraints: + type: list + minLength: 2 + + - label: "Step 3: TH reads from the DUT the CurrentMode attribute." + PICS: DEMM.S.A0001 + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: old_current_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 255 + + - label: + "Step 4: TH sends a ChangeToMode command to the DUT with NewMode set + to old_current_mode_dut" + PICS: DEMM.S.C00.Rsp + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: old_current_mode_dut + response: + values: + - name: "Status" + value: 0x00 + + - label: + "Step 5: Manually put the device in a state from which it will FAIL to + transition to PIXIT.DEMM.MODE_CHANGE_FAIL" + PICS: + DEMM.S.M.CAN_TEST_MODE_FAILURE && DEMM.S.M.CAN_MANUALLY_CONTROLLED && + PICS_SKIP_SAMPLE_APP + verification: | + Manual operation required + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: "Step 6: TH reads from the DUT the CurrentMode attribute" + PICS: DEMM.S.A0001 && DEMM.S.M.CAN_MANUALLY_CONTROLLED + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: Step6_current_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 255 + + #Skipping test-7 because SDK is not enabled with this failure response + - label: + "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set + to PIXIT.DEMM.MODE_CHANGE_FAIL" + PICS: + DEMM.S.M.CAN_TEST_MODE_FAILURE && DEMM.S.C00.Rsp && + PICS_SKIP_SAMPLE_APP + verification: | + Note : Please skip this step as SDK is not enabled with this failure response + + ./chip-tool energyevsemode change-to-mode 2 1 1 + + Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with Status field is set to GenericFailure(0x02), InvalidInMode(0x03) , or in the MfgCodes (0x80 to 0xBF) range and StatusText field has a length between 1 and 64, below is the sample log provided for the raspi platform: + + [1705995550.805161][7567:7569] CHIP:DMG: }, + [1705995550.805185][7567:7569] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_009D Command=0x0000_0001 + [1705995550.805197][7567:7569] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_009D Command 0x0000_0001 + [1705995550.805221][7567:7569] CHIP:TOO: ChangeToModeResponse: { + [1705995550.805228][7567:7569] CHIP:TOO: status: 0 + [1705995550.805232][7567:7569] CHIP:TOO: } + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: "Step 8: TH reads from the DUT the CurrentMode attribute." + PICS: DEMM.S.A0001 + command: "readAttribute" + attribute: "CurrentMode" + response: + value: old_current_mode_dut + constraints: + type: int8u + + - label: + "Step 9: Manually put the device in a state from which it will + SUCCESSFULLY transition to PIXIT.DEMM.MODE_CHANGE_OK" + PICS: PICS_SKIP_SAMPLE_APP && DEMM.S.M.CAN_MANUALLY_CONTROLLED + verification: | + Manual operation required + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: "Step 10: TH reads from the DUT the CurrentMode attribute." + PICS: DEMM.S.A0001 && DEMM.S.M.CAN_MANUALLY_CONTROLLED + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: Step10_current_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 255 + + - label: + "Step 11: TH sends a ChangeToMode command to the DUT with NewMode set + to PIXIT.DEMM.MODE_CHANGE_OK" + PICS: DEMM.S.C00.Rsp + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: PIXIT.DEMM.MODE_CHANGE_OK + response: + values: + - name: "Status" + value: 0x00 + + - label: + "Step 12: TH reads from the DUT the CurrentMode attribute. Verify that + the DUT response contains an integer value equal to + PIXIT.RVCRUNM.MODE_CHANGE_OK" + PICS: DEMM.S.A0001 + command: "readAttribute" + attribute: "CurrentMode" + response: + value: PIXIT.DEMM.MODE_CHANGE_OK + + - label: + "Step 13: TH sends a ChangeToMode command to the DUT with NewMode set + to invalid_mode_th" + PICS: DEMM.S.C00.Rsp + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: invalid_mode_th + response: + values: + - name: "Status" + value: 0x01 + + - label: + "Step 14: TH reads from the DUT the CurrentMode attribute. Verify that + the DUT response contains an integer value equal to + PIXIT.RVCRUNM.MODE_CHANGE_OK" + PICS: DEMM.S.A0001 + command: "readAttribute" + attribute: "CurrentMode" + response: + value: PIXIT.DEMM.MODE_CHANGE_OK diff --git a/src/app/tests/suites/certification/Test_TC_EEVSEM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_EEVSEM_1_1.yaml new file mode 100644 index 00000000000000..ea416ee91e96b3 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_EEVSEM_1_1.yaml @@ -0,0 +1,116 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 265.1.1. [TC-EEVSEM-1.1] Global Attributes with DUT as Server + +PICS: + - EEVSEM.S + +config: + nodeId: 0x12344321 + cluster: "Energy EVSE Mode" + endpoint: 1 + +tests: + - label: + "Step 1: Commission DUT to TH (can be skipped if done in a preceding + test)." + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 2: TH reads from the DUT the ClusterRevision attribute" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + type: int16u + + #https://github.com/project-chip/connectedhomeip/issues/31599 + - label: "Step 3: TH reads from the DUT the FeatureMap attribute" + verification: | + ./chip-tool energyevsemode read feature-map 1 1 + + On the TH(Chip-tool) Log, Verify featureMap value is 0 and below is the sample log provided for the raspi platform: + + [1705995388.110138][7525:7527] CHIP:DMG: } + [1705995388.110173][7525:7527] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_009D Attribute 0x0000_FFFC DataVersion: 1324786556 + [1705995388.110192][7525:7527] CHIP:TOO: FeatureMap: 1 + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: "Step 4: TH reads from the DUT the AttributeList attribute" + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1, 65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Step 4a: TH reads AttributeList from DUT" + PICS: "!PICS_EVENT_LIST_ENABLED" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1, 65528, 65529, 65531, 65532, 65533] + + - label: + "Step 4b: TH reads optional attribute (StartUpMode) in AttributeList + from DUT" + PICS: EEVSEM.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2] + + - label: "Step 5: TH reads EventList from DUT" + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list + + - label: "Step 6: TH reads AcceptedCommandList from DUT" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + value: [0] + constraints: + type: list + + - label: "Step 7: TH reads GeneratedCommandList from DUT" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [1] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_EEVSEM_1_2.yaml b/src/app/tests/suites/certification/Test_TC_EEVSEM_1_2.yaml new file mode 100644 index 00000000000000..642dc5f09912dd --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_EEVSEM_1_2.yaml @@ -0,0 +1,95 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default + +name: 269.1.2. [TC-EEVSEM-1.2] Cluster attributes with DUT as Server + +PICS: + - EEVSEM.S + +config: + nodeId: 0x12344321 + cluster: "Basic Information" + endpoint: 1 + +tests: + - label: "Step 1: TH reads from the DUT the SupportedModes attribute" + PICS: EEVSEM.S.A0000 + verification: | + ./chip-tool energyevsemode read supported-modes 1 1 + + - Verify that the DUT response contains a list of ModeOptionsStruct entries + - Verify that the list has at least 2 and at most 255 entries + - Verify that each ModeOptionsStruct entry has a unique Mode field value + - Verify that each ModeOptionsStruct entry has a unique Label field value + - Verify that each ModeOptionsStruct entry’s ModeTags field has: + at least one entry the values of the Value fields that are not larger than 16 bits + - for each Value field: Is the mode tag value a defined common tag value (Auto(0x0000), Quick(0x0001), Quiet(0x0002), LowNoise(0x0003), LowEnergy(0x0004), Vacation(0x0005), Min(0x0006), Max(0x0007), Night(0x0008), Day(0x0009)) or a defined cluster-derived tag value (Manual, Time of Use, (T_SOLAR_CHARGING)) or in the MfgTags (0x8000 to 0xBFFF) range + - for at least one Value field: Is the mode tag value a defined common tag value (Auto(0x0000), Quick(0x0001), Quiet(0x0002), LowNoise(0x0003), LowEnergy(0x0004), Vacation(0x0005), Min(0x0006), Max(0x0007), Night(0x0008), Day(0x0009)) or a derived cluster value (Bake(0x4000), Convection(0x4001), Grill(0x4002), Roast(0x4003), Clean(0x4004), Convection Bake(0x4005), Convection Roast(0x4006), Warming(0x4007), Proofing(0x4008)) + - if the Value field is in the MfgTags (0x8000 to 0xBFFF) range, the TagName field is a string with a length between 1 and 64 + - Verify that at least one ModeOptionsStruct entry includes the Manual mode tag + - Save the Mode field values as supported_modes_dut on the TH (Chip-tool) and below is the sample log provided for the raspi platform: + + + [1705995452.973731][7546:7548] CHIP:DMG: } + [1705995452.973843][7546:7548] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_009D Attribute 0x0000_0000 DataVersion: 1324786556 + [1705995452.973865][7546:7548] CHIP:TOO: SupportedModes: 4 entries + [1705995452.973883][7546:7548] CHIP:TOO: [1]: { + [1705995452.973886][7546:7548] CHIP:TOO: Label: Manual + [1705995452.973892][7546:7548] CHIP:TOO: Mode: 0 + [1705995452.973898][7546:7548] CHIP:TOO: ModeTags: 1 entries + [1705995452.973903][7546:7548] CHIP:TOO: [1]: { + [1705995452.973906][7546:7548] CHIP:TOO: Value: 16384 + [1705995452.973909][7546:7548] CHIP:TOO: } + [1705995452.973912][7546:7548] CHIP:TOO: } + [1705995452.973918][7546:7548] CHIP:TOO: [2]: { + [1705995452.973921][7546:7548] CHIP:TOO: Label: Auto-scheduled + [1705995452.973923][7546:7548] CHIP:TOO: Mode: 1 + [1705995452.973926][7546:7548] CHIP:TOO: ModeTags: 1 entries + [1705995452.973930][7546:7548] CHIP:TOO: [1]: { + [1705995452.973933][7546:7548] CHIP:TOO: Value: 16385 + [1705995452.973935][7546:7548] CHIP:TOO: } + [1705995452.973938][7546:7548] CHIP:TOO: } + [1705995452.973943][7546:7548] CHIP:TOO: [3]: { + [1705995452.973946][7546:7548] CHIP:TOO: Label: Solar + [1705995452.973948][7546:7548] CHIP:TOO: Mode: 2 + [1705995452.973951][7546:7548] CHIP:TOO: ModeTags: 1 entries + [1705995452.973955][7546:7548] CHIP:TOO: [1]: { + [1705995452.973957][7546:7548] CHIP:TOO: Value: 16386 + [1705995452.973960][7546:7548] CHIP:TOO: } + [1705995452.973962][7546:7548] CHIP:TOO: } + [1705995452.973968][7546:7548] CHIP:TOO: [4]: { + [1705995452.973971][7546:7548] CHIP:TOO: Label: Auto-scheduled with Solar charging + [1705995452.973973][7546:7548] CHIP:TOO: Mode: 3 + [1705995452.973977][7546:7548] CHIP:TOO: ModeTags: 2 entries + [1705995452.973981][7546:7548] CHIP:TOO: [1]: { + [1705995452.973983][7546:7548] CHIP:TOO: Value: 16385 + [1705995452.973986][7546:7548] CHIP:TOO: } + [1705995452.973989][7546:7548] CHIP:TOO: [2]: { + [1705995452.973992][7546:7548] CHIP:TOO: Value: 16386 + [1705995452.973994][7546:7548] CHIP:TOO: } + [1705995452.973996][7546:7548] CHIP:TOO: } + disabled: true + + - label: "Step 2: TH reads from the DUT the CurrentMode attribute" + PICS: EEVSEM.S.A0001 + verification: | + ./chip-tool energyevsemode read current-mode 1 1 + + Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value from supported_modes_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 + + [1705995474.391307][7551:7553] CHIP:DMG: } + [1705995474.391347][7551:7553] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_009D Attribute 0x0000_0001 DataVersion: 1324786556 + [1705995474.391367][7551:7553] CHIP:TOO: CurrentMode: 0 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_EEVSEM_2_1.yaml b/src/app/tests/suites/certification/Test_TC_EEVSEM_2_1.yaml new file mode 100644 index 00000000000000..b5f483f62fe2d9 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_EEVSEM_2_1.yaml @@ -0,0 +1,219 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 269.2.1. [TC-EEVSEM-2.1] Change to Mode functionality with DUT as Server + +PICS: + - EEVSEM.S + +config: + nodeId: 0x12344321 + cluster: "Energy EVSE Mode" + endpoint: 1 + + #PIXIT.EEVSEM.MODE_CHANGE_OK + PIXIT.EEVSEM.MODE_CHANGE_OK: + type: int8u + defaultValue: 2 + #PIXIT.EEVSEM.MODE_CHANGE_FAIL + PIXIT.EEVSEM.MODE_CHANGE_FAIL: + type: int8u + defaultValue: 10 + invalid_mode_th: + type: int8u + defaultValue: 15 + +tests: + - label: "Step 1: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 2: TH reads from the DUT the SupportedModes attribute." + PICS: EEVSEM.S.A0000 + command: "readAttribute" + attribute: "SupportedModes" + response: + saveAs: supported_mode_dut + constraints: + type: list + minLength: 2 + + - label: "Step 3: TH reads from the DUT the CurrentMode attribute." + PICS: EEVSEM.S.A0001 + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: old_current_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 255 + + - label: + "Step 4: TH sends a ChangeToMode command to the DUT with NewMode set + to old_current_mode_dut" + PICS: EEVSEM.S.C00.Rsp + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: old_current_mode_dut + response: + values: + - name: "Status" + value: 0x00 + + - label: + "Step 5: Manually put the device in a state from which it will FAIL to + transition to PIXIT.EEVSEM.MODE_CHANGE_FAIL" + PICS: + " EEVSEM.S.M.CAN_TEST_MODE_FAILURE && + EEVSEM.S.M.CAN_MANUALLY_CONTROLLED && PICS_SKIP_SAMPLE_APP " + verification: | + Manual operation required + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: "Step 6: TH reads from the DUT the CurrentMode attribute" + PICS: EEVSEM.S.A0001 && EEVSEM.S.M.CAN_MANUALLY_CONTROLLED + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: Step6_current_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 255 + + #Skipping test-7 because SDK is not enabled with this failure response + - label: + "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set + to PIXIT.EEVSEM.MODE_CHANGE_FAIL" + PICS: + EEVSEM.S.M.CAN_TEST_MODE_FAILURE && EEVSEM.S.C00.Rsp && + PICS_SKIP_SAMPLE_APP + verification: | + Note : Please skip this step as SDK is not enabled with this failure response + + ./chip-tool energyevsemode change-to-mode 2 1 1 + + Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with Status field is set to GenericFailure(0x02), InvalidInMode(0x03) , or in the MfgCodes (0x80 to 0xBF) range and StatusText field has a length between 1 and 64, below is the sample log provided for the raspi platform: + + [1705995550.805161][7567:7569] CHIP:DMG: }, + [1705995550.805185][7567:7569] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_009D Command=0x0000_0001 + [1705995550.805197][7567:7569] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_009D Command 0x0000_0001 + [1705995550.805221][7567:7569] CHIP:TOO: ChangeToModeResponse: { + [1705995550.805228][7567:7569] CHIP:TOO: status: 0 + [1705995550.805232][7567:7569] CHIP:TOO: } + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: "Step 8: TH reads from the DUT the CurrentMode attribute." + PICS: EEVSEM.S.A0001 + command: "readAttribute" + attribute: "CurrentMode" + response: + value: old_current_mode_dut + constraints: + type: int8u + + - label: + "Step 9: Manually put the device in a state from which it will + SUCCESSFULLY transition to PIXIT.EEVSEM.MODE_CHANGE_OK" + PICS: PICS_SKIP_SAMPLE_APP + verification: | + Manual operation required + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: "Step 10: TH reads from the DUT the CurrentMode attribute." + PICS: EEVSEM.S.A0001 && EEVSEM.S.M.CAN_MANUALLY_CONTROLLED + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: Step10_current_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 255 + + - label: + "Step 11: TH sends a ChangeToMode command to the DUT with NewMode set + to PIXIT.EEVSEM.MODE_CHANGE_OK" + PICS: EEVSEM.S.C00.Rsp + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: PIXIT.EEVSEM.MODE_CHANGE_OK + response: + values: + - name: "Status" + value: 0x00 + + - label: + "Step 12: TH reads from the DUT the CurrentMode attribute. Verify that + the DUT response contains an integer value equal to + PIXIT.EEVSEM.MODE_CHANGE_OK" + PICS: EEVSEM.S.A0001 + command: "readAttribute" + attribute: "CurrentMode" + response: + value: PIXIT.EEVSEM.MODE_CHANGE_OK + + - label: + "Step 13: TH sends a ChangeToMode command to the DUT with NewMode set + to invalid_mode_th" + PICS: EEVSEM.S.C00.Rsp + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: invalid_mode_th + response: + values: + - name: "Status" + value: 0x01 + + - label: + "Step 14: TH reads from the DUT the CurrentMode attribute. Verify that + the DUT response contains an integer value equal to + PIXIT.EEVSEM.MODE_CHANGE_OK" + PICS: EEVSEM.S.A0001 + command: "readAttribute" + attribute: "CurrentMode" + response: + value: PIXIT.EEVSEM.MODE_CHANGE_OK diff --git a/src/app/tests/suites/certification/Test_TC_EEVSEM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_EEVSEM_3_1.yaml new file mode 100644 index 00000000000000..2d38a6c1465236 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_EEVSEM_3_1.yaml @@ -0,0 +1,134 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 183.3.1. [TC-EEVSEM-3.1] On Mode functionality with DUT as Server + +PICS: + - EEVSEM.S.A0003 + - MOD.S.F00 + - OO.S.C00.Rsp + - OO.S.C01.Rsp + +config: + nodeId: 0x12344321 + cluster: "Energy EVSE Mode" + endpoint: 1 + + ConfigureOnMode: + type: int8u + defaultValue: 0 + new_mode_th: + type: int8u + defaultValue: 2 + +tests: + - label: + "Step 1: Commission DUT to TH (can be skipped if done in a preceding + test)." + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: + "Precondition: TH writes from the DUT the OnMode attribute.NOTE: To + execute this test case set onmode to any integer value because as + default it value has null." + PICS: EEVSEM.S.A0003 && MOD.S.F00 + command: "writeAttribute" + attribute: "OnMode" + arguments: + value: ConfigureOnMode + + - label: "Step 2: TH reads from the DUT the OnMode attribute." + PICS: EEVSEM.S.A0003 && MOD.S.F00 + command: "readAttribute" + attribute: "OnMode" + response: + saveAs: on_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 254 + + - label: "Step 3: TH reads from the DUT the CurrentMode attribute." + PICS: EEVSEM.S.A0001 && MOD.S.F00 + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: old_current_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 254 + + - label: + "If on_mode_dut is equal to old_current_mode_dut proceed to step 4. + Else proceed to step 6." + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: on_mode_dut + - name: "Value2" + value: old_current_mode_dut + response: + - values: + - name: "Equals" + saveAs: IsExpectedValue + + - label: "Step 4: TH reads from the DUT the SupportedModes attribute." + runIf: IsExpectedValue + PICS: EEVSEM.S.A0000 && MOD.S.F00 + command: "readAttribute" + attribute: "SupportedModes" + response: + constraints: + type: list + minLength: 2 + + - label: + "Step 5: TH sends a ChangeToMode command to the DUT with NewMode set + to new_mode_th" + runIf: IsExpectedValue + PICS: EEVSEM.S.C00.Rsp && MOD.S.F00 + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: new_mode_th + response: + values: + - name: "Status" + value: 0x00 + + - label: "Step 6:TH sends a Off command to the DUT" + PICS: OO.S.C00.Rsp + cluster: "On/Off" + command: "Off" + + - label: "Step 7:TH sends a On command to the DUT" + PICS: OO.S.C01.Rsp + cluster: "On/Off" + command: "On" + + - label: "Step 8: TH reads from the DUT the CurrentMode attribute." + PICS: EEVSEM.S.A0001 && EEVSEM.S.A0003 && MOD.S.F00 + command: "readAttribute" + attribute: "CurrentMode" + response: + value: on_mode_dut diff --git a/src/app/tests/suites/certification/Test_TC_EEVSEM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_EEVSEM_3_2.yaml new file mode 100644 index 00000000000000..0251528f9ffe94 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_EEVSEM_3_2.yaml @@ -0,0 +1,172 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 269.3.2. [TC-EEVSEM-3.2] Startup Mode functionality with DUT as Server + +PICS: + - EEVSEM.S.A0002 + +config: + nodeId: 0x12344321 + cluster: "Energy EVSE Mode" + endpoint: 1 + + new_start_up_mode_th: + type: int8u + defaultValue: 0 + new_mode_th: + type: int8u + defaultValue: 1 + +tests: + - label: + "Step 1: Commission DUT to TH (can be skipped if done in a preceding + test)." + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 2: TH reads from the DUT the StartUpMode attribute." + PICS: EEVSEM.S.A0002 + command: "readAttribute" + attribute: "StartUpMode" + response: + saveAs: startup_mode_dut + + - label: + "Step 2: If startup_mode_dut is null proceed to step 3. Else save + startup_mode_dut as new_start_up_mode_th and proceed to step 5." + PICS: EEVSEM.S.A0002 + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: startup_mode_dut + - name: "Value2" + value: null + response: + - values: + - name: "Equals" + saveAs: IsExpectedValue + + - label: "Step 3: TH reads from the DUT the SupportedModes attribute." + runIf: IsExpectedValue + PICS: EEVSEM.S.A0000 + command: "readAttribute" + attribute: "SupportedModes" + response: + saveAs: supported_modes_dut + constraints: + type: list + minLength: 2 + - label: + "Step 4: TH writes to the DUT the StartUpMode attribute with the + new_start_up_mode_th value" + PICS: EEVSEM.S.A0002 + runIf: IsExpectedValue + command: "writeAttribute" + attribute: "StartUpMode" + arguments: + value: new_start_up_mode_th + + - label: "Step 5: TH reads from the DUT the CurrentMode attribute." + PICS: EEVSEM.S.A0001 + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: old_current_mode_dut + + - label: + "Step 5: If startup_mode_dut is equal to old_current_mode_dut proceed + to step 6. Else proceed to step 8." + PICS: EEVSEM.S.A0001 && EEVSEM.S.A0002 + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: startup_mode_dut + - name: "Value2" + value: old_current_mode_dut + response: + - values: + - name: "Equals" + saveAs: Step5_IsExpectedValue + + - label: "Step 6: TH reads from the DUT the SupportedModes attribute." + PICS: EEVSEM.S.A0000 + runIf: Step5_IsExpectedValue + command: "readAttribute" + attribute: "SupportedModes" + response: + saveAs: Step6_supported_modes_dut + constraints: + type: list + minLength: 2 + + - label: + "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set + to new_mode_th" + PICS: EEVSEM.S.C00.Rsp + runIf: Step5_IsExpectedValue + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: new_mode_th + response: + values: + - name: "Status" + value: 0x00 + + - label: "Step 8: Physically power cycle the device" + verification: | + Physically power cycle the device. + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 9: TH reads from the DUT the StartUpMode attribute." + PICS: EEVSEM.S.A0002 && PICS_USER_PROMPT + command: "readAttribute" + attribute: "StartUpMode" + response: + saveAs: new_start_up_mode_dut + constraints: + anyOf: [startup_mode_dut, new_start_up_mode_th] + + - label: "Step 10: TH reads from the DUT the CurrentMode attribute." + PICS: EEVSEM.S.A0001 && PICS_USER_PROMPT + command: "readAttribute" + attribute: "CurrentMode" + response: + value: new_start_up_mode_dut diff --git a/src/app/tests/suites/certification/Test_TC_EEVSEM_3_3.yaml b/src/app/tests/suites/certification/Test_TC_EEVSEM_3_3.yaml new file mode 100644 index 00000000000000..e60aa1ca60c740 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_EEVSEM_3_3.yaml @@ -0,0 +1,189 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: + 269.3.3. [TC-EEVSEM-3.3] On Mode and Startup Mode functionality with DUT as + Server + +PICS: + - EEVSEM.S.A0002 + - EEVSEM.S.A0003 + - MOD.S.F00 + - OO.S.A4003 + +config: + nodeId: 0x12344321 + cluster: "Energy EVSE Mode" + endpoint: 1 + + new_start_up_mode_th: + type: int8u + defaultValue: 0 + new_mode_th: + type: int8u + defaultValue: 1 + +tests: + - label: + "Step 1: Commission DUT to TH (can be skipped if done in a preceding + test)." + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 2: TH reads from the DUT the StartUpMode attribute." + PICS: EEVSEM.S.A0002 + command: "readAttribute" + attribute: "StartUpMode" + response: + saveAs: startup_mode_dut + + - label: + "Step 2: If startup_mode_dut is null proceed to step 3. Else save + startup_mode_dut as new_start_up_mode_th and proceed to step 5." + PICS: EEVSEM.S.A0002 + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: startup_mode_dut + - name: "Value2" + value: null + response: + - values: + - name: "Equals" + saveAs: IsExpectedValue + + - label: "Step 3: TH reads from the DUT the SupportedModes attribute." + runIf: IsExpectedValue + PICS: EEVSEM.S.A0000 + command: "readAttribute" + attribute: "SupportedModes" + response: + saveAs: supported_modes_dut + constraints: + type: list + minLength: 2 + + - label: + "Step 4: TH writes to the DUT the StartUpMode attribute with the + new_start_up_mode_th value" + PICS: EEVSEM.S.A0002 + runIf: IsExpectedValue + command: "writeAttribute" + attribute: "StartUpMode" + arguments: + value: new_start_up_mode_th + + - label: "Step 5: TH reads from the DUT the OnMode attribute." + PICS: EEVSEM.S.A0003 && EEVSEM.S.A0002 + command: "readAttribute" + attribute: "OnMode" + response: + saveAs: old_on_mode_dut + + - label: + "Step 5: If startup_mode_dut is equal to old_on_mode_dut proceed to + step 6. Else proceed to step 8." + PICS: EEVSEM.S.A0002 + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: old_on_mode_dut + - name: "Value2" + value: startup_mode_dut + response: + - values: + - name: "Equals" + saveAs: Step5_IsExpectedValue + + - label: "Step 6: TH reads from the DUT the SupportedModes attribute." + PICS: EEVSEM.S.A0000 && EEVSEM.S.A0002 + runIf: Step5_IsExpectedValue + command: "readAttribute" + attribute: "SupportedModes" + response: + saveAs: Step6_supported_modes_dut + constraints: + type: list + minLength: 2 + + - label: + "Step 7: TH writes to the DUT the OnMode attribute with the + new_mode_th value" + PICS: EEVSEM.S.A0003 + runIf: Step5_IsExpectedValue + command: "writeAttribute" + attribute: "OnMode" + arguments: + value: new_mode_th + + - label: "Step 8: TH reads from the DUT the OnMode attribute." + PICS: EEVSEM.S.A0003 && MOD.S.F00 + command: "readAttribute" + attribute: "OnMode" + response: + saveAs: new_on_mode_dut + + - label: + "Step 9: TH writes to the DUT the StartUpOnOff attribute with the + value 1." + PICS: OO.S.A4003 + cluster: "On/Off" + command: "writeAttribute" + attribute: "StartUpOnOff" + arguments: + value: 1 + + - label: "Step 10: Physically power cycle the device" + verification: | + Physically power cycle the device. + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 11: TH reads from the DUT the StartUpMode attribute." + PICS: EEVSEM.S.A0002 && PICS_USER_PROMPT + command: "readAttribute" + attribute: "StartUpMode" + response: + constraints: + anyOf: [new_start_up_mode_th, startup_mode_dut] + + - label: "Step 12: TH reads from the DUT the CurrentMode attribute." + PICS: EEVSEM.S.A0001 && PICS_USER_PROMPT + command: "readAttribute" + attribute: "CurrentMode" + response: + value: new_on_mode_dut diff --git a/src/app/tests/suites/certification/Test_TC_EEVSE_1_1.yaml b/src/app/tests/suites/certification/Test_TC_EEVSE_1_1.yaml index 44932851b0343c..0be6a9015ed5e9 100644 --- a/src/app/tests/suites/certification/Test_TC_EEVSE_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_EEVSE_1_1.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2023 Project CHIP Authors +# Copyright (c) 2024 Project CHIP Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -11,129 +11,291 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 272.1.1. [TC-EEVSE-1.1] Global Attributes with DUT as Server +name: 265.1.1. [TC-EEVSE-1.1] Global Attributes with DUT as Server PICS: - EEVSE.S config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Energy EVSE" + endpoint: 1 tests: + - label: "Step 1: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 2: TH reads from the DUT the ClusterRevision attribute" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 2 + constraints: + type: int16u + + - label: "Step 3a: TH reads from the DUT the FeatureMap attribute" + PICS: + "!EEVSE.S.F00 && !EEVSE.S.F01 && !EEVSE.S.F02 && !EEVSE.S.F03 && + !EEVSE.S.F04" + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + constraints: + type: bitmap32 + + - label: + "Step 3b: Given EEVSE.S.F00(ChargingPreferences) ensure featuremap has + the correct bit set" + PICS: EEVSE.S.F00 + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Step 3b: Given EEVSE.S.F01(SoCReporting) ensure featuremap has the + correct bit set" + PICS: EEVSE.S.F01 + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: + "Step 3b: Given EEVSE.S.F02(PlugAndCharge) ensure featuremap has the + correct bit set" + PICS: EEVSE.S.F02 + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + hasMasksSet: [0x4] + + - label: + "Step 3b: Given EEVSE.S.F03(RFID) ensure featuremap has the correct + bit set" + PICS: EEVSE.S.F03 + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + hasMasksSet: [0x8] + + - label: + "Step 3b: Given EEVSE.S.F04(V2X) ensure featuremap has the correct bit + set" + PICS: EEVSE.S.F04 + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + hasMasksSet: [0x10] + + - label: "Step 4a: TH reads from the DUT the AttributeList attribute" + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: + [ + 0, + 1, + 2, + 3, + 5, + 6, + 7, + 64, + 65, + 66, + 65528, + 65529, + 65530, + 65531, + 65532, + 65533, + ] + + - label: "Step 4a: TH reads AttributeList from DUT" + PICS: "!PICS_EVENT_LIST_ENABLED" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: + [ + 0, + 1, + 2, + 3, + 5, + 6, + 7, + 64, + 65, + 66, + 65528, + 65529, + 65531, + 65532, + 65533, + ] + + - label: + "Step 4b: TH reads optional attribute (UserMaximumChargeCurrent) in + AttributeList from DUT" + PICS: EEVSE.S.A0009 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [9] + + - label: + "Step 4c: TH reads optional attribute (RandomizationDelayWindow) in + AttributeList from DUT" + PICS: EEVSE.S.A000A + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [10] + + - label: + "Step 4d: TH reads optional attribute (V2X) in AttributeList from DUT" + PICS: EEVSE.S.F04 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [4, 8, 67] + + - label: + "Step 4e: TH reads optional attribute (ChargingPreferences) in + AttributeList from DUT" + PICS: EEVSE.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [35, 36, 37, 38, 39] + + - label: + "Step 4e: TH reads optional attribute (SoCReporting) in AttributeList + from DUT" + PICS: EEVSE.S.F01 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [48, 49] + + - label: + "Step 4f: TH reads optional attribute (PlugAndCharge) in AttributeList + from DUT" + PICS: EEVSE.S.F02 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [50] + + - label: "Step 5a: TH reads EventList from DUT" + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + contains: [0, 1, 2, 3, 4] + + - label: "Step 5b: TH reads optional attribute (RFID) in EventList from DUT" + PICS: EEVSE.S.F03 && PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "EventList" + response: + constraints: + type: list + contains: [5] + + - label: "Step 6a: TH reads AcceptedCommandList from DUT" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [1, 2] + + - label: + "Step 6b: TH reads the optional (StartDiagnostics) command in + AcceptedCommandList" + PICS: EEVSE.S.C04.Rsp + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [4] + - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | - - disabled: true - - - label: "Step 2: TH reads from the DUT the ClusterRevision attribute." - verification: | - ./chip-tool energyevse read cluster-revision 1 1 - - On TH(chip-tool), Verify the ClusterRevision attribute value as 2: - Below mentioned log is based on the RPI implementation, Value may vary on real DUT - - [1703744384.239486][1259:1261] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_FFFD DataVersion: 1471857723 - [1703744384.239529][1259:1261] CHIP:TOO: ClusterRevision: 2 - disabled: true - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute." - verification: | - ./chip-tool energyevse read feature-map 1 1 - - Via the TH (chip-tool), verify that theFeatureMap attribute contains the value. Below mentioned log is based on the RPI implementation, Value may vary on real DUT - - - [1703744496.721907][1265:1267] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_FFFC DataVersion: 1471857723 - [1703744496.721955][1265:1267] CHIP:TOO: FeatureMap: 31 - disabled: true - - - label: "Step 4: TH reads from the DUT the AttributeList attribute." - verification: | - ./chip-tool energyevse read attribute-list 1 1 - - Via the TH (chip-tool), verify that theAttributeListattribute contains - - Mandatory entries:0x0000, 0x0001, 0x0002, 0x0003, 0x0005, 0x0006, 0x0007, 0x0040, 0x0041, 0x0042 0xfff8, 0xfff9, 0xfffb, 0xfffc and 0xfffd - - Optional entries: 0x0009, 0x000A - - Based on feature support:- 0x0004, 0x0008, 0x0043, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0030, 0x0031, 0x0032 - Below mentioned log is based on the RPI implementation, Value may vary on real DUT - - [1705654173.130338][6375:6377] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_FFFB DataVersion: 1462274739 - [1705654173.130427][6375:6377] CHIP:TOO: AttributeList: 28 entries - [1705654173.130469][6375:6377] CHIP:TOO: [1]: 0 - [1705654173.130506][6375:6377] CHIP:TOO: [2]: 1 - [1705654173.130529][6375:6377] CHIP:TOO: [3]: 2 - [1705654173.130551][6375:6377] CHIP:TOO: [4]: 3 - [1705654173.130574][6375:6377] CHIP:TOO: [5]: 4 - [1705654173.130608][6375:6377] CHIP:TOO: [6]: 5 - [1705654173.130631][6375:6377] CHIP:TOO: [7]: 6 - [1705654173.130664][6375:6377] CHIP:TOO: [8]: 7 - [1705654173.130687][6375:6377] CHIP:TOO: [9]: 8 - [1705654173.130710][6375:6377] CHIP:TOO: [10]: 9 - [1705654173.130744][6375:6377] CHIP:TOO: [11]: 10 - [1705654173.130769][6375:6377] CHIP:TOO: [12]: 35 - [1705654173.130801][6375:6377] CHIP:TOO: [13]: 36 - [1705654173.130826][6375:6377] CHIP:TOO: [14]: 37 - [1705654173.130849][6375:6377] CHIP:TOO: [15]: 38 - [1705654173.130883][6375:6377] CHIP:TOO: [16]: 39 - [1705654173.130907][6375:6377] CHIP:TOO: [17]: 48 - [1705654173.130930][6375:6377] CHIP:TOO: [18]: 49 - [1705654173.130964][6375:6377] CHIP:TOO: [19]: 50 - [1705654173.130988][6375:6377] CHIP:TOO: [20]: 64 - [1705654173.131021][6375:6377] CHIP:TOO: [21]: 65 - [1705654173.131045][6375:6377] CHIP:TOO: [22]: 66 - [1705654173.131068][6375:6377] CHIP:TOO: [23]: 67 - [1705654173.131101][6375:6377] CHIP:TOO: [24]: 65528 - [1705654173.131126][6375:6377] CHIP:TOO: [25]: 65529 - [1705654173.131149][6375:6377] CHIP:TOO: [26]: 65531 - [1705654173.131182][6375:6377] CHIP:TOO: [27]: 65532 - [1705654173.131205][6375:6377] CHIP:TOO: [28]: 65533 - disabled: true - - - label: "Step 5*: TH reads from the DUT the EventList attribute." - verification: | - EventList is currently not supported and SHALL be skipped. - - ./chip-tool energyevse read event-list 1 1 - - Via the TH (chip-tool), verify that the EventList attribute. Below mentioned log is based on the RPI implementation, Value may vary on real DUT - - [1703745599.166331][1300:1302] CHIP:DMG: StatusIB = - [1703745599.166364][1300:1302] CHIP:DMG: { - [1703745599.166419][1300:1302] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1703745599.166450][1300:1302] CHIP:DMG: }, - disabled: true - - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute." - verification: | - ./chip-tool energyevse read accepted-command-list 1 1 - - On TH(chip-tool), Verify the AcceptedCommandList attribute that contains 7 entries: - Below mentioned log is based on the RPI implementation, Value may vary on real DUT - - [1703745620.007744][1304:1306] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_FFF9 DataVersion: 1471857723 - [1703745620.007809][1304:1306] CHIP:TOO: AcceptedCommandList: 7 entries - [1703745620.007838][1304:1306] CHIP:TOO: [1]: 1 - [1703745620.007862][1304:1306] CHIP:TOO: [2]: 2 - [1703745620.007886][1304:1306] CHIP:TOO: [3]: 3 - [1703745620.007909][1304:1306] CHIP:TOO: [4]: 5 - [1703745620.007931][1304:1306] CHIP:TOO: [5]: 6 - [1703745620.007954][1304:1306] CHIP:TOO: [6]: 7 - [1703745620.007977][1304:1306] CHIP:TOO: [7]: 4 - disabled: true - - - label: "Step 7: TH reads from the DUT the GeneratedCommandList attribute." - verification: | - ./chip-tool energyevse read generated-command-list 1 1 - - On TH(chip-tool), Verify the GeneratedCommandList attribute that contains 1 entries: - - [1703745647.799108][1307:1309] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_FFF8 DataVersion: 1471857723 - [1703745647.799167][1307:1309] CHIP:TOO: GeneratedCommandList: 1 entries - [1703745647.799197][1307:1309] CHIP:TOO: [1]: 0 - disabled: true + "Step 6c: TH reads Feature dependent commands(EEVSE.S.F04) in + AcceptedCommandList" + PICS: EEVSE.S.F04 + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [3] + + - label: + "Step 6d: TH reads Feature dependent commands(ChargingPreferences) in + AcceptedCommandList" + PICS: EEVSE.S.F00 + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [5, 6, 7] + + - label: "Step 7a: TH reads GeneratedCommandList from DUT" + PICS: " !EEVSE.S.F00 " + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + + - label: "Step 7b: TH reads GeneratedCommandList from DUT" + PICS: EEVSE.S.F00 + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + constraints: + type: list + contains: [0] diff --git a/src/app/tests/suites/certification/Test_TC_EEVSE_2_1.yaml b/src/app/tests/suites/certification/Test_TC_EEVSE_2_1.yaml index f1ea0b28385634..a448a969c7e44e 100644 --- a/src/app/tests/suites/certification/Test_TC_EEVSE_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_EEVSE_2_1.yaml @@ -11,333 +11,278 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 266.1.2. [TC-EEVSE-2.1] Attributes with DUT as Server +name: 265.1.2. [TC-EEVSE-2.1] Attributes with DUT as Server PICS: - EEVSE.S config: - nodeId: "0x12344321" - cluster: "Basic Information" - endpoint: 0 + nodeId: 0x12344321 + cluster: "Energy EVSE" + endpoint: 1 tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | - - disabled: true - - - label: "Step 2: TH reads from the DUT the State attribute." - verification: | - ./chip-tool energyevse read state 1 1 - - On TH(chip-tool), Verify the State value between 0 and 6 inclusive. - - [1703746501.478667][1324:1326] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0000 DataVersion: 1471857723 - [1703746501.482885][1324:1326] CHIP:TOO: State: 0 - disabled: true - - - label: "Step 3: TH reads from the DUT the SupplyState attribute." + - label: "Step 1: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 2: TH reads from the DUT the State attribute" + command: "readAttribute" + attribute: "State" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 6 + + - label: "Step 3: TH reads from the DUT the SupplyState attribute" PICS: EEVSE.S.A0001 - verification: | - ./chip-tool energyevse read supply-state 1 1 - - On TH(chip-tool), Verify the SupplyState value between 0 and 4 inclusive. - - [1703746567.014836][1331:1333] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0001 DataVersion: 1471857723 - [1703746567.014912][1331:1333] CHIP:TOO: SupplyState: 0 - disabled: true - - - label: "Step 4: TH reads from the DUT the FaultState attribute." + command: "readAttribute" + attribute: "SupplyState" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 4 + + - label: "Step 4: TH reads from the DUT the FaultState attribute" PICS: EEVSE.S.A0002 - verification: | - ./chip-tool energyevse read fault-state 1 1 - - On TH(chip-tool), Verify the FaultState value between 0 to 15 and 255 inclusive. - - [1703746609.539647][1339:1341] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0002 DataVersion: 1471857723 - [1703746609.539748][1339:1341] CHIP:TOO: FaultState: 0 - disabled: true - - - label: "Step 5: TH reads from the DUT the ChargingEnabledUntil attribute." + command: "readAttribute" + attribute: "FaultState" + response: + constraints: + type: enum8 + anyOf: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 255] + + - label: "Step 5: TH reads from the DUT the ChargingEnabledUntil attribut" PICS: EEVSE.S.A0003 - verification: | - ./chip-tool energyevse read charging-enabled-until 1 1 - - On TH(chip-tool), Verify the ChargingEnabledUntil attribute contains epoch-s value or null. - - [1703746659.995945][1410:1412] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0003 DataVersion: 1471857723 - [1703746659.996071][1410:1412] CHIP:TOO: ChargingEnabledUntil: null - disabled: true + command: "readAttribute" + attribute: "ChargingEnabledUntil" + response: + constraints: + type: epoch-s + minValue: 0 + maxValue: 4294967295 - label: - "Step 6: TH reads from the DUT the DischargingEnabledUntil attribute." + "Step 6: TH reads from the DUT the DischargingEnabledUntil attribute" PICS: EEVSE.S.A0004 - verification: | - ./chip-tool energyevse read discharging-enabled-until 1 1 - - On TH(chip-tool), Verify the DischargingEnabledUntil attribute contains epoch-s value or null. - - [1703746787.751096][1849:1851] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0004 DataVersion: 1471857723 - [1703746787.751173][1849:1851] CHIP:TOO: DischargingEnabledUntil: null - disabled: true - - - label: "Step 7: TH reads from the DUT the CircuitCapacity attribute." + command: "readAttribute" + attribute: "DischargingEnabledUntil" + response: + constraints: + type: epoch-s + minValue: 0 + maxValue: 4294967295 + + - label: "Step 7: TH reads from the DUT the CircuitCapacity attribute" PICS: EEVSE.S.A0005 - verification: | - ./chip-tool energyevse read circuit-capacity 1 1 - - On TH(chip-tool), Verify the CircuitCapacity contains an amperage-mA value is in the range of 0 to 80000. - - [1703746836.529283][1855:1857] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0005 DataVersion: 1471857723 - [1703746836.529406][1855:1857] CHIP:TOO: CircuitCapacity: 0 - disabled: true - - - label: "Step 8: TH reads from the DUT the MinimumChargeCurrent attribute." + command: "readAttribute" + attribute: "CircuitCapacity" + response: + constraints: + type: amperage_ma + minValue: 0 + maxValue: 80000 + + - label: "Step 8: TH reads from the DUT the MinimumChargeCurrent attribute" PICS: EEVSE.S.A0006 - verification: | - ./chip-tool energyevse read minimum-charge-current 1 1 - - On TH(chip-tool), Verify the MinimumChargeCurrent contains an amperage-mA value is in the range of 0 to 80000. - - [1703746900.151431][1861:1863] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0006 DataVersion: 1471857723 - [1703746900.151511][1861:1863] CHIP:TOO: MinimumChargeCurrent: 6000 - disabled: true - - - label: "Step 9: TH reads from the DUT the MaximumChargeCurrent attribute." + command: "readAttribute" + attribute: "MinimumChargeCurrent" + response: + constraints: + type: amperage_ma + minValue: 0 + maxValue: 80000 + + - label: "Step 9: TH reads from the DUT the MaximumChargeCurrent attribute" PICS: EEVSE.S.A0007 - verification: | - ./chip-tool energyevse read maximum-charge-current 1 1 - - On TH(chip-tool), Verify the MaximumChargeCurrent contains an amperage-mA value is in the range of 0 80000. - - [1703746980.955341][1866:1868] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0007 DataVersion: 1471857723 - [1703746980.955401][1866:1868] CHIP:TOO: MaximumChargeCurrent: 0 - disabled: true + command: "readAttribute" + attribute: "MaximumChargeCurrent" + response: + constraints: + type: amperage_ma + minValue: 0 + maxValue: 80000 - label: - "Step 10: TH reads from the DUT the MaximumDischargeCurrent attribute." + "Step 10: TH reads from the DUT the MaximumDischargeCurrent attribute" PICS: EEVSE.S.A0008 - verification: | - ./chip-tool energyevse read maximum-discharge-current 1 1 - - On TH(chip-tool), Verify the MaximumDischargeCurrent contains an amperage-mA value is in the range of 0 80000. - - [1703747035.548962][1870:1872] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0008 DataVersion: 1471857723 - [1703747035.549016][1870:1872] CHIP:TOO: MaximumDischargeCurrent: 0 - disabled: true + command: "readAttribute" + attribute: "MaximumDischargeCurrent" + response: + constraints: + type: amperage_ma + minValue: 0 + maxValue: 80000 - label: "Step 11: TH writes to the DUT the UserMaximumChargeCurrent attribute - value 30000." + value 3000" PICS: EEVSE.S.A0009 - verification: | - ./chip-tool energyevse write user-maximum-charge-current 30000 1 1 - - On TH(chip-tool), Verify the SUCCESS response for UserMaximumChargeCurrent attribute successful write. - - [1703747211.562507][1880:1882] CHIP:DMG: StatusIB = - [1703747211.562536][1880:1882] CHIP:DMG: { - [1703747211.562599][1880:1882] CHIP:DMG: status = 0x00 (SUCCESS), - [1703747211.562629][1880:1882] CHIP:DMG: }, - [1703747211.562677][1880:1882] CHIP:DMG: - [1703747211.562703][1880:1882] CHIP:DMG: }, - disabled: true + command: "writeAttribute" + attribute: "UserMaximumChargeCurrent" + arguments: + value: 30000 - label: "Step 11a: TH reads from the DUT the UserMaximumChargeCurrent - attribute." + attribute" PICS: EEVSE.S.A0009 - verification: | - ./chip-tool energyevse read user-maximum-charge-current 1 1 - - On TH(chip-tool), Verify the UserMaximumChargeCurrent attribute contains the amperage-mA value 30000. - - [1703747252.643892][1886:1888] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0009 DataVersion: 1471857725 - [1703747252.643979][1886:1888] CHIP:TOO: UserMaximumChargeCurrent: 30000 - disabled: true + command: "readAttribute" + attribute: "UserMaximumChargeCurrent" + response: + value: 30000 + constraints: + type: amperage_ma - label: "Step 12: TH writes to the DUT the RandomizationDelayWindow attribute - value 600." + value 600" PICS: EEVSE.S.A000A - verification: | - ./chip-tool energyevse write randomization-delay-window 600 1 1 - - On TH(chip-tool), Verify the SUCCESS response for RandomizationDelayWindow attribute successful write. - - [1703747329.583214][1890:1892] CHIP:DMG: StatusIB = - [1703747329.583244][1890:1892] CHIP:DMG: { - [1703747329.583273][1890:1892] CHIP:DMG: status = 0x00 (SUCCESS), - [1703747329.583301][1890:1892] CHIP:DMG: }, - disabled: true + command: "writeAttribute" + attribute: "RandomizationDelayWindow" + arguments: + value: 600 - label: "Step 12a: TH reads from the DUT the RandomizationDelayWindow - attribute." + attribute" PICS: EEVSE.S.A000A - verification: | - ./chip-tool energyevse read randomization-delay-window 1 1 - - On TH(chip-tool), Verify the RandomizationDelayWindow attribute contains elapsed-s value 600. - - [1703747373.495538][1893:1895] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_000A DataVersion: 1471857726 - [1703747373.495591][1893:1895] CHIP:TOO: RandomizationDelayWindow: 600 - disabled: true - - - label: "Step 13: TH reads from the DUT the NextChargeStartTime attribute." + command: "readAttribute" + attribute: "RandomizationDelayWindow" + response: + value: 600 + constraints: + type: elapsed_s + + - label: "Step 13: TH reads from the DUT the NextChargeStartTime attribute" PICS: EEVSE.S.A0023 - verification: | - ./chip-tool energyevse read next-charge-start-time 1 1 - - On TH(chip-tool), Verify the NextChargeStartTime attribute contains epoch-s value or null. - - [1703747468.300635][1902:1904] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0023 DataVersion: 1471857726 - [1703747468.300690][1902:1904] CHIP:TOO: NextChargeStartTime: null - disabled: true - - - label: - "Step 14: TH reads from the DUT the NextChargeTargetTime attribute." + command: "readAttribute" + attribute: "NextChargeStartTime" + response: + constraints: + type: epoch-s + minValue: 0 + maxValue: 4294967295 + + - label: "Step 14: TH reads from the DUT the NextChargeTargetTime attribute" PICS: EEVSE.S.A0024 - verification: | - ./chip-tool energyevse read next-charge-target-time 1 1 - - On TH(chip-tool), Verify the NextChargeTargetTime attribute contains epoch-s value or null. - - [1703747509.059648][1906:1908] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0024 DataVersion: 1471857726 - [1703747509.059700][1906:1908] CHIP:TOO: NextChargeTargetTime: null - disabled: true + command: "readAttribute" + attribute: "NextChargeTargetTime" + response: + constraints: + type: epoch-s + minValue: 0 + maxValue: 4294967295 - label: - "Step 15: TH reads from the DUT the NextChargeRequiredEnergy - attribute." + "Step 15: TH reads from the DUT the NextChargeRequiredEnergy attribute" PICS: EEVSE.S.A0025 - verification: | - ./chip-tool energyevse read next-charge-required-energy 1 1 - - On TH(chip-tool), Verify the NextChargeRequiredEnergy attribute energy-mWh value is in the valid range(min 0) or null. - - [1703747579.793082][1917:1919] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0025 DataVersion: 1471857726 - [1703747579.793170][1917:1919] CHIP:TOO: NextChargeRequiredEnergy: null - disabled: true - - - label: "Step 16: TH reads from the DUT the NextChargeTargetSoC attribute." + command: "readAttribute" + attribute: "NextChargeRequiredEnergy" + response: + constraints: + type: energy-mWh + minValue: 0 + + - label: "Step 16: TH reads from the DUT the NextChargeTargetSoC attribute" PICS: EEVSE.S.A0026 - verification: | - ./chip-tool energyevse read next-charge-target-so-c 1 1 - - On TH(chip-tool), Verify the NextChargeTargetSoC attribute contains a percent value, or null. - - [1703747625.575922][1922:1924] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0026 DataVersion: 1471857726 - [1703747625.576013][1922:1924] CHIP:TOO: NextChargeTargetSoC: null - disabled: true + command: "readAttribute" + attribute: "NextChargeTargetSoC" + response: + constraints: + type: percent + minValue: 0 + maxValue: 100 - label: "Step 17: TH writes to the DUT the ApproximateEVEfficiency attribute - value 3500." + value 3500" PICS: EEVSE.S.A0027 - verification: | - ./chip-tool energyevse write approximate-evefficiency 3500 1 1 - - On TH(chip-tool), Verify the SUCCESS response for ApproximateEVEfficiency attribute successful write. - - [1703747688.527575][1927:1929] CHIP:DMG: StatusIB = - [1703747688.527603][1927:1929] CHIP:DMG: { - [1703747688.527631][1927:1929] CHIP:DMG: status = 0x00 (SUCCESS), - [1703747688.527678][1927:1929] CHIP:DMG: }, - disabled: true + command: "writeAttribute" + attribute: "ApproximateEVEfficiency" + arguments: + value: 3500 - label: - "Step 17a: TH reads from the DUT the ApproximateEVEfficiency - attribute." + "Step 17a: TH reads from the DUT the ApproximateEVEfficiency attribute" PICS: EEVSE.S.A0027 - verification: | - ./chip-tool energyevse read approximate-evefficiency 1 1 - - On TH(chip-tool), Verify the ApproximateEVEfficiency attribute contains the uint16 value 3500. - - [1703747727.592819][1930:1932] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0027 DataVersion: 1471857728 - [1703747727.592870][1930:1932] CHIP:TOO: ApproximateEVEfficiency: 3500 - disabled: true - - - label: "Step 18: TH reads from the DUT the StateOfCharge attribute." + command: "readAttribute" + attribute: "ApproximateEVEfficiency" + response: + value: 3500 + constraints: + type: int16u + + - label: "Step 18: TH reads from the DUT the StateOfCharge attribute" PICS: EEVSE.S.A0030 - verification: | - ./chip-tool energyevse read state-of-charge 1 1 - - On TH(chip-tool), Verify the StateOfCharge attribute contains a percent value, or null. - - [1703747792.711492][1934:1936] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0030 DataVersion: 1471857728 - [1703747792.711546][1934:1936] CHIP:TOO: StateOfCharge: null - disabled: true - - - label: "Step 19: TH reads from the DUT the BatteryCapacity attribute." + command: "readAttribute" + attribute: "StateOfCharge" + response: + constraints: + type: percent + minValue: 0 + maxValue: 100 + + - label: "Step 19: TH reads from the DUT the BatteryCapacity attribute" PICS: EEVSE.S.A0031 - verification: | - ./chip-tool energyevse read battery-capacity 1 1 - - On TH(chip-tool), Verify the BatteryCapacity attribute contains an energy-mWh value or null. - - [1703747831.580988][1942:1944] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0031 DataVersion: 1471857728 - [1703747831.581068][1942:1944] CHIP:TOO: BatteryCapacity: null - disabled: true - - - label: "Step 20: TH reads from the DUT the VehicleID attribute." + command: "readAttribute" + attribute: "BatteryCapacity" + response: + constraints: + type: energy-mWh + minValue: 0 + + - label: "Step 20: TH reads from the DUT the VehicleID attribute" PICS: EEVSE.S.A0032 - verification: | - ./chip-tool energyevse read vehicle-id 1 1 - - On TH(chip-tool), Verify the VehicleID attribute contains a string value, or null. - - [1703747885.083733][1948:1950] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0032 DataVersion: 1471857728 - [1703747885.083795][1948:1950] CHIP:TOO: VehicleID: null - disabled: true - - - label: "Step 21: TH reads from the DUT the SessionID attribute." + command: "readAttribute" + attribute: "VehicleID" + response: + constraints: + type: char_string + maxLength: 32 + + - label: "Step 21: TH reads from the DUT the SessionID attribute" PICS: EEVSE.S.A0040 - verification: | - ./chip-tool energyevse read session-id 1 1 - - On TH(chip-tool), Verify the SessionID attribute contains a uint32 value, or null. - [1703747940.652133][1953:1955] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0040 DataVersion: 1471857728 - [1703747940.652210][1953:1955] CHIP:TOO: SessionID: null - disabled: true - - - label: "Step 22: TH reads from the DUT the SessionDuration attribute." + command: "readAttribute" + attribute: "SessionID" + response: + constraints: + type: int32u + minValue: 0 + maxValue: 2147483647 + + - label: "Step 22: TH reads from the DUT the SessionDuration attribute" PICS: EEVSE.S.A0041 - verification: | - ./chip-tool energyevse read session-duration 1 1 - - On TH(chip-tool), Verify the SessionDuration attribute contains an elapsed-s value or null. - - [1703747993.886193][1957:1959] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0041 DataVersion: 1471857728 - [1703747993.886248][1957:1959] CHIP:TOO: SessionDuration: null - disabled: true - - - label: - "Step 23: TH reads from the DUT the SessionEnergyCharged attribute." + command: "readAttribute" + attribute: "SessionDuration" + response: + constraints: + type: elapsed_s + minValue: 0 + maxValue: 2147483647 + + - label: "Step 23: TH reads from the DUT the SessionEnergyCharged attribute" PICS: EEVSE.S.A0042 - verification: | - ./chip-tool energyevse read session-energy-charged 1 1 - - On TH(chip-tool), Verify the SessionEnergyCharged attribute energy-mWh value is in the valid range(min 0) or null. - - [1703748035.855732][1962:1964] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0042 DataVersion: 1471857728 - [1703748035.855811][1962:1964] CHIP:TOO: SessionEnergyCharged: null - disabled: true + command: "readAttribute" + attribute: "SessionEnergyCharged" + response: + constraints: + type: energy-mWh + minValue: 0 - label: - "Step 24: TH reads from the DUT the SessionEnergyDischarged attribute." + "Step 24: TH reads from the DUT the SessionEnergyDischarged attribute" PICS: EEVSE.S.A0043 - verification: | - ./chip-tool energyevse read session-energy-discharged 1 1 - - On TH(chip-tool), Verify the SessionEnergyDischarged attribute energy-mWh value is in the valid range(min 0) or null. - - [1703748130.507623][1967:1970] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0099 Attribute 0x0000_0043 DataVersion: 1471857728 - [1703748130.507701][1967:1970] CHIP:TOO: SessionEnergyDischarged: null - disabled: true + command: "readAttribute" + attribute: "SessionEnergyDischarged" + response: + constraints: + type: energy-mWh + minValue: 0 diff --git a/src/app/tests/suites/certification/Test_TC_ICDM_3_4.yaml b/src/app/tests/suites/certification/Test_TC_ICDM_3_4.yaml index 2237dc6dae247c..7bbcb729489eef 100644 --- a/src/app/tests/suites/certification/Test_TC_ICDM_3_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_ICDM_3_4.yaml @@ -11,96 +11,188 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: "[TC-ICDM-3.4] ICDCounter persistence with DUT as Server" +name: 217.1.6. [TC-ICDM-3.4] ICDCounter persistence with DUT as Server PICS: - ICDM.S config: nodeId: 0x12344321 - cluster: "Basic Information" + cluster: "ICD Management" endpoint: 0 + CheckInNodeID1: + type: node_id + defaultValue: 1 + MonitorSubID1: + type: subject-id + defaultValue: 2 + Key1: + type: octstr + defaultValue: "hex:1234567890abcdef1234567890abcdef" + IdleModedurationValue: + type: int16u + defaultValue: 5 + tests: - - label: "Preconditions" + - label: + "Precondition: Commission DUT to TH (can be skipped if done in a + preceding test)" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: + "Precondition: TH reads the RegisteredClients attribute from the DUT" + PICS: ICDM.S.A0003 + command: "readAttribute" + attribute: "RegisteredClients" + response: + saveAs: RegisteredClientsIDs + constraints: + type: list + + - label: + "Precondition: If list of registered clients is not empty, unregister + existing client(s)" verification: | - 1.Commission DUT to TH (can be skipped if done in a preceding test). - disabled: true + Please send the 'unregister client' command using the check-in nodeID received from the previous read + ./chip-tool icdmanagement unregister-client 112233 1 0 + + [1704888949.629057][71657:71659] CHIP:DMG: + [1704888949.629066][71657:71659] CHIP:DMG: InteractionModelRevision = 11 + [1704888949.629074][71657:71659] CHIP:DMG: }, + [1704888949.629125][71657:71659] CHIP:DMG: Received Command Response Status for Endpoint=0 Cluster=0x0000_0046 Command=0x0000_0002 Status=0x0 + [1704888949.629153][71657:71659] CHIP:DMG: ICR moving to [AwaitingDe] + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && ICDM.S.C02.Rsp + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: + "Precondition: TH reads from the DUT the RegisteredClients attribute. + Verify that the DUT response contains empty list of registered + clients." + PICS: ICDM.S.A0003 && PICS_USER_PROMPT + command: "readAttribute" + attribute: "RegisteredClients" + response: + value: [] + constraints: + type: list - label: "Step 1: TH reads from the DUT the IdleModeDuration attribute" PICS: ICDM.S.A0000 - verification: | - ./chip-tool icdmanagement read idle-mode-duration 1 0 - - [1702414709.798241][3855:3857] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0046 Attribute 0x0000_0000 DataVersion: 2130984683 - [1702414709.798379][3855:3857] CHIP:TOO: IdleModeDuration: 3600 - disabled: true + command: "readAttribute" + attribute: "IdleModeDuration" + response: + saveAs: IdleModeDuration1 + constraints: + type: int32u + minValue: 1 + maxValue: 64800 - label: "Step 2: TH reads from the DUT the ICDCounter attribute." PICS: ICDM.S.A0004 - verification: | - ./chip-tool icdmanagement read icdcounter 1 0 - - [1702420930.466437][1422:1425] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0046 Attribute 0x0000_0004 DataVersion: 2255930497 - [1702420930.469162][1422:1425] CHIP:TOO: ICDCounter: 1706188495 - disabled: true + command: "readAttribute" + attribute: "ICDCounter" + response: + saveAs: ICDCounter1 + constraints: + type: int32u + minValue: 0 + maxValue: 4294967295 - label: - "Step 3a: TH sends RegisterClient command. - CheckInNodeID: + "Step 3a & 3b: TH sends RegisterClient command. - CheckInNodeID: registering clients node ID (CheckInNodeID1) - MonitoredSubject: monitored subject ID (MonitorSubID1) - Key: shared secret between the - client and the ICD (Key1)" - PICS: ICDM.S.C00.Rsp - verification: | - ./chip-tool icdmanagement register-client 1 1 1234567890abcdef 1 0 - - [1702420936.087934][1426:1428] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0046 Command=0x0000_0001 - [1702420936.088020][1426:1428] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0046 Command 0x0000_0001 - [1702420936.088218][1426:1428] CHIP:TOO: RegisterClientResponse: { - [1702420936.088275][1426:1428] CHIP:TOO: ICDCounter: 1706188495 - [1702420936.088320][1426:1428] CHIP:TOO: } - disabled: true - - - label: - "Step 3b: Verify DUT responds w/ status SUCCESS(0x00); Verify that the - DUT response contains IcdCounter1" - PICS: ICDM.S.C01.Tx - verification: | - ./chip-tool icdmanagement register-client 1 1 1234567890abcdef 1 0 - - [1702420936.087934][1426:1428] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0046 Command=0x0000_0001 - [1702420936.088020][1426:1428] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0046 Command 0x0000_0001 - [1702420936.088218][1426:1428] CHIP:TOO: RegisterClientResponse: { - [1702420936.088275][1426:1428] CHIP:TOO: ICDCounter: 1706188495 - [1702420936.088320][1426:1428] CHIP:TOO: } - disabled: true + client and the ICD (Key1). Verify DUT responds w/ status + SUCCESS(0x00); Verify that the DUT response contains IcdCounter1" + PICS: ICDM.S.C00.Rsp && ICDM.S.C01.Tx + command: "RegisterClient" + arguments: + values: + - name: "CheckInNodeID" + value: CheckInNodeID1 + - name: "MonitoredSubject" + value: MonitorSubID1 + - name: "Key" + value: Key1 + response: + values: + - name: "ICDCounter" + value: ICDCounter1 + constraints: + type: int32u - label: "Step 4: Wait for 1 or more Idle Mode duration." - verification: | - Wait for 1 or more Idle Mode duration. - disabled: true - + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: ( IdleModedurationValue * 1000 ) + + #Issue https://github.com/project-chip/connectedhomeip/issues/31297 - label: "Step 5: TH reads from the DUT the ICDCounter attribute." - PICS: ICDM.S.A0004 verification: | ./chip-tool icdmanagement read icdcounter 1 0 [1702421000.635860][1431:1433] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0046 Attribute 0x0000_0004 DataVersion: 2255930497 [1702421000.635970][1431:1433] CHIP:TOO: ICDCounter: 1706188496 - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && ICDM.S.A0004 + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" - label: "Step 6: Reboot DUT" - verification: | - Reboot DUT - disabled: true + PICS: PICS_SDK_CI_ONLY + cluster: "SystemCommands" + endpoint: 0 + command: "Reboot" - - label: "Step 7: TH reads from the DUT the ICDCounter attribute." - PICS: ICDM.S.A0004 + - label: "Step Reboot target device(DUT)" verification: | - ./chip-tool icdmanagement read icdcounter 1 0 + Did the DUT successfully reboot? + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP + arguments: + values: + - name: "message" + value: "Please reboot the DUT and enter 'y' after DUT starts" + - name: "expectedValue" + value: "y" + + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - [1702421019.370137][1435:1437] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0046 Attribute 0x0000_0004 DataVersion: 3029212499 - [1702421019.370232][1435:1437] CHIP:TOO: ICDCounter: 1706188596 - disabled: true + - label: "Step 7: TH reads from the DUT the ICDCounter attribute." + PICS: ICDM.S.A0004 && PICS_USER_PROMPT + command: "readAttribute" + attribute: "ICDCounter" + response: + constraints: + type: int32u + minValue: ICDCounter2 + maxValue: 4294967295 diff --git a/src/app/tests/suites/certification/Test_TC_IDM_1_3.yaml b/src/app/tests/suites/certification/Test_TC_IDM_1_3.yaml index de5625a8d11ad4..4c2d250ca17de1 100644 --- a/src/app/tests/suites/certification/Test_TC_IDM_1_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_IDM_1_3.yaml @@ -40,7 +40,6 @@ tests: in a single InvokeResponseMessage, the ordering of CommandDataIBs in the InvokeResponseMessage SHALL be in the same order as provided in the request." - verification: | Product maker needs to provide instructions for how to trigger the command on the DUT that is capable of fitting into a single InvokeResponseMessage. For comparison, the DUT behavior for this test step can be simulated using chip-repl (when DUT is a commissioner/Client). @@ -104,7 +103,6 @@ tests: contain a response to the first CommandDataIB in the InvokeRequestMessage. The second InvokeReponseMessage SHALL contains a response to the second CommandDataIB in the InvokeRequestMessage." - verification: | Product maker needs to provide instructions for how to trigger the command this on the DUT that is capable of fitting into a single InvokeResponseMessage. For comparison, the DUT behavior for this test step can be simulated using chip-repl (when DUT is a commissioner/Client). @@ -125,7 +123,6 @@ tests: contain a response to the second CommandDataIB in the InvokeRequestMessage. The second InvokeReponseMessage SHALL contains a response to the first CommandDataIB in the InvokeRequestMessage." - verification: | Product maker needs to provide instructions for how to trigger the command this on the DUT that is capable of fitting into a single InvokeResponseMessage. For comparison, the DUT behavior for this test step can be simulated using chip-repl (when DUT is a commissioner/Client). @@ -146,7 +143,6 @@ tests: InvokeResponseMessage SHALL contain a response to the first CommandDataIB in the InvokeRequestMessage. The second response to second CommandDataIB will intentionally be left out." - verification: | Product maker needs to provide instructions for how to trigger the command this on the DUT that is capable of fitting into a single InvokeResponseMessage. For comparison, the DUT behavior for this test step can be simulated using chip-repl (when DUT is a commissioner/Client). @@ -163,7 +159,6 @@ tests: TH should be configured such that it responds regularly to single invoke request." - verification: | Product maker needs to provide instructions for how to trigger the command this on the DUT that is capable of fitting into a single InvokeResponseMessage. For comparison, the DUT behavior for this test step can be simulated using chip-repl (when DUT is a commissioner/Client). diff --git a/src/app/tests/suites/certification/Test_TC_LWM_2_1.yaml b/src/app/tests/suites/certification/Test_TC_LWM_2_1.yaml index a6a916f1b2e2d8..b3535b13ceec51 100644 --- a/src/app/tests/suites/certification/Test_TC_LWM_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LWM_2_1.yaml @@ -177,7 +177,7 @@ tests: command: "readAttribute" attribute: "CurrentMode" response: - value: Step6_current_mode_dut + value: old_current_mode_dut constraints: type: int8u minValue: 0 diff --git a/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_6_8.yaml b/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_6_8.yaml index 7514964cabce09..1d840bfe1b8da2 100644 --- a/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_6_8.yaml +++ b/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_6_8.yaml @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 19.8.7. [TC-MEDIAPLAYBACK-6.8] Text Track Verification @@ -20,130 +19,63 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Media Playback" + endpoint: 3 + + ID_Value: + type: CHAR_STRING + defaultValue: activeTextTrackId_0 tests: - - label: "Preconditions" - verification: | - 1.DUT is powered on and not in a low power state - 2.DUT has media playing with no corresponding text appearing on screen (text tracks are disabled) - disabled: true + - label: + "Commission DUT to TH (can be skipped if done in a preceding test)." + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "Step 1: TH reads the ActiveTextTrack attribute from the DUT" PICS: MEDIAPLAYBACK.S.A0009 - verification: | - ./chip-tool mediaplayback read active-text-track 1 3 - - [1705510042.296465][16330:16332] CHIP:DMG: InteractionModelRevision = 11 - [1705510042.296473][16330:16332] CHIP:DMG: } - [1705510042.296562][16330:16332] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0506 Attribute 0x0000_0009 DataVersion: 900375739 - [1705510042.296659][16330:16332] CHIP:TOO: ActiveTextTrack: { - [1705510042.296668][16330:16332] CHIP:TOO: Id: activeTextTrackId_0 - [1705510042.296701][16330:16332] CHIP:TOO: TrackAttributes: { - [1705510042.296710][16330:16332] CHIP:TOO: LanguageCode: languageCode1 - [1705510042.296722][16330:16332] CHIP:TOO: DisplayName: displayName1 - [1705510042.296731][16330:16332] CHIP:TOO: } - [1705510042.296741][16330:16332] CHIP:TOO: } - [1705510042.296826][16330:16332] CHIP:EM: <<< [E:46686i S:46889 M:218476891 (Ack:232741748)] (S) Msg TX to 1:0000000000000001 [DC0D] [UDP:[fe80::a151:a1e6:e7:e224%wlp0s20f3]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1705510042.296863][16330:16332] CHIP:EM: Flushed pending ack for MessageCounter:232741748 on exchange 46686i - disabled: true + command: "readAttribute" + attribute: "ActiveTextTrack" + response: + value: { ID: "", TrackAttributes: null } - label: "Step 2: TH reads the AvailableTextTracks attribute from the DUT" PICS: MEDIAPLAYBACK.S.A000a - verification: | - ./chip-tool mediaplayback read available-text-tracks 1 3 - - [1705510341.175871][16392:16394] CHIP:DMG: InteractionModelRevision = 11 - [1705510341.175877][16392:16394] CHIP:DMG: } - [1705510341.176016][16392:16394] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0506 Attribute 0x0000_000A DataVersion: 900375739 - [1705510341.176056][16392:16394] CHIP:TOO: AvailableTextTracks: 2 entries - [1705510341.176114][16392:16394] CHIP:TOO: [1]: { - [1705510341.176121][16392:16394] CHIP:TOO: Id: activeTextTrackId_0 - [1705510341.176142][16392:16394] CHIP:TOO: TrackAttributes: { - [1705510341.176148][16392:16394] CHIP:TOO: LanguageCode: languageCode1 - [1705510341.176156][16392:16394] CHIP:TOO: DisplayName: displayName1 - [1705510341.176163][16392:16394] CHIP:TOO: } - [1705510341.176169][16392:16394] CHIP:TOO: } - [1705510341.176184][16392:16394] CHIP:TOO: [2]: { - [1705510341.176189][16392:16394] CHIP:TOO: Id: activeTextTrackId_1 - [1705510341.176195][16392:16394] CHIP:TOO: TrackAttributes: { - [1705510341.176200][16392:16394] CHIP:TOO: LanguageCode: languageCode2 - [1705510341.176206][16392:16394] CHIP:TOO: DisplayName: displayName2 - [1705510341.176212][16392:16394] CHIP:TOO: } - [1705510341.176218][16392:16394] CHIP:TOO: } - [1705510341.176307][16392:16394] CHIP:EM: <<< [E:6048i S:22581 M:56736636 (Ack:198505019)] (S) Msg TX to 1:0000000000000001 [DC0D] [UDP:[fe80::a151:a1e6:e7:e224%wlp0s20f3]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1705510341.176351][16392:16394] CHIP:EM: Flushed pending ack for MessageCounter:198505019 o - disabled: true + command: "readAttribute" + attribute: "AvailableTextTracks" + response: + constraints: + type: list + minLength: 1 - label: "Step 3: TH sends a ActivateTextTrack command to DUT specifying the ID value from step 2" PICS: MEDIAPLAYBACK.S.C0d.Rsp - verification: | - ./chip-tool mediaplayback activate-text-track activeAudioTrackId_0 1 3 - - [1705510090.516480][16340:16342] CHIP:DMG: ], - [1705510090.516490][16340:16342] CHIP:DMG: - [1705510090.516496][16340:16342] CHIP:DMG: InteractionModelRevision = 11 - [1705510090.516502][16340:16342] CHIP:DMG: }, - [1705510090.516532][16340:16342] CHIP:DMG: Received Command Response Status for Endpoint=3 Cluster=0x0000_0506 Command=0x0000_000D Status=0x0 - [1705510090.516551][16340:16342] CHIP:DMG: ICR moving to [AwaitingDe] - [1705510090.516603][16340:16342] CHIP:EM: <<< [E:38439i S:17770 M:29388041 (Ack:36384138)] (S) Msg TX to 1:0000000000000001 [DC0D] [UDP:[fe80::a151:a1e6:e7:e224%wlp0s20f3]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1705510090.516635][16340:16342] CHIP:EM: Flushed pending ack for MessageCounter:36384138 on exchange 38439i - disabled: true + command: "ActivateTextTrack" + arguments: + values: + - name: "TrackID" + value: ID_Value - label: "Step 4: TH reads the ActiveTextTrack attribute from the DUT" PICS: MEDIAPLAYBACK.S.A0009 - verification: | - ./chip-tool mediaplayback read active-text-track 1 3 - - [1705510111.140989][16347:16349] CHIP:DMG: SuppressResponse = true, - [1705510111.140995][16347:16349] CHIP:DMG: InteractionModelRevision = 11 - [1705510111.141001][16347:16349] CHIP:DMG: } - [1705510111.141083][16347:16349] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0506 Attribute 0x0000_0009 DataVersion: 900375739 - [1705510111.141165][16347:16349] CHIP:TOO: ActiveTextTrack: { - [1705510111.141173][16347:16349] CHIP:TOO: Id: activeTextTrackId_0 - [1705510111.141193][16347:16349] CHIP:TOO: TrackAttributes: { - [1705510111.141200][16347:16349] CHIP:TOO: LanguageCode: languageCode1 - [1705510111.141207][16347:16349] CHIP:TOO: DisplayName: displayName1 - [1705510111.141214][16347:16349] CHIP:TOO: } - [1705510111.141220][16347:16349] CHIP:TOO: } - [1705510111.141301][16347:16349] CHIP:EM: <<< [E:17921i S:33385 M:33192485 (Ack:130923512)] (S) Msg TX to 1:0000000000000001 [DC0D] [UDP:[fe80::a151:a1e6:e7:e224%wlp0s20f3]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1705510111.141335][16347:16349] CHIP:EM: Flushed pending ack for MessageCounter:130923512 on exchange 17921i - [1705510111.141507][16347:16347] CHIP:CTL: Shutting down the commissioner - [1705510111.141549][16347:16347] CHIP:CTL: Shutting down the controller - [1705510111.141558][16347:16347] CHIP:IN: Expiring all sessions for fabric 0x1!! - disabled: true + command: "readAttribute" + attribute: "ActiveTextTrack" + response: + value: { ID: ID_Value } - label: "Step 5: TH sends a DeactivateTextTrack command to DUT" PICS: MEDIAPLAYBACK.S.C0e.Rsp - verification: | - ./chip-tool mediaplayback deactivate-text-track 1 3 - - [1705510243.371080][16362:16364] CHIP:DMG: InteractionModelRevision = 11 - [1705510243.371088][16362:16364] CHIP:DMG: }, - [1705510243.371125][16362:16364] CHIP:DMG: Received Command Response Status for Endpoint=3 Cluster=0x0000_0506 Command=0x0000_000E Status=0x0 - [1705510243.371148][16362:16364] CHIP:DMG: ICR moving to [AwaitingDe] - [1705510243.371203][16362:16364] CHIP:EM: <<< [E:35676i S:44821 M:224478765 (Ack:259090512)] (S) Msg TX to 1:0000000000000001 [DC0D] [UDP:[fe80::a151:a1e6:e7:e224%wlp0s20f3]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1705510243.371238][16362:16364] CHIP:EM: Flushed pending ack for MessageCounter:259090512 on exchange 35676i - [1705510243.371429][16362:16362] CHIP:CTL: Shutting down the commissioner - [1705510243.371483][16362:16362] CHIP:CTL: Shutting down the controller - disabled: true + command: "DeactivateTextTrack" - label: "Step 6: TH reads the ActiveTextTrack attribute from the DUT" PICS: MEDIAPLAYBACK.S.A0009 - verification: | - ./chip-tool mediaplayback read active-text-track 1 3 - - - [1705510269.182464][16374:16376] CHIP:DMG: InteractionModelRevision = 11 - [1705510269.182472][16374:16376] CHIP:DMG: } - [1705510269.182556][16374:16376] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0506 Attribute 0x0000_0009 DataVersion: 900375739 - [1705510269.182642][16374:16376] CHIP:TOO: ActiveTextTrack: { - [1705510269.182651][16374:16376] CHIP:TOO: Id: - [1705510269.182670][16374:16376] CHIP:TOO: TrackAttributes: null - [1705510269.182679][16374:16376] CHIP:TOO: } - [1705510269.182763][16374:16376] CHIP:EM: <<< [E:17583i S:2252 M:176774078 (Ack:187039870)] (S) Msg TX to 1:0000000000000001 [DC0D] [UDP:[fe80::a151:a1e6:e7:e224%wlp0s20f3]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1705510269.182802][16374:16376] CHIP:EM: Flushed pending ack for MessageCounter:187039870 on exchange 17583i - disabled: true + command: "readAttribute" + attribute: "ActiveTextTrack" + response: + value: { ID: "", TrackAttributes: null } diff --git a/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_6_9.yaml b/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_6_9.yaml index 1e5333c65ad226..57d790d965a651 100644 --- a/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_6_9.yaml +++ b/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_6_9.yaml @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 19.8.8. [TC-MEDIAPLAYBACK-6.9] Audio Track Verification @@ -20,95 +19,58 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Media Playback" + endpoint: 3 + + AudioTrack_ID_Value: + type: CHAR_STRING + defaultValue: activeAudioTrackId_1 + AudioOutputIndex_Value: + type: int16u + defaultValue: 1 tests: - - label: "Preconditions" - verification: | - 1.DUT is powered on and not in a low power state - 2.DUT has media playing content with multiple audio tracks available - disabled: true + - label: + "Commission DUT to TH (can be skipped if done in a preceding test)." + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "Step 1: TH reads the ActiveAudioTrack attribute from the DUT" PICS: MEDIAPLAYBACK.S.A0007 - verification: | - ./chip-tool mediaplayback read active-audio-track 1 3 - - - [1705510425.048787][16407:16409] CHIP:DMG: SuppressResponse = true, - [1705510425.048793][16407:16409] CHIP:DMG: InteractionModelRevision = 11 - [1705510425.048799][16407:16409] CHIP:DMG: } - [1705510425.048880][16407:16409] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0506 Attribute 0x0000_0007 DataVersion: 900375739 - [1705510425.048963][16407:16409] CHIP:TOO: ActiveAudioTrack: { - [1705510425.048971][16407:16409] CHIP:TOO: Id: activeAudioTrackId_0 - [1705510425.048979][16407:16409] CHIP:TOO: TrackAttributes: { - [1705510425.048985][16407:16409] CHIP:TOO: LanguageCode: languageCode1 - [1705510425.048999][16407:16409] CHIP:TOO: DisplayName: displayName1 - [1705510425.049006][16407:16409] CHIP:TOO: } - [1705510425.049012][16407:16409] CHIP:TOO: } - [1705510425.049085][16407:16409] CHIP:EM: <<< [E:36805i S:17177 M:13072081 (Ack:131987814)] (S) Msg TX to 1:0000000000000001 [DC0D] [UDP:[fe80::a151:a1e6:e7:e224%wlp0s20f3]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + command: "readAttribute" + attribute: "ActiveAudioTrack" + response: + saveAs: ActiveAudioTrackValue - label: "Step 2: TH reads the AvailableAudioTracks attribute from the DUT" PICS: MEDIAPLAYBACK.S.A0008 - verification: | - ./chip-tool mediaplayback read available-audio-tracks 1 3 - - - [1705510455.278768][16412:16414] CHIP:DMG: - [1705510455.278774][16412:16414] CHIP:DMG: SuppressResponse = true, - [1705510455.278781][16412:16414] CHIP:DMG: InteractionModelRevision = 11 - [1705510455.278786][16412:16414] CHIP:DMG: } - [1705510455.278928][16412:16414] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0506 Attribute 0x0000_0008 DataVersion: 900375739 - [1705510455.278981][16412:16414] CHIP:TOO: AvailableAudioTracks: 2 entries - [1705510455.279038][16412:16414] CHIP:TOO: [1]: { - [1705510455.279045][16412:16414] CHIP:TOO: Id: activeAudioTrackId_0 - [1705510455.279053][16412:16414] CHIP:TOO: TrackAttributes: { - [1705510455.279059][16412:16414] CHIP:TOO: LanguageCode: languageCode1 - [1705510455.279074][16412:16414] CHIP:TOO: DisplayName: displayName1 - [1705510455.279081][16412:16414] CHIP:TOO: } - [1705510455.279087][16412:16414] CHIP:TOO: } - [1705510455.279101][16412:16414] CHIP:TOO: [2]: { - [1705510455.279107][16412:16414] CHIP:TOO: Id: activeAudioTrackId_1 - [1705510455.279113][16412:16414] CHIP:TOO: TrackAttributes: { - [1705510455.279119][16412:16414] CHIP:TOO: LanguageCode: languageCode2 - [1705510455.279125][16412:16414] CHIP:TOO: DisplayName: displayName2 - [1705510455.279131][16412:16414] CHIP:TOO: } - [1705510455.279136][16412:16414] CHIP:TOO: } - [1705510455.279220][16412:16414] CHIP:EM: <<< [E:35757i S:13973 M:92594399 (Ack:246741638)] (S) Msg TX to 1:0000000000000001 [DC0D] [UDP:[fe80::a151:a1e6:e7:e224%wlp0s20f3]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1705510455.279240][16412:16414] CHIP:EM: Flushed pending ack for MessageC - disabled: true + command: "readAttribute" + attribute: "AvailableAudioTracks" + response: + saveAs: AvailableAudioTracksValue + constraints: + type: list + minLength: 2 - label: "Step 3: TH sends a ActivateAudioTrack command to DUT specifying the ID value from step 2" PICS: MEDIAPLAYBACK.S.C09.Rsp - verification: | - ./chip-tool mediaplayback activate-text-track activeAudioTrackId_1 1 3 - - [1705510513.251669][16417:16419] CHIP:DMG: - [1705510513.251677][16417:16419] CHIP:DMG: InteractionModelRevision = 11 - [1705510513.251685][16417:16419] CHIP:DMG: }, - [1705510513.251722][16417:16419] CHIP:DMG: Received Command Response Status for Endpoint=3 Cluster=0x0000_0506 Command=0x0000_000D Status=0x0 - [1705510513.251744][16417:16419] CHIP:DMG: ICR moving to [AwaitingDe] - [1705510513.251824][16417:16419] CHIP:EM: <<< [E:31201i S:10659 M:469610 (Ack:79656282)] (S) Msg TX to 1:0000000000000001 [DC0D] [UDP:[fe80::a151:a1e6:e7:e224%wlp0s20f3]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + command: "ActivateAudioTrack" + arguments: + values: + - name: "AudioOutputIndex" + value: AudioOutputIndex_Value + - name: "TrackID" + value: AudioTrack_ID_Value - label: "Step 4: TH reads the ActiveAudioTrack attribute from the DUT" PICS: MEDIAPLAYBACK.S.A0007 - verification: | - ./chip-tool mediaplayback read active-audio-track 1 3 - - [1705510563.022455][16427:16429] CHIP:DMG: } - [1705510563.022535][16427:16429] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0506 Attribute 0x0000_0007 DataVersion: 900375739 - [1705510563.022607][16427:16429] CHIP:TOO: ActiveAudioTrack: { - [1705510563.022614][16427:16429] CHIP:TOO: Id: activeAudioTrackId_0 - [1705510563.022622][16427:16429] CHIP:TOO: TrackAttributes: { - [1705510563.022628][16427:16429] CHIP:TOO: LanguageCode: languageCode1 - [1705510563.022642][16427:16429] CHIP:TOO: DisplayName: displayName1 - [1705510563.022649][16427:16429] CHIP:TOO: } - [1705510563.022655][16427:16429] CHIP:TOO: } - [1705510563.022725][16427:16429] CHIP:EM: <<< [E:32787i S:18357 M:255165335 (Ack:47655138)] (S) Msg TX to 1:0000000000000001 [DC0D] [UDP:[fe80::a151:a1e6:e7:e224%wlp0s20f3]:5640] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1705510563.022757][16427:16429] CHIP:EM: Flushed pending ack for MessageCounter:47655138 on exchange 32787i - disabled: true + command: "readAttribute" + attribute: "ActiveAudioTrack" + response: + value: { ID: AudioTrack_ID_Value } diff --git a/src/app/tests/suites/certification/Test_TC_REFALM_2_2.yaml b/src/app/tests/suites/certification/Test_TC_REFALM_2_2.yaml index 3404d4ff6d9ed2..54a872047dc99d 100644 --- a/src/app/tests/suites/certification/Test_TC_REFALM_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_REFALM_2_2.yaml @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 223.2.2. [TC-REFALM-2.2] Primary functionality with DUT as Server @@ -20,117 +19,189 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Refrigerator Alarm" + endpoint: 1 + PIXIT.REFALM.AlarmThreshold: + type: int16u + defaultValue: 5 tests: - - label: "Note" - verification: | - This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. - disabled: true - - label: "Step 1: Commission DUT to TH (can be skipped if done in a preceding test)" - verification: | - - disabled: true + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "Step 2: Ensure that the door on the DUT is closed" verification: | Ensure that the door on the DUT is closed - disabled: true - - - label: "Step 3: TH reads from the DUT the State attribute" + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: "Step 3:TH reads from the DUT the State attribute" + command: "readAttribute" + attribute: "State" PICS: REFALM.S.A0002 - verification: | - ./chip-tool refrigeratoralarm read state 1 1 - On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 0 set to 0. - - [1688447820.603249][4247:4249] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_0002 DataVersion: 1795162772 - [1688447820.603415][4247:4249] CHIP:TOO: State: 1 - [1688447820.603708][4247:4249] CHIP:EM: <<< [E:2198i S:4260 M:156565261 (Ack:46517349)] (S) Msg TX to 1:0000000000000001 [10DB] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] - label: "Step 4: Manually open the door on the DUT" verification: | Manually open the door on the DUT - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 5: Wait for the time defined in PIXIT.REFALM.AlarmThreshold" - verification: | - Wait for the time defined in PIXIT.REFALM.AlarmThreshold - disabled: true + cluster: "DelayCommands" + command: "WaitForMs" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "ms" + value: PIXIT.REFALM.AlarmThreshold * 1000 - label: "Step 6: TH reads from the DUT the State attribute" - PICS: REFALM.S.A0002 - verification: | - ./chip-tool refrigeratoralarm read state 1 1 - On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 0 set to 1. - - [1688447820.603249][4247:4249] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_0002 DataVersion: 1795162772 - [1688447820.603415][4247:4249] CHIP:TOO: State: 1 - [1688447820.603708][4247:4249] CHIP:EM: <<< [E:2198i S:4260 M:156565261 (Ack:46517349)] (S) Msg TX to 1:0000000000000001 [10DB] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + command: "readAttribute" + attribute: "State" + PICS: REFALM.S.A0002 && PICS_USER_PROMPT + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] - label: "Step 7: Ensure that the door on the DUT is closed" verification: | Ensure that the door on the DUT is closed - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 8: TH reads from the DUT the State attribute" - PICS: REFALM.S.A0002 - verification: | - ./chip-tool refrigeratoralarm read state 1 1 - On TH(chip-tool), Verify that the DUT response contains a 32-bit value with bit 0 set to 0. - - [1688447820.603249][4247:4249] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0057 Attribute 0x0000_0002 DataVersion: 1795162772 - [1688447820.603415][4247:4249] CHIP:TOO: State: 0 - [1688447820.603708][4247:4249] CHIP:EM: <<< [E:2198i S:4260 M:156565261 (Ack:46517349)] (S) Msg TX to 1:0000000000000001 [10DB] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true - + command: "readAttribute" + attribute: "State" + PICS: REFALM.S.A0002 PICS_USER_PROMPT + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] + + # Issue: https://github.com/project-chip/connectedhomeip/issues/28325 + # Issue: https://github.com/project-chip/connectedhomeip/issues/27235 - label: "Step 9: TH sends Reset command to the DUT" - PICS: REFALM.S.C00.Rsp + PICS: REFALM.S.C00.Rsp && PICS_USER_PROMPT verification: | Reset command is not implemeted in Chip-tool - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 10: TH sends ModifyEnabledAlarms command to the DUT" - PICS: REFALM.S.C01.Rsp + PICS: REFALM.S.C01.Rsp && PICS_USER_PROMPT verification: | ModifyEnabledAlarms is not implemeted in Chip-tool - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 11: Set up subscription to the Notify event." PICS: REFALM.S.E00 && REFALM.S.A0002 + command: "subscribeEvent" + event: "Notify" + minInterval: 2 + maxInterval: 10 + + - label: "Step 12a: Repeating step 4 Manually open the door on the DUT" verification: | - Please use Interactive mode to subscribe the OperationalError event - Here the command to enter interactive mode after provision :- - ./chip-tool interactive start - - Please subscribe to the Notify event by sending below mentioned command - refrigeratoralarm subscribe-event notify 2 10 1 1 - - [1690959967.087585][3549:3551] CHIP:EM: Rxd Ack; Removing MessageCounter:144404037 from Retrans Table on exchange 19895i - [1690959967.087651][3549:3551] CHIP:DMG: ReportDataMessage = - [1690959967.087684][3549:3551] CHIP:DMG: { - [1690959967.087712][3549:3551] CHIP:DMG: SubscriptionId = 0x959257ec, - [1690959967.087743][3549:3551] CHIP:DMG: InteractionModelRevision = 1 - [1690959967.087770][3549:3551] CHIP:DMG: } - [1690959967.087813][3549:3551] CHIP:DMG: MoveToState ReadClient[0xffff80010ac0]: Moving to [AwaitingSu] - [1690959967.087923][3549:3551] CHIP:EM: <<< [E:19895i S:58037 M:144404038 (Ack:133694741)] (S) Msg TX to 1:0000000000000001 [7C8C] --- Type 0001:01 (IM:StatusResponse) - [1690959967.087966][3549:3551] CHIP:IN: (S) Sending msg 144404038 on secure session with LSID: 58037 - disabled: true - - - label: "Step 12: Repeat steps 4 then 5" - PICS: REFALM.S.E00 - verification: | - Repeat steps 4 - Manually open the door on the DUT - then 5 - Wait for the time defined in PIXIT.REFALM.AlarmThreshold - disabled: true + Manually open the door on the DUT + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 12b: Repeat step 5 Wait for the time defined in + PIXIT.REFALM.AlarmThreshold" + cluster: "DelayCommands" + command: "WaitForMs" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "ms" + value: PIXIT.REFALM.AlarmThreshold * 1000 - - label: "Step 13: Repeat step 7" - PICS: REFALM.S.E00 + - label: + "Step 12c: After step 5 (repeated), receive a Notify event with the + State attribute bit 0 set to 1." + command: "readAttribute" + attribute: "State" + PICS: REFALM.S.A0002 && PICS_USER_PROMPT + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] + + - label: + "Step 13a : Repeat step 7 Ensure that the door on the DUT is closed" verification: | - Repeat step 7 - that is Ensure that the door on the DUT is closed - disabled: true + Manually open the door on the DUT + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 13b: Receive a Notify event with the State attribute bit 0 set + to 0" + command: "readAttribute" + attribute: "State" + PICS: REFALM.S.A0002 && PICS_USER_PROMPT + response: + constraints: + type: bitmap32 + hasMasksClear: [0x1] diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index fd11f3ae2ac007..3e8f5ed69b37ae 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -423,10 +423,10 @@ MEDIAPLAYBACK.S.A0003=1 MEDIAPLAYBACK.S.A0004=1 MEDIAPLAYBACK.S.A0005=1 MEDIAPLAYBACK.S.A0006=1 -MEDIAPLAYBACK.S.A0007=0 -MEDIAPLAYBACK.S.A0008=0 -MEDIAPLAYBACK.S.A0009=0 -MEDIAPLAYBACK.S.A000a=0 +MEDIAPLAYBACK.S.A0007=1 +MEDIAPLAYBACK.S.A0008=1 +MEDIAPLAYBACK.S.A0009=1 +MEDIAPLAYBACK.S.A000a=1 MEDIAPLAYBACK.S.C00.Rsp=1 MEDIAPLAYBACK.S.C01.Rsp=1 @@ -439,6 +439,9 @@ MEDIAPLAYBACK.S.C07.Rsp=1 MEDIAPLAYBACK.S.C08.Rsp=1 MEDIAPLAYBACK.S.C09.Rsp=1 MEDIAPLAYBACK.S.C0b.Rsp=1 +MEDIAPLAYBACK.S.C0c.Rsp=1 +MEDIAPLAYBACK.S.C0d.Rsp=1 +MEDIAPLAYBACK.S.C0e.Rsp=1 MEDIAPLAYBACK.S.F00=1 MEDIAPLAYBACK.S.F01=1 @@ -2842,56 +2845,96 @@ OTCCM.S.M.CAN_MANUALLY_CONTROLLED=0 #Energy EVSE Cluster EEVSE.S=0 -EEVSE.S.A0000=0 -EEVSE.S.A0001=0 -EEVSE.S.A0002=0 -EEVSE.S.A0003=0 -EEVSE.S.A0004=0 -EEVSE.S.A0005=0 -EEVSE.S.A0006=0 -EEVSE.S.A0007=0 -EEVSE.S.A0008=0 -EEVSE.S.A0009=0 -EEVSE.S.A000A=0 -EEVSE.S.A0023=0 -EEVSE.S.A0024=0 -EEVSE.S.A0025=0 -EEVSE.S.A0026=0 -EEVSE.S.A0027=0 -EEVSE.S.A0030=0 -EEVSE.S.A0031=0 -EEVSE.S.A0032=0 -EEVSE.S.A0040=0 -EEVSE.S.A0041=0 -EEVSE.S.A0042=0 -EEVSE.S.A0043=0 +EEVSE.S.A0000=1 +EEVSE.S.A0001=1 +EEVSE.S.A0002=1 +EEVSE.S.A0003=1 +EEVSE.S.A0004=1 +EEVSE.S.A0005=1 +EEVSE.S.A0006=1 +EEVSE.S.A0007=1 +EEVSE.S.A0008=1 +EEVSE.S.A0009=1 +EEVSE.S.A000A=1 +EEVSE.S.A0023=1 +EEVSE.S.A0024=1 +EEVSE.S.A0025=1 +EEVSE.S.A0026=1 +EEVSE.S.A0027=1 +EEVSE.S.A0030=1 +EEVSE.S.A0031=1 +EEVSE.S.A0032=1 +EEVSE.S.A0040=1 +EEVSE.S.A0041=1 +EEVSE.S.A0042=1 +EEVSE.S.A0043=1 #Commands received -EEVSE.S.C01.Rsp=0 -EEVSE.S.C02.Rsp=0 -EEVSE.S.C03.Rsp=0 -EEVSE.S.C04.Rsp=0 -EEVSE.S.C05.Rsp=0 -EEVSE.S.C06.Rsp=0 -EEVSE.S.C07.Rsp=0 +EEVSE.S.C01.Rsp=1 +EEVSE.S.C02.Rsp=1 +EEVSE.S.C03.Rsp=1 +EEVSE.S.C04.Rsp=1 +EEVSE.S.C05.Rsp=1 +EEVSE.S.C06.Rsp=1 +EEVSE.S.C07.Rsp=1 # Commands generated -EEVSE.S.C00.Tx=0 +EEVSE.S.C00.Tx=1 #Manual controllable -EEVSE.S.M.ManuallyControlledPluggedIn=0 +EEVSE.S.M.ManuallyControlledPluggedIn=1 #Features -EEVSE.S.F00=0 -EEVSE.S.F01=0 -EEVSE.S.F02=0 -EEVSE.S.F03=0 -EEVSE.S.F04=0 +EEVSE.S.F00=1 +EEVSE.S.F01=1 +EEVSE.S.F02=1 +EEVSE.S.F03=1 +EEVSE.S.F04=1 #Events -EEVSE.S.E00=0 -EEVSE.S.E01=0 -EEVSE.S.E02=0 -EEVSE.S.E03=0 -EEVSE.S.E04=0 -EEVSE.S.E05=0 +EEVSE.S.E00=1 +EEVSE.S.E01=1 +EEVSE.S.E02=1 +EEVSE.S.E03=1 +EEVSE.S.E04=1 +EEVSE.S.E05=1 + +# Energy EVSE Mode Cluster + +#Feature +EEVSEM.S.F00=1 +#Server +EEVSEM.S=1 +EEVSEM.S.A0000=1 +EEVSEM.S.A0001=1 +EEVSEM.S.A0002=0 +EEVSEM.S.A0003=0 + +#Commands received +EEVSEM.S.C00.Rsp=1 + +#Commands generated +EEVSEM.S.C01.Tx=1 + +#Manual controllable +EEVSEM.S.M.CAN_TEST_MODE_FAILURE=1 +EEVSEM.S.M.CAN_MANUALLY_CONTROLLED=1 + +# Device Energy Management Mode Cluster + +#Server +DEMM.S=1 +DEMM.S.A0000=1 +DEMM.S.A0001=1 +DEMM.S.A0002=0 +DEMM.S.A0003=1 + +#Commands received +DEMM.S.C00.Rsp=1 + +#Commands generated +DEMM.S.C01.Tx=1 + +#Manual controllable +DEMM.S.M.CAN_TEST_MODE_FAILURE=1 +DEMM.S.M.CAN_MANUALLY_CONTROLLED=1 diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index 8c17e1876c36ec..ee6b5436451a6f 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -50,12 +50,21 @@ "Test_TC_CNET_1_3" ], "Descriptor": ["Test_TC_DESC_1_1"], + "DeviceEnergyManagementMode": ["Test_TC_DEMM_1_1", "Test_TC_DEMM_2_1"], "EthernetNetworkDiagnostics": [ "Test_TC_DGETH_1_1", "Test_TC_DGETH_2_1", "Test_TC_DGETH_2_2" ], "DiagnosticsLogs": ["Test_TC_DLOG_1_1"], + "EnergyEVSE": ["Test_TC_EEVSE_1_1", "Test_TC_EEVSE_2_1"], + "EnergyEVSEMode": [ + "Test_TC_EEVSEM_1_1", + "Test_TC_EEVSEM_2_1", + "Test_TC_EEVSEM_3_1", + "Test_TC_EEVSEM_3_2", + "Test_TC_EEVSEM_3_3" + ], "FlowMeasurement": ["Test_TC_FLW_1_1", "Test_TC_FLW_2_1"], "FixedLabel": ["Test_TC_FLABEL_1_1", "Test_TC_FLABEL_2_1"], "FanControl": [ @@ -69,7 +78,11 @@ "GeneralCommissioning": ["Test_TC_CGEN_1_1", "Test_TC_CGEN_2_1"], "GeneralDiagnostics": ["Test_TC_DGGEN_1_1"], "GroupKeyManagement": ["Test_TC_GRPKEY_1_1", "Test_TC_GRPKEY_2_2"], - "IcdManagement": ["TestIcdManagementCluster", "Test_TC_ICDM_1_1"], + "IcdManagement": [ + "TestIcdManagementCluster", + "Test_TC_ICDM_1_1", + "Test_TC_ICDM_3_4" + ], "Identify": [ "Test_TC_I_1_1", "Test_TC_I_2_1", @@ -389,9 +402,12 @@ "ConcentrationMeasurement", "ContentAppObserver", "DeviceManagement", + "DeviceEnergyManagementMode", "Descriptor", "DiagnosticsLogs", "EthernetNetworkDiagnostics", + "EnergyEVSE", + "EnergyEVSEMode", "FlowMeasurement", "FixedLabel", "FanControl", diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index 8f67fe1348a802..774b3d8dce35f3 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -113,6 +113,8 @@ "Test_TC_DLOG_3_1" ], "Descriptor": ["Test_TC_DESC_2_1"], + "DeviceEnergyManagementMode": ["Test_TC_DEMM_1_2"], + "EnergyEVSEMode": ["Test_TC_EEVSEM_1_2"], "FanControl": [], "GeneralCommissioning": ["Test_TC_CGEN_2_2"], "GeneralDiagnostics": ["Test_TC_DGGEN_2_2"], @@ -122,7 +124,6 @@ "Test_TC_ICDM_3_1", "Test_TC_ICDM_3_2", "Test_TC_ICDM_3_3", - "Test_TC_ICDM_3_4", "Test_TC_ICDM_4_1", "Test_TC_ICDM_5_1" ], @@ -321,9 +322,11 @@ "DishwasherAlarm", "DishwasherMode", "Descriptor", + "DeviceEnergyManagementMode", "FanControl", "EthernetNetworkDiagnostics", "EnergyEVSE", + "EnergyEVSEMode", "GeneralCommissioning", "GeneralDiagnostics", "IcdManagement",