From 92981d5c3db1c140118a0d192e6c7f75203b9055 Mon Sep 17 00:00:00 2001 From: yang-g Date: Tue, 6 Oct 2015 14:45:01 -0700 Subject: [PATCH 1/2] remove flag use_prod_roots in interop test and add use_test_ca per the interop test spec --- test/cpp/interop/client.cc | 2 +- test/cpp/interop/client_helper.cc | 10 +++++----- tools/gce_setup/grpc_docker.sh | 8 ++++---- tools/run_tests/run_interop_tests.py | 3 +-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index dbe29395b4f..ee64716f3f6 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -46,7 +46,7 @@ #include "test/cpp/util/test_config.h" DEFINE_bool(use_tls, false, "Whether to use tls."); -DEFINE_bool(use_prod_roots, false, "True to use SSL roots for google"); +DEFINE_bool(use_test_ca, true, "False to use SSL roots for google"); DEFINE_int32(server_port, 0, "Server port."); DEFINE_string(server_host, "127.0.0.1", "Server host to connect to"); DEFINE_string(server_host_override, "foo.test.google.fr", diff --git a/test/cpp/interop/client_helper.cc b/test/cpp/interop/client_helper.cc index cbad21e318e..61b46d25aa0 100644 --- a/test/cpp/interop/client_helper.cc +++ b/test/cpp/interop/client_helper.cc @@ -52,7 +52,7 @@ #include "test/cpp/util/create_test_channel.h" DECLARE_bool(use_tls); -DECLARE_bool(use_prod_roots); +DECLARE_bool(use_test_ca); DECLARE_int32(server_port); DECLARE_string(server_host); DECLARE_string(server_host_override); @@ -102,7 +102,7 @@ std::shared_ptr CreateChannelForTestCase( GPR_ASSERT(FLAGS_use_tls); creds = GoogleComputeEngineCredentials(); return CreateTestChannel(host_port, FLAGS_server_host_override, - FLAGS_use_tls, FLAGS_use_prod_roots, creds); + FLAGS_use_tls, !FLAGS_use_test_ca, creds); } else if (test_case == "jwt_token_creds") { std::shared_ptr creds; GPR_ASSERT(FLAGS_use_tls); @@ -111,15 +111,15 @@ std::shared_ptr CreateChannelForTestCase( creds = ServiceAccountJWTAccessCredentials(json_key, token_lifetime.count()); return CreateTestChannel(host_port, FLAGS_server_host_override, - FLAGS_use_tls, FLAGS_use_prod_roots, creds); + FLAGS_use_tls, !FLAGS_use_test_ca, creds); } else if (test_case == "oauth2_auth_token") { grpc::string raw_token = GetOauth2AccessToken(); std::shared_ptr creds = AccessTokenCredentials(raw_token); return CreateTestChannel(host_port, FLAGS_server_host_override, - FLAGS_use_tls, FLAGS_use_prod_roots, creds); + FLAGS_use_tls, !FLAGS_use_test_ca, creds); } else { return CreateTestChannel(host_port, FLAGS_server_host_override, - FLAGS_use_tls, FLAGS_use_prod_roots); + FLAGS_use_tls, !FLAGS_use_test_ca); } } diff --git a/tools/gce_setup/grpc_docker.sh b/tools/gce_setup/grpc_docker.sh index fdb77363273..1ac0209e278 100755 --- a/tools/gce_setup/grpc_docker.sh +++ b/tools/gce_setup/grpc_docker.sh @@ -1489,7 +1489,7 @@ grpc_interop_gen_cxx_cmd() { # cmd=$($grpc_gen_test_cmd $flags) grpc_cloud_prod_gen_cxx_cmd() { local cmd_prefix="sudo docker run grpc/cxx"; - local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls --use_prod_roots"; + local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls --use_test_ca=false"; local gfe_flags=$(_grpc_prod_gfe_flags) local the_cmd="$cmd_prefix $test_script $gfe_flags $@"; echo $the_cmd @@ -1502,7 +1502,7 @@ grpc_cloud_prod_gen_cxx_cmd() { # cmd=$($grpc_gen_test_cmd $flags) grpc_cloud_prod_auth_service_account_creds_gen_cxx_cmd() { local cmd_prefix="sudo docker run grpc/cxx"; - local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls --use_prod_roots"; + local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls --use_test_ca=false"; local gfe_flags=$(_grpc_prod_gfe_flags) local added_gfe_flags=$(_grpc_svc_acc_test_flags) local the_cmd="$cmd_prefix $test_script $gfe_flags $added_gfe_flags $@"; @@ -1516,7 +1516,7 @@ grpc_cloud_prod_auth_service_account_creds_gen_cxx_cmd() { # cmd=$($grpc_gen_test_cmd $flags) grpc_cloud_prod_auth_compute_engine_creds_gen_cxx_cmd() { local cmd_prefix="sudo docker run grpc/cxx"; - local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls --use_prod_roots"; + local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls --use_test_ca=false"; local gfe_flags=$(_grpc_prod_gfe_flags) local added_gfe_flags=$(_grpc_gce_test_flags) local the_cmd="$cmd_prefix $test_script $gfe_flags $added_gfe_flags $@"; @@ -1530,7 +1530,7 @@ grpc_cloud_prod_auth_compute_engine_creds_gen_cxx_cmd() { # cmd=$($grpc_gen_test_cmd $flags) grpc_cloud_prod_auth_jwt_token_creds_gen_cxx_cmd() { local cmd_prefix="sudo docker run grpc/cxx"; - local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls --use_prod_roots"; + local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls --use_test_ca=false"; local gfe_flags=$(_grpc_prod_gfe_flags) local added_gfe_flags=$(_grpc_jwt_token_test_flags) local the_cmd="$cmd_prefix $test_script $gfe_flags $added_gfe_flags $@"; diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index 48c34f68713..39c9e53ce7f 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -62,7 +62,6 @@ _CLOUD_TO_CLOUD_BASE_ARGS = [ _SSL_CERT_ENV = { 'SSL_CERT_FILE':'/usr/local/share/grpc/roots.pem' } # TODO(jtattermusch) unify usage of --use_tls and --use_tls=true -# TODO(jtattermusch) unify usage of --use_prod_roots and --use_test_ca # TODO(jtattermusch) go uses --tls_ca_file instead of --use_test_ca @@ -75,7 +74,7 @@ class CXXLanguage: def cloud_to_prod_args(self): return (self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS + - ['--use_tls=true','--use_prod_roots']) + ['--use_tls=true','--use_test_ca=false']) def cloud_to_cloud_args(self): return (self.client_cmdline_base + _CLOUD_TO_CLOUD_BASE_ARGS + From a006b5f33ba39ed7eb49e6d140f9da2d375de9c6 Mon Sep 17 00:00:00 2001 From: yang-g Date: Wed, 7 Oct 2015 13:14:35 -0700 Subject: [PATCH 2/2] change default value of use_test_ca --- test/cpp/interop/client.cc | 2 +- tools/gce_setup/grpc_docker.sh | 10 +++++----- tools/run_tests/run_interop_tests.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index ee64716f3f6..cb9b396beb5 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -46,7 +46,7 @@ #include "test/cpp/util/test_config.h" DEFINE_bool(use_tls, false, "Whether to use tls."); -DEFINE_bool(use_test_ca, true, "False to use SSL roots for google"); +DEFINE_bool(use_test_ca, false, "False to use SSL roots for google"); DEFINE_int32(server_port, 0, "Server port."); DEFINE_string(server_host, "127.0.0.1", "Server host to connect to"); DEFINE_string(server_host_override, "foo.test.google.fr", diff --git a/tools/gce_setup/grpc_docker.sh b/tools/gce_setup/grpc_docker.sh index 1ac0209e278..e50706ec74b 100755 --- a/tools/gce_setup/grpc_docker.sh +++ b/tools/gce_setup/grpc_docker.sh @@ -1477,7 +1477,7 @@ grpc_cloud_prod_auth_compute_engine_creds_gen_node_cmd() { # cmd=$($grpc_gen_test_cmd $flags) grpc_interop_gen_cxx_cmd() { local cmd_prefix="sudo docker run grpc/cxx"; - local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls"; + local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls --use_test_ca"; local the_cmd="$cmd_prefix $test_script $@"; echo $the_cmd } @@ -1489,7 +1489,7 @@ grpc_interop_gen_cxx_cmd() { # cmd=$($grpc_gen_test_cmd $flags) grpc_cloud_prod_gen_cxx_cmd() { local cmd_prefix="sudo docker run grpc/cxx"; - local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls --use_test_ca=false"; + local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls"; local gfe_flags=$(_grpc_prod_gfe_flags) local the_cmd="$cmd_prefix $test_script $gfe_flags $@"; echo $the_cmd @@ -1502,7 +1502,7 @@ grpc_cloud_prod_gen_cxx_cmd() { # cmd=$($grpc_gen_test_cmd $flags) grpc_cloud_prod_auth_service_account_creds_gen_cxx_cmd() { local cmd_prefix="sudo docker run grpc/cxx"; - local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls --use_test_ca=false"; + local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls"; local gfe_flags=$(_grpc_prod_gfe_flags) local added_gfe_flags=$(_grpc_svc_acc_test_flags) local the_cmd="$cmd_prefix $test_script $gfe_flags $added_gfe_flags $@"; @@ -1516,7 +1516,7 @@ grpc_cloud_prod_auth_service_account_creds_gen_cxx_cmd() { # cmd=$($grpc_gen_test_cmd $flags) grpc_cloud_prod_auth_compute_engine_creds_gen_cxx_cmd() { local cmd_prefix="sudo docker run grpc/cxx"; - local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls --use_test_ca=false"; + local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls"; local gfe_flags=$(_grpc_prod_gfe_flags) local added_gfe_flags=$(_grpc_gce_test_flags) local the_cmd="$cmd_prefix $test_script $gfe_flags $added_gfe_flags $@"; @@ -1530,7 +1530,7 @@ grpc_cloud_prod_auth_compute_engine_creds_gen_cxx_cmd() { # cmd=$($grpc_gen_test_cmd $flags) grpc_cloud_prod_auth_jwt_token_creds_gen_cxx_cmd() { local cmd_prefix="sudo docker run grpc/cxx"; - local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls --use_test_ca=false"; + local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls"; local gfe_flags=$(_grpc_prod_gfe_flags) local added_gfe_flags=$(_grpc_jwt_token_test_flags) local the_cmd="$cmd_prefix $test_script $gfe_flags $added_gfe_flags $@"; diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index 39c9e53ce7f..209270f0c62 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -74,11 +74,11 @@ class CXXLanguage: def cloud_to_prod_args(self): return (self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS + - ['--use_tls=true','--use_test_ca=false']) + ['--use_tls=true']) def cloud_to_cloud_args(self): return (self.client_cmdline_base + _CLOUD_TO_CLOUD_BASE_ARGS + - ['--use_tls=true']) + ['--use_tls=true', '--use_test_ca=true']) def cloud_to_prod_env(self): return {}