From 4741160789680c5bd31a1c91993134c67bdd524b Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Thu, 20 Jul 2023 15:32:34 -0700 Subject: [PATCH] Regenerating ZAP (#28137) --- .github/workflows/zap_regeneration.yaml | 22 +- .../CHIP/zap-generated/MTRBaseClusters.h | 2 + .../zap-generated/test/Commands.h | 316 +++++++++++++++--- 3 files changed, 268 insertions(+), 72 deletions(-) diff --git a/.github/workflows/zap_regeneration.yaml b/.github/workflows/zap_regeneration.yaml index d15cbc5f004f29..86f8439f1f4f49 100644 --- a/.github/workflows/zap_regeneration.yaml +++ b/.github/workflows/zap_regeneration.yaml @@ -48,21 +48,7 @@ jobs: - name: Generate all run: ./scripts/run_in_build_env.sh scripts/tools/zap_regen_all.py - - name: Ensure git works in current working directory - run: git config --global --add safe.directory `pwd` - - name: Add uncommitted changes - run: git add . - - name: Fix upstream - run: | - git remote set-url origin https://x-access-token:$COMMITTER_TOKEN@github.com/$GITHUB_REPOSITORY.git - git config --global user.email "$USER_EMAIL" - git config --global user.name "$USER_NAME" - env: - COMMITTER_TOKEN: ${{ secrets.MATTER_PAT }} - USER_EMAIL: ${{ secrets.MATTER_PAT_EMAIL }} - USER_NAME: ${{ secrets.MATTER_PAT_NAME }} - GITHUB_REPOSITORY: ${{ github.GITHUB_REPOSITORY }} - - name: Commit - run: git commit -a -m "Regenerating ZAP" - - name: Push - run: git push + - uses: EndBug/add-and-commit@v9 + with: + default_author: github_actions + message: Regenerating ZAP diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 222a04933852f2..73bbdf12755f6a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -26642,6 +26642,7 @@ typedef NS_ENUM(uint8_t, MTRHEPAFilterMonitoringProductIdentifierType) { typedef NS_OPTIONS(uint32_t, MTRHEPAFilterMonitoringFeature) { MTRHEPAFilterMonitoringFeatureCondition MTR_PROVISIONALLY_AVAILABLE = 0x1, MTRHEPAFilterMonitoringFeatureWarning MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTRHEPAFilterMonitoringFeatureReplacementProductList MTR_PROVISIONALLY_AVAILABLE = 0x3, } MTR_PROVISIONALLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRActivatedCarbonFilterMonitoringChangeIndication) { @@ -26666,6 +26667,7 @@ typedef NS_ENUM(uint8_t, MTRActivatedCarbonFilterMonitoringProductIdentifierType typedef NS_OPTIONS(uint32_t, MTRActivatedCarbonFilterMonitoringFeature) { MTRActivatedCarbonFilterMonitoringFeatureCondition MTR_PROVISIONALLY_AVAILABLE = 0x1, MTRActivatedCarbonFilterMonitoringFeatureWarning MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTRActivatedCarbonFilterMonitoringFeatureReplacementProductList MTR_PROVISIONALLY_AVAILABLE = 0x3, } MTR_PROVISIONALLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRDoorLockAlarmCode) { 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 fcb43c9a9b430b..aba39585a18687 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -171348,7 +171348,7 @@ class Test_TC_ACFREMON_1_1 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3a: Read the global attribute: FeatureMap\n"); - if (ShouldSkip("!ACFREMON.S.F00 && !ACFREMON.S.F01")) { + if (ShouldSkip("!ACFREMON.S.F00 && !ACFREMON.S.F01 && !ACFREMON.S.F02")) { NextTest(); return; } @@ -171373,47 +171373,57 @@ class Test_TC_ACFREMON_1_1 : public TestCommandBridge { err = TestStep3cGivenACFREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4a: Read the global attribute: AttributeList\n"); - err = TestStep4aReadTheGlobalAttributeAttributeList_5(); + ChipLogProgress(chipTool, + " ***** Test Step 5 : Step 3d: Given ACFREMON.S.F01(ReplacementProductList) ensure featuremap has the correct bit " + "set\n"); + if (ShouldSkip("ACFREMON.S.F02")) { + NextTest(); + return; + } + err = TestStep3dGivenACFREMONSF01ReplacementProductListEnsureFeaturemapHasTheCorrectBitSet_5(); break; case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 4a: Read the global attribute: AttributeList\n"); + err = TestStep4aReadTheGlobalAttributeAttributeList_6(); + break; + case 7: ChipLogProgress( - chipTool, " ***** Test Step 6 : Step 4b: Read the feature dependent(ACFREMON.S.F00) attribute in AttributeList\n"); + chipTool, " ***** Test Step 7 : Step 4b: Read the feature dependent(ACFREMON.S.F00) attribute in AttributeList\n"); if (ShouldSkip("ACFREMON.S.F00")) { NextTest(); return; } - err = TestStep4bReadTheFeatureDependentACFREMONSF00AttributeInAttributeList_6(); + err = TestStep4bReadTheFeatureDependentACFREMONSF00AttributeInAttributeList_7(); break; - case 7: + case 8: ChipLogProgress(chipTool, - " ***** Test Step 7 : Step 4c: Read the optional attribute InPlaceIndicator (ACFREMON.S.A0002) in AttributeList\n"); + " ***** Test Step 8 : Step 4c: Read the optional attribute InPlaceIndicator (ACFREMON.S.A0002) in AttributeList\n"); if (ShouldSkip("ACFREMON.S.A0002")) { NextTest(); return; } - err = TestStep4cReadTheOptionalAttributeInPlaceIndicatorAcfremonsa0002InAttributeList_7(); + err = TestStep4cReadTheOptionalAttributeInPlaceIndicatorAcfremonsa0002InAttributeList_8(); break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Step 5: TH reads EventList attribute from DUT\n"); + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Step 5: TH reads EventList attribute from DUT\n"); NextTest(); return; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Step 6a: Read the global attribute: AcceptedCommandList\n"); - err = TestStep6aReadTheGlobalAttributeAcceptedCommandList_9(); - break; case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Step 6a: Read the global attribute: AcceptedCommandList\n"); + err = TestStep6aReadTheGlobalAttributeAcceptedCommandList_10(); + break; + case 11: ChipLogProgress( - chipTool, " ***** Test Step 10 : Step 6b: Read the optional command (ResetCondition) in AcceptedCommandList\n"); + chipTool, " ***** Test Step 11 : Step 6b: Read the optional command (ResetCondition) in AcceptedCommandList\n"); if (ShouldSkip("ACFREMON.S.C00.Rsp")) { NextTest(); return; } - err = TestStep6bReadTheOptionalCommandResetConditionInAcceptedCommandList_10(); + err = TestStep6bReadTheOptionalCommandResetConditionInAcceptedCommandList_11(); break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Step 7: Read the global attribute: GeneratedCommandList\n"); - err = TestStep7ReadTheGlobalAttributeGeneratedCommandList_11(); + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Step 7: Read the global attribute: GeneratedCommandList\n"); + err = TestStep7ReadTheGlobalAttributeGeneratedCommandList_12(); break; } @@ -171462,6 +171472,9 @@ class Test_TC_ACFREMON_1_1 : public TestCommandBridge { case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -171475,7 +171488,7 @@ class Test_TC_ACFREMON_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; + const uint16_t mTestCount = 13; chip::Optional mNodeId; chip::Optional mCluster; @@ -171584,7 +171597,29 @@ class Test_TC_ACFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4aReadTheGlobalAttributeAttributeList_5() + CHIP_ERROR TestStep3dGivenACFREMONSF01ReplacementProductListEnsureFeaturemapHasTheCorrectBitSet_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog( + @"Step 3d: Given ACFREMON.S.F01(ReplacementProductList) ensure featuremap has the correct bit set Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4aReadTheGlobalAttributeAttributeList_6() { MTRBaseDevice * device = GetDevice("alpha"); @@ -171613,7 +171648,7 @@ class Test_TC_ACFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4bReadTheFeatureDependentACFREMONSF00AttributeInAttributeList_6() + CHIP_ERROR TestStep4bReadTheFeatureDependentACFREMONSF00AttributeInAttributeList_7() { MTRBaseDevice * device = GetDevice("alpha"); @@ -171630,6 +171665,7 @@ class Test_TC_ACFREMON_1_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); NextTest(); }]; @@ -171637,7 +171673,7 @@ class Test_TC_ACFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4cReadTheOptionalAttributeInPlaceIndicatorAcfremonsa0002InAttributeList_7() + CHIP_ERROR TestStep4cReadTheOptionalAttributeInPlaceIndicatorAcfremonsa0002InAttributeList_8() { MTRBaseDevice * device = GetDevice("alpha"); @@ -171660,7 +171696,7 @@ class Test_TC_ACFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6aReadTheGlobalAttributeAcceptedCommandList_9() + CHIP_ERROR TestStep6aReadTheGlobalAttributeAcceptedCommandList_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -171681,7 +171717,7 @@ class Test_TC_ACFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6bReadTheOptionalCommandResetConditionInAcceptedCommandList_10() + CHIP_ERROR TestStep6bReadTheOptionalCommandResetConditionInAcceptedCommandList_11() { MTRBaseDevice * device = GetDevice("alpha"); @@ -171704,7 +171740,7 @@ class Test_TC_ACFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep7ReadTheGlobalAttributeGeneratedCommandList_11() + CHIP_ERROR TestStep7ReadTheGlobalAttributeGeneratedCommandList_12() { MTRBaseDevice * device = GetDevice("alpha"); @@ -171805,6 +171841,22 @@ class Test_TC_ACFREMON_2_1 : public TestCommandBridge { } err = TestStep5ThReadsFromTheDutTheInPlaceIndicatorAttribute_4(); break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 6: TH reads from the DUT the LastChangedTime attribute\n"); + if (ShouldSkip("ACFREMON.S.A0004")) { + NextTest(); + return; + } + err = TestStep6ThReadsFromTheDutTheLastChangedTimeAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 7: TH reads from the DUT the ReplacementProductList attribute\n"); + if (ShouldSkip("ACFREMON.S.A0005")) { + NextTest(); + return; + } + err = TestStep7ThReadsFromTheDutTheReplacementProductListAttribute_6(); + break; } if (CHIP_NO_ERROR != err) { @@ -171831,6 +171883,12 @@ class Test_TC_ACFREMON_2_1 : public TestCommandBridge { 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; } // Go on to the next test. @@ -171844,7 +171902,7 @@ class Test_TC_ACFREMON_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; @@ -171951,6 +172009,52 @@ class Test_TC_ACFREMON_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestStep6ThReadsFromTheDutTheLastChangedTimeAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLastChangedTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6: TH reads from the DUT the LastChangedTime attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("lastChangedTime", "epoch_s", "epoch_s")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep7ThReadsFromTheDutTheReplacementProductListAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeReplacementProductListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 7: TH reads from the DUT the ReplacementProductList attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("replacementProductList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_HEPAFREMON_1_1 : public TestCommandBridge { @@ -172001,7 +172105,7 @@ class Test_TC_HEPAFREMON_1_1 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3a: Read the global attribute: FeatureMap\n"); - if (ShouldSkip("!HEPAFREMON.S.F00 && !HEPAFREMON.S.F01")) { + if (ShouldSkip("!HEPAFREMON.S.F00 && !HEPAFREMON.S.F01 && !HEPAFREMON.S.F02")) { NextTest(); return; } @@ -172026,48 +172130,58 @@ class Test_TC_HEPAFREMON_1_1 : public TestCommandBridge { err = TestStep3cGivenHEPAFREMONSF01WarningEnsureFeaturemapHasTheCorrectBitSet_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4: Read the global attribute: AttributeList\n"); - err = TestStep4ReadTheGlobalAttributeAttributeList_5(); + ChipLogProgress(chipTool, + " ***** Test Step 5 : Step 3d: Given HEPAFREMON.S.F02(ReplacementProductList) ensure featuremap has the correct " + "bit set\n"); + if (ShouldSkip("HEPAFREMON.S.F02")) { + NextTest(); + return; + } + err = TestStep3dGivenHEPAFREMONSF02ReplacementProductListEnsureFeaturemapHasTheCorrectBitSet_5(); break; case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 4: Read the global attribute: AttributeList\n"); + err = TestStep4ReadTheGlobalAttributeAttributeList_6(); + break; + case 7: ChipLogProgress(chipTool, - " ***** Test Step 6 : Step 4a: Read the feature dependent(HEPAFREMON.S.F00) attribute in AttributeList\n"); + " ***** Test Step 7 : Step 4a: Read the feature dependent(HEPAFREMON.S.F00) attribute in AttributeList\n"); if (ShouldSkip("HEPAFREMON.S.F00")) { NextTest(); return; } - err = TestStep4aReadTheFeatureDependentHEPAFREMONSF00AttributeInAttributeList_6(); + err = TestStep4aReadTheFeatureDependentHEPAFREMONSF00AttributeInAttributeList_7(); break; - case 7: + case 8: ChipLogProgress(chipTool, - " ***** Test Step 7 : Step 4b: Read the optional attribute InPlaceIndicator (HEPAFREMON.S.A0002) in " + " ***** Test Step 8 : Step 4b: Read the optional attribute InPlaceIndicator (HEPAFREMON.S.A0002) in " "AttributeList\n"); if (ShouldSkip("HEPAFREMON.S.A0002")) { NextTest(); return; } - err = TestStep4bReadTheOptionalAttributeInPlaceIndicatorHepafremonsa0002InAttributeList_7(); + err = TestStep4bReadTheOptionalAttributeInPlaceIndicatorHepafremonsa0002InAttributeList_8(); break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Step 5: TH reads EventList attribute from DUT\n"); + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Step 5: TH reads EventList attribute from DUT\n"); NextTest(); return; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Step 6a: Read the global attribute: AcceptedCommandList\n"); - err = TestStep6aReadTheGlobalAttributeAcceptedCommandList_9(); - break; case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Step 6a: Read the global attribute: AcceptedCommandList\n"); + err = TestStep6aReadTheGlobalAttributeAcceptedCommandList_10(); + break; + case 11: ChipLogProgress( - chipTool, " ***** Test Step 10 : Step 6b: Read the optional command (ResetCondition) in AcceptedCommandList\n"); + chipTool, " ***** Test Step 11 : Step 6b: Read the optional command (ResetCondition) in AcceptedCommandList\n"); if (ShouldSkip("HEPAFREMON.S.C00.Rsp")) { NextTest(); return; } - err = TestStep6bReadTheOptionalCommandResetConditionInAcceptedCommandList_10(); + err = TestStep6bReadTheOptionalCommandResetConditionInAcceptedCommandList_11(); break; - case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Step 7: Read the global attribute: GeneratedCommandList\n"); - err = TestStep7ReadTheGlobalAttributeGeneratedCommandList_11(); + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Step 7: Read the global attribute: GeneratedCommandList\n"); + err = TestStep7ReadTheGlobalAttributeGeneratedCommandList_12(); break; } @@ -172116,6 +172230,9 @@ class Test_TC_HEPAFREMON_1_1 : public TestCommandBridge { case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -172129,7 +172246,7 @@ class Test_TC_HEPAFREMON_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; + const uint16_t mTestCount = 13; chip::Optional mNodeId; chip::Optional mCluster; @@ -172238,7 +172355,29 @@ class Test_TC_HEPAFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4ReadTheGlobalAttributeAttributeList_5() + CHIP_ERROR TestStep3dGivenHEPAFREMONSF02ReplacementProductListEnsureFeaturemapHasTheCorrectBitSet_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3d: Given HEPAFREMON.S.F02(ReplacementProductList) ensure featuremap has the correct bit set Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4ReadTheGlobalAttributeAttributeList_6() { MTRBaseDevice * device = GetDevice("alpha"); @@ -172267,7 +172406,7 @@ class Test_TC_HEPAFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4aReadTheFeatureDependentHEPAFREMONSF00AttributeInAttributeList_6() + CHIP_ERROR TestStep4aReadTheFeatureDependentHEPAFREMONSF00AttributeInAttributeList_7() { MTRBaseDevice * device = GetDevice("alpha"); @@ -172284,6 +172423,7 @@ class Test_TC_HEPAFREMON_1_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); NextTest(); }]; @@ -172291,7 +172431,7 @@ class Test_TC_HEPAFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4bReadTheOptionalAttributeInPlaceIndicatorHepafremonsa0002InAttributeList_7() + CHIP_ERROR TestStep4bReadTheOptionalAttributeInPlaceIndicatorHepafremonsa0002InAttributeList_8() { MTRBaseDevice * device = GetDevice("alpha"); @@ -172314,7 +172454,7 @@ class Test_TC_HEPAFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6aReadTheGlobalAttributeAcceptedCommandList_9() + CHIP_ERROR TestStep6aReadTheGlobalAttributeAcceptedCommandList_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -172335,7 +172475,7 @@ class Test_TC_HEPAFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6bReadTheOptionalCommandResetConditionInAcceptedCommandList_10() + CHIP_ERROR TestStep6bReadTheOptionalCommandResetConditionInAcceptedCommandList_11() { MTRBaseDevice * device = GetDevice("alpha"); @@ -172358,7 +172498,7 @@ class Test_TC_HEPAFREMON_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep7ReadTheGlobalAttributeGeneratedCommandList_11() + CHIP_ERROR TestStep7ReadTheGlobalAttributeGeneratedCommandList_12() { MTRBaseDevice * device = GetDevice("alpha"); @@ -172459,6 +172599,22 @@ class Test_TC_HEPAFREMON_2_1 : public TestCommandBridge { } err = TestStep5ThReadsFromTheDutTheInPlaceIndicatorAttribute_4(); break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 6: TH reads from the DUT the LastChangedTime attribute\n"); + if (ShouldSkip("HEPAFREMON.S.A0004")) { + NextTest(); + return; + } + err = TestStep6ThReadsFromTheDutTheLastChangedTimeAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 7: TH reads from the DUT the ReplacementProductList attribute\n"); + if (ShouldSkip("HEPAFREMON.S.A0005")) { + NextTest(); + return; + } + err = TestStep7ThReadsFromTheDutTheReplacementProductListAttribute_6(); + break; } if (CHIP_NO_ERROR != err) { @@ -172485,6 +172641,12 @@ class Test_TC_HEPAFREMON_2_1 : public TestCommandBridge { 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; } // Go on to the next test. @@ -172498,7 +172660,7 @@ class Test_TC_HEPAFREMON_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 5; + const uint16_t mTestCount = 7; chip::Optional mNodeId; chip::Optional mCluster; @@ -172605,6 +172767,52 @@ class Test_TC_HEPAFREMON_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } + + CHIP_ERROR TestStep6ThReadsFromTheDutTheLastChangedTimeAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeLastChangedTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6: TH reads from the DUT the LastChangedTime attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("lastChangedTime", "epoch_s", "epoch_s")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep7ThReadsFromTheDutTheReplacementProductListAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeReplacementProductListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 7: TH reads from the DUT the ReplacementProductList attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("replacementProductList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; #endif // CONFIG_ENABLE_YAML_TESTS