| 1 |
#!/bin/bash |
| 2 |
# Copyright 2019 gRPC authors. |
| 3 |
# |
| 4 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
# you may not use this file except in compliance with the License. |
| 6 |
# You may obtain a copy of the License at |
| 7 |
# |
| 8 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
# |
| 10 |
# Unless required by applicable law or agreed to in writing, software |
| 11 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
# See the License for the specific language governing permissions and |
| 14 |
# limitations under the License. |
| 15 |
|
| 16 |
# Don't run this script standalone. Instead, run from the repository root: |
| 17 |
# ./tools/run_tests/run_tests.py -l objc |
| 18 |
|
| 19 |
# TODO(tonyzhehaolu): |
| 20 |
# For future use when Xcode is upgraded and tvos_unit_test is fully functional |
| 21 |
|
| 22 |
set -ev |
| 23 |
|
| 24 |
cd $(dirname $0) |
| 25 |
|
| 26 |
BAZEL=../../../tools/bazel |
| 27 |
|
| 28 |
INTEROP=../../../bazel-out/darwin-fastbuild/bin/test/cpp/interop/interop_server |
| 29 |
|
| 30 |
[ -f $INTEROP ] || { |
| 31 |
$BAZEL build //test/cpp/interop:interop_server |
| 32 |
} |
| 33 |
|
| 34 |
[ -z "$(ps aux |egrep 'port_server\.py.*-p\s32766')" ] && { |
| 35 |
echo >&2 "Can't find the port server. Start port server with tools/run_tests/start_port_server.py." |
| 36 |
exit 1 |
| 37 |
} |
| 38 |
|
| 39 |
PLAIN_PORT=$(curl localhost:32766/get) |
| 40 |
TLS_PORT=$(curl localhost:32766/get) |
| 41 |
|
| 42 |
$INTEROP --port=$PLAIN_PORT --max_send_message_size=8388608 & |
| 43 |
$INTEROP --port=$TLS_PORT --max_send_message_size=8388608 --use_tls & |
| 44 |
|
| 45 |
trap 'kill -9 `jobs -p` ; echo "EXIT TIME: $(date)"' EXIT |
| 46 |
|
| 47 |
time $BAZEL run \ |
| 48 |
--test_env HOST_PORT_LOCALSSL=localhost:$TLS_PORT \ |
| 49 |
--test_env HOST_PORT_LOCAL=localhost:$PLAIN_PORT \ |
| 50 |
$SCHEME |