Jorge Canizales | 91db5ac | 2015-10-28 14:53:38 -0700 | [diff] [blame] | 1 | /* |
| 2 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 3 | * Copyright 2015 gRPC authors. |
Jorge Canizales | 91db5ac | 2015-10-28 14:53:38 -0700 | [diff] [blame] | 4 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
Jorge Canizales | 91db5ac | 2015-10-28 14:53:38 -0700 | [diff] [blame] | 8 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Jorge Canizales | 91db5ac | 2015-10-28 14:53:38 -0700 | [diff] [blame] | 10 | * |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
Jorge Canizales | 91db5ac | 2015-10-28 14:53:38 -0700 | [diff] [blame] | 16 | * |
| 17 | */ |
| 18 | |
Muxi Yan | 8e6aec5 | 2017-02-10 09:40:18 -0800 | [diff] [blame] | 19 | #import <GRPCClient/GRPCCall+Tests.h> |
| 20 | #import <GRPCClient/internal_testing/GRPCCall+InternalTests.h> |
Jorge Canizales | 91db5ac | 2015-10-28 14:53:38 -0700 | [diff] [blame] | 21 | |
| 22 | #import "InteropTests.h" |
| 23 | |
Makarand Dharmapurikar | b4e9727 | 2017-04-12 12:16:28 -0700 | [diff] [blame] | 24 | // The server address is derived from preprocessor macro, which is |
| 25 | // in turn derived from environment variable of the same name. |
| 26 | #define NSStringize_helper(x) #x |
| 27 | #define NSStringize(x) @NSStringize_helper(x) |
Muxi Yan | c92d90a | 2018-04-11 18:10:02 -0700 | [diff] [blame] | 28 | static NSString *const kRemoteSSLHost = NSStringize(HOST_PORT_REMOTE); |
Jorge Canizales | 91db5ac | 2015-10-28 14:53:38 -0700 | [diff] [blame] | 29 | |
Muxi Yan | dc87ef5 | 2017-03-10 11:41:53 -0800 | [diff] [blame] | 30 | // The Protocol Buffers encoding overhead of remote interop server. Acquired |
| 31 | // by experiment. Adjust this when server's proto file changes. |
| 32 | static int32_t kRemoteInteropServerOverhead = 12; |
| 33 | |
Jorge Canizales | 2beb88c | 2015-10-28 15:13:40 -0700 | [diff] [blame] | 34 | /** Tests in InteropTests.m, sending the RPCs to a remote SSL server. */ |
Jorge Canizales | 91db5ac | 2015-10-28 14:53:38 -0700 | [diff] [blame] | 35 | @interface InteropTestsRemote : InteropTests |
| 36 | @end |
| 37 | |
| 38 | @implementation InteropTestsRemote |
| 39 | |
| 40 | + (NSString *)host { |
| 41 | return kRemoteSSLHost; |
| 42 | } |
| 43 | |
Jorge Canizales | 9e83d7e | 2016-08-01 12:51:31 -0700 | [diff] [blame] | 44 | - (int32_t)encodingOverhead { |
Muxi Yan | c92d90a | 2018-04-11 18:10:02 -0700 | [diff] [blame] | 45 | return kRemoteInteropServerOverhead; // bytes |
Jorge Canizales | 9e83d7e | 2016-08-01 12:51:31 -0700 | [diff] [blame] | 46 | } |
| 47 | |
Jorge Canizales | 91db5ac | 2015-10-28 14:53:38 -0700 | [diff] [blame] | 48 | @end |