From f21a90120744be90ed1218d943351ea44e921495 Mon Sep 17 00:00:00 2001 From: "m.trayer" Date: Thu, 13 Jul 2023 15:59:47 -0500 Subject: [PATCH 01/11] Add OperationalState Global Attributes test to the CI Steps: - regen all yaml tests - re-build chip-tool, re-build all-clusters - manually run OPSTATE_1_1 via chip-tool - verify resulting logs --- src/app/tests/suites/certification/PICS.yaml | 24 ++ .../certification/Test_TC_OPSTATE_1_1.yaml | 18 +- .../tests/suites/certification/ci-pics-values | 13 + src/app/tests/suites/ciTests.json | 135 ++++-- src/app/tests/suites/manualTests.json | 119 ++++-- .../chip-tool/zap-generated/test/Commands.h | 245 +++++++++++ .../zap-generated/test/Commands.h | 403 ++++++++++++++++++ 7 files changed, 892 insertions(+), 65 deletions(-) diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 82d7d55a1ff0ea..92707327668eba 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -9536,3 +9536,27 @@ PICS: - label: "Does the device implement sending the ChangeToModeResponse command?" id: RVCCLEANMS.S.C03.Tx + + # + #Operational State + # + #Server Attributes + - label: "Does the device implement the CountdownTime attribute?" + id: OPSTATE.S.A0002 + + #Events Generated + - label: "Does the device generate the OperationCompltion event?" + id: OPSTATE.S.E01 + + #Server Commands Received + - label: "Does the device implement receiving the Pause command?" + id: OPSTATE.S.C00 + + - label: "Does the device implement receiving the Stop command?" + id: OPSTATE.S.C01 + + - label: "Does the device implement receiving the Start command?" + id: OPSTATE.S.C02 + + - label: "Does the device implement receiving the Resume command?" + id: OPSTATE.S.C03 diff --git a/src/app/tests/suites/certification/Test_TC_OPSTATE_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OPSTATE_1_1.yaml index 3f5e2e062c46f8..8f95d577fdf6b5 100644 --- a/src/app/tests/suites/certification/Test_TC_OPSTATE_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OPSTATE_1_1.yaml @@ -32,7 +32,6 @@ tests: value: nodeId - label: "TH reads the ClusterRevision attribute from the DUT" - PICS: OPSTATE.S.Afffd command: "readAttribute" attribute: "ClusterRevision" response: @@ -41,7 +40,6 @@ tests: type: int16u - label: "TH reads the FeatureMap attribute from the DUT" - PICS: OPSTATE.S.Afffc command: "readAttribute" attribute: "FeatureMap" response: @@ -50,7 +48,6 @@ tests: type: bitmap32 - label: "TH reads the AttributeList attribute from the DUT" - PICS: OPSTATE.S.Afffb command: "readAttribute" attribute: "AttributeList" response: @@ -62,7 +59,7 @@ tests: - label: "TH reads from the DUT the optional attribute(CountdownTime) in the AttributeList from the DUT" - PICS: OPSTATE.S.A0002 && OPSTATE.S.Afffb + PICS: OPSTATE.S.A0002 command: "readAttribute" attribute: "AttributeList" response: @@ -71,7 +68,6 @@ tests: contains: [2] - label: "TH reads from the DUT the EventList attribute." - PICS: OPSTATE.S.Afffa command: "readAttribute" attribute: "EventList" response: @@ -82,7 +78,7 @@ tests: - label: "TH reads from the DUT the optional event(OperationCompletion) in EventList." - PICS: OPSTATE.S.E01 && OPSTATE.S.Afffa + PICS: OPSTATE.S.E01 command: "readAttribute" attribute: "EventList" response: @@ -91,7 +87,7 @@ tests: contains: [0x01] - label: "Read the optional command(Start) in AcceptedCommandList" - PICS: OPSTATE.S.C02 && OPSTATE.S.Afff9 + PICS: OPSTATE.S.C02 command: "readAttribute" attribute: "AcceptedCommandList" response: @@ -100,7 +96,7 @@ tests: contains: [1, 2] - label: "Read the optional command(Stop) in AcceptedCommandList" - PICS: OPSTATE.S.C01 && OPSTATE.S.Afff9 + PICS: OPSTATE.S.C01 command: "readAttribute" attribute: "AcceptedCommandList" response: @@ -109,7 +105,7 @@ tests: contains: [1] - label: "Read the optional command(Pause) in AcceptedCommandList" - PICS: OPSTATE.S.C00 && OPSTATE.S.Afff9 + PICS: OPSTATE.S.C00 command: "readAttribute" attribute: "AcceptedCommandList" response: @@ -118,7 +114,7 @@ tests: contains: [0, 3] - label: "Read the optional command(Resume) in AcceptedCommandList" - PICS: OPSTATE.S.C03 && OPSTATE.S.Afff9 + PICS: OPSTATE.S.C03 command: "readAttribute" attribute: "AcceptedCommandList" response: @@ -128,7 +124,7 @@ tests: - label: "Read the global attribute: GeneratedCommandList" PICS: - OPSTATE.S.Afff8 && (OPSTATE.S.C00 || OPSTATE.S.C01 || OPSTATE.S.C02 || + (OPSTATE.S.C00 || OPSTATE.S.C01 || OPSTATE.S.C02 || OPSTATE.S.C03) command: "readAttribute" attribute: "GeneratedCommandList" diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 0264ad8fe3be8d..12f84b6f559b05 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -1827,6 +1827,19 @@ OPCREDS.C.C09.Tx=1 OPCREDS.C.C0a.Tx=1 OPCREDS.C.C0b.Tx=1 +# Operational State +# Server Attributes +OPSTATE.S.A0002=1 + +# Server Events +OPSTATE.S.E01=1 + +# Server Commands +OPSTATE.S.C00=1 +OPSTATE.S.C01=1 +OPSTATE.S.C02=1 +OPSTATE.S.C03=1 + # Thermostat # Server TSTAT.S=1 diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index 71a6406bfa2c2b..654936839eb917 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -11,14 +11,24 @@ "Test_TC_ACL_2_9", "Test_TC_ACL_2_10" ], - "AccessControlEnforcement": ["Test_TC_ACE_1_1", "Test_TC_ACE_1_5"], - "BooleanState": ["Test_TC_BOOL_1_1", "Test_TC_BOOL_2_1"], - "Binding": ["Test_TC_BIND_1_1"], + "AccessControlEnforcement": [ + "Test_TC_ACE_1_1", + "Test_TC_ACE_1_5" + ], + "BooleanState": [ + "Test_TC_BOOL_1_1", + "Test_TC_BOOL_2_1" + ], + "Binding": [ + "Test_TC_BIND_1_1" + ], "BridgedDeviceBasicInformation": [ "Test_TC_BRBINFO_1_1", "Test_TC_BRBINFO_2_1" ], - "Actions": ["Test_TC_ACT_1_1"], + "Actions": [ + "Test_TC_ACT_1_1" + ], "ColorControl": [ "Test_TC_CC_1_1", "Test_TC_CC_2_1", @@ -49,15 +59,25 @@ "Test_TC_BINFO_2_1", "Test_TC_CNET_1_3" ], - "Descriptor": ["Test_TC_DESC_1_1"], + "Descriptor": [ + "Test_TC_DESC_1_1" + ], "EthernetNetworkDiagnostics": [ "Test_TC_DGETH_1_1", "Test_TC_DGETH_2_1", "Test_TC_DGETH_2_2" ], - "DiagnosticsLogs": ["Test_TC_DLOG_1_1"], - "FlowMeasurement": ["Test_TC_FLW_1_1", "Test_TC_FLW_2_1"], - "FixedLabel": ["Test_TC_FLABEL_1_1", "Test_TC_FLABEL_2_1"], + "DiagnosticsLogs": [ + "Test_TC_DLOG_1_1" + ], + "FlowMeasurement": [ + "Test_TC_FLW_1_1", + "Test_TC_FLW_2_1" + ], + "FixedLabel": [ + "Test_TC_FLABEL_1_1", + "Test_TC_FLABEL_2_1" + ], "FanControl": [ "Test_TC_FAN_1_1", "Test_TC_FAN_2_1", @@ -69,9 +89,18 @@ "Test_TC_FAN_3_2", "Test_TC_FAN_3_4" ], - "GeneralCommissioning": ["Test_TC_CGEN_1_1", "Test_TC_CGEN_2_1"], - "GeneralDiagnostics": ["Test_TC_DGGEN_1_1", "Test_TC_DGGEN_2_1"], - "IcdManagement": ["Test_TC_ICDM_1_1", "Test_TC_ICDM_2_1"], + "GeneralCommissioning": [ + "Test_TC_CGEN_1_1", + "Test_TC_CGEN_2_1" + ], + "GeneralDiagnostics": [ + "Test_TC_DGGEN_1_1", + "Test_TC_DGGEN_2_1" + ], + "IcdManagement": [ + "Test_TC_ICDM_1_1", + "Test_TC_ICDM_2_1" + ], "Identify": [ "Test_TC_I_1_1", "Test_TC_I_2_1", @@ -98,9 +127,16 @@ "Test_TC_LVL_6_1", "Test_TC_LVL_7_1" ], - "LocalizationConfiguration": ["Test_TC_LCFG_1_1"], - "TimeFormatLocalization": ["Test_TC_LTIME_1_2"], - "UnitLocalization": ["Test_TC_LUNIT_1_2", "Test_TC_LUNIT_3_1"], + "LocalizationConfiguration": [ + "Test_TC_LCFG_1_1" + ], + "TimeFormatLocalization": [ + "Test_TC_LTIME_1_2" + ], + "UnitLocalization": [ + "Test_TC_LUNIT_1_2", + "Test_TC_LUNIT_3_1" + ], "UserLabel": [ "Test_TC_ULABEL_1_1", "Test_TC_ULABEL_2_1", @@ -151,16 +187,26 @@ "Test_TC_CONTENTLAUNCHER_10_5", "Test_TC_CONTENTLAUNCHER_10_7" ], - "ModeSelect": ["Test_TC_MOD_1_1"], + "ModeSelect": [ + "Test_TC_MOD_1_1" + ], "MultipleFabrics": [], - "OTASoftwareUpdate": ["OTA_SuccessfulTransfer"], + "OTASoftwareUpdate": [ + "OTA_SuccessfulTransfer" + ], "OnOff": [ "Test_TC_OO_1_1", "Test_TC_OO_2_1", "Test_TC_OO_2_2", "Test_TC_OO_2_4" ], - "PowerSource": ["Test_TC_PS_1_1", "Test_TC_PS_2_1"], + "OperationalState": [ + "Test_TC_OPSTATE_1_1" + ], + "PowerSource": [ + "Test_TC_PS_1_1", + "Test_TC_PS_2_1" + ], "PressureMeasurement": [ "Test_TC_PRS_1_1", "Test_TC_PRS_2_1", @@ -173,12 +219,30 @@ "Test_TC_PCC_2_3", "Test_TC_PCC_2_4" ], - "PowerSourceConfiguration": ["Test_TC_PSCFG_1_1", "Test_TC_PSCFG_2_1"], - "RelativeHumidityMeasurement": ["Test_TC_RH_1_1", "Test_TC_RH_2_1"], - "SecureChannel": ["Test_TC_SC_5_1", "Test_TC_SC_5_2"], - "Switch": ["Test_TC_SWTCH_1_1", "Test_TC_SWTCH_2_1"], - "TemperatureMeasurement": ["Test_TC_TMP_1_1", "Test_TC_TMP_2_1"], - "Thermostat": ["Test_TC_TSTAT_1_1", "Test_TC_TSTAT_2_1"], + "PowerSourceConfiguration": [ + "Test_TC_PSCFG_1_1", + "Test_TC_PSCFG_2_1" + ], + "RelativeHumidityMeasurement": [ + "Test_TC_RH_1_1", + "Test_TC_RH_2_1" + ], + "SecureChannel": [ + "Test_TC_SC_5_1", + "Test_TC_SC_5_2" + ], + "Switch": [ + "Test_TC_SWTCH_1_1", + "Test_TC_SWTCH_2_1" + ], + "TemperatureMeasurement": [ + "Test_TC_TMP_1_1", + "Test_TC_TMP_2_1" + ], + "Thermostat": [ + "Test_TC_TSTAT_1_1", + "Test_TC_TSTAT_2_1" + ], "ThermostatUserConfiguration": [ "Test_TC_TSUIC_1_1", "Test_TC_TSUIC_2_1", @@ -191,7 +255,10 @@ "Test_TC_DGTHREAD_2_3", "Test_TC_DGTHREAD_2_4" ], - "TimeSynchronization": ["Test_TC_TIMESYNC_1_1", "Test_TC_TIMESYNC_2_3"], + "TimeSynchronization": [ + "Test_TC_TIMESYNC_1_1", + "Test_TC_TIMESYNC_2_3" + ], "WiFiNetworkDiagnostics": [ "Test_TC_DGWIFI_1_1", "Test_TC_DGWIFI_2_1", @@ -260,8 +327,12 @@ "TestTimeSynchronization", "TestOperationalState" ], - "MultiAdmin": ["TestMultiAdmin"], - "SoftwareDiagnostics": ["Test_TC_DGSW_1_1"], + "MultiAdmin": [ + "TestMultiAdmin" + ], + "SoftwareDiagnostics": [ + "Test_TC_DGSW_1_1" + ], "Subscriptions": [ "TestSubscribe_OnOff", "TestSubscribe_AdministratorCommissioning" @@ -288,7 +359,9 @@ "Test_TC_G_1_1", "Test_TC_G_2_1" ], - "Scenes": ["Test_TC_S_1_1"], + "Scenes": [ + "Test_TC_S_1_1" + ], "ReplaceableMonitoring": [ "Test_TC_ACFREMON_1_1", "Test_TC_ACFREMON_2_1", @@ -315,7 +388,10 @@ "Test_TC_ZEOFREMON_1_1", "Test_TC_ZEOFREMON_2_1" ], - "AirQuality": ["Test_TC_AIRQUAL_1_1", "Test_TC_AIRQUAL_2_1"], + "AirQuality": [ + "Test_TC_AIRQUAL_1_1", + "Test_TC_AIRQUAL_2_1" + ], "ConcentrationMeasurement": [ "Test_TC_CDOCONC_1_1", "Test_TC_CDOCONC_2_1", @@ -370,6 +446,7 @@ "OTASoftwareUpdate", "OccupancySensing", "OnOff", + "OperationalState", "PowerSource", "PressureMeasurement", "PumpConfigurationControl", @@ -394,4 +471,4 @@ "Groups", "ReplaceableMonitoring" ] -} +} \ No newline at end of file diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index 5fd2b511e5caa1..8251e1af7c6e58 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -55,7 +55,12 @@ "Test_TC_BDX_2_4", "Test_TC_BDX_2_5" ], - "bridge": ["Test_TC_BR_1", "Test_TC_BR_2", "Test_TC_BR_3", "Test_TC_BR_4"], + "bridge": [ + "Test_TC_BR_1", + "Test_TC_BR_2", + "Test_TC_BR_3", + "Test_TC_BR_4" + ], "DeviceAttestation": [ "Test_TC_DA_1_1", "Test_TC_DA_1_2", @@ -99,14 +104,20 @@ "Test_TC_DLOG_2_2", "Test_TC_DLOG_3_1" ], - "Descriptor": ["Test_TC_DESC_2_1"], - "GeneralCommissioning": ["Test_TC_CGEN_2_2"], + "Descriptor": [ + "Test_TC_DESC_2_1" + ], + "GeneralCommissioning": [ + "Test_TC_CGEN_2_2" + ], "GeneralDiagnostics": [ "Test_TC_DGGEN_2_2", "Test_TC_DGGEN_2_3", "Test_TC_DGGEN_3_1" ], - "Identify": ["Test_TC_I_3_2"], + "Identify": [ + "Test_TC_I_3_2" + ], "IlluminanceMeasurement": [], "InteractionDataModel": [ "Test_TC_IDM_1_1", @@ -202,7 +213,9 @@ "Test_TC_SU_4_1", "Test_TC_SU_4_2" ], - "PowerSourceConfiguration": ["Test_TC_PSCFG_2_2"], + "PowerSourceConfiguration": [ + "Test_TC_PSCFG_2_2" + ], "PressureMeasurement": [], "SecureChannel": [ "Test_TC_SC_1_1", @@ -236,12 +249,23 @@ "Test_TC_DGSW_2_3" ], "EthernetNetworkDiagnostics": [], - "WiFiNetworkDiagnostics": ["Test_TC_DGWIFI_2_2"], + "WiFiNetworkDiagnostics": [ + "Test_TC_DGWIFI_2_2" + ], "WindowCovering": [], - "FlowMeasurement": ["Test_TC_FLW_2_2"], - "OccupancySensing": ["Test_TC_OCC_3_1"], - "PowerSource": ["Test_TC_PS_2_2", "Test_TC_PS_3_1"], - "BooleanState": ["Test_TC_BOOL_2_2"], + "FlowMeasurement": [ + "Test_TC_FLW_2_2" + ], + "OccupancySensing": [ + "Test_TC_OCC_3_1" + ], + "PowerSource": [ + "Test_TC_PS_2_2", + "Test_TC_PS_3_1" + ], + "BooleanState": [ + "Test_TC_BOOL_2_2" + ], "ColorControl": [ "Test_TC_CC_3_1", "Test_TC_CC_7_1", @@ -249,20 +273,53 @@ "Test_TC_CC_9_2", "Test_TC_CC_9_3" ], - "DoorLock": ["Test_TC_DRLK_2_10", "Test_TC_DRLK_3_2", "Test_TC_DRLK_3_3"], - "LocalizationConfiguration": ["Test_TC_LCFG_2_1"], - "LevelControl": ["Test_TC_LVL_8_1"], - "OnOff": ["Test_TC_OO_2_3"], - "RelativeHumidityMeasurement": ["Test_TC_RH_2_2"], - "Switch": ["Test_TC_SWTCH_2_2", "Test_TC_SWTCH_3_2"], - "TemperatureMeasurement": ["Test_TC_TMP_2_2"], - "Thermostat": ["Test_TC_TSTAT_3_1", "Test_TC_TSTAT_3_2"], + "DoorLock": [ + "Test_TC_DRLK_2_10", + "Test_TC_DRLK_3_2", + "Test_TC_DRLK_3_3" + ], + "LocalizationConfiguration": [ + "Test_TC_LCFG_2_1" + ], + "LevelControl": [ + "Test_TC_LVL_8_1" + ], + "OnOff": [ + "Test_TC_OO_2_3" + ], + "RelativeHumidityMeasurement": [ + "Test_TC_RH_2_2" + ], + "Switch": [ + "Test_TC_SWTCH_2_2", + "Test_TC_SWTCH_3_2" + ], + "TemperatureMeasurement": [ + "Test_TC_TMP_2_2" + ], + "Thermostat": [ + "Test_TC_TSTAT_3_1", + "Test_TC_TSTAT_3_2" + ], "ThermostatUserConfiguration": [], - "ThreadNetworkDiagnostics": ["Test_TC_DGTHREAD_2_5"], - "Actions": ["Test_TC_ACT_2_1", "Test_TC_ACT_2_2", "Test_TC_ACT_3_2"], - "TimeFormatLocalization": ["Test_TC_LTIME_2_1", "Test_TC_LTIME_3_1"], + "ThreadNetworkDiagnostics": [ + "Test_TC_DGTHREAD_2_5" + ], + "Actions": [ + "Test_TC_ACT_2_1", + "Test_TC_ACT_2_2", + "Test_TC_ACT_3_2" + ], + "TimeFormatLocalization": [ + "Test_TC_LTIME_2_1", + "Test_TC_LTIME_3_1" + ], "UnitLocalization": [], - "Binding": ["Test_TC_BIND_2_1", "Test_TC_BIND_2_2", "Test_TC_BIND_2_3"], + "Binding": [ + "Test_TC_BIND_2_1", + "Test_TC_BIND_2_2", + "Test_TC_BIND_2_3" + ], "Scenes": [ "Test_TC_S_1_1", "Test_TC_S_2_1", @@ -272,13 +329,24 @@ "Test_TC_S_3_1" ], "PumpConfigurationControl": [], - "AccessControl": ["Test_TC_ACL_2_5", "Test_TC_ACL_2_6"], + "AccessControl": [ + "Test_TC_ACL_2_5", + "Test_TC_ACL_2_6" + ], "UserLabel": [], "BridgedDeviceBasicInformation": [ "Test_TC_BRBINFO_2_2", "Test_TC_BRBINFO_2_3" ], - "AccessControlEnforcement": ["Test_TC_ACE_1_2", "Test_TC_ACE_1_6"], + "AccessControlEnforcement": [ + "Test_TC_ACE_1_2", + "Test_TC_ACE_1_6" + ], + "OperationalState": [ + "Test_TC_OPSTATE_2_1", + "Test_TC_OPSTATE_2_2", + "Test_TC_OPSTATE_2_3" + ], "collection": [ "DeviceDiscovery", "Groups", @@ -313,6 +381,7 @@ "LocalizationConfiguration", "LevelControl", "OnOff", + "OperationalState", "RelativeHumidityMeasurement", "Switch", "TemperatureMeasurement", @@ -330,4 +399,4 @@ "BridgedDeviceBasicInformation", "AccessControlEnforcement" ] -} +} \ No newline at end of file diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index feda117830052c..31392e9486c57a 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -194,6 +194,7 @@ class TestList : public Command printf("Test_TC_OO_2_1\n"); printf("Test_TC_OO_2_2\n"); printf("Test_TC_OO_2_4\n"); + printf("Test_TC_OPSTATE_1_1\n"); printf("Test_TC_PS_1_1\n"); printf("Test_TC_PS_2_1\n"); printf("Test_TC_PRS_1_1\n"); @@ -54093,6 +54094,249 @@ class Test_TC_OO_2_4Suite : public TestCommand } }; +class Test_TC_OPSTATE_1_1Suite : public TestCommand +{ +public: + Test_TC_OPSTATE_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_OPSTATE_1_1", 12, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_OPSTATE_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads the ClusterRevision attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads the FeatureMap attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, OperationalState::Attributes::FeatureMap::Id, + true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads the AttributeList attribute from the DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads from the DUT the optional attribute(CountdownTime) in the AttributeList from the DUT"); + VerifyOrDo(!ShouldSkip("OPSTATE.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads from the DUT the EventList attribute."); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, OperationalState::Attributes::EventList::Id, + true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads from the DUT the optional event(OperationCompletion) in EventList."); + VerifyOrDo(!ShouldSkip("OPSTATE.S.E01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, OperationalState::Attributes::EventList::Id, + true, chip::NullOptional); + } + case 7: { + LogStep(7, "Read the optional command(Start) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("OPSTATE.S.C02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Read the optional command(Stop) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("OPSTATE.S.C01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Read the optional command(Pause) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("OPSTATE.S.C00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Read the optional command(Resume) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("OPSTATE.S.C03"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Read the global attribute: GeneratedCommandList"); + VerifyOrDo(!ShouldSkip("(OPSTATE.S.C00 || OPSTATE.S.C01 || OPSTATE.S.C02 || OPSTATE.S.C03)"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OperationalState::Id, + OperationalState::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + class Test_TC_PS_1_1Suite : public TestCommand { public: @@ -139050,6 +139294,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 7e47aa29ac6c57..96ded131061aa6 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -154,6 +154,7 @@ class TestList : public Command { printf("Test_TC_OO_2_1\n"); printf("Test_TC_OO_2_2\n"); printf("Test_TC_OO_2_4\n"); + printf("Test_TC_OPSTATE_1_1\n"); printf("Test_TC_PS_1_1\n"); printf("Test_TC_PS_2_1\n"); printf("Test_TC_PRS_1_1\n"); @@ -62459,6 +62460,407 @@ class Test_TC_OO_2_4 : public TestCommandBridge { } }; +class Test_TC_OPSTATE_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_OPSTATE_1_1() + : TestCommandBridge("Test_TC_OPSTATE_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_OPSTATE_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_OPSTATE_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OPSTATE_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision attribute from the DUT\n"); + err = TestThReadsTheClusterRevisionAttributeFromTheDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the FeatureMap attribute from the DUT\n"); + err = TestThReadsTheFeatureMapAttributeFromTheDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads the AttributeList attribute from the DUT\n"); + err = TestThReadsTheAttributeListAttributeFromTheDut_3(); + break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : TH reads from the DUT the optional attribute(CountdownTime) in the AttributeList from the " + "DUT\n"); + if (ShouldSkip("OPSTATE.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsFromTheDutTheOptionalAttributeCountdownTimeInTheAttributeListFromTheDut_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the EventList attribute.\n"); + NextTest(); + return; + case 6: + ChipLogProgress( + chipTool, " ***** Test Step 6 : TH reads from the DUT the optional event(OperationCompletion) in EventList.\n"); + if (ShouldSkip("OPSTATE.S.E01")) { + NextTest(); + return; + } + NextTest(); + return; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Read the optional command(Start) in AcceptedCommandList\n"); + if (ShouldSkip("OPSTATE.S.C02")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandStartInAcceptedCommandList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the optional command(Stop) in AcceptedCommandList\n"); + if (ShouldSkip("OPSTATE.S.C01")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandStopInAcceptedCommandList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional command(Pause) in AcceptedCommandList\n"); + if (ShouldSkip("OPSTATE.S.C00")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandPauseInAcceptedCommandList_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Read the optional command(Resume) in AcceptedCommandList\n"); + if (ShouldSkip("OPSTATE.S.C03")) { + NextTest(); + return; + } + err = TestReadTheOptionalCommandResumeInAcceptedCommandList_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Read the global attribute: GeneratedCommandList\n"); + if (ShouldSkip("(OPSTATE.S.C00 || OPSTATE.S.C01 || OPSTATE.S.C02 || OPSTATE.S.C03)")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeGeneratedCommandList_11(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 12; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsTheClusterRevisionAttributeFromTheDut_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the ClusterRevision attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheFeatureMapAttributeFromTheDut_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the FeatureMap attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheAttributeListAttributeFromTheDut_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the AttributeList attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsFromTheDutTheOptionalAttributeCountdownTimeInTheAttributeListFromTheDut_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads from the DUT the optional attribute(CountdownTime) in the AttributeList from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalCommandStartInAcceptedCommandList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command(Start) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalCommandStopInAcceptedCommandList_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command(Stop) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalCommandPauseInAcceptedCommandList_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command(Pause) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheOptionalCommandResumeInAcceptedCommandList_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the optional command(Resume) in AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 4UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class Test_TC_PS_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -149900,6 +150302,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), From 8be9157a365c6b99fde029ec98c9ab4c4215e8d6 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 13 Jul 2023 21:04:53 +0000 Subject: [PATCH 02/11] Restyled by whitespace --- src/app/tests/suites/certification/Test_TC_OPSTATE_1_1.yaml | 6 +++--- src/app/tests/suites/ciTests.json | 2 +- src/app/tests/suites/manualTests.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_OPSTATE_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OPSTATE_1_1.yaml index 8f95d577fdf6b5..4beddcd12b8dd6 100644 --- a/src/app/tests/suites/certification/Test_TC_OPSTATE_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OPSTATE_1_1.yaml @@ -96,7 +96,7 @@ tests: contains: [1, 2] - label: "Read the optional command(Stop) in AcceptedCommandList" - PICS: OPSTATE.S.C01 + PICS: OPSTATE.S.C01 command: "readAttribute" attribute: "AcceptedCommandList" response: @@ -105,7 +105,7 @@ tests: contains: [1] - label: "Read the optional command(Pause) in AcceptedCommandList" - PICS: OPSTATE.S.C00 + PICS: OPSTATE.S.C00 command: "readAttribute" attribute: "AcceptedCommandList" response: @@ -114,7 +114,7 @@ tests: contains: [0, 3] - label: "Read the optional command(Resume) in AcceptedCommandList" - PICS: OPSTATE.S.C03 + PICS: OPSTATE.S.C03 command: "readAttribute" attribute: "AcceptedCommandList" response: diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index 654936839eb917..a2d04588c9ec96 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -471,4 +471,4 @@ "Groups", "ReplaceableMonitoring" ] -} \ No newline at end of file +} diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index 8251e1af7c6e58..f5ef6f3be48d5d 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -399,4 +399,4 @@ "BridgedDeviceBasicInformation", "AccessControlEnforcement" ] -} \ No newline at end of file +} From a8e20f5c79ed9ca41de5cd139b9453766a4afd55 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 13 Jul 2023 21:05:07 +0000 Subject: [PATCH 03/11] Restyled by prettier-json --- src/app/tests/suites/ciTests.json | 133 ++++++-------------------- src/app/tests/suites/manualTests.json | 111 +++++---------------- 2 files changed, 53 insertions(+), 191 deletions(-) diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index a2d04588c9ec96..d8be70d1f907de 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -11,24 +11,14 @@ "Test_TC_ACL_2_9", "Test_TC_ACL_2_10" ], - "AccessControlEnforcement": [ - "Test_TC_ACE_1_1", - "Test_TC_ACE_1_5" - ], - "BooleanState": [ - "Test_TC_BOOL_1_1", - "Test_TC_BOOL_2_1" - ], - "Binding": [ - "Test_TC_BIND_1_1" - ], + "AccessControlEnforcement": ["Test_TC_ACE_1_1", "Test_TC_ACE_1_5"], + "BooleanState": ["Test_TC_BOOL_1_1", "Test_TC_BOOL_2_1"], + "Binding": ["Test_TC_BIND_1_1"], "BridgedDeviceBasicInformation": [ "Test_TC_BRBINFO_1_1", "Test_TC_BRBINFO_2_1" ], - "Actions": [ - "Test_TC_ACT_1_1" - ], + "Actions": ["Test_TC_ACT_1_1"], "ColorControl": [ "Test_TC_CC_1_1", "Test_TC_CC_2_1", @@ -59,25 +49,15 @@ "Test_TC_BINFO_2_1", "Test_TC_CNET_1_3" ], - "Descriptor": [ - "Test_TC_DESC_1_1" - ], + "Descriptor": ["Test_TC_DESC_1_1"], "EthernetNetworkDiagnostics": [ "Test_TC_DGETH_1_1", "Test_TC_DGETH_2_1", "Test_TC_DGETH_2_2" ], - "DiagnosticsLogs": [ - "Test_TC_DLOG_1_1" - ], - "FlowMeasurement": [ - "Test_TC_FLW_1_1", - "Test_TC_FLW_2_1" - ], - "FixedLabel": [ - "Test_TC_FLABEL_1_1", - "Test_TC_FLABEL_2_1" - ], + "DiagnosticsLogs": ["Test_TC_DLOG_1_1"], + "FlowMeasurement": ["Test_TC_FLW_1_1", "Test_TC_FLW_2_1"], + "FixedLabel": ["Test_TC_FLABEL_1_1", "Test_TC_FLABEL_2_1"], "FanControl": [ "Test_TC_FAN_1_1", "Test_TC_FAN_2_1", @@ -89,18 +69,9 @@ "Test_TC_FAN_3_2", "Test_TC_FAN_3_4" ], - "GeneralCommissioning": [ - "Test_TC_CGEN_1_1", - "Test_TC_CGEN_2_1" - ], - "GeneralDiagnostics": [ - "Test_TC_DGGEN_1_1", - "Test_TC_DGGEN_2_1" - ], - "IcdManagement": [ - "Test_TC_ICDM_1_1", - "Test_TC_ICDM_2_1" - ], + "GeneralCommissioning": ["Test_TC_CGEN_1_1", "Test_TC_CGEN_2_1"], + "GeneralDiagnostics": ["Test_TC_DGGEN_1_1", "Test_TC_DGGEN_2_1"], + "IcdManagement": ["Test_TC_ICDM_1_1", "Test_TC_ICDM_2_1"], "Identify": [ "Test_TC_I_1_1", "Test_TC_I_2_1", @@ -127,16 +98,9 @@ "Test_TC_LVL_6_1", "Test_TC_LVL_7_1" ], - "LocalizationConfiguration": [ - "Test_TC_LCFG_1_1" - ], - "TimeFormatLocalization": [ - "Test_TC_LTIME_1_2" - ], - "UnitLocalization": [ - "Test_TC_LUNIT_1_2", - "Test_TC_LUNIT_3_1" - ], + "LocalizationConfiguration": ["Test_TC_LCFG_1_1"], + "TimeFormatLocalization": ["Test_TC_LTIME_1_2"], + "UnitLocalization": ["Test_TC_LUNIT_1_2", "Test_TC_LUNIT_3_1"], "UserLabel": [ "Test_TC_ULABEL_1_1", "Test_TC_ULABEL_2_1", @@ -187,26 +151,17 @@ "Test_TC_CONTENTLAUNCHER_10_5", "Test_TC_CONTENTLAUNCHER_10_7" ], - "ModeSelect": [ - "Test_TC_MOD_1_1" - ], + "ModeSelect": ["Test_TC_MOD_1_1"], "MultipleFabrics": [], - "OTASoftwareUpdate": [ - "OTA_SuccessfulTransfer" - ], + "OTASoftwareUpdate": ["OTA_SuccessfulTransfer"], "OnOff": [ "Test_TC_OO_1_1", "Test_TC_OO_2_1", "Test_TC_OO_2_2", "Test_TC_OO_2_4" ], - "OperationalState": [ - "Test_TC_OPSTATE_1_1" - ], - "PowerSource": [ - "Test_TC_PS_1_1", - "Test_TC_PS_2_1" - ], + "OperationalState": ["Test_TC_OPSTATE_1_1"], + "PowerSource": ["Test_TC_PS_1_1", "Test_TC_PS_2_1"], "PressureMeasurement": [ "Test_TC_PRS_1_1", "Test_TC_PRS_2_1", @@ -219,30 +174,12 @@ "Test_TC_PCC_2_3", "Test_TC_PCC_2_4" ], - "PowerSourceConfiguration": [ - "Test_TC_PSCFG_1_1", - "Test_TC_PSCFG_2_1" - ], - "RelativeHumidityMeasurement": [ - "Test_TC_RH_1_1", - "Test_TC_RH_2_1" - ], - "SecureChannel": [ - "Test_TC_SC_5_1", - "Test_TC_SC_5_2" - ], - "Switch": [ - "Test_TC_SWTCH_1_1", - "Test_TC_SWTCH_2_1" - ], - "TemperatureMeasurement": [ - "Test_TC_TMP_1_1", - "Test_TC_TMP_2_1" - ], - "Thermostat": [ - "Test_TC_TSTAT_1_1", - "Test_TC_TSTAT_2_1" - ], + "PowerSourceConfiguration": ["Test_TC_PSCFG_1_1", "Test_TC_PSCFG_2_1"], + "RelativeHumidityMeasurement": ["Test_TC_RH_1_1", "Test_TC_RH_2_1"], + "SecureChannel": ["Test_TC_SC_5_1", "Test_TC_SC_5_2"], + "Switch": ["Test_TC_SWTCH_1_1", "Test_TC_SWTCH_2_1"], + "TemperatureMeasurement": ["Test_TC_TMP_1_1", "Test_TC_TMP_2_1"], + "Thermostat": ["Test_TC_TSTAT_1_1", "Test_TC_TSTAT_2_1"], "ThermostatUserConfiguration": [ "Test_TC_TSUIC_1_1", "Test_TC_TSUIC_2_1", @@ -255,10 +192,7 @@ "Test_TC_DGTHREAD_2_3", "Test_TC_DGTHREAD_2_4" ], - "TimeSynchronization": [ - "Test_TC_TIMESYNC_1_1", - "Test_TC_TIMESYNC_2_3" - ], + "TimeSynchronization": ["Test_TC_TIMESYNC_1_1", "Test_TC_TIMESYNC_2_3"], "WiFiNetworkDiagnostics": [ "Test_TC_DGWIFI_1_1", "Test_TC_DGWIFI_2_1", @@ -327,12 +261,8 @@ "TestTimeSynchronization", "TestOperationalState" ], - "MultiAdmin": [ - "TestMultiAdmin" - ], - "SoftwareDiagnostics": [ - "Test_TC_DGSW_1_1" - ], + "MultiAdmin": ["TestMultiAdmin"], + "SoftwareDiagnostics": ["Test_TC_DGSW_1_1"], "Subscriptions": [ "TestSubscribe_OnOff", "TestSubscribe_AdministratorCommissioning" @@ -359,9 +289,7 @@ "Test_TC_G_1_1", "Test_TC_G_2_1" ], - "Scenes": [ - "Test_TC_S_1_1" - ], + "Scenes": ["Test_TC_S_1_1"], "ReplaceableMonitoring": [ "Test_TC_ACFREMON_1_1", "Test_TC_ACFREMON_2_1", @@ -388,10 +316,7 @@ "Test_TC_ZEOFREMON_1_1", "Test_TC_ZEOFREMON_2_1" ], - "AirQuality": [ - "Test_TC_AIRQUAL_1_1", - "Test_TC_AIRQUAL_2_1" - ], + "AirQuality": ["Test_TC_AIRQUAL_1_1", "Test_TC_AIRQUAL_2_1"], "ConcentrationMeasurement": [ "Test_TC_CDOCONC_1_1", "Test_TC_CDOCONC_2_1", diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index f5ef6f3be48d5d..233d3ce7dd8c9f 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -55,12 +55,7 @@ "Test_TC_BDX_2_4", "Test_TC_BDX_2_5" ], - "bridge": [ - "Test_TC_BR_1", - "Test_TC_BR_2", - "Test_TC_BR_3", - "Test_TC_BR_4" - ], + "bridge": ["Test_TC_BR_1", "Test_TC_BR_2", "Test_TC_BR_3", "Test_TC_BR_4"], "DeviceAttestation": [ "Test_TC_DA_1_1", "Test_TC_DA_1_2", @@ -104,20 +99,14 @@ "Test_TC_DLOG_2_2", "Test_TC_DLOG_3_1" ], - "Descriptor": [ - "Test_TC_DESC_2_1" - ], - "GeneralCommissioning": [ - "Test_TC_CGEN_2_2" - ], + "Descriptor": ["Test_TC_DESC_2_1"], + "GeneralCommissioning": ["Test_TC_CGEN_2_2"], "GeneralDiagnostics": [ "Test_TC_DGGEN_2_2", "Test_TC_DGGEN_2_3", "Test_TC_DGGEN_3_1" ], - "Identify": [ - "Test_TC_I_3_2" - ], + "Identify": ["Test_TC_I_3_2"], "IlluminanceMeasurement": [], "InteractionDataModel": [ "Test_TC_IDM_1_1", @@ -213,9 +202,7 @@ "Test_TC_SU_4_1", "Test_TC_SU_4_2" ], - "PowerSourceConfiguration": [ - "Test_TC_PSCFG_2_2" - ], + "PowerSourceConfiguration": ["Test_TC_PSCFG_2_2"], "PressureMeasurement": [], "SecureChannel": [ "Test_TC_SC_1_1", @@ -249,23 +236,12 @@ "Test_TC_DGSW_2_3" ], "EthernetNetworkDiagnostics": [], - "WiFiNetworkDiagnostics": [ - "Test_TC_DGWIFI_2_2" - ], + "WiFiNetworkDiagnostics": ["Test_TC_DGWIFI_2_2"], "WindowCovering": [], - "FlowMeasurement": [ - "Test_TC_FLW_2_2" - ], - "OccupancySensing": [ - "Test_TC_OCC_3_1" - ], - "PowerSource": [ - "Test_TC_PS_2_2", - "Test_TC_PS_3_1" - ], - "BooleanState": [ - "Test_TC_BOOL_2_2" - ], + "FlowMeasurement": ["Test_TC_FLW_2_2"], + "OccupancySensing": ["Test_TC_OCC_3_1"], + "PowerSource": ["Test_TC_PS_2_2", "Test_TC_PS_3_1"], + "BooleanState": ["Test_TC_BOOL_2_2"], "ColorControl": [ "Test_TC_CC_3_1", "Test_TC_CC_7_1", @@ -273,53 +249,20 @@ "Test_TC_CC_9_2", "Test_TC_CC_9_3" ], - "DoorLock": [ - "Test_TC_DRLK_2_10", - "Test_TC_DRLK_3_2", - "Test_TC_DRLK_3_3" - ], - "LocalizationConfiguration": [ - "Test_TC_LCFG_2_1" - ], - "LevelControl": [ - "Test_TC_LVL_8_1" - ], - "OnOff": [ - "Test_TC_OO_2_3" - ], - "RelativeHumidityMeasurement": [ - "Test_TC_RH_2_2" - ], - "Switch": [ - "Test_TC_SWTCH_2_2", - "Test_TC_SWTCH_3_2" - ], - "TemperatureMeasurement": [ - "Test_TC_TMP_2_2" - ], - "Thermostat": [ - "Test_TC_TSTAT_3_1", - "Test_TC_TSTAT_3_2" - ], + "DoorLock": ["Test_TC_DRLK_2_10", "Test_TC_DRLK_3_2", "Test_TC_DRLK_3_3"], + "LocalizationConfiguration": ["Test_TC_LCFG_2_1"], + "LevelControl": ["Test_TC_LVL_8_1"], + "OnOff": ["Test_TC_OO_2_3"], + "RelativeHumidityMeasurement": ["Test_TC_RH_2_2"], + "Switch": ["Test_TC_SWTCH_2_2", "Test_TC_SWTCH_3_2"], + "TemperatureMeasurement": ["Test_TC_TMP_2_2"], + "Thermostat": ["Test_TC_TSTAT_3_1", "Test_TC_TSTAT_3_2"], "ThermostatUserConfiguration": [], - "ThreadNetworkDiagnostics": [ - "Test_TC_DGTHREAD_2_5" - ], - "Actions": [ - "Test_TC_ACT_2_1", - "Test_TC_ACT_2_2", - "Test_TC_ACT_3_2" - ], - "TimeFormatLocalization": [ - "Test_TC_LTIME_2_1", - "Test_TC_LTIME_3_1" - ], + "ThreadNetworkDiagnostics": ["Test_TC_DGTHREAD_2_5"], + "Actions": ["Test_TC_ACT_2_1", "Test_TC_ACT_2_2", "Test_TC_ACT_3_2"], + "TimeFormatLocalization": ["Test_TC_LTIME_2_1", "Test_TC_LTIME_3_1"], "UnitLocalization": [], - "Binding": [ - "Test_TC_BIND_2_1", - "Test_TC_BIND_2_2", - "Test_TC_BIND_2_3" - ], + "Binding": ["Test_TC_BIND_2_1", "Test_TC_BIND_2_2", "Test_TC_BIND_2_3"], "Scenes": [ "Test_TC_S_1_1", "Test_TC_S_2_1", @@ -329,19 +272,13 @@ "Test_TC_S_3_1" ], "PumpConfigurationControl": [], - "AccessControl": [ - "Test_TC_ACL_2_5", - "Test_TC_ACL_2_6" - ], + "AccessControl": ["Test_TC_ACL_2_5", "Test_TC_ACL_2_6"], "UserLabel": [], "BridgedDeviceBasicInformation": [ "Test_TC_BRBINFO_2_2", "Test_TC_BRBINFO_2_3" ], - "AccessControlEnforcement": [ - "Test_TC_ACE_1_2", - "Test_TC_ACE_1_6" - ], + "AccessControlEnforcement": ["Test_TC_ACE_1_2", "Test_TC_ACE_1_6"], "OperationalState": [ "Test_TC_OPSTATE_2_1", "Test_TC_OPSTATE_2_2", From d022978402e51982dabdcf3b4ca0fe613d6f84b0 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 13 Jul 2023 21:05:33 +0000 Subject: [PATCH 04/11] Restyled by prettier-yaml --- src/app/tests/suites/certification/Test_TC_OPSTATE_1_1.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_OPSTATE_1_1.yaml b/src/app/tests/suites/certification/Test_TC_OPSTATE_1_1.yaml index 4beddcd12b8dd6..c4e3694536081e 100644 --- a/src/app/tests/suites/certification/Test_TC_OPSTATE_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OPSTATE_1_1.yaml @@ -123,9 +123,7 @@ tests: contains: [0, 3] - label: "Read the global attribute: GeneratedCommandList" - PICS: - (OPSTATE.S.C00 || OPSTATE.S.C01 || OPSTATE.S.C02 || - OPSTATE.S.C03) + PICS: (OPSTATE.S.C00 || OPSTATE.S.C01 || OPSTATE.S.C02 || OPSTATE.S.C03) command: "readAttribute" attribute: "GeneratedCommandList" response: From 03b694a7747f52e3a0b512c015507fd6fb0ccb90 Mon Sep 17 00:00:00 2001 From: "m.trayer" Date: Thu, 13 Jul 2023 16:26:09 -0500 Subject: [PATCH 05/11] Revert change to manualtests.json --- src/app/tests/suites/manualTests.json | 117 +++++++++++++++++++------- 1 file changed, 87 insertions(+), 30 deletions(-) diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index 233d3ce7dd8c9f..045c42101e73c3 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -55,7 +55,12 @@ "Test_TC_BDX_2_4", "Test_TC_BDX_2_5" ], - "bridge": ["Test_TC_BR_1", "Test_TC_BR_2", "Test_TC_BR_3", "Test_TC_BR_4"], + "bridge": [ + "Test_TC_BR_1", + "Test_TC_BR_2", + "Test_TC_BR_3", + "Test_TC_BR_4" + ], "DeviceAttestation": [ "Test_TC_DA_1_1", "Test_TC_DA_1_2", @@ -99,14 +104,20 @@ "Test_TC_DLOG_2_2", "Test_TC_DLOG_3_1" ], - "Descriptor": ["Test_TC_DESC_2_1"], - "GeneralCommissioning": ["Test_TC_CGEN_2_2"], + "Descriptor": [ + "Test_TC_DESC_2_1" + ], + "GeneralCommissioning": [ + "Test_TC_CGEN_2_2" + ], "GeneralDiagnostics": [ "Test_TC_DGGEN_2_2", "Test_TC_DGGEN_2_3", "Test_TC_DGGEN_3_1" ], - "Identify": ["Test_TC_I_3_2"], + "Identify": [ + "Test_TC_I_3_2" + ], "IlluminanceMeasurement": [], "InteractionDataModel": [ "Test_TC_IDM_1_1", @@ -202,7 +213,9 @@ "Test_TC_SU_4_1", "Test_TC_SU_4_2" ], - "PowerSourceConfiguration": ["Test_TC_PSCFG_2_2"], + "PowerSourceConfiguration": [ + "Test_TC_PSCFG_2_2" + ], "PressureMeasurement": [], "SecureChannel": [ "Test_TC_SC_1_1", @@ -236,12 +249,23 @@ "Test_TC_DGSW_2_3" ], "EthernetNetworkDiagnostics": [], - "WiFiNetworkDiagnostics": ["Test_TC_DGWIFI_2_2"], + "WiFiNetworkDiagnostics": [ + "Test_TC_DGWIFI_2_2" + ], "WindowCovering": [], - "FlowMeasurement": ["Test_TC_FLW_2_2"], - "OccupancySensing": ["Test_TC_OCC_3_1"], - "PowerSource": ["Test_TC_PS_2_2", "Test_TC_PS_3_1"], - "BooleanState": ["Test_TC_BOOL_2_2"], + "FlowMeasurement": [ + "Test_TC_FLW_2_2" + ], + "OccupancySensing": [ + "Test_TC_OCC_3_1" + ], + "PowerSource": [ + "Test_TC_PS_2_2", + "Test_TC_PS_3_1" + ], + "BooleanState": [ + "Test_TC_BOOL_2_2" + ], "ColorControl": [ "Test_TC_CC_3_1", "Test_TC_CC_7_1", @@ -249,20 +273,53 @@ "Test_TC_CC_9_2", "Test_TC_CC_9_3" ], - "DoorLock": ["Test_TC_DRLK_2_10", "Test_TC_DRLK_3_2", "Test_TC_DRLK_3_3"], - "LocalizationConfiguration": ["Test_TC_LCFG_2_1"], - "LevelControl": ["Test_TC_LVL_8_1"], - "OnOff": ["Test_TC_OO_2_3"], - "RelativeHumidityMeasurement": ["Test_TC_RH_2_2"], - "Switch": ["Test_TC_SWTCH_2_2", "Test_TC_SWTCH_3_2"], - "TemperatureMeasurement": ["Test_TC_TMP_2_2"], - "Thermostat": ["Test_TC_TSTAT_3_1", "Test_TC_TSTAT_3_2"], + "DoorLock": [ + "Test_TC_DRLK_2_10", + "Test_TC_DRLK_3_2", + "Test_TC_DRLK_3_3" + ], + "LocalizationConfiguration": [ + "Test_TC_LCFG_2_1" + ], + "LevelControl": [ + "Test_TC_LVL_8_1" + ], + "OnOff": [ + "Test_TC_OO_2_3" + ], + "RelativeHumidityMeasurement": [ + "Test_TC_RH_2_2" + ], + "Switch": [ + "Test_TC_SWTCH_2_2", + "Test_TC_SWTCH_3_2" + ], + "TemperatureMeasurement": [ + "Test_TC_TMP_2_2" + ], + "Thermostat": [ + "Test_TC_TSTAT_3_1", + "Test_TC_TSTAT_3_2" + ], "ThermostatUserConfiguration": [], - "ThreadNetworkDiagnostics": ["Test_TC_DGTHREAD_2_5"], - "Actions": ["Test_TC_ACT_2_1", "Test_TC_ACT_2_2", "Test_TC_ACT_3_2"], - "TimeFormatLocalization": ["Test_TC_LTIME_2_1", "Test_TC_LTIME_3_1"], + "ThreadNetworkDiagnostics": [ + "Test_TC_DGTHREAD_2_5" + ], + "Actions": [ + "Test_TC_ACT_2_1", + "Test_TC_ACT_2_2", + "Test_TC_ACT_3_2" + ], + "TimeFormatLocalization": [ + "Test_TC_LTIME_2_1", + "Test_TC_LTIME_3_1" + ], "UnitLocalization": [], - "Binding": ["Test_TC_BIND_2_1", "Test_TC_BIND_2_2", "Test_TC_BIND_2_3"], + "Binding": [ + "Test_TC_BIND_2_1", + "Test_TC_BIND_2_2", + "Test_TC_BIND_2_3" + ], "Scenes": [ "Test_TC_S_1_1", "Test_TC_S_2_1", @@ -272,17 +329,18 @@ "Test_TC_S_3_1" ], "PumpConfigurationControl": [], - "AccessControl": ["Test_TC_ACL_2_5", "Test_TC_ACL_2_6"], + "AccessControl": [ + "Test_TC_ACL_2_5", + "Test_TC_ACL_2_6" + ], "UserLabel": [], "BridgedDeviceBasicInformation": [ "Test_TC_BRBINFO_2_2", "Test_TC_BRBINFO_2_3" ], - "AccessControlEnforcement": ["Test_TC_ACE_1_2", "Test_TC_ACE_1_6"], - "OperationalState": [ - "Test_TC_OPSTATE_2_1", - "Test_TC_OPSTATE_2_2", - "Test_TC_OPSTATE_2_3" + "AccessControlEnforcement": [ + "Test_TC_ACE_1_2", + "Test_TC_ACE_1_6" ], "collection": [ "DeviceDiscovery", @@ -318,7 +376,6 @@ "LocalizationConfiguration", "LevelControl", "OnOff", - "OperationalState", "RelativeHumidityMeasurement", "Switch", "TemperatureMeasurement", @@ -336,4 +393,4 @@ "BridgedDeviceBasicInformation", "AccessControlEnforcement" ] -} +} \ No newline at end of file From eea725c18db0197c3ab355679cb10cba37062184 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 13 Jul 2023 21:27:00 +0000 Subject: [PATCH 06/11] Restyled by whitespace --- src/app/tests/suites/manualTests.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index 045c42101e73c3..135151eaf2d9f9 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -393,4 +393,4 @@ "BridgedDeviceBasicInformation", "AccessControlEnforcement" ] -} \ No newline at end of file +} From 452ab39a0e333aeb098730dd17165f2ac102ec61 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 13 Jul 2023 21:27:03 +0000 Subject: [PATCH 07/11] Restyled by prettier-json --- src/app/tests/suites/manualTests.json | 111 ++++++-------------------- 1 file changed, 24 insertions(+), 87 deletions(-) diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index 135151eaf2d9f9..5fd2b511e5caa1 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -55,12 +55,7 @@ "Test_TC_BDX_2_4", "Test_TC_BDX_2_5" ], - "bridge": [ - "Test_TC_BR_1", - "Test_TC_BR_2", - "Test_TC_BR_3", - "Test_TC_BR_4" - ], + "bridge": ["Test_TC_BR_1", "Test_TC_BR_2", "Test_TC_BR_3", "Test_TC_BR_4"], "DeviceAttestation": [ "Test_TC_DA_1_1", "Test_TC_DA_1_2", @@ -104,20 +99,14 @@ "Test_TC_DLOG_2_2", "Test_TC_DLOG_3_1" ], - "Descriptor": [ - "Test_TC_DESC_2_1" - ], - "GeneralCommissioning": [ - "Test_TC_CGEN_2_2" - ], + "Descriptor": ["Test_TC_DESC_2_1"], + "GeneralCommissioning": ["Test_TC_CGEN_2_2"], "GeneralDiagnostics": [ "Test_TC_DGGEN_2_2", "Test_TC_DGGEN_2_3", "Test_TC_DGGEN_3_1" ], - "Identify": [ - "Test_TC_I_3_2" - ], + "Identify": ["Test_TC_I_3_2"], "IlluminanceMeasurement": [], "InteractionDataModel": [ "Test_TC_IDM_1_1", @@ -213,9 +202,7 @@ "Test_TC_SU_4_1", "Test_TC_SU_4_2" ], - "PowerSourceConfiguration": [ - "Test_TC_PSCFG_2_2" - ], + "PowerSourceConfiguration": ["Test_TC_PSCFG_2_2"], "PressureMeasurement": [], "SecureChannel": [ "Test_TC_SC_1_1", @@ -249,23 +236,12 @@ "Test_TC_DGSW_2_3" ], "EthernetNetworkDiagnostics": [], - "WiFiNetworkDiagnostics": [ - "Test_TC_DGWIFI_2_2" - ], + "WiFiNetworkDiagnostics": ["Test_TC_DGWIFI_2_2"], "WindowCovering": [], - "FlowMeasurement": [ - "Test_TC_FLW_2_2" - ], - "OccupancySensing": [ - "Test_TC_OCC_3_1" - ], - "PowerSource": [ - "Test_TC_PS_2_2", - "Test_TC_PS_3_1" - ], - "BooleanState": [ - "Test_TC_BOOL_2_2" - ], + "FlowMeasurement": ["Test_TC_FLW_2_2"], + "OccupancySensing": ["Test_TC_OCC_3_1"], + "PowerSource": ["Test_TC_PS_2_2", "Test_TC_PS_3_1"], + "BooleanState": ["Test_TC_BOOL_2_2"], "ColorControl": [ "Test_TC_CC_3_1", "Test_TC_CC_7_1", @@ -273,53 +249,20 @@ "Test_TC_CC_9_2", "Test_TC_CC_9_3" ], - "DoorLock": [ - "Test_TC_DRLK_2_10", - "Test_TC_DRLK_3_2", - "Test_TC_DRLK_3_3" - ], - "LocalizationConfiguration": [ - "Test_TC_LCFG_2_1" - ], - "LevelControl": [ - "Test_TC_LVL_8_1" - ], - "OnOff": [ - "Test_TC_OO_2_3" - ], - "RelativeHumidityMeasurement": [ - "Test_TC_RH_2_2" - ], - "Switch": [ - "Test_TC_SWTCH_2_2", - "Test_TC_SWTCH_3_2" - ], - "TemperatureMeasurement": [ - "Test_TC_TMP_2_2" - ], - "Thermostat": [ - "Test_TC_TSTAT_3_1", - "Test_TC_TSTAT_3_2" - ], + "DoorLock": ["Test_TC_DRLK_2_10", "Test_TC_DRLK_3_2", "Test_TC_DRLK_3_3"], + "LocalizationConfiguration": ["Test_TC_LCFG_2_1"], + "LevelControl": ["Test_TC_LVL_8_1"], + "OnOff": ["Test_TC_OO_2_3"], + "RelativeHumidityMeasurement": ["Test_TC_RH_2_2"], + "Switch": ["Test_TC_SWTCH_2_2", "Test_TC_SWTCH_3_2"], + "TemperatureMeasurement": ["Test_TC_TMP_2_2"], + "Thermostat": ["Test_TC_TSTAT_3_1", "Test_TC_TSTAT_3_2"], "ThermostatUserConfiguration": [], - "ThreadNetworkDiagnostics": [ - "Test_TC_DGTHREAD_2_5" - ], - "Actions": [ - "Test_TC_ACT_2_1", - "Test_TC_ACT_2_2", - "Test_TC_ACT_3_2" - ], - "TimeFormatLocalization": [ - "Test_TC_LTIME_2_1", - "Test_TC_LTIME_3_1" - ], + "ThreadNetworkDiagnostics": ["Test_TC_DGTHREAD_2_5"], + "Actions": ["Test_TC_ACT_2_1", "Test_TC_ACT_2_2", "Test_TC_ACT_3_2"], + "TimeFormatLocalization": ["Test_TC_LTIME_2_1", "Test_TC_LTIME_3_1"], "UnitLocalization": [], - "Binding": [ - "Test_TC_BIND_2_1", - "Test_TC_BIND_2_2", - "Test_TC_BIND_2_3" - ], + "Binding": ["Test_TC_BIND_2_1", "Test_TC_BIND_2_2", "Test_TC_BIND_2_3"], "Scenes": [ "Test_TC_S_1_1", "Test_TC_S_2_1", @@ -329,19 +272,13 @@ "Test_TC_S_3_1" ], "PumpConfigurationControl": [], - "AccessControl": [ - "Test_TC_ACL_2_5", - "Test_TC_ACL_2_6" - ], + "AccessControl": ["Test_TC_ACL_2_5", "Test_TC_ACL_2_6"], "UserLabel": [], "BridgedDeviceBasicInformation": [ "Test_TC_BRBINFO_2_2", "Test_TC_BRBINFO_2_3" ], - "AccessControlEnforcement": [ - "Test_TC_ACE_1_2", - "Test_TC_ACE_1_6" - ], + "AccessControlEnforcement": ["Test_TC_ACE_1_2", "Test_TC_ACE_1_6"], "collection": [ "DeviceDiscovery", "Groups", From 64fcb0b8d7ca1c9bcb2f66f763389e6bd23216bc Mon Sep 17 00:00:00 2001 From: "m.trayer" Date: Mon, 17 Jul 2023 11:15:01 -0500 Subject: [PATCH 08/11] Exclude test from Darwin --- examples/darwin-framework-tool/templates/tests/ciTests.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/darwin-framework-tool/templates/tests/ciTests.json b/examples/darwin-framework-tool/templates/tests/ciTests.json index 7260c76ca3a53d..0053b4e6f64389 100644 --- a/examples/darwin-framework-tool/templates/tests/ciTests.json +++ b/examples/darwin-framework-tool/templates/tests/ciTests.json @@ -114,6 +114,8 @@ "Test_TC_ACFREMON_2_1", "Disabled due to HEPAFilterMonitoring not being enabled in Matter.framework for now:", "Test_TC_HEPAFREMON_1_1", - "Test_TC_HEPAFREMON_2_1" + "Test_TC_HEPAFREMON_2_1", + "Disabled due to OperationalState not being enabled in Matter.framework for now:", + "Test_TC_OPSTATE_1_1" ] -} +} \ No newline at end of file From 0fb542288b088f3e52f5cea8fe85584cbd56b729 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Mon, 17 Jul 2023 16:15:55 +0000 Subject: [PATCH 09/11] Restyled by whitespace --- examples/darwin-framework-tool/templates/tests/ciTests.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/darwin-framework-tool/templates/tests/ciTests.json b/examples/darwin-framework-tool/templates/tests/ciTests.json index 0053b4e6f64389..1152d7a9bf8586 100644 --- a/examples/darwin-framework-tool/templates/tests/ciTests.json +++ b/examples/darwin-framework-tool/templates/tests/ciTests.json @@ -118,4 +118,4 @@ "Disabled due to OperationalState not being enabled in Matter.framework for now:", "Test_TC_OPSTATE_1_1" ] -} \ No newline at end of file +} From 4186d436ab4b45a7882c7282fdd5e5614e2c05b2 Mon Sep 17 00:00:00 2001 From: "m.trayer" Date: Mon, 17 Jul 2023 12:09:04 -0500 Subject: [PATCH 10/11] Update with results of regen --- .../zap-generated/test/Commands.h | 403 ------------------ 1 file changed, 403 deletions(-) diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index e72e9f5abecb68..8cbd89fe9f47cf 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -153,7 +153,6 @@ class TestList : public Command { printf("Test_TC_OO_2_1\n"); printf("Test_TC_OO_2_2\n"); printf("Test_TC_OO_2_4\n"); - printf("Test_TC_OPSTATE_1_1\n"); printf("Test_TC_PS_1_1\n"); printf("Test_TC_PS_2_1\n"); printf("Test_TC_PRS_1_1\n"); @@ -62321,407 +62320,6 @@ class Test_TC_OO_2_4 : public TestCommandBridge { } }; -class Test_TC_OPSTATE_1_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_OPSTATE_1_1() - : TestCommandBridge("Test_TC_OPSTATE_1_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_OPSTATE_1_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_OPSTATE_1_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_OPSTATE_1_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision attribute from the DUT\n"); - err = TestThReadsTheClusterRevisionAttributeFromTheDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the FeatureMap attribute from the DUT\n"); - err = TestThReadsTheFeatureMapAttributeFromTheDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads the AttributeList attribute from the DUT\n"); - err = TestThReadsTheAttributeListAttributeFromTheDut_3(); - break; - case 4: - ChipLogProgress(chipTool, - " ***** Test Step 4 : TH reads from the DUT the optional attribute(CountdownTime) in the AttributeList from the " - "DUT\n"); - if (ShouldSkip("OPSTATE.S.A0002")) { - NextTest(); - return; - } - err = TestThReadsFromTheDutTheOptionalAttributeCountdownTimeInTheAttributeListFromTheDut_4(); - break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads from the DUT the EventList attribute.\n"); - NextTest(); - return; - case 6: - ChipLogProgress( - chipTool, " ***** Test Step 6 : TH reads from the DUT the optional event(OperationCompletion) in EventList.\n"); - if (ShouldSkip("OPSTATE.S.E01")) { - NextTest(); - return; - } - NextTest(); - return; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Read the optional command(Start) in AcceptedCommandList\n"); - if (ShouldSkip("OPSTATE.S.C02")) { - NextTest(); - return; - } - err = TestReadTheOptionalCommandStartInAcceptedCommandList_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Read the optional command(Stop) in AcceptedCommandList\n"); - if (ShouldSkip("OPSTATE.S.C01")) { - NextTest(); - return; - } - err = TestReadTheOptionalCommandStopInAcceptedCommandList_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Read the optional command(Pause) in AcceptedCommandList\n"); - if (ShouldSkip("OPSTATE.S.C00")) { - NextTest(); - return; - } - err = TestReadTheOptionalCommandPauseInAcceptedCommandList_9(); - break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Read the optional command(Resume) in AcceptedCommandList\n"); - if (ShouldSkip("OPSTATE.S.C03")) { - NextTest(); - return; - } - err = TestReadTheOptionalCommandResumeInAcceptedCommandList_10(); - break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Read the global attribute: GeneratedCommandList\n"); - if (ShouldSkip("(OPSTATE.S.C00 || OPSTATE.S.C01 || OPSTATE.S.C02 || OPSTATE.S.C03)")) { - NextTest(); - return; - } - err = TestReadTheGlobalAttributeGeneratedCommandList_11(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestThReadsTheClusterRevisionAttributeFromTheDut_1() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the ClusterRevision attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); - } - - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsTheFeatureMapAttributeFromTheDut_2() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the FeatureMap attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } - - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsTheAttributeListAttributeFromTheDut_3() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the AttributeList attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsFromTheDutTheOptionalAttributeCountdownTimeInTheAttributeListFromTheDut_4() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads from the DUT the optional attribute(CountdownTime) in the AttributeList from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalCommandStartInAcceptedCommandList_7() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional command(Start) in AcceptedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalCommandStopInAcceptedCommandList_8() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional command(Stop) in AcceptedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 1UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalCommandPauseInAcceptedCommandList_9() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional command(Pause) in AcceptedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheOptionalCommandResumeInAcceptedCommandList_10() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the optional command(Resume) in AcceptedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_11() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOperationalState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 4UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - class Test_TC_PS_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -149056,7 +148654,6 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), - make_unique(), make_unique(), make_unique(), make_unique(), From 123e8d1434e7e5fac53f64b71a20d853648cd405 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Mon, 17 Jul 2023 17:10:19 +0000 Subject: [PATCH 11/11] Restyled by whitespace --- examples/darwin-framework-tool/templates/tests/ciTests.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/darwin-framework-tool/templates/tests/ciTests.json b/examples/darwin-framework-tool/templates/tests/ciTests.json index 6946fff52d0c47..6bbdca3711641f 100644 --- a/examples/darwin-framework-tool/templates/tests/ciTests.json +++ b/examples/darwin-framework-tool/templates/tests/ciTests.json @@ -120,4 +120,4 @@ "Disabled due to Events verification not supported", "Test_TC_BINFO_2_2" ] -} \ No newline at end of file +}