aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/core/echo/server.c4
-rw-r--r--test/core/end2end/fixtures/chttp2_fake_security.c4
-rw-r--r--test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c4
-rw-r--r--test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c4
-rw-r--r--test/core/fling/server.c4
-rw-r--r--test/core/surface/lame_client_test.c2
-rw-r--r--test/cpp/client/credentials_test.cc3
-rw-r--r--test/cpp/end2end/async_end2end_test.cc7
-rw-r--r--test/cpp/end2end/end2end_test.cc14
-rw-r--r--test/cpp/interop/client.cc17
-rw-r--r--test/cpp/interop/server.cc12
-rw-r--r--test/cpp/qps/server.cc3
-rw-r--r--test/cpp/qps/server_async.cc4
-rw-r--r--test/cpp/util/create_test_channel.cc10
14 files changed, 46 insertions, 46 deletions
diff --git a/test/core/echo/server.c b/test/core/echo/server.c
index bc84645a04..e888a0c877 100644
--- a/test/core/echo/server.c
+++ b/test/core/echo/server.c
@@ -143,8 +143,8 @@ int main(int argc, char **argv) {
test_server1_cert};
grpc_server_credentials *ssl_creds =
grpc_ssl_server_credentials_create(NULL, &pem_key_cert_pair, 1);
- server = grpc_secure_server_create(ssl_creds, cq, &args);
- GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr));
+ server = grpc_server_create(cq, &args);
+ GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, ssl_creds));
grpc_server_credentials_release(ssl_creds);
} else {
server = grpc_server_create(cq, &args);
diff --git a/test/core/end2end/fixtures/chttp2_fake_security.c b/test/core/end2end/fixtures/chttp2_fake_security.c
index 247d1fd322..047d482be3 100644
--- a/test/core/end2end/fixtures/chttp2_fake_security.c
+++ b/test/core/end2end/fixtures/chttp2_fake_security.c
@@ -84,9 +84,9 @@ static void chttp2_init_server_secure_fullstack(
grpc_server_destroy(f->server);
}
f->server =
- grpc_secure_server_create(server_creds, f->server_cq, server_args);
+ grpc_server_create(f->server_cq, server_args);
+ GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr, server_creds));
grpc_server_credentials_release(server_creds);
- GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr));
grpc_server_start(f->server);
}
diff --git a/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c b/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c
index 3df2e40806..16433f5f87 100644
--- a/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c
+++ b/test/core/end2end/fixtures/chttp2_simple_ssl_fullstack.c
@@ -87,9 +87,9 @@ static void chttp2_init_server_secure_fullstack(
grpc_server_destroy(f->server);
}
f->server =
- grpc_secure_server_create(server_creds, f->server_cq, server_args);
+ grpc_server_create(f->server_cq, server_args);
+ GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr, server_creds));
grpc_server_credentials_release(server_creds);
- GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr));
grpc_server_start(f->server);
}
diff --git a/test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c b/test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c
index 8d6c561d25..99031df8e5 100644
--- a/test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c
+++ b/test/core/end2end/fixtures/chttp2_simple_ssl_with_oauth2_fullstack.c
@@ -85,9 +85,9 @@ static void chttp2_init_server_secure_fullstack(
grpc_server_destroy(f->server);
}
f->server =
- grpc_secure_server_create(server_creds, f->server_cq, server_args);
+ grpc_server_create(f->server_cq, server_args);
+ GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr, server_creds));
grpc_server_credentials_release(server_creds);
- GPR_ASSERT(grpc_server_add_secure_http2_port(f->server, ffd->localaddr));
grpc_server_start(f->server);
}
diff --git a/test/core/fling/server.c b/test/core/fling/server.c
index 5c1ab14d03..ca39cd84b1 100644
--- a/test/core/fling/server.c
+++ b/test/core/fling/server.c
@@ -205,8 +205,8 @@ int main(int argc, char **argv) {
test_server1_cert};
grpc_server_credentials *ssl_creds =
grpc_ssl_server_credentials_create(NULL, &pem_key_cert_pair, 1);
- server = grpc_secure_server_create(ssl_creds, cq, NULL);
- GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr));
+ server = grpc_server_create(cq, NULL);
+ GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr, ssl_creds));
grpc_server_credentials_release(ssl_creds);
} else {
server = grpc_server_create(cq, NULL);
diff --git a/test/core/surface/lame_client_test.c b/test/core/surface/lame_client_test.c
index 3653c5a1b0..f0420896ee 100644
--- a/test/core/surface/lame_client_test.c
+++ b/test/core/surface/lame_client_test.c
@@ -31,7 +31,7 @@
*
*/
-#include "src/core/surface/lame_client.h"
+#include <grpc/grpc.h>
#include "test/core/end2end/cq_verifier.h"
#include "test/core/util/test_config.h"
diff --git a/test/cpp/client/credentials_test.cc b/test/cpp/client/credentials_test.cc
index dc8d76d7ef..59ca33cc29 100644
--- a/test/cpp/client/credentials_test.cc
+++ b/test/cpp/client/credentials_test.cc
@@ -47,8 +47,7 @@ class CredentialsTest : public ::testing::Test {
TEST_F(CredentialsTest, InvalidServiceAccountCreds) {
std::unique_ptr<Credentials> bad1 =
- CredentialsFactory::ServiceAccountCredentials("", "",
- std::chrono::seconds(1));
+ ServiceAccountCredentials("", "", std::chrono::seconds(1));
EXPECT_EQ(nullptr, bad1.get());
}
diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc
index 331a5ef8a0..70df9e14b2 100644
--- a/test/cpp/end2end/async_end2end_test.cc
+++ b/test/cpp/end2end/async_end2end_test.cc
@@ -47,6 +47,7 @@
#include <grpc++/server.h>
#include <grpc++/server_builder.h>
#include <grpc++/server_context.h>
+#include <grpc++/server_credentials.h>
#include <grpc++/status.h>
#include <grpc++/stream.h>
#include "test/core/util/port.h"
@@ -84,7 +85,7 @@ class AsyncEnd2endTest : public ::testing::Test {
server_address_ << "localhost:" << port;
// Setup server
ServerBuilder builder;
- builder.AddPort(server_address_.str());
+ builder.AddPort(server_address_.str(), grpc::InsecureServerCredentials());
builder.RegisterAsyncService(&service_);
server_ = builder.BuildAndStart();
}
@@ -102,8 +103,8 @@ class AsyncEnd2endTest : public ::testing::Test {
}
void ResetStub() {
- std::shared_ptr<ChannelInterface> channel =
- CreateChannelDeprecated(server_address_.str(), ChannelArguments());
+ std::shared_ptr<ChannelInterface> channel = CreateChannel(
+ server_address_.str(), InsecureCredentials(), ChannelArguments());
stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel));
}
diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc
index 1d5dfc4e34..c586849349 100644
--- a/test/cpp/end2end/end2end_test.cc
+++ b/test/cpp/end2end/end2end_test.cc
@@ -47,6 +47,7 @@
#include <grpc++/server.h>
#include <grpc++/server_builder.h>
#include <grpc++/server_context.h>
+#include <grpc++/server_credentials.h>
#include <grpc++/status.h>
#include <grpc++/stream.h>
#include "test/core/util/port.h"
@@ -150,7 +151,7 @@ class End2endTest : public ::testing::Test {
server_address_ << "localhost:" << port;
// Setup server
ServerBuilder builder;
- builder.AddPort(server_address_.str());
+ builder.AddPort(server_address_.str(), InsecureServerCredentials());
builder.RegisterService(&service_);
builder.RegisterService(&dup_pkg_service_);
builder.SetThreadPool(&thread_pool_);
@@ -160,8 +161,8 @@ class End2endTest : public ::testing::Test {
void TearDown() GRPC_OVERRIDE { server_->Shutdown(); }
void ResetStub() {
- std::shared_ptr<ChannelInterface> channel =
- CreateChannelDeprecated(server_address_.str(), ChannelArguments());
+ std::shared_ptr<ChannelInterface> channel = CreateChannel(
+ server_address_.str(), InsecureCredentials(), ChannelArguments());
stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel));
}
@@ -371,8 +372,8 @@ TEST_F(End2endTest, BidiStream) {
// Talk to the two services with the same name but different package names.
// The two stubs are created on the same channel.
TEST_F(End2endTest, DiffPackageServices) {
- std::shared_ptr<ChannelInterface> channel =
- CreateChannelDeprecated(server_address_.str(), ChannelArguments());
+ std::shared_ptr<ChannelInterface> channel = CreateChannel(
+ server_address_.str(), InsecureCredentials(), ChannelArguments());
EchoRequest request;
EchoResponse response;
@@ -397,8 +398,7 @@ TEST_F(End2endTest, DiffPackageServices) {
// rpc and stream should fail on bad credentials.
TEST_F(End2endTest, BadCredentials) {
std::unique_ptr<Credentials> bad_creds =
- CredentialsFactory::ServiceAccountCredentials("", "",
- std::chrono::seconds(1));
+ ServiceAccountCredentials("", "", std::chrono::seconds(1));
EXPECT_EQ(nullptr, bad_creds.get());
std::shared_ptr<ChannelInterface> channel =
CreateChannel(server_address_.str(), bad_creds, ChannelArguments());
diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc
index f7537c2d7b..ae68f7a556 100644
--- a/test/cpp/interop/client.cc
+++ b/test/cpp/interop/client.cc
@@ -82,9 +82,10 @@ DEFINE_string(oauth_scope, "", "Scope for OAuth tokens.");
using grpc::ChannelInterface;
using grpc::ClientContext;
+using grpc::ComputeEngineCredentials;
using grpc::CreateTestChannel;
using grpc::Credentials;
-using grpc::CredentialsFactory;
+using grpc::ServiceAccountCredentials;
using grpc::testing::ResponseParameters;
using grpc::testing::SimpleRequest;
using grpc::testing::SimpleResponse;
@@ -96,8 +97,8 @@ using grpc::testing::TestService;
// In some distros, gflags is in the namespace google, and in some others,
// in gflags. This hack is enabling us to find both.
-namespace google { }
-namespace gflags { }
+namespace google {}
+namespace gflags {}
using namespace google;
using namespace gflags;
@@ -135,14 +136,14 @@ std::shared_ptr<ChannelInterface> CreateChannelForTestCase(
std::unique_ptr<Credentials> creds;
GPR_ASSERT(FLAGS_enable_ssl);
grpc::string json_key = GetServiceAccountJsonKey();
- creds = CredentialsFactory::ServiceAccountCredentials(
- json_key, FLAGS_oauth_scope, std::chrono::hours(1));
+ creds = ServiceAccountCredentials(json_key, FLAGS_oauth_scope,
+ std::chrono::hours(1));
return CreateTestChannel(host_port, FLAGS_server_host_override,
FLAGS_enable_ssl, FLAGS_use_prod_roots, creds);
} else if (test_case == "compute_engine_creds") {
std::unique_ptr<Credentials> creds;
GPR_ASSERT(FLAGS_enable_ssl);
- creds = CredentialsFactory::ComputeEngineCredentials();
+ creds = ComputeEngineCredentials();
return CreateTestChannel(host_port, FLAGS_server_host_override,
FLAGS_enable_ssl, FLAGS_use_prod_roots, creds);
} else {
@@ -202,7 +203,7 @@ void DoComputeEngineCreds() {
GPR_ASSERT(!response.username().empty());
GPR_ASSERT(response.username().c_str() == FLAGS_default_service_account);
GPR_ASSERT(!response.oauth_scope().empty());
- const char *oauth_scope_str = response.oauth_scope().c_str();
+ const char* oauth_scope_str = response.oauth_scope().c_str();
GPR_ASSERT(FLAGS_oauth_scope.find(oauth_scope_str) != grpc::string::npos);
gpr_log(GPR_INFO, "Large unary with compute engine creds done.");
}
@@ -221,7 +222,7 @@ void DoServiceAccountCreds() {
GPR_ASSERT(!response.oauth_scope().empty());
grpc::string json_key = GetServiceAccountJsonKey();
GPR_ASSERT(json_key.find(response.username()) != grpc::string::npos);
- const char *oauth_scope_str = response.oauth_scope().c_str();
+ const char* oauth_scope_str = response.oauth_scope().c_str();
GPR_ASSERT(FLAGS_oauth_scope.find(oauth_scope_str) != grpc::string::npos);
gpr_log(GPR_INFO, "Large unary with service account creds done.");
}
diff --git a/test/cpp/interop/server.cc b/test/cpp/interop/server.cc
index 9810ff6622..743482e967 100644
--- a/test/cpp/interop/server.cc
+++ b/test/cpp/interop/server.cc
@@ -60,7 +60,6 @@ using grpc::Server;
using grpc::ServerBuilder;
using grpc::ServerContext;
using grpc::ServerCredentials;
-using grpc::ServerCredentialsFactory;
using grpc::ServerReader;
using grpc::ServerReaderWriter;
using grpc::ServerWriter;
@@ -78,8 +77,8 @@ using grpc::Status;
// In some distros, gflags is in the namespace google, and in some others,
// in gflags. This hack is enabling us to find both.
-namespace google { }
-namespace gflags { }
+namespace google {}
+namespace gflags {}
using namespace google;
using namespace gflags;
@@ -211,15 +210,14 @@ void RunServer() {
SimpleResponse response;
ServerBuilder builder;
- builder.AddPort(server_address.str());
builder.RegisterService(&service);
+ std::shared_ptr<ServerCredentials> creds = grpc::InsecureServerCredentials();
if (FLAGS_enable_ssl) {
SslServerCredentialsOptions ssl_opts = {
"", {{test_server1_key, test_server1_cert}}};
- std::shared_ptr<ServerCredentials> creds =
- ServerCredentialsFactory::SslCredentials(ssl_opts);
- builder.SetCredentials(creds);
+ creds = grpc::SslServerCredentials(ssl_opts);
}
+ builder.AddPort(server_address.str(), creds);
std::unique_ptr<Server> server(builder.BuildAndStart());
gpr_log(GPR_INFO, "Server listening on %s", server_address.str().c_str());
while (!got_sigint) {
diff --git a/test/cpp/qps/server.cc b/test/cpp/qps/server.cc
index be27c12b30..005f0f9c5e 100644
--- a/test/cpp/qps/server.cc
+++ b/test/cpp/qps/server.cc
@@ -45,6 +45,7 @@
#include <grpc++/server.h>
#include <grpc++/server_builder.h>
#include <grpc++/server_context.h>
+#include <grpc++/server_credentials.h>
#include <grpc++/status.h>
#include "src/cpp/server/thread_pool.h"
#include "test/core/util/grpc_profiler.h"
@@ -136,7 +137,7 @@ static void RunServer() {
SimpleResponse response;
ServerBuilder builder;
- builder.AddPort(server_address);
+ builder.AddPort(server_address, grpc::InsecureServerCredentials());
builder.RegisterService(&service);
std::unique_ptr<ThreadPool> pool(new ThreadPool(FLAGS_server_threads));
diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc
index c006262fc3..a7c7f495d2 100644
--- a/test/cpp/qps/server_async.cc
+++ b/test/cpp/qps/server_async.cc
@@ -46,6 +46,7 @@
#include <grpc++/server.h>
#include <grpc++/server_builder.h>
#include <grpc++/server_context.h>
+#include <grpc++/server_credentials.h>
#include <grpc++/status.h>
#include <gtest/gtest.h>
#include "src/cpp/server/thread_pool.h"
@@ -60,6 +61,7 @@ DEFINE_int32(port, 0, "Server port.");
DEFINE_int32(server_threads, 4, "Number of server threads.");
using grpc::CompletionQueue;
+using grpc::InsecureServerCredentials;
using grpc::Server;
using grpc::ServerBuilder;
using grpc::ServerContext;
@@ -109,7 +111,7 @@ class AsyncQpsServerTest {
gpr_join_host_port(&server_address, "::", FLAGS_port);
ServerBuilder builder;
- builder.AddPort(server_address);
+ builder.AddPort(server_address, InsecureServerCredentials());
builder.RegisterAsyncService(&async_service_);
diff --git a/test/cpp/util/create_test_channel.cc b/test/cpp/util/create_test_channel.cc
index 745496f463..d3b84b2965 100644
--- a/test/cpp/util/create_test_channel.cc
+++ b/test/cpp/util/create_test_channel.cc
@@ -61,12 +61,10 @@ std::shared_ptr<ChannelInterface> CreateTestChannel(
const std::unique_ptr<Credentials>& creds) {
ChannelArguments channel_args;
if (enable_ssl) {
- const char* roots_certs =
- use_prod_roots ? "" : test_root_cert;
+ const char* roots_certs = use_prod_roots ? "" : test_root_cert;
SslCredentialsOptions ssl_opts = {roots_certs, "", ""};
- std::unique_ptr<Credentials> channel_creds =
- CredentialsFactory::SslCredentials(ssl_opts);
+ std::unique_ptr<Credentials> channel_creds = SslCredentials(ssl_opts);
if (!server.empty() && !override_hostname.empty()) {
channel_args.SetSslTargetNameOverride(override_hostname);
@@ -75,11 +73,11 @@ std::shared_ptr<ChannelInterface> CreateTestChannel(
server.empty() ? override_hostname : server;
if (creds.get()) {
channel_creds =
- CredentialsFactory::CompositeCredentials(creds, channel_creds);
+ CompositeCredentials(creds, channel_creds);
}
return CreateChannel(connect_to, channel_creds, channel_args);
} else {
- return CreateChannelDeprecated(server, channel_args);
+ return CreateChannel(server, InsecureCredentials(), channel_args);
}
}