|
29 | 29 | #import "MTRTestKeys.h"
|
30 | 30 | #import "MTRTestPerControllerStorage.h"
|
31 | 31 | #import "MTRTestResetCommissioneeHelper.h"
|
| 32 | +#import "MTRTestServerAppRunner.h" |
32 | 33 |
|
33 | 34 | static const uint16_t kPairingTimeoutInSeconds = 10;
|
34 | 35 | static const uint16_t kTimeoutInSeconds = 3;
|
@@ -2147,7 +2148,7 @@ - (void)testSetMRPParametersWithRunningController
|
2147 | 2148 | }
|
2148 | 2149 |
|
2149 | 2150 | // TODO: This might also want to go in a separate test file, with some shared setup for commissioning devices per test
|
2150 |
| -- (void)doTestSubscriptionPoolWithSize:(NSInteger)subscriptionPoolSize |
| 2151 | +- (void)doTestSubscriptionPoolWithSize:(NSInteger)subscriptionPoolSize deviceOnboardingPayloads:(NSDictionary<NSNumber *, NSString *> *)deviceOnboardingPayloads |
2151 | 2152 | {
|
2152 | 2153 | __auto_type * factory = [MTRDeviceControllerFactory sharedInstance];
|
2153 | 2154 | XCTAssertNotNil(factory);
|
@@ -2183,15 +2184,7 @@ - (void)doTestSubscriptionPoolWithSize:(NSInteger)subscriptionPoolSize
|
2183 | 2184 |
|
2184 | 2185 | XCTAssertEqualObjects(controller.controllerNodeID, nodeID);
|
2185 | 2186 |
|
2186 |
| - // QRCodes generated for discriminators 101~105 and passcodes 1001~1005 |
2187 | 2187 | NSArray<NSNumber *> * orderedDeviceIDs = @[ @(101), @(102), @(103), @(104), @(105) ];
|
2188 |
| - NSDictionary<NSNumber *, NSString *> * deviceOnboardingPayloads = @{ |
2189 |
| - @(101) : @"MT:00000EBQ15IZC900000", |
2190 |
| - @(102) : @"MT:00000MNY16-AD900000", |
2191 |
| - @(103) : @"MT:00000UZ427GOD900000", |
2192 |
| - @(104) : @"MT:00000CQM00Z.D900000", |
2193 |
| - @(105) : @"MT:00000K0V01FDE900000", |
2194 |
| - }; |
2195 | 2188 |
|
2196 | 2189 | // Commission 5 devices
|
2197 | 2190 | for (NSNumber * deviceID in orderedDeviceIDs) {
|
@@ -2272,8 +2265,27 @@ - (void)doTestSubscriptionPoolWithSize:(NSInteger)subscriptionPoolSize
|
2272 | 2265 |
|
2273 | 2266 | - (void)testSubscriptionPool
|
2274 | 2267 | {
|
2275 |
| - [self doTestSubscriptionPoolWithSize:1]; |
2276 |
| - [self doTestSubscriptionPoolWithSize:2]; |
| 2268 | + // QRCodes generated for discriminators 1111~1115 and passcodes 1001~1005 |
| 2269 | + NSDictionary<NSNumber *, NSString *> * deviceOnboardingPayloads = @{ |
| 2270 | + @(101) : @"MT:00000UZ427U0D900000", |
| 2271 | + @(102) : @"MT:00000CQM00BED900000", |
| 2272 | + @(103) : @"MT:00000K0V01TRD900000", |
| 2273 | + @(104) : @"MT:00000SC11293E900000", |
| 2274 | + @(105) : @"MT:00000-O913RGE900000", |
| 2275 | + }; |
| 2276 | + |
| 2277 | + // Start our helper apps. |
| 2278 | + __auto_type * sortedKeys = [[deviceOnboardingPayloads allKeys] sortedArrayUsingSelector:@selector(compare:)]; |
| 2279 | + for (NSNumber * deviceID in sortedKeys) { |
| 2280 | + __auto_type * appRunner = [[MTRTestServerAppRunner alloc] initWithAppName:@"all-clusters" |
| 2281 | + arguments:@[] |
| 2282 | + payload:deviceOnboardingPayloads[deviceID] |
| 2283 | + testcase:self]; |
| 2284 | + XCTAssertNotNil(appRunner); |
| 2285 | + } |
| 2286 | + |
| 2287 | + [self doTestSubscriptionPoolWithSize:1 deviceOnboardingPayloads:deviceOnboardingPayloads]; |
| 2288 | + [self doTestSubscriptionPoolWithSize:2 deviceOnboardingPayloads:deviceOnboardingPayloads]; |
2277 | 2289 | }
|
2278 | 2290 |
|
2279 | 2291 | @end
|
0 commit comments