From d869bed623f9340d8be4e16d0a96a7fc871776d2 Mon Sep 17 00:00:00 2001 From: Matthew Stevenson Date: Wed, 5 Feb 2020 15:56:16 -0800 Subject: [PATCH] Added in server builder. --- test/cpp/client/credentials_test.cc | 7 +++++-- tools/internal_ci/macos/grpc_experiment.cfg | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 tools/internal_ci/macos/grpc_experiment.cfg diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc index 002c5e87cc9..5a3e58b0b6c 100644 --- a/test/cpp/client/credentials_test.cc +++ b/test/cpp/client/credentials_test.cc @@ -19,6 +19,7 @@ #include #include #include +#include #include @@ -690,6 +691,10 @@ TEST_F(CredentialsTest, LoadTlsServerCredentials) { TlsCredentialsOptions options = TlsCredentialsOptions( GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY, GRPC_TLS_SERVER_VERIFICATION, nullptr, credential_reload_config, nullptr); + // It is necessary to instantiate a |ServerBuilder| object so that the C-core + // is properly initialized. + ::grpc::ServerBuilder builder; + (void)builder; std::shared_ptr<::grpc_impl::ServerCredentials> server_credentials = grpc::experimental::TlsServerCredentials(options); GPR_ASSERT(server_credentials.get() != nullptr); @@ -762,8 +767,6 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigErrorMessages) { int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); - grpc_init(); int ret = RUN_ALL_TESTS(); - grpc_shutdown(); return ret; } diff --git a/tools/internal_ci/macos/grpc_experiment.cfg b/tools/internal_ci/macos/grpc_experiment.cfg new file mode 100644 index 00000000000..3b15ca78b6a --- /dev/null +++ b/tools/internal_ci/macos/grpc_experiment.cfg @@ -0,0 +1,18 @@ +# Copyright 2019 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Config file for the internal CI (in protobuf text format) + +# Location of the continuous shell script in repository. +build_file: "grpc/tools/internal_ci/macos/grpc_run_bazel_cpp_ios_tests.sh"