Debian Codegraph @

src/objective-c/tests/MacTests/StressTestsCleartext.m

raw
1
2 /*
3 *
4 * Copyright 2019 gRPC authors.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19
20 #import <GRPCClient/GRPCCall+Tests.h>
21 #import <GRPCClient/internal_testing/GRPCCall+InternalTests.h>
22
23 #import "StressTests.h"
24
25 static NSString *const kHostAddress = @"10.0.0.1";
26
27 // The Protocol Buffers encoding overhead of local interop server. Acquired
28 // by experiment. Adjust this when server's proto file changes.
29 static int32_t kLocalInteropServerOverhead = 10;
30
31 /** Tests in InteropTests.m, sending the RPCs to a local cleartext server. */
32 @interface StressTestsCleartext : StressTests
33 @end
34
35 @implementation StressTestsCleartext
36
37 + (NSString *)host {
38 return [NSString stringWithFormat:@"%@:5050", kHostAddress];
39 }
40
41 + (NSString *)hostAddress {
42 return kHostAddress;
43 }
44
45 + (NSString *)PEMRootCertificates {
46 return nil;
47 }
48
49 + (NSString *)hostNameOverride {
50 return nil;
51 }
52
53 - (int32_t)encodingOverhead {
54 return kLocalInteropServerOverhead; // bytes
55 }
56
57 - (void)setUp {
58 [super setUp];
59
60 // Register test server as non-SSL.
61 [GRPCCall useInsecureConnectionsForHost:[[self class] host]];
62 }
63
64 + (GRPCTransportType)transportType {
65 return GRPCTransportTypeInsecure;
66 }
67
68 @end