From 7d2a3e1917ebfd4e1262020b021b3bf09d238c86 Mon Sep 17 00:00:00 2001 From: yang-g Date: Thu, 18 Feb 2016 15:41:56 -0800 Subject: Refactor end2end_test. Make the credentials a separate library. --- test/cpp/util/test_credentials_provider.h | 61 +++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 test/cpp/util/test_credentials_provider.h (limited to 'test/cpp/util/test_credentials_provider.h') diff --git a/test/cpp/util/test_credentials_provider.h b/test/cpp/util/test_credentials_provider.h new file mode 100644 index 0000000000..4f25e3be66 --- /dev/null +++ b/test/cpp/util/test_credentials_provider.h @@ -0,0 +1,61 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef GRPC_TEST_CPP_UTIL_TEST_CREDENTIALS_PROVIDER_H +#define GRPC_TEST_CPP_UTIL_TEST_CREDENTIALS_PROVIDER_H + +#include + +#include +#include +#include + +namespace grpc { +namespace testing { + +const char kInsecureCredentialsType[] = "INSECURE_CREDENTIALS"; +const char kTlsCredentialsType[] = "TLS_CREDENTIALS"; + +// Provide channel credentials according to the given type. Alter the channel +// arguments if needed. +std::shared_ptr GetChannelCredentials( + const grpc::string& type, ChannelArguments* args); + +// Provide server credentials according to the given type. +std::shared_ptr GetServerCredentials( + const grpc::string& type); + +} // namespace testing +} // namespace grpc + +#endif // GRPC_TEST_CPP_UTIL_TEST_CREDENTIALS_PROVIDER_H -- cgit v1.2.3 From 5152cd29f8541d7600b7ddc3d9db188ad59ea673 Mon Sep 17 00:00:00 2001 From: yang-g Date: Thu, 18 Feb 2016 16:37:51 -0800 Subject: make an enum --- test/cpp/end2end/end2end_test.cc | 62 +++++++++++++++++++----------- test/cpp/util/test_credentials_provider.cc | 28 ++++++++++---- test/cpp/util/test_credentials_provider.h | 13 +++++-- 3 files changed, 69 insertions(+), 34 deletions(-) (limited to 'test/cpp/util/test_credentials_provider.h') diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index df9aae7436..2169afb816 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -191,14 +191,14 @@ class TestServiceImplDupPkg class TestScenario { public: - TestScenario(bool proxy, const grpc::string& creds_type) - : use_proxy(proxy), credentials_type(creds_type) {} + TestScenario(bool proxy, TestCredentialsType type) + : use_proxy(proxy), credentials_type(type) {} void Log() const { gpr_log(GPR_INFO, "Scenario: proxy %d, credentials %s", use_proxy, - credentials_type.c_str()); + TestCredentialsTypeToString(credentials_type).c_str()); } bool use_proxy; - const grpc::string credentials_type; + TestCredentialsType credentials_type; }; class End2endTest : public ::testing::TestWithParam { @@ -223,7 +223,7 @@ class End2endTest : public ::testing::TestWithParam { // Setup server ServerBuilder builder; auto server_creds = GetServerCredentials(GetParam().credentials_type); - if (GetParam().credentials_type != kInsecureCredentialsType) { + if (GetParam().credentials_type != INSECURE_CREDENTIALS) { server_creds->SetAuthMetadataProcessor(processor); } builder.AddListeningPort(server_address_.str(), server_creds); @@ -933,7 +933,7 @@ TEST_P(End2endTest, ChannelState) { // Takes 10s. TEST_P(End2endTest, ChannelStateTimeout) { - if (GetParam().credentials_type != kInsecureCredentialsType) { + if (GetParam().credentials_type != INSECURE_CREDENTIALS) { return; } int port = grpc_pick_unused_port_or_die(); @@ -1142,7 +1142,7 @@ class SecureEnd2endTest : public End2endTest { protected: SecureEnd2endTest() { GPR_ASSERT(!GetParam().use_proxy); - GPR_ASSERT(GetParam().credentials_type != kInsecureCredentialsType); + GPR_ASSERT(GetParam().credentials_type != INSECURE_CREDENTIALS); } }; @@ -1365,25 +1365,43 @@ TEST_P(SecureEnd2endTest, ClientAuthContext) { EXPECT_EQ("*.test.youtube.com", ToString(auth_ctx->GetPeerIdentity()[2])); } -INSTANTIATE_TEST_CASE_P( - End2end, End2endTest, - ::testing::Values(TestScenario(false, kInsecureCredentialsType), - TestScenario(false, kTlsCredentialsType))); +std::vector CreateTestScenarios(bool use_proxy, + bool test_insecure, + bool test_secure) { + std::vector scenarios; + for (int i = INSECURE_CREDENTIALS; i < MAX_CREDENTIALS_TYPE; i++) { + if (i == INSECURE_CREDENTIALS && !test_insecure) { + continue; + } + if (i != INSECURE_CREDENTIALS && !test_secure) { + continue; + } + if (use_proxy) { + scenarios.push_back( + TestScenario(true, static_cast(i))); + } + scenarios.push_back( + TestScenario(false, static_cast(i))); + } + GPR_ASSERT(!scenarios.empty()); + return scenarios; +} + +INSTANTIATE_TEST_CASE_P(End2end, End2endTest, + ::testing::ValuesIn(CreateTestScenarios(false, true, + true))); -INSTANTIATE_TEST_CASE_P( - End2endServerTryCancel, End2endServerTryCancelTest, - ::testing::Values(TestScenario(false, kInsecureCredentialsType))); +INSTANTIATE_TEST_CASE_P(End2endServerTryCancel, End2endServerTryCancelTest, + ::testing::ValuesIn(CreateTestScenarios(false, true, + false))); -INSTANTIATE_TEST_CASE_P( - ProxyEnd2end, ProxyEnd2endTest, - ::testing::Values(TestScenario(false, kInsecureCredentialsType), - TestScenario(false, kTlsCredentialsType), - TestScenario(true, kInsecureCredentialsType), - TestScenario(true, kTlsCredentialsType))); +INSTANTIATE_TEST_CASE_P(ProxyEnd2end, ProxyEnd2endTest, + ::testing::ValuesIn(CreateTestScenarios(true, true, + true))); INSTANTIATE_TEST_CASE_P(SecureEnd2end, SecureEnd2endTest, - ::testing::Values(TestScenario(false, - kTlsCredentialsType))); + ::testing::ValuesIn(CreateTestScenarios(false, false, + true))); } // namespace } // namespace testing diff --git a/test/cpp/util/test_credentials_provider.cc b/test/cpp/util/test_credentials_provider.cc index f8380cdb65..9746ca692a 100644 --- a/test/cpp/util/test_credentials_provider.cc +++ b/test/cpp/util/test_credentials_provider.cc @@ -40,24 +40,24 @@ namespace grpc { namespace testing { std::shared_ptr GetChannelCredentials( - const grpc::string& type, ChannelArguments* args) { - if (type == kInsecureCredentialsType) { + TestCredentialsType type, ChannelArguments* args) { + if (type == INSECURE_CREDENTIALS) { return InsecureChannelCredentials(); - } else if (type == kTlsCredentialsType) { + } else if (type == TLS_CREDENTIALS) { SslCredentialsOptions ssl_opts = {test_root_cert, "", ""}; args->SetSslTargetNameOverride("foo.test.google.fr"); return SslCredentials(ssl_opts); } else { - gpr_log(GPR_ERROR, "Unsupported credentials type %s.", type.c_str()); + gpr_log(GPR_ERROR, "Unsupported credentials type %d.", type); } return nullptr; } std::shared_ptr GetServerCredentials( - const grpc::string& type) { - if (type == kInsecureCredentialsType) { + TestCredentialsType type) { + if (type == INSECURE_CREDENTIALS) { return InsecureServerCredentials(); - } else if (type == kTlsCredentialsType) { + } else if (type == TLS_CREDENTIALS) { SslServerCredentialsOptions::PemKeyCertPair pkcp = {test_server1_key, test_server1_cert}; SslServerCredentialsOptions ssl_opts; @@ -65,10 +65,22 @@ std::shared_ptr GetServerCredentials( ssl_opts.pem_key_cert_pairs.push_back(pkcp); return SslServerCredentials(ssl_opts); } else { - gpr_log(GPR_ERROR, "Unsupported credentials type %s.", type.c_str()); + gpr_log(GPR_ERROR, "Unsupported credentials type %d.", type); } return nullptr; } +grpc::string TestCredentialsTypeToString(TestCredentialsType type) { + switch (type) { + case INSECURE_CREDENTIALS: + return "INSECURE_CREDENTIALS"; + case TLS_CREDENTIALS: + return "TLS_CREDENTIALS"; + default: + break; + } + return "UNKNOWN"; +} + } // namespace testing } // namespace grpc diff --git a/test/cpp/util/test_credentials_provider.h b/test/cpp/util/test_credentials_provider.h index 4f25e3be66..005254a652 100644 --- a/test/cpp/util/test_credentials_provider.h +++ b/test/cpp/util/test_credentials_provider.h @@ -43,17 +43,22 @@ namespace grpc { namespace testing { -const char kInsecureCredentialsType[] = "INSECURE_CREDENTIALS"; -const char kTlsCredentialsType[] = "TLS_CREDENTIALS"; +enum TestCredentialsType { + INSECURE_CREDENTIALS = 0, + TLS_CREDENTIALS, + MAX_CREDENTIALS_TYPE +}; // Provide channel credentials according to the given type. Alter the channel // arguments if needed. std::shared_ptr GetChannelCredentials( - const grpc::string& type, ChannelArguments* args); + TestCredentialsType type, ChannelArguments* args); // Provide server credentials according to the given type. std::shared_ptr GetServerCredentials( - const grpc::string& type); + TestCredentialsType type); + +grpc::string TestCredentialsTypeToString(TestCredentialsType type); } // namespace testing } // namespace grpc -- cgit v1.2.3 From 17197ddc714d5268a6b1fca678ac8b94ed74f3bd Mon Sep 17 00:00:00 2001 From: yang-g Date: Fri, 19 Feb 2016 00:04:22 -0800 Subject: Revert "make an enum" This reverts commit 5152cd29f8541d7600b7ddc3d9db188ad59ea673. --- test/cpp/end2end/end2end_test.cc | 62 +++++++++++------------------- test/cpp/util/test_credentials_provider.cc | 28 ++++---------- test/cpp/util/test_credentials_provider.h | 13 ++----- 3 files changed, 34 insertions(+), 69 deletions(-) (limited to 'test/cpp/util/test_credentials_provider.h') diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index 2169afb816..df9aae7436 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -191,14 +191,14 @@ class TestServiceImplDupPkg class TestScenario { public: - TestScenario(bool proxy, TestCredentialsType type) - : use_proxy(proxy), credentials_type(type) {} + TestScenario(bool proxy, const grpc::string& creds_type) + : use_proxy(proxy), credentials_type(creds_type) {} void Log() const { gpr_log(GPR_INFO, "Scenario: proxy %d, credentials %s", use_proxy, - TestCredentialsTypeToString(credentials_type).c_str()); + credentials_type.c_str()); } bool use_proxy; - TestCredentialsType credentials_type; + const grpc::string credentials_type; }; class End2endTest : public ::testing::TestWithParam { @@ -223,7 +223,7 @@ class End2endTest : public ::testing::TestWithParam { // Setup server ServerBuilder builder; auto server_creds = GetServerCredentials(GetParam().credentials_type); - if (GetParam().credentials_type != INSECURE_CREDENTIALS) { + if (GetParam().credentials_type != kInsecureCredentialsType) { server_creds->SetAuthMetadataProcessor(processor); } builder.AddListeningPort(server_address_.str(), server_creds); @@ -933,7 +933,7 @@ TEST_P(End2endTest, ChannelState) { // Takes 10s. TEST_P(End2endTest, ChannelStateTimeout) { - if (GetParam().credentials_type != INSECURE_CREDENTIALS) { + if (GetParam().credentials_type != kInsecureCredentialsType) { return; } int port = grpc_pick_unused_port_or_die(); @@ -1142,7 +1142,7 @@ class SecureEnd2endTest : public End2endTest { protected: SecureEnd2endTest() { GPR_ASSERT(!GetParam().use_proxy); - GPR_ASSERT(GetParam().credentials_type != INSECURE_CREDENTIALS); + GPR_ASSERT(GetParam().credentials_type != kInsecureCredentialsType); } }; @@ -1365,43 +1365,25 @@ TEST_P(SecureEnd2endTest, ClientAuthContext) { EXPECT_EQ("*.test.youtube.com", ToString(auth_ctx->GetPeerIdentity()[2])); } -std::vector CreateTestScenarios(bool use_proxy, - bool test_insecure, - bool test_secure) { - std::vector scenarios; - for (int i = INSECURE_CREDENTIALS; i < MAX_CREDENTIALS_TYPE; i++) { - if (i == INSECURE_CREDENTIALS && !test_insecure) { - continue; - } - if (i != INSECURE_CREDENTIALS && !test_secure) { - continue; - } - if (use_proxy) { - scenarios.push_back( - TestScenario(true, static_cast(i))); - } - scenarios.push_back( - TestScenario(false, static_cast(i))); - } - GPR_ASSERT(!scenarios.empty()); - return scenarios; -} - -INSTANTIATE_TEST_CASE_P(End2end, End2endTest, - ::testing::ValuesIn(CreateTestScenarios(false, true, - true))); +INSTANTIATE_TEST_CASE_P( + End2end, End2endTest, + ::testing::Values(TestScenario(false, kInsecureCredentialsType), + TestScenario(false, kTlsCredentialsType))); -INSTANTIATE_TEST_CASE_P(End2endServerTryCancel, End2endServerTryCancelTest, - ::testing::ValuesIn(CreateTestScenarios(false, true, - false))); +INSTANTIATE_TEST_CASE_P( + End2endServerTryCancel, End2endServerTryCancelTest, + ::testing::Values(TestScenario(false, kInsecureCredentialsType))); -INSTANTIATE_TEST_CASE_P(ProxyEnd2end, ProxyEnd2endTest, - ::testing::ValuesIn(CreateTestScenarios(true, true, - true))); +INSTANTIATE_TEST_CASE_P( + ProxyEnd2end, ProxyEnd2endTest, + ::testing::Values(TestScenario(false, kInsecureCredentialsType), + TestScenario(false, kTlsCredentialsType), + TestScenario(true, kInsecureCredentialsType), + TestScenario(true, kTlsCredentialsType))); INSTANTIATE_TEST_CASE_P(SecureEnd2end, SecureEnd2endTest, - ::testing::ValuesIn(CreateTestScenarios(false, false, - true))); + ::testing::Values(TestScenario(false, + kTlsCredentialsType))); } // namespace } // namespace testing diff --git a/test/cpp/util/test_credentials_provider.cc b/test/cpp/util/test_credentials_provider.cc index 9746ca692a..f8380cdb65 100644 --- a/test/cpp/util/test_credentials_provider.cc +++ b/test/cpp/util/test_credentials_provider.cc @@ -40,24 +40,24 @@ namespace grpc { namespace testing { std::shared_ptr GetChannelCredentials( - TestCredentialsType type, ChannelArguments* args) { - if (type == INSECURE_CREDENTIALS) { + const grpc::string& type, ChannelArguments* args) { + if (type == kInsecureCredentialsType) { return InsecureChannelCredentials(); - } else if (type == TLS_CREDENTIALS) { + } else if (type == kTlsCredentialsType) { SslCredentialsOptions ssl_opts = {test_root_cert, "", ""}; args->SetSslTargetNameOverride("foo.test.google.fr"); return SslCredentials(ssl_opts); } else { - gpr_log(GPR_ERROR, "Unsupported credentials type %d.", type); + gpr_log(GPR_ERROR, "Unsupported credentials type %s.", type.c_str()); } return nullptr; } std::shared_ptr GetServerCredentials( - TestCredentialsType type) { - if (type == INSECURE_CREDENTIALS) { + const grpc::string& type) { + if (type == kInsecureCredentialsType) { return InsecureServerCredentials(); - } else if (type == TLS_CREDENTIALS) { + } else if (type == kTlsCredentialsType) { SslServerCredentialsOptions::PemKeyCertPair pkcp = {test_server1_key, test_server1_cert}; SslServerCredentialsOptions ssl_opts; @@ -65,22 +65,10 @@ std::shared_ptr GetServerCredentials( ssl_opts.pem_key_cert_pairs.push_back(pkcp); return SslServerCredentials(ssl_opts); } else { - gpr_log(GPR_ERROR, "Unsupported credentials type %d.", type); + gpr_log(GPR_ERROR, "Unsupported credentials type %s.", type.c_str()); } return nullptr; } -grpc::string TestCredentialsTypeToString(TestCredentialsType type) { - switch (type) { - case INSECURE_CREDENTIALS: - return "INSECURE_CREDENTIALS"; - case TLS_CREDENTIALS: - return "TLS_CREDENTIALS"; - default: - break; - } - return "UNKNOWN"; -} - } // namespace testing } // namespace grpc diff --git a/test/cpp/util/test_credentials_provider.h b/test/cpp/util/test_credentials_provider.h index 005254a652..4f25e3be66 100644 --- a/test/cpp/util/test_credentials_provider.h +++ b/test/cpp/util/test_credentials_provider.h @@ -43,22 +43,17 @@ namespace grpc { namespace testing { -enum TestCredentialsType { - INSECURE_CREDENTIALS = 0, - TLS_CREDENTIALS, - MAX_CREDENTIALS_TYPE -}; +const char kInsecureCredentialsType[] = "INSECURE_CREDENTIALS"; +const char kTlsCredentialsType[] = "TLS_CREDENTIALS"; // Provide channel credentials according to the given type. Alter the channel // arguments if needed. std::shared_ptr GetChannelCredentials( - TestCredentialsType type, ChannelArguments* args); + const grpc::string& type, ChannelArguments* args); // Provide server credentials according to the given type. std::shared_ptr GetServerCredentials( - TestCredentialsType type); - -grpc::string TestCredentialsTypeToString(TestCredentialsType type); + const grpc::string& type); } // namespace testing } // namespace grpc -- cgit v1.2.3 From 4c8aed3dbad9fdf749052a79d8f5f608bfb120fe Mon Sep 17 00:00:00 2001 From: yang-g Date: Fri, 19 Feb 2016 00:19:39 -0800 Subject: Add a helper to return all the secure types --- test/cpp/end2end/end2end_test.cc | 51 ++++++++++++++++++++---------- test/cpp/util/test_credentials_provider.cc | 6 ++++ test/cpp/util/test_credentials_provider.h | 3 ++ 3 files changed, 43 insertions(+), 17 deletions(-) (limited to 'test/cpp/util/test_credentials_provider.h') diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index df9aae7436..ce8e4d2a10 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -1365,25 +1365,42 @@ TEST_P(SecureEnd2endTest, ClientAuthContext) { EXPECT_EQ("*.test.youtube.com", ToString(auth_ctx->GetPeerIdentity()[2])); } -INSTANTIATE_TEST_CASE_P( - End2end, End2endTest, - ::testing::Values(TestScenario(false, kInsecureCredentialsType), - TestScenario(false, kTlsCredentialsType))); - -INSTANTIATE_TEST_CASE_P( - End2endServerTryCancel, End2endServerTryCancelTest, - ::testing::Values(TestScenario(false, kInsecureCredentialsType))); - -INSTANTIATE_TEST_CASE_P( - ProxyEnd2end, ProxyEnd2endTest, - ::testing::Values(TestScenario(false, kInsecureCredentialsType), - TestScenario(false, kTlsCredentialsType), - TestScenario(true, kInsecureCredentialsType), - TestScenario(true, kTlsCredentialsType))); +std::vector CreateTestScenarios(bool use_proxy, + bool test_insecure, + bool test_secure) { + std::vector scenarios; + std::vector credentials_types; + if (test_secure) { + credentials_types = GetSecureCredentialsTypeList(); + } + if (test_insecure) { + credentials_types.push_back(kInsecureCredentialsType); + } + for (auto it = credentials_types.begin(); it != credentials_types.end(); + ++it) { + scenarios.push_back(TestScenario(false, *it)); + if (use_proxy) { + scenarios.push_back(TestScenario(true, *it)); + } + } + return scenarios; +} + +INSTANTIATE_TEST_CASE_P(End2end, End2endTest, + ::testing::ValuesIn(CreateTestScenarios(false, true, + true))); + +INSTANTIATE_TEST_CASE_P(End2endServerTryCancel, End2endServerTryCancelTest, + ::testing::ValuesIn(CreateTestScenarios(false, true, + false))); + +INSTANTIATE_TEST_CASE_P(ProxyEnd2end, ProxyEnd2endTest, + ::testing::ValuesIn(CreateTestScenarios(true, true, + true))); INSTANTIATE_TEST_CASE_P(SecureEnd2end, SecureEnd2endTest, - ::testing::Values(TestScenario(false, - kTlsCredentialsType))); + ::testing::ValuesIn(CreateTestScenarios(false, false, + true))); } // namespace } // namespace testing diff --git a/test/cpp/util/test_credentials_provider.cc b/test/cpp/util/test_credentials_provider.cc index f8380cdb65..69651700fe 100644 --- a/test/cpp/util/test_credentials_provider.cc +++ b/test/cpp/util/test_credentials_provider.cc @@ -70,5 +70,11 @@ std::shared_ptr GetServerCredentials( return nullptr; } +std::vector GetSecureCredentialsTypeList() { + std::vector types; + types.push_back(kTlsCredentialsType); + return types; +} + } // namespace testing } // namespace grpc diff --git a/test/cpp/util/test_credentials_provider.h b/test/cpp/util/test_credentials_provider.h index 4f25e3be66..f4105d94b8 100644 --- a/test/cpp/util/test_credentials_provider.h +++ b/test/cpp/util/test_credentials_provider.h @@ -55,6 +55,9 @@ std::shared_ptr GetChannelCredentials( std::shared_ptr GetServerCredentials( const grpc::string& type); +// Provide a list of secure credentials type. +std::vector GetSecureCredentialsTypeList(); + } // namespace testing } // namespace grpc -- cgit v1.2.3 From 12a0a2c20b5f377b4495d257ee961a111c3dff6e Mon Sep 17 00:00:00 2001 From: yang-g Date: Fri, 19 Feb 2016 00:22:20 -0800 Subject: move tls type name to .cc file --- test/cpp/util/test_credentials_provider.cc | 2 ++ test/cpp/util/test_credentials_provider.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'test/cpp/util/test_credentials_provider.h') diff --git a/test/cpp/util/test_credentials_provider.cc b/test/cpp/util/test_credentials_provider.cc index 69651700fe..1086e14258 100644 --- a/test/cpp/util/test_credentials_provider.cc +++ b/test/cpp/util/test_credentials_provider.cc @@ -39,6 +39,8 @@ namespace grpc { namespace testing { +const char kTlsCredentialsType[] = "TLS_CREDENTIALS"; + std::shared_ptr GetChannelCredentials( const grpc::string& type, ChannelArguments* args) { if (type == kInsecureCredentialsType) { diff --git a/test/cpp/util/test_credentials_provider.h b/test/cpp/util/test_credentials_provider.h index f4105d94b8..f7253051a9 100644 --- a/test/cpp/util/test_credentials_provider.h +++ b/test/cpp/util/test_credentials_provider.h @@ -44,7 +44,6 @@ namespace grpc { namespace testing { const char kInsecureCredentialsType[] = "INSECURE_CREDENTIALS"; -const char kTlsCredentialsType[] = "TLS_CREDENTIALS"; // Provide channel credentials according to the given type. Alter the channel // arguments if needed. -- cgit v1.2.3