From e7d53b4b770113326616f53e10a7d415173d8586 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Mon, 6 Feb 2023 22:15:37 +0100 Subject: [PATCH] Fix typos in Test_TC_ACL_2_10.yaml and Test_TC_ACL_2_8.yaml (#24881) * Fix typos in Test_TC_ACL_2_10.yaml and Test_TC_ACL_2_8.yaml * Update generated tests content --- .../certification/Test_TC_ACL_2_10.yaml | 10 +- .../suites/certification/Test_TC_ACL_2_8.yaml | 20 +-- .../chip-tool/zap-generated/test/Commands.h | 116 ++++++++++++++++-- 3 files changed, 122 insertions(+), 24 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_10.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_10.yaml index d3c0b880bc077c..5c94764acd696d 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_10.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_10.yaml @@ -211,7 +211,7 @@ tests: - label: "Step 10:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute" PICS: ACL.S.A0000 - command: "readAttribute" + command: "writeAttribute" attribute: "ACL" arguments: value: @@ -233,13 +233,13 @@ tests: ] - label: - "Step 11:TH1 resds DUT Endpoint 0 AccessControl cluster Extension + "Step 11:TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of AccessControlExtensionStruct containing 1 element" PICS: ACL.S.A0001 command: "readAttribute" attribute: "Extension" - arguments: + response: value: [{ Data: D_OK_EMPTY, FabricIndex: TH1FabricIndex }] - label: @@ -333,8 +333,8 @@ tests: PICS: ACL.S.A0001 command: "readAttribute" attribute: "Extension" - arguments: - value: [{ Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndex }] + response: + value: [{ Data: D_OK_EMPTY, FabricIndex: TH1FabricIndex }] - label: "Step 18: If DUT is an app on host, examine persistent storage in diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_8.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_8.yaml index 77fe085a0d0fc2..fe69b83182997d 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_8.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_8.yaml @@ -99,8 +99,8 @@ tests: value: [ { - Privilege: "5", - AuthMode: "2", + Privilege: 5, + AuthMode: 2, Subjects: [TH1CommissionerNodeId, 1111], Targets: null, FabricIndex: TH1FabricIndex, @@ -116,8 +116,8 @@ tests: value: [ { - Privilege: "5", - AuthMode: "2", + Privilege: 5, + AuthMode: 2, Subjects: [TH2CommissionerNodeId, 2222], Targets: null, FabricIndex: TH2FabricIndex, @@ -128,12 +128,12 @@ tests: PICS: ACL.S.A0000 command: "readAttribute" attribute: "ACL" - arguments: + response: value: [ { - Privilege: "5", - AuthMode: "2", + Privilege: 5, + AuthMode: 2, Subjects: [TH1CommissionerNodeId, 1111], Targets: null, FabricIndex: TH1FabricIndex, @@ -145,12 +145,12 @@ tests: identity: "beta" command: "readAttribute" attribute: "ACL" - arguments: + response: value: [ { - Privilege: "5", - AuthMode: "2", + Privilege: 5, + AuthMode: 2, Subjects: [TH2CommissionerNodeId, 2222], Targets: null, FabricIndex: TH2FabricIndex, diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index a307cd0827e0ea..50406d3e4632fc 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -6014,6 +6014,28 @@ class Test_TC_ACL_2_8Suite : public TestCommand chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), + mTH1CommissionerNodeId.HasValue() ? mTH1CommissionerNodeId.Value() : 112233ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 1)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[1]", iter_3.GetValue(), 1111ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 2)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, TH1FabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 1)); + } } break; case 9: @@ -6023,6 +6045,28 @@ class Test_TC_ACL_2_8Suite : public TestCommand chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5U)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2U)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_3 = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_3.GetValue(), + mTH2CommissionerNodeId.HasValue() ? mTH2CommissionerNodeId.Value() : 112233ULL)); + VerifyOrReturn(CheckNextListItemDecodes( + "acl[0].subjects.Value()", iter_3, 1)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[1]", iter_3.GetValue(), 2222ULL)); + VerifyOrReturn(CheckNoMoreListItems("acl[0].subjects.Value()", + iter_3, 2)); + } + VerifyOrReturn(CheckValueNull("acl[0].targets", iter_0.GetValue().targets)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, TH2FabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 1)); + } } break; case 10: @@ -6797,12 +6841,6 @@ class Test_TC_ACL_2_10Suite : public TestCommand break; case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - chip::app::DataModel::DecodableList< - chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType> - value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - } break; case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -6811,6 +6849,15 @@ class Test_TC_ACL_2_10Suite : public TestCommand chip::app::Clusters::AccessControl::Structs::AccessControlExtensionStruct::DecodableType> value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("extension", iter_0, 0)); + VerifyOrReturn(CheckValueAsString( + "extension[0].data", iter_0.GetValue().data, + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2))); + VerifyOrReturn(CheckValue("extension[0].fabricIndex", iter_0.GetValue().fabricIndex, TH1FabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 1)); + } } break; case 16: @@ -6882,6 +6929,15 @@ class Test_TC_ACL_2_10Suite : public TestCommand chip::app::Clusters::AccessControl::Structs::AccessControlExtensionStruct::DecodableType> value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("extension", iter_0, 0)); + VerifyOrReturn(CheckValueAsString( + "extension[0].data", iter_0.GetValue().data, + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2))); + VerifyOrReturn(CheckValue("extension[0].fabricIndex", iter_0.GetValue().fabricIndex, TH1FabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 1)); + } } break; case 22: @@ -7129,12 +7185,54 @@ class Test_TC_ACL_2_10Suite : public TestCommand case 14: { LogStep(14, "Step 10:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute"); VerifyOrDo(!ShouldSkip("ACL.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, true, - chip::NullOptional); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = + new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].privilege = + static_cast(5); + listHolder_0->mList[0].authMode = + static_cast(2); + listHolder_0->mList[0].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(2); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = mTH1CommissionerNodeId.HasValue() ? mTH1CommissionerNodeId.Value() : 112233ULL; + listHolder_3->mList[1] = 1111ULL; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 2); + } + listHolder_0->mList[0].targets.SetNull(); + listHolder_0->mList[0].fabricIndex = TH1FabricIndex; + + listHolder_0->mList[1].privilege = + static_cast(3); + listHolder_0->mList[1].authMode = + static_cast(3); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 3333ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[1].targets.SetNull(); + listHolder_0->mList[1].fabricIndex = TH1FabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Acl::Id, value, + chip::NullOptional, chip::NullOptional); } case 15: { LogStep(15, - "Step 11:TH1 resds DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "Step 11:TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " "AccessControlExtensionStruct containing 1 element"); VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true,