From cd249cc9ce169d77e9d57ac050332df2ae36ee69 Mon Sep 17 00:00:00 2001 From: Marc Lepage Date: Tue, 15 Feb 2022 15:03:15 -0500 Subject: [PATCH] Add simple YAML test for access control cluster This is a very simple test for now. I will come back and add lots more. Towards issue #10253 --- examples/chip-tool/templates/tests.js | 5 + .../suites/TestAccessControlCluster.yaml | 163 +++++ src/darwin/Framework/CHIP/templates/tests.js | 5 + .../Framework/CHIPTests/CHIPClustersTests.m | 527 ++++++++++++++ .../chip-tool/zap-generated/test/Commands.h | 653 ++++++++++++++++++ 5 files changed, 1353 insertions(+) create mode 100644 src/app/tests/suites/TestAccessControlCluster.yaml diff --git a/examples/chip-tool/templates/tests.js b/examples/chip-tool/templates/tests.js index f1f2154c0712cc..eb6def572ffe6e 100644 --- a/examples/chip-tool/templates/tests.js +++ b/examples/chip-tool/templates/tests.js @@ -50,6 +50,10 @@ function getManualTests() function getTests() { + const AccessControl = [ + 'TestAccessControlCluster', + ]; + const BinaryInput = [ 'Test_TC_BI_1_1', 'Test_TC_BI_2_1', @@ -285,6 +289,7 @@ function getTests() ]; const tests = [ + AccessControl, // BinaryInput, // BooleanState, // BridgedActions, // diff --git a/src/app/tests/suites/TestAccessControlCluster.yaml b/src/app/tests/suites/TestAccessControlCluster.yaml new file mode 100644 index 00000000000000..987b625413663a --- /dev/null +++ b/src/app/tests/suites/TestAccessControlCluster.yaml @@ -0,0 +1,163 @@ +# Copyright (c) 2022 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Access Control Cluster Tests + +config: + nodeId: 0x12344321 + cluster: "Access Control" + endpoint: 0 + +tests: + - label: "Wait for commissionee" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Write" + command: "writeAttribute" + attribute: "ACL" + arguments: + value: [ + { + FabricIndex: 1, + Privilege: 5, # administer + AuthMode: 2, # case + Subjects: [nodeId, 1234, 5678, 9090], + Targets: [ + {Cluster: null, Endpoint: 0, DeviceType: null}, + {Cluster: 1, Endpoint: null, DeviceType: null}, + {Cluster: 2, Endpoint: 3, DeviceType: null}, + ], + }, + { + FabricIndex: 1, + Privilege: 1, # view + AuthMode: 2, # case + Subjects: [1234, 5678, 0x8080, 0xFFFF], + Targets: [ + {Cluster: null, Endpoint: 1, DeviceType: null}, + {Cluster: 2, Endpoint: null, DeviceType: null}, + {Cluster: 3, Endpoint: 4, DeviceType: null}, + ], + }, + { + FabricIndex: 1, + Privilege: 3, # operate + AuthMode: 3, # group + Subjects: [0x0101, 0x0102, 0xAAAA, 0xBBBB], + Targets: [ + {Cluster: null, Endpoint: 2, DeviceType: null}, + {Cluster: 3, Endpoint: null, DeviceType: null}, + {Cluster: 4, Endpoint: 5, DeviceType: null}, + ], + }, + ] + + - label: "Read" + command: "readAttribute" + attribute: "ACL" + response: + value: [ + { + FabricIndex: 1, + Privilege: 5, # administer + AuthMode: 2, # case + Subjects: [nodeId, 1234, 5678, 9090], + Targets: [ + {Cluster: null, Endpoint: 0, DeviceType: null}, + {Cluster: 1, Endpoint: null, DeviceType: null}, + {Cluster: 2, Endpoint: 3, DeviceType: null}, + ], + }, + { + FabricIndex: 1, + Privilege: 1, # view + AuthMode: 2, # case + Subjects: [1234, 5678, 0x8080, 0xFFFF], + Targets: [ + {Cluster: null, Endpoint: 1, DeviceType: null}, + {Cluster: 2, Endpoint: null, DeviceType: null}, + {Cluster: 3, Endpoint: 4, DeviceType: null}, + ], + }, + { + FabricIndex: 1, + Privilege: 3, # operate + AuthMode: 3, # group + Subjects: [0x0101, 0x0102, 0xAAAA, 0xBBBB], + Targets: [ + {Cluster: null, Endpoint: 2, DeviceType: null}, + {Cluster: 3, Endpoint: null, DeviceType: null}, + {Cluster: 4, Endpoint: 5, DeviceType: null}, + ], + }, + ] + + - label: "Write" + command: "writeAttribute" + attribute: "ACL" + arguments: + value: [ + { + FabricIndex: 1, + Privilege: 5, # administer + AuthMode: 2, # case + Subjects: [nodeId], + Targets: [ + {Cluster: null, Endpoint: 0, DeviceType: null}, + {Cluster: 1, Endpoint: null, DeviceType: null}, + {Cluster: 2, Endpoint: 3, DeviceType: null}, + ], + }, + { + FabricIndex: 1, + Privilege: 1, # view + AuthMode: 2, # case + Subjects: [0xCCCC, 0xDDDD], + Targets: [ + {Cluster: 5, Endpoint: 6, DeviceType: null}, + ], + }, + ] + + - label: "Read" + command: "readAttribute" + attribute: "ACL" + response: + value: [ + { + FabricIndex: 1, + Privilege: 5, # administer + AuthMode: 2, # case + Subjects: [nodeId], + Targets: [ + {Cluster: null, Endpoint: 0, DeviceType: null}, + {Cluster: 1, Endpoint: null, DeviceType: null}, + {Cluster: 2, Endpoint: 3, DeviceType: null}, + ], + }, + { + FabricIndex: 1, + Privilege: 1, # view + AuthMode: 2, # case + Subjects: [0xCCCC, 0xDDDD], + Targets: [ + {Cluster: 5, Endpoint: 6, DeviceType: null}, + ], + }, + ] diff --git a/src/darwin/Framework/CHIP/templates/tests.js b/src/darwin/Framework/CHIP/templates/tests.js index db2debd1fdbc12..f4f288e03be4ae 100644 --- a/src/darwin/Framework/CHIP/templates/tests.js +++ b/src/darwin/Framework/CHIP/templates/tests.js @@ -17,6 +17,10 @@ function getTests() { + const AccessControl = [ + 'TestAccessControlCluster', + ]; + const BinaryInput = [ 'Test_TC_BI_1_1', 'Test_TC_BI_2_1', @@ -231,6 +235,7 @@ function getTests() ]; const tests = [ + AccessControl, // BinaryInput, // BooleanState, // BridgedActions, // diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 34a5c0aad2a901..c586ed9142fbe2 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -223,6 +223,533 @@ - (void)testReuseChipClusterObject [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTestAccessControlCluster_000000_WaitForCommissionee +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for commissionee"]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + WaitForCommissionee(expectation, queue, nodeId); + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestAccessControlCluster_000001_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + id aclArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).privilege = [NSNumber numberWithUnsignedChar:5]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).authMode = [NSNumber numberWithUnsignedChar:2]; + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [NSNumber numberWithUnsignedLongLong:nodeId]; + temp_3[1] = [NSNumber numberWithUnsignedLongLong:1234ULL]; + temp_3[2] = [NSNumber numberWithUnsignedLongLong:5678ULL]; + temp_3[3] = [NSNumber numberWithUnsignedLongLong:9090ULL]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).subjects = temp_3; + } + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[CHIPAccessControlClusterTarget alloc] init]; + ((CHIPAccessControlClusterTarget *) temp_3[0]).cluster = nil; + ((CHIPAccessControlClusterTarget *) temp_3[0]).endpoint = [NSNumber numberWithUnsignedShort:0U]; + ((CHIPAccessControlClusterTarget *) temp_3[0]).deviceType = nil; + + temp_3[1] = [[CHIPAccessControlClusterTarget alloc] init]; + ((CHIPAccessControlClusterTarget *) temp_3[1]).cluster = [NSNumber numberWithUnsignedInt:1UL]; + ((CHIPAccessControlClusterTarget *) temp_3[1]).endpoint = nil; + ((CHIPAccessControlClusterTarget *) temp_3[1]).deviceType = nil; + + temp_3[2] = [[CHIPAccessControlClusterTarget alloc] init]; + ((CHIPAccessControlClusterTarget *) temp_3[2]).cluster = [NSNumber numberWithUnsignedInt:2UL]; + ((CHIPAccessControlClusterTarget *) temp_3[2]).endpoint = [NSNumber numberWithUnsignedShort:3U]; + ((CHIPAccessControlClusterTarget *) temp_3[2]).deviceType = nil; + + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).targets = temp_3; + } + + temp_0[1] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).privilege = [NSNumber numberWithUnsignedChar:1]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).authMode = [NSNumber numberWithUnsignedChar:2]; + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [NSNumber numberWithUnsignedLongLong:1234ULL]; + temp_3[1] = [NSNumber numberWithUnsignedLongLong:5678ULL]; + temp_3[2] = [NSNumber numberWithUnsignedLongLong:32896ULL]; + temp_3[3] = [NSNumber numberWithUnsignedLongLong:65535ULL]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).subjects = temp_3; + } + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[CHIPAccessControlClusterTarget alloc] init]; + ((CHIPAccessControlClusterTarget *) temp_3[0]).cluster = nil; + ((CHIPAccessControlClusterTarget *) temp_3[0]).endpoint = [NSNumber numberWithUnsignedShort:1U]; + ((CHIPAccessControlClusterTarget *) temp_3[0]).deviceType = nil; + + temp_3[1] = [[CHIPAccessControlClusterTarget alloc] init]; + ((CHIPAccessControlClusterTarget *) temp_3[1]).cluster = [NSNumber numberWithUnsignedInt:2UL]; + ((CHIPAccessControlClusterTarget *) temp_3[1]).endpoint = nil; + ((CHIPAccessControlClusterTarget *) temp_3[1]).deviceType = nil; + + temp_3[2] = [[CHIPAccessControlClusterTarget alloc] init]; + ((CHIPAccessControlClusterTarget *) temp_3[2]).cluster = [NSNumber numberWithUnsignedInt:3UL]; + ((CHIPAccessControlClusterTarget *) temp_3[2]).endpoint = [NSNumber numberWithUnsignedShort:4U]; + ((CHIPAccessControlClusterTarget *) temp_3[2]).deviceType = nil; + + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).targets = temp_3; + } + + temp_0[2] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[2]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[2]).privilege = [NSNumber numberWithUnsignedChar:3]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[2]).authMode = [NSNumber numberWithUnsignedChar:3]; + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [NSNumber numberWithUnsignedLongLong:257ULL]; + temp_3[1] = [NSNumber numberWithUnsignedLongLong:258ULL]; + temp_3[2] = [NSNumber numberWithUnsignedLongLong:43690ULL]; + temp_3[3] = [NSNumber numberWithUnsignedLongLong:48059ULL]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[2]).subjects = temp_3; + } + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[CHIPAccessControlClusterTarget alloc] init]; + ((CHIPAccessControlClusterTarget *) temp_3[0]).cluster = nil; + ((CHIPAccessControlClusterTarget *) temp_3[0]).endpoint = [NSNumber numberWithUnsignedShort:2U]; + ((CHIPAccessControlClusterTarget *) temp_3[0]).deviceType = nil; + + temp_3[1] = [[CHIPAccessControlClusterTarget alloc] init]; + ((CHIPAccessControlClusterTarget *) temp_3[1]).cluster = [NSNumber numberWithUnsignedInt:3UL]; + ((CHIPAccessControlClusterTarget *) temp_3[1]).endpoint = nil; + ((CHIPAccessControlClusterTarget *) temp_3[1]).deviceType = nil; + + temp_3[2] = [[CHIPAccessControlClusterTarget alloc] init]; + ((CHIPAccessControlClusterTarget *) temp_3[2]).cluster = [NSNumber numberWithUnsignedInt:4UL]; + ((CHIPAccessControlClusterTarget *) temp_3[2]).endpoint = [NSNumber numberWithUnsignedShort:5U]; + ((CHIPAccessControlClusterTarget *) temp_3[2]).deviceType = nil; + + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[2]).targets = temp_3; + } + + aclArgument = temp_0; + } + [cluster writeAttributeAclWithValue:aclArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestAccessControlCluster_000002_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeAclWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue count], 3); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).fabricIndex unsignedCharValue], 1); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).privilege unsignedCharValue], 5); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).authMode unsignedCharValue], 2); + XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects == nil); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects count], 4); + XCTAssertEqual( + [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects[0] unsignedLongLongValue], nodeId); + XCTAssertEqual( + [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects[1] unsignedLongLongValue], 1234ULL); + XCTAssertEqual( + [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects[2] unsignedLongLongValue], 5678ULL); + XCTAssertEqual( + [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects[3] unsignedLongLongValue], 9090ULL); + XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets == nil); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets count], 3); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets[0]) + .cluster + == nil); + XCTAssertFalse( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets[0]) + .endpoint + == nil); + XCTAssertEqual([((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) + .targets[0]).endpoint unsignedShortValue], + 0U); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets[0]) + .deviceType + == nil); + XCTAssertFalse( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets[1]) + .cluster + == nil); + XCTAssertEqual([((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) + .targets[1]).cluster unsignedIntValue], + 1UL); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets[1]) + .endpoint + == nil); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets[1]) + .deviceType + == nil); + XCTAssertFalse( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets[2]) + .cluster + == nil); + XCTAssertEqual([((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) + .targets[2]).cluster unsignedIntValue], + 2UL); + XCTAssertFalse( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets[2]) + .endpoint + == nil); + XCTAssertEqual([((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) + .targets[2]).endpoint unsignedShortValue], + 3U); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets[2]) + .deviceType + == nil); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).fabricIndex unsignedCharValue], 1); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).privilege unsignedCharValue], 1); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).authMode unsignedCharValue], 2); + XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects == nil); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects count], 4); + XCTAssertEqual( + [((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects[0] unsignedLongLongValue], 1234ULL); + XCTAssertEqual( + [((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects[1] unsignedLongLongValue], 5678ULL); + XCTAssertEqual( + [((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects[2] unsignedLongLongValue], 32896ULL); + XCTAssertEqual( + [((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects[3] unsignedLongLongValue], 65535ULL); + XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets == nil); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets count], 3); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets[0]) + .cluster + == nil); + XCTAssertFalse( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets[0]) + .endpoint + == nil); + XCTAssertEqual([((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]) + .targets[0]).endpoint unsignedShortValue], + 1U); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets[0]) + .deviceType + == nil); + XCTAssertFalse( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets[1]) + .cluster + == nil); + XCTAssertEqual([((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]) + .targets[1]).cluster unsignedIntValue], + 2UL); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets[1]) + .endpoint + == nil); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets[1]) + .deviceType + == nil); + XCTAssertFalse( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets[2]) + .cluster + == nil); + XCTAssertEqual([((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]) + .targets[2]).cluster unsignedIntValue], + 3UL); + XCTAssertFalse( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets[2]) + .endpoint + == nil); + XCTAssertEqual([((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]) + .targets[2]).endpoint unsignedShortValue], + 4U); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets[2]) + .deviceType + == nil); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).fabricIndex unsignedCharValue], 1); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).privilege unsignedCharValue], 3); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).authMode unsignedCharValue], 3); + XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).subjects == nil); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).subjects count], 4); + XCTAssertEqual( + [((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).subjects[0] unsignedLongLongValue], 257ULL); + XCTAssertEqual( + [((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).subjects[1] unsignedLongLongValue], 258ULL); + XCTAssertEqual( + [((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).subjects[2] unsignedLongLongValue], 43690ULL); + XCTAssertEqual( + [((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).subjects[3] unsignedLongLongValue], 48059ULL); + XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).targets == nil); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).targets count], 3); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).targets[0]) + .cluster + == nil); + XCTAssertFalse( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).targets[0]) + .endpoint + == nil); + XCTAssertEqual([((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]) + .targets[0]).endpoint unsignedShortValue], + 2U); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).targets[0]) + .deviceType + == nil); + XCTAssertFalse( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).targets[1]) + .cluster + == nil); + XCTAssertEqual([((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]) + .targets[1]).cluster unsignedIntValue], + 3UL); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).targets[1]) + .endpoint + == nil); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).targets[1]) + .deviceType + == nil); + XCTAssertFalse( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).targets[2]) + .cluster + == nil); + XCTAssertEqual([((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]) + .targets[2]).cluster unsignedIntValue], + 4UL); + XCTAssertFalse( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).targets[2]) + .endpoint + == nil); + XCTAssertEqual([((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]) + .targets[2]).endpoint unsignedShortValue], + 5U); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[2]).targets[2]) + .deviceType + == nil); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestAccessControlCluster_000003_WriteAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Write"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + id aclArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).privilege = [NSNumber numberWithUnsignedChar:5]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).authMode = [NSNumber numberWithUnsignedChar:2]; + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [NSNumber numberWithUnsignedLongLong:nodeId]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).subjects = temp_3; + } + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[CHIPAccessControlClusterTarget alloc] init]; + ((CHIPAccessControlClusterTarget *) temp_3[0]).cluster = nil; + ((CHIPAccessControlClusterTarget *) temp_3[0]).endpoint = [NSNumber numberWithUnsignedShort:0U]; + ((CHIPAccessControlClusterTarget *) temp_3[0]).deviceType = nil; + + temp_3[1] = [[CHIPAccessControlClusterTarget alloc] init]; + ((CHIPAccessControlClusterTarget *) temp_3[1]).cluster = [NSNumber numberWithUnsignedInt:1UL]; + ((CHIPAccessControlClusterTarget *) temp_3[1]).endpoint = nil; + ((CHIPAccessControlClusterTarget *) temp_3[1]).deviceType = nil; + + temp_3[2] = [[CHIPAccessControlClusterTarget alloc] init]; + ((CHIPAccessControlClusterTarget *) temp_3[2]).cluster = [NSNumber numberWithUnsignedInt:2UL]; + ((CHIPAccessControlClusterTarget *) temp_3[2]).endpoint = [NSNumber numberWithUnsignedShort:3U]; + ((CHIPAccessControlClusterTarget *) temp_3[2]).deviceType = nil; + + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).targets = temp_3; + } + + temp_0[1] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).privilege = [NSNumber numberWithUnsignedChar:1]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).authMode = [NSNumber numberWithUnsignedChar:2]; + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [NSNumber numberWithUnsignedLongLong:52428ULL]; + temp_3[1] = [NSNumber numberWithUnsignedLongLong:56797ULL]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).subjects = temp_3; + } + { + NSMutableArray * temp_3 = [[NSMutableArray alloc] init]; + temp_3[0] = [[CHIPAccessControlClusterTarget alloc] init]; + ((CHIPAccessControlClusterTarget *) temp_3[0]).cluster = [NSNumber numberWithUnsignedInt:5UL]; + ((CHIPAccessControlClusterTarget *) temp_3[0]).endpoint = [NSNumber numberWithUnsignedShort:6U]; + ((CHIPAccessControlClusterTarget *) temp_3[0]).deviceType = nil; + + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).targets = temp_3; + } + + aclArgument = temp_0; + } + [cluster writeAttributeAclWithValue:aclArgument + completionHandler:^(NSError * _Nullable err) { + NSLog(@"Write Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestAccessControlCluster_000004_ReadAttribute +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Read"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestAccessControl * cluster = [[CHIPTestAccessControl alloc] initWithDevice:device endpoint:0 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeAclWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + XCTAssertEqual([actualValue count], 2); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).fabricIndex unsignedCharValue], 1); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).privilege unsignedCharValue], 5); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).authMode unsignedCharValue], 2); + XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects == nil); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects count], 1); + XCTAssertEqual( + [((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).subjects[0] unsignedLongLongValue], nodeId); + XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets == nil); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets count], 3); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets[0]) + .cluster + == nil); + XCTAssertFalse( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets[0]) + .endpoint + == nil); + XCTAssertEqual([((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) + .targets[0]).endpoint unsignedShortValue], + 0U); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets[0]) + .deviceType + == nil); + XCTAssertFalse( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets[1]) + .cluster + == nil); + XCTAssertEqual([((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) + .targets[1]).cluster unsignedIntValue], + 1UL); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets[1]) + .endpoint + == nil); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets[1]) + .deviceType + == nil); + XCTAssertFalse( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets[2]) + .cluster + == nil); + XCTAssertEqual([((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) + .targets[2]).cluster unsignedIntValue], + 2UL); + XCTAssertFalse( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets[2]) + .endpoint + == nil); + XCTAssertEqual([((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]) + .targets[2]).endpoint unsignedShortValue], + 3U); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[0]).targets[2]) + .deviceType + == nil); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).fabricIndex unsignedCharValue], 1); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).privilege unsignedCharValue], 1); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).authMode unsignedCharValue], 2); + XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects == nil); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects count], 2); + XCTAssertEqual( + [((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects[0] unsignedLongLongValue], 52428ULL); + XCTAssertEqual( + [((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).subjects[1] unsignedLongLongValue], 56797ULL); + XCTAssertFalse(((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets == nil); + XCTAssertEqual([((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets count], 1); + XCTAssertFalse( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets[0]) + .cluster + == nil); + XCTAssertEqual([((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]) + .targets[0]).cluster unsignedIntValue], + 5UL); + XCTAssertFalse( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets[0]) + .endpoint + == nil); + XCTAssertEqual([((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]) + .targets[0]).endpoint unsignedShortValue], + 6U); + XCTAssertTrue( + ((CHIPAccessControlClusterTarget *) ((CHIPAccessControlClusterAccessControlEntry *) actualValue[1]).targets[0]) + .deviceType + == nil); + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterTest_TC_BI_1_1_000000_WaitForCommissionee { XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for the commissioned device to be retrieved"]; diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 88a1397abed072..7ff31863ef575d 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -33,6 +33,7 @@ class TestList : public Command TestList() : Command("list"){}; CHIP_ERROR Run() override { + printf("TestAccessControlCluster\n"); printf("Test_TC_BI_1_1\n"); printf("Test_TC_BI_2_1\n"); printf("Test_TC_BI_2_2\n"); @@ -206,6 +207,657 @@ class ManualTestList : public Command } }; +class TestAccessControlCluster : public TestCommand +{ +public: + TestAccessControlCluster(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("TestAccessControlCluster", credsIssuerConfig), mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + } + + ~TestAccessControlCluster() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: TestAccessControlCluster\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: TestAccessControlCluster\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 commissionee\n"); + err = TestWaitForCommissionee_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Write\n"); + err = TestWrite_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read\n"); + err = TestRead_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Write\n"); + err = TestWrite_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read\n"); + err = TestRead_4(); + break; + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + + void OnDiscoveryCommandsResults(const DiscoveryCommandResult & nodeData) override + { + bool isExpectedDnssdResult = false; + + VerifyOrReturn(isExpectedDnssdResult, Exit("An unexpected dnssd result has been received")); + NextTest(); + } + + static void OnFailureCallback_1(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_1(error); + } + + static void OnSuccessCallback_1(void * context) { (static_cast(context))->OnSuccessResponse_1(); } + + static void OnFailureCallback_2(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_2(error); + } + + static void OnSuccessCallback_2( + void * context, + const chip::app::DataModel::DecodableList & + acl) + { + (static_cast(context))->OnSuccessResponse_2(acl); + } + + static void OnFailureCallback_3(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_3(error); + } + + static void OnSuccessCallback_3(void * context) { (static_cast(context))->OnSuccessResponse_3(); } + + static void OnFailureCallback_4(void * context, CHIP_ERROR error) + { + (static_cast(context))->OnFailureResponse_4(error); + } + + static void OnSuccessCallback_4( + void * context, + const chip::app::DataModel::DecodableList & + acl) + { + (static_cast(context))->OnSuccessResponse_4(acl); + } + + // + // Tests methods + // + + CHIP_ERROR TestWaitForCommissionee_0() + { + SetIdentity(kIdentityAlpha); + return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); + } + + CHIP_ERROR TestWrite_1() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::AccessControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ListFreer listFreer; + chip::app::DataModel::List aclArgument; + + { + auto * listHolder_0 = new ListHolder(3); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].fabricIndex = 1; + 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(4); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + listHolder_3->mList[1] = 1234ULL; + listHolder_3->mList[2] = 5678ULL; + listHolder_3->mList[3] = 9090ULL; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 4); + } + listHolder_0->mList[0].targets.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(3); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 0U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_3->mList[1].cluster.SetNonNull(); + listHolder_3->mList[1].cluster.Value() = 1UL; + listHolder_3->mList[1].endpoint.SetNull(); + listHolder_3->mList[1].deviceType.SetNull(); + + listHolder_3->mList[2].cluster.SetNonNull(); + listHolder_3->mList[2].cluster.Value() = 2UL; + listHolder_3->mList[2].endpoint.SetNonNull(); + listHolder_3->mList[2].endpoint.Value() = 3U; + listHolder_3->mList[2].deviceType.SetNull(); + + listHolder_0->mList[0].targets.Value() = + chip::app::DataModel::List(listHolder_3->mList, 3); + } + + listHolder_0->mList[1].fabricIndex = 1; + listHolder_0->mList[1].privilege = static_cast(1); + listHolder_0->mList[1].authMode = static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(4); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 1234ULL; + listHolder_3->mList[1] = 5678ULL; + listHolder_3->mList[2] = 32896ULL; + listHolder_3->mList[3] = 65535ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 4); + } + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(3); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 1U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_3->mList[1].cluster.SetNonNull(); + listHolder_3->mList[1].cluster.Value() = 2UL; + listHolder_3->mList[1].endpoint.SetNull(); + listHolder_3->mList[1].deviceType.SetNull(); + + listHolder_3->mList[2].cluster.SetNonNull(); + listHolder_3->mList[2].cluster.Value() = 3UL; + listHolder_3->mList[2].endpoint.SetNonNull(); + listHolder_3->mList[2].endpoint.Value() = 4U; + listHolder_3->mList[2].deviceType.SetNull(); + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List(listHolder_3->mList, 3); + } + + listHolder_0->mList[2].fabricIndex = 1; + listHolder_0->mList[2].privilege = static_cast(3); + listHolder_0->mList[2].authMode = static_cast(3); + listHolder_0->mList[2].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(4); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 257ULL; + listHolder_3->mList[1] = 258ULL; + listHolder_3->mList[2] = 43690ULL; + listHolder_3->mList[3] = 48059ULL; + listHolder_0->mList[2].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 4); + } + listHolder_0->mList[2].targets.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(3); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 2U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_3->mList[1].cluster.SetNonNull(); + listHolder_3->mList[1].cluster.Value() = 3UL; + listHolder_3->mList[1].endpoint.SetNull(); + listHolder_3->mList[1].deviceType.SetNull(); + + listHolder_3->mList[2].cluster.SetNonNull(); + listHolder_3->mList[2].cluster.Value() = 4UL; + listHolder_3->mList[2].endpoint.SetNonNull(); + listHolder_3->mList[2].endpoint.Value() = 5U; + listHolder_3->mList[2].deviceType.SetNull(); + + listHolder_0->mList[2].targets.Value() = + chip::app::DataModel::List(listHolder_3->mList, 3); + } + + aclArgument = chip::app::DataModel::List( + listHolder_0->mList, 3); + } + + ReturnErrorOnFailure(cluster.WriteAttribute( + aclArgument, this, OnSuccessCallback_1, OnFailureCallback_1)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_1(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_1() { NextTest(); } + + CHIP_ERROR TestRead_2() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::AccessControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ListFreer listFreer; + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_2, OnFailureCallback_2)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_2(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_2( + const chip::app::DataModel::DecodableList & + acl) + { + { + auto iter_0 = acl.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, 1)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_NaN = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn( + CheckNextListItemDecodes("acl[0].subjects.Value()", iter_NaN, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_NaN.GetValue(), + mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL)); + VerifyOrReturn( + CheckNextListItemDecodes("acl[0].subjects.Value()", iter_NaN, 1)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[1]", iter_NaN.GetValue(), 1234ULL)); + VerifyOrReturn( + CheckNextListItemDecodes("acl[0].subjects.Value()", iter_NaN, 2)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[2]", iter_NaN.GetValue(), 5678ULL)); + VerifyOrReturn( + CheckNextListItemDecodes("acl[0].subjects.Value()", iter_NaN, 3)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[3]", iter_NaN.GetValue(), 9090ULL)); + VerifyOrReturn( + CheckNoMoreListItems("acl[0].subjects.Value()", iter_NaN, 4)); + } + VerifyOrReturn(CheckValueNonNull("acl[0].targets", iter_0.GetValue().targets)); + { + auto iter_NaN = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn( + CheckNextListItemDecodes("acl[0].targets.Value()", iter_NaN, 0)); + VerifyOrReturn(CheckValueNull("acl[0].targets.Value()[0].cluster", iter_NaN.GetValue().cluster)); + VerifyOrReturn(CheckValueNonNull("acl[0].targets.Value()[0].endpoint", iter_NaN.GetValue().endpoint)); + VerifyOrReturn(CheckValue("acl[0].targets.Value()[0].endpoint.Value()", iter_NaN.GetValue().endpoint.Value(), 0U)); + VerifyOrReturn(CheckValueNull("acl[0].targets.Value()[0].deviceType", iter_NaN.GetValue().deviceType)); + VerifyOrReturn( + CheckNextListItemDecodes("acl[0].targets.Value()", iter_NaN, 1)); + VerifyOrReturn(CheckValueNonNull("acl[0].targets.Value()[1].cluster", iter_NaN.GetValue().cluster)); + VerifyOrReturn(CheckValue("acl[0].targets.Value()[1].cluster.Value()", iter_NaN.GetValue().cluster.Value(), 1UL)); + VerifyOrReturn(CheckValueNull("acl[0].targets.Value()[1].endpoint", iter_NaN.GetValue().endpoint)); + VerifyOrReturn(CheckValueNull("acl[0].targets.Value()[1].deviceType", iter_NaN.GetValue().deviceType)); + VerifyOrReturn( + CheckNextListItemDecodes("acl[0].targets.Value()", iter_NaN, 2)); + VerifyOrReturn(CheckValueNonNull("acl[0].targets.Value()[2].cluster", iter_NaN.GetValue().cluster)); + VerifyOrReturn(CheckValue("acl[0].targets.Value()[2].cluster.Value()", iter_NaN.GetValue().cluster.Value(), 2UL)); + VerifyOrReturn(CheckValueNonNull("acl[0].targets.Value()[2].endpoint", iter_NaN.GetValue().endpoint)); + VerifyOrReturn(CheckValue("acl[0].targets.Value()[2].endpoint.Value()", iter_NaN.GetValue().endpoint.Value(), 3U)); + VerifyOrReturn(CheckValueNull("acl[0].targets.Value()[2].deviceType", iter_NaN.GetValue().deviceType)); + VerifyOrReturn( + CheckNoMoreListItems("acl[0].targets.Value()", iter_NaN, 3)); + } + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 1)); + VerifyOrReturn(CheckValue("acl[1].fabricIndex", iter_0.GetValue().fabricIndex, 1)); + VerifyOrReturn(CheckValue("acl[1].privilege", iter_0.GetValue().privilege, 1)); + VerifyOrReturn(CheckValue("acl[1].authMode", iter_0.GetValue().authMode, 2)); + VerifyOrReturn(CheckValueNonNull("acl[1].subjects", iter_0.GetValue().subjects)); + { + auto iter_NaN = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn( + CheckNextListItemDecodes("acl[1].subjects.Value()", iter_NaN, 0)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[0]", iter_NaN.GetValue(), 1234ULL)); + VerifyOrReturn( + CheckNextListItemDecodes("acl[1].subjects.Value()", iter_NaN, 1)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[1]", iter_NaN.GetValue(), 5678ULL)); + VerifyOrReturn( + CheckNextListItemDecodes("acl[1].subjects.Value()", iter_NaN, 2)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[2]", iter_NaN.GetValue(), 32896ULL)); + VerifyOrReturn( + CheckNextListItemDecodes("acl[1].subjects.Value()", iter_NaN, 3)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[3]", iter_NaN.GetValue(), 65535ULL)); + VerifyOrReturn( + CheckNoMoreListItems("acl[1].subjects.Value()", iter_NaN, 4)); + } + VerifyOrReturn(CheckValueNonNull("acl[1].targets", iter_0.GetValue().targets)); + { + auto iter_NaN = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn( + CheckNextListItemDecodes("acl[1].targets.Value()", iter_NaN, 0)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[0].cluster", iter_NaN.GetValue().cluster)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[0].endpoint", iter_NaN.GetValue().endpoint)); + VerifyOrReturn(CheckValue("acl[1].targets.Value()[0].endpoint.Value()", iter_NaN.GetValue().endpoint.Value(), 1U)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[0].deviceType", iter_NaN.GetValue().deviceType)); + VerifyOrReturn( + CheckNextListItemDecodes("acl[1].targets.Value()", iter_NaN, 1)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[1].cluster", iter_NaN.GetValue().cluster)); + VerifyOrReturn(CheckValue("acl[1].targets.Value()[1].cluster.Value()", iter_NaN.GetValue().cluster.Value(), 2UL)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[1].endpoint", iter_NaN.GetValue().endpoint)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[1].deviceType", iter_NaN.GetValue().deviceType)); + VerifyOrReturn( + CheckNextListItemDecodes("acl[1].targets.Value()", iter_NaN, 2)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[2].cluster", iter_NaN.GetValue().cluster)); + VerifyOrReturn(CheckValue("acl[1].targets.Value()[2].cluster.Value()", iter_NaN.GetValue().cluster.Value(), 3UL)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[2].endpoint", iter_NaN.GetValue().endpoint)); + VerifyOrReturn(CheckValue("acl[1].targets.Value()[2].endpoint.Value()", iter_NaN.GetValue().endpoint.Value(), 4U)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[2].deviceType", iter_NaN.GetValue().deviceType)); + VerifyOrReturn( + CheckNoMoreListItems("acl[1].targets.Value()", iter_NaN, 3)); + } + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 2)); + VerifyOrReturn(CheckValue("acl[2].fabricIndex", iter_0.GetValue().fabricIndex, 1)); + VerifyOrReturn(CheckValue("acl[2].privilege", iter_0.GetValue().privilege, 3)); + VerifyOrReturn(CheckValue("acl[2].authMode", iter_0.GetValue().authMode, 3)); + VerifyOrReturn(CheckValueNonNull("acl[2].subjects", iter_0.GetValue().subjects)); + { + auto iter_NaN = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn( + CheckNextListItemDecodes("acl[2].subjects.Value()", iter_NaN, 0)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[0]", iter_NaN.GetValue(), 257ULL)); + VerifyOrReturn( + CheckNextListItemDecodes("acl[2].subjects.Value()", iter_NaN, 1)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[1]", iter_NaN.GetValue(), 258ULL)); + VerifyOrReturn( + CheckNextListItemDecodes("acl[2].subjects.Value()", iter_NaN, 2)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[2]", iter_NaN.GetValue(), 43690ULL)); + VerifyOrReturn( + CheckNextListItemDecodes("acl[2].subjects.Value()", iter_NaN, 3)); + VerifyOrReturn(CheckValue("acl[2].subjects.Value()[3]", iter_NaN.GetValue(), 48059ULL)); + VerifyOrReturn( + CheckNoMoreListItems("acl[2].subjects.Value()", iter_NaN, 4)); + } + VerifyOrReturn(CheckValueNonNull("acl[2].targets", iter_0.GetValue().targets)); + { + auto iter_NaN = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn( + CheckNextListItemDecodes("acl[2].targets.Value()", iter_NaN, 0)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[0].cluster", iter_NaN.GetValue().cluster)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[0].endpoint", iter_NaN.GetValue().endpoint)); + VerifyOrReturn(CheckValue("acl[2].targets.Value()[0].endpoint.Value()", iter_NaN.GetValue().endpoint.Value(), 2U)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[0].deviceType", iter_NaN.GetValue().deviceType)); + VerifyOrReturn( + CheckNextListItemDecodes("acl[2].targets.Value()", iter_NaN, 1)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[1].cluster", iter_NaN.GetValue().cluster)); + VerifyOrReturn(CheckValue("acl[2].targets.Value()[1].cluster.Value()", iter_NaN.GetValue().cluster.Value(), 3UL)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[1].endpoint", iter_NaN.GetValue().endpoint)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[1].deviceType", iter_NaN.GetValue().deviceType)); + VerifyOrReturn( + CheckNextListItemDecodes("acl[2].targets.Value()", iter_NaN, 2)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[2].cluster", iter_NaN.GetValue().cluster)); + VerifyOrReturn(CheckValue("acl[2].targets.Value()[2].cluster.Value()", iter_NaN.GetValue().cluster.Value(), 4UL)); + VerifyOrReturn(CheckValueNonNull("acl[2].targets.Value()[2].endpoint", iter_NaN.GetValue().endpoint)); + VerifyOrReturn(CheckValue("acl[2].targets.Value()[2].endpoint.Value()", iter_NaN.GetValue().endpoint.Value(), 5U)); + VerifyOrReturn(CheckValueNull("acl[2].targets.Value()[2].deviceType", iter_NaN.GetValue().deviceType)); + VerifyOrReturn( + CheckNoMoreListItems("acl[2].targets.Value()", iter_NaN, 3)); + } + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 3)); + } + + NextTest(); + } + + CHIP_ERROR TestWrite_3() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::AccessControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ListFreer listFreer; + chip::app::DataModel::List aclArgument; + + { + auto * listHolder_0 = new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].fabricIndex = 1; + 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(1); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + listHolder_0->mList[0].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 1); + } + listHolder_0->mList[0].targets.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(3); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNull(); + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 0U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_3->mList[1].cluster.SetNonNull(); + listHolder_3->mList[1].cluster.Value() = 1UL; + listHolder_3->mList[1].endpoint.SetNull(); + listHolder_3->mList[1].deviceType.SetNull(); + + listHolder_3->mList[2].cluster.SetNonNull(); + listHolder_3->mList[2].cluster.Value() = 2UL; + listHolder_3->mList[2].endpoint.SetNonNull(); + listHolder_3->mList[2].endpoint.Value() = 3U; + listHolder_3->mList[2].deviceType.SetNull(); + + listHolder_0->mList[0].targets.Value() = + chip::app::DataModel::List(listHolder_3->mList, 3); + } + + listHolder_0->mList[1].fabricIndex = 1; + listHolder_0->mList[1].privilege = static_cast(1); + listHolder_0->mList[1].authMode = static_cast(2); + listHolder_0->mList[1].subjects.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(2); + listFreer.add(listHolder_3); + listHolder_3->mList[0] = 52428ULL; + listHolder_3->mList[1] = 56797ULL; + listHolder_0->mList[1].subjects.Value() = chip::app::DataModel::List(listHolder_3->mList, 2); + } + listHolder_0->mList[1].targets.SetNonNull(); + + { + auto * listHolder_3 = new ListHolder(1); + listFreer.add(listHolder_3); + + listHolder_3->mList[0].cluster.SetNonNull(); + listHolder_3->mList[0].cluster.Value() = 5UL; + listHolder_3->mList[0].endpoint.SetNonNull(); + listHolder_3->mList[0].endpoint.Value() = 6U; + listHolder_3->mList[0].deviceType.SetNull(); + + listHolder_0->mList[1].targets.Value() = + chip::app::DataModel::List(listHolder_3->mList, 1); + } + + aclArgument = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + + ReturnErrorOnFailure(cluster.WriteAttribute( + aclArgument, this, OnSuccessCallback_3, OnFailureCallback_3)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_3(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_3() { NextTest(); } + + CHIP_ERROR TestRead_4() + { + const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; + chip::Controller::AccessControlClusterTest cluster; + cluster.Associate(mDevices[kIdentityAlpha], endpoint); + + ListFreer listFreer; + + ReturnErrorOnFailure(cluster.ReadAttribute( + this, OnSuccessCallback_4, OnFailureCallback_4)); + return CHIP_NO_ERROR; + } + + void OnFailureResponse_4(CHIP_ERROR error) + { + chip::app::StatusIB status(error); + ThrowFailureResponse(); + } + + void OnSuccessResponse_4( + const chip::app::DataModel::DecodableList & + acl) + { + { + auto iter_0 = acl.begin(); + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 0)); + VerifyOrReturn(CheckValue("acl[0].fabricIndex", iter_0.GetValue().fabricIndex, 1)); + VerifyOrReturn(CheckValue("acl[0].privilege", iter_0.GetValue().privilege, 5)); + VerifyOrReturn(CheckValue("acl[0].authMode", iter_0.GetValue().authMode, 2)); + VerifyOrReturn(CheckValueNonNull("acl[0].subjects", iter_0.GetValue().subjects)); + { + auto iter_NaN = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn( + CheckNextListItemDecodes("acl[0].subjects.Value()", iter_NaN, 0)); + VerifyOrReturn(CheckValue("acl[0].subjects.Value()[0]", iter_NaN.GetValue(), + mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL)); + VerifyOrReturn( + CheckNoMoreListItems("acl[0].subjects.Value()", iter_NaN, 1)); + } + VerifyOrReturn(CheckValueNonNull("acl[0].targets", iter_0.GetValue().targets)); + { + auto iter_NaN = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn( + CheckNextListItemDecodes("acl[0].targets.Value()", iter_NaN, 0)); + VerifyOrReturn(CheckValueNull("acl[0].targets.Value()[0].cluster", iter_NaN.GetValue().cluster)); + VerifyOrReturn(CheckValueNonNull("acl[0].targets.Value()[0].endpoint", iter_NaN.GetValue().endpoint)); + VerifyOrReturn(CheckValue("acl[0].targets.Value()[0].endpoint.Value()", iter_NaN.GetValue().endpoint.Value(), 0U)); + VerifyOrReturn(CheckValueNull("acl[0].targets.Value()[0].deviceType", iter_NaN.GetValue().deviceType)); + VerifyOrReturn( + CheckNextListItemDecodes("acl[0].targets.Value()", iter_NaN, 1)); + VerifyOrReturn(CheckValueNonNull("acl[0].targets.Value()[1].cluster", iter_NaN.GetValue().cluster)); + VerifyOrReturn(CheckValue("acl[0].targets.Value()[1].cluster.Value()", iter_NaN.GetValue().cluster.Value(), 1UL)); + VerifyOrReturn(CheckValueNull("acl[0].targets.Value()[1].endpoint", iter_NaN.GetValue().endpoint)); + VerifyOrReturn(CheckValueNull("acl[0].targets.Value()[1].deviceType", iter_NaN.GetValue().deviceType)); + VerifyOrReturn( + CheckNextListItemDecodes("acl[0].targets.Value()", iter_NaN, 2)); + VerifyOrReturn(CheckValueNonNull("acl[0].targets.Value()[2].cluster", iter_NaN.GetValue().cluster)); + VerifyOrReturn(CheckValue("acl[0].targets.Value()[2].cluster.Value()", iter_NaN.GetValue().cluster.Value(), 2UL)); + VerifyOrReturn(CheckValueNonNull("acl[0].targets.Value()[2].endpoint", iter_NaN.GetValue().endpoint)); + VerifyOrReturn(CheckValue("acl[0].targets.Value()[2].endpoint.Value()", iter_NaN.GetValue().endpoint.Value(), 3U)); + VerifyOrReturn(CheckValueNull("acl[0].targets.Value()[2].deviceType", iter_NaN.GetValue().deviceType)); + VerifyOrReturn( + CheckNoMoreListItems("acl[0].targets.Value()", iter_NaN, 3)); + } + VerifyOrReturn(CheckNextListItemDecodes("acl", iter_0, 1)); + VerifyOrReturn(CheckValue("acl[1].fabricIndex", iter_0.GetValue().fabricIndex, 1)); + VerifyOrReturn(CheckValue("acl[1].privilege", iter_0.GetValue().privilege, 1)); + VerifyOrReturn(CheckValue("acl[1].authMode", iter_0.GetValue().authMode, 2)); + VerifyOrReturn(CheckValueNonNull("acl[1].subjects", iter_0.GetValue().subjects)); + { + auto iter_NaN = iter_0.GetValue().subjects.Value().begin(); + VerifyOrReturn( + CheckNextListItemDecodes("acl[1].subjects.Value()", iter_NaN, 0)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[0]", iter_NaN.GetValue(), 52428ULL)); + VerifyOrReturn( + CheckNextListItemDecodes("acl[1].subjects.Value()", iter_NaN, 1)); + VerifyOrReturn(CheckValue("acl[1].subjects.Value()[1]", iter_NaN.GetValue(), 56797ULL)); + VerifyOrReturn( + CheckNoMoreListItems("acl[1].subjects.Value()", iter_NaN, 2)); + } + VerifyOrReturn(CheckValueNonNull("acl[1].targets", iter_0.GetValue().targets)); + { + auto iter_NaN = iter_0.GetValue().targets.Value().begin(); + VerifyOrReturn( + CheckNextListItemDecodes("acl[1].targets.Value()", iter_NaN, 0)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[0].cluster", iter_NaN.GetValue().cluster)); + VerifyOrReturn(CheckValue("acl[1].targets.Value()[0].cluster.Value()", iter_NaN.GetValue().cluster.Value(), 5UL)); + VerifyOrReturn(CheckValueNonNull("acl[1].targets.Value()[0].endpoint", iter_NaN.GetValue().endpoint)); + VerifyOrReturn(CheckValue("acl[1].targets.Value()[0].endpoint.Value()", iter_NaN.GetValue().endpoint.Value(), 6U)); + VerifyOrReturn(CheckValueNull("acl[1].targets.Value()[0].deviceType", iter_NaN.GetValue().deviceType)); + VerifyOrReturn( + CheckNoMoreListItems("acl[1].targets.Value()", iter_NaN, 1)); + } + VerifyOrReturn(CheckNoMoreListItems("acl", iter_0, 2)); + } + + NextTest(); + } +}; + class Test_TC_BI_1_1 : public TestCommand { public: @@ -95774,6 +96426,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds commands_list clusterCommands = { make_unique(), make_unique(), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig),