diff --git a/src/app/tests/suites/TestAccessControlCluster.yaml b/src/app/tests/suites/TestAccessControlCluster.yaml index 442bbacff93763..9c8b1f9d6dacdc 100644 --- a/src/app/tests/suites/TestAccessControlCluster.yaml +++ b/src/app/tests/suites/TestAccessControlCluster.yaml @@ -28,13 +28,13 @@ tests: - name: "nodeId" value: nodeId - - label: "Write" + - label: "Write three entries" command: "writeAttribute" attribute: "ACL" arguments: value: [ { - FabricIndex: 1, + FabricIndex: 0, Privilege: 5, # administer AuthMode: 2, # case Subjects: [nodeId, 1234, 5678, 9090], @@ -46,7 +46,7 @@ tests: ], }, { - FabricIndex: 1, + FabricIndex: 0, Privilege: 1, # view AuthMode: 2, # case Subjects: [1234, 5678, 0x8080, 0xFFFF], @@ -58,7 +58,7 @@ tests: ], }, { - FabricIndex: 1, + FabricIndex: 0, Privilege: 3, # operate AuthMode: 3, # group Subjects: [0x0101, 0x0102, 0xAAAA, 0xBBBB], @@ -71,7 +71,7 @@ tests: }, ] - - label: "Read" + - label: "Read three entries" command: "readAttribute" attribute: "ACL" response: @@ -114,13 +114,13 @@ tests: }, ] - - label: "Write" + - label: "Write two entries" command: "writeAttribute" attribute: "ACL" arguments: value: [ { - FabricIndex: 1, + FabricIndex: 0, Privilege: 5, # administer AuthMode: 2, # case Subjects: [nodeId], @@ -132,7 +132,7 @@ tests: ], }, { - FabricIndex: 1, + FabricIndex: 0, Privilege: 1, # view AuthMode: 2, # case Subjects: [0xCCCC, 0xDDDD], @@ -140,7 +140,7 @@ tests: }, ] - - label: "Read" + - label: "Read two entries" command: "readAttribute" attribute: "ACL" response: diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index ac037c052d006f..152af235071ae0 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -228,12 +228,12 @@ - (void)testSendClusterTestAccessControlCluster_000000_WaitForCommissionee XCTestExpectation * expectation = [self expectationWithDescription:@"Wait for commissionee"]; dispatch_queue_t queue = dispatch_get_main_queue(); - WaitForCommissionee(expectation, queue, nodeId); + WaitForCommissionee(expectation, queue, 305414945); [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterTestAccessControlCluster_000001_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write three entries"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -244,12 +244,12 @@ - (void)testSendClusterTestAccessControlCluster_000001_WriteAttribute { NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; temp_0[0] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; ((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[0] = [NSNumber numberWithUnsignedLongLong:305414945ULL]; temp_3[1] = [NSNumber numberWithUnsignedLongLong:1234ULL]; temp_3[2] = [NSNumber numberWithUnsignedLongLong:5678ULL]; temp_3[3] = [NSNumber numberWithUnsignedLongLong:9090ULL]; @@ -276,7 +276,7 @@ - (void)testSendClusterTestAccessControlCluster_000001_WriteAttribute } temp_0[1] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).privilege = [NSNumber numberWithUnsignedChar:1]; ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).authMode = [NSNumber numberWithUnsignedChar:2]; { @@ -308,7 +308,7 @@ - (void)testSendClusterTestAccessControlCluster_000001_WriteAttribute } temp_0[2] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[2]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[2]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; ((CHIPAccessControlClusterAccessControlEntry *) temp_0[2]).privilege = [NSNumber numberWithUnsignedChar:3]; ((CHIPAccessControlClusterAccessControlEntry *) temp_0[2]).authMode = [NSNumber numberWithUnsignedChar:3]; { @@ -343,7 +343,7 @@ - (void)testSendClusterTestAccessControlCluster_000001_WriteAttribute } [cluster writeAttributeAclWithValue:aclArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write Error: %@", err); + NSLog(@"Write three entries Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -354,7 +354,7 @@ - (void)testSendClusterTestAccessControlCluster_000001_WriteAttribute } - (void)testSendClusterTestAccessControlCluster_000002_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read three entries"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -362,7 +362,7 @@ - (void)testSendClusterTestAccessControlCluster_000002_ReadAttribute XCTAssertNotNil(cluster); [cluster readAttributeAclWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read Error: %@", err); + NSLog(@"Read three entries Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -567,7 +567,7 @@ - (void)testSendClusterTestAccessControlCluster_000002_ReadAttribute } - (void)testSendClusterTestAccessControlCluster_000003_WriteAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Write"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Write two entries"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -578,12 +578,11 @@ - (void)testSendClusterTestAccessControlCluster_000003_WriteAttribute { NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; temp_0[0] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[0]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; ((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; } { @@ -607,7 +606,7 @@ - (void)testSendClusterTestAccessControlCluster_000003_WriteAttribute } temp_0[1] = [[CHIPAccessControlClusterAccessControlEntry alloc] init]; - ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:1]; + ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).fabricIndex = [NSNumber numberWithUnsignedChar:0]; ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).privilege = [NSNumber numberWithUnsignedChar:1]; ((CHIPAccessControlClusterAccessControlEntry *) temp_0[1]).authMode = [NSNumber numberWithUnsignedChar:2]; { @@ -630,7 +629,7 @@ - (void)testSendClusterTestAccessControlCluster_000003_WriteAttribute } [cluster writeAttributeAclWithValue:aclArgument completionHandler:^(NSError * _Nullable err) { - NSLog(@"Write Error: %@", err); + NSLog(@"Write two entries Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); @@ -641,7 +640,7 @@ - (void)testSendClusterTestAccessControlCluster_000003_WriteAttribute } - (void)testSendClusterTestAccessControlCluster_000004_ReadAttribute { - XCTestExpectation * expectation = [self expectationWithDescription:@"Read"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"Read two entries"]; CHIPDevice * device = GetConnectedDevice(); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -649,7 +648,7 @@ - (void)testSendClusterTestAccessControlCluster_000004_ReadAttribute XCTAssertNotNil(cluster); [cluster readAttributeAclWithCompletionHandler:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read Error: %@", err); + NSLog(@"Read two entries Error: %@", err); XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 2483a0d6eee510..18be92acdc2c94 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -250,20 +250,20 @@ class TestAccessControlCluster : public TestCommand err = TestWaitForCommissionee_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Write\n"); - err = TestWrite_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Write three entries\n"); + err = TestWriteThreeEntries_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read\n"); - err = TestRead_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Read three entries\n"); + err = TestReadThreeEntries_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Write\n"); - err = TestWrite_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : Write two entries\n"); + err = TestWriteTwoEntries_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read\n"); - err = TestRead_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : Read two entries\n"); + err = TestReadTwoEntries_4(); break; } @@ -340,7 +340,7 @@ class TestAccessControlCluster : public TestCommand return WaitForCommissionee(mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL); } - CHIP_ERROR TestWrite_1() + CHIP_ERROR TestWriteThreeEntries_1() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; chip::Controller::AccessControlClusterTest cluster; @@ -353,7 +353,7 @@ class TestAccessControlCluster : public TestCommand auto * listHolder_0 = new ListHolder(3); listFreer.add(listHolder_0); - listHolder_0->mList[0].fabricIndex = 1; + listHolder_0->mList[0].fabricIndex = 0; listHolder_0->mList[0].privilege = static_cast(5); listHolder_0->mList[0].authMode = static_cast(2); listHolder_0->mList[0].subjects.SetNonNull(); @@ -393,7 +393,7 @@ class TestAccessControlCluster : public TestCommand chip::app::DataModel::List(listHolder_3->mList, 3); } - listHolder_0->mList[1].fabricIndex = 1; + listHolder_0->mList[1].fabricIndex = 0; listHolder_0->mList[1].privilege = static_cast(1); listHolder_0->mList[1].authMode = static_cast(2); listHolder_0->mList[1].subjects.SetNonNull(); @@ -433,7 +433,7 @@ class TestAccessControlCluster : public TestCommand chip::app::DataModel::List(listHolder_3->mList, 3); } - listHolder_0->mList[2].fabricIndex = 1; + listHolder_0->mList[2].fabricIndex = 0; listHolder_0->mList[2].privilege = static_cast(3); listHolder_0->mList[2].authMode = static_cast(3); listHolder_0->mList[2].subjects.SetNonNull(); @@ -490,7 +490,7 @@ class TestAccessControlCluster : public TestCommand void OnSuccessResponse_1() { NextTest(); } - CHIP_ERROR TestRead_2() + CHIP_ERROR TestReadThreeEntries_2() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; chip::Controller::AccessControlClusterTest cluster; @@ -499,7 +499,7 @@ class TestAccessControlCluster : public TestCommand ListFreer listFreer; ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_2, OnFailureCallback_2)); + this, OnSuccessCallback_2, OnFailureCallback_2, true)); return CHIP_NO_ERROR; } @@ -663,7 +663,7 @@ class TestAccessControlCluster : public TestCommand NextTest(); } - CHIP_ERROR TestWrite_3() + CHIP_ERROR TestWriteTwoEntries_3() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; chip::Controller::AccessControlClusterTest cluster; @@ -676,7 +676,7 @@ class TestAccessControlCluster : public TestCommand auto * listHolder_0 = new ListHolder(2); listFreer.add(listHolder_0); - listHolder_0->mList[0].fabricIndex = 1; + listHolder_0->mList[0].fabricIndex = 0; listHolder_0->mList[0].privilege = static_cast(5); listHolder_0->mList[0].authMode = static_cast(2); listHolder_0->mList[0].subjects.SetNonNull(); @@ -713,7 +713,7 @@ class TestAccessControlCluster : public TestCommand chip::app::DataModel::List(listHolder_3->mList, 3); } - listHolder_0->mList[1].fabricIndex = 1; + listHolder_0->mList[1].fabricIndex = 0; listHolder_0->mList[1].privilege = static_cast(1); listHolder_0->mList[1].authMode = static_cast(2); listHolder_0->mList[1].subjects.SetNonNull(); @@ -758,7 +758,7 @@ class TestAccessControlCluster : public TestCommand void OnSuccessResponse_3() { NextTest(); } - CHIP_ERROR TestRead_4() + CHIP_ERROR TestReadTwoEntries_4() { const chip::EndpointId endpoint = mEndpoint.HasValue() ? mEndpoint.Value() : 0; chip::Controller::AccessControlClusterTest cluster; @@ -767,7 +767,7 @@ class TestAccessControlCluster : public TestCommand ListFreer listFreer; ReturnErrorOnFailure(cluster.ReadAttribute( - this, OnSuccessCallback_4, OnFailureCallback_4)); + this, OnSuccessCallback_4, OnFailureCallback_4, true)); return CHIP_NO_ERROR; }