From 8cbc2506d56af103a6691648eba660aac874f6a3 Mon Sep 17 00:00:00 2001 From: Xudong Ma Date: Fri, 29 May 2015 14:49:02 -0700 Subject: Enable service_account_creds test and compute_engine_creds for gRpc-java. --- tools/dockerfile/grpc_java/Dockerfile | 3 +++ tools/gce_setup/grpc_docker.sh | 34 +++++++++++++++++++++++++++++---- tools/gce_setup/shared_startup_funcs.sh | 3 +++ 3 files changed, 36 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/dockerfile/grpc_java/Dockerfile b/tools/dockerfile/grpc_java/Dockerfile index fa67cb2627..c20ab4687c 100644 --- a/tools/dockerfile/grpc_java/Dockerfile +++ b/tools/dockerfile/grpc_java/Dockerfile @@ -36,5 +36,8 @@ RUN cd /var/local/git/grpc-java/lib/netty && \ RUN cd /var/local/git/grpc-java && \ ./gradlew build installDist +# Add a service_account directory containing the auth creds file +ADD service_account service_account + # Specify the default command such that the interop server runs on its known testing port CMD ["/var/local/git/grpc-java/run-test-server.sh", "--use_tls=true", "--port=8030"] diff --git a/tools/gce_setup/grpc_docker.sh b/tools/gce_setup/grpc_docker.sh index 123d0615b4..b53aa98aab 100755 --- a/tools/gce_setup/grpc_docker.sh +++ b/tools/gce_setup/grpc_docker.sh @@ -1274,8 +1274,7 @@ grpc_cloud_prod_gen_go_cmd() { # cmd=$($grpc_gen_test_cmd $flags) grpc_interop_gen_java_cmd() { local cmd_prefix="sudo docker run grpc/java"; - local test_script="/var/local/git/grpc-java/run-test-client.sh"; - local test_script+=" --use_test_ca=true --use_tls=true" + local test_script="/var/local/git/grpc-java/run-test-client.sh --use_test_ca=true --use_tls=true"; local the_cmd="$cmd_prefix $test_script $@"; echo $the_cmd } @@ -1287,13 +1286,40 @@ grpc_interop_gen_java_cmd() { # cmd=$($grpc_gen_test_cmd $flags) grpc_cloud_prod_gen_java_cmd() { local cmd_prefix="sudo docker run grpc/java"; - local test_script="/var/local/git/grpc-java/run-test-client.sh"; - local test_script+=" --use_tls=true" + local test_script="/var/local/git/grpc-java/run-test-client.sh --use_tls=true"; local gfe_flags=$(_grpc_prod_gfe_flags) local the_cmd="$cmd_prefix $test_script $gfe_flags $@"; echo $the_cmd } +# constructs the full dockerized java service_account auth interop test cmd. +# +# call-seq: +# flags= .... # generic flags to include the command +# cmd=$($grpc_gen_test_cmd $flags) +grpc_cloud_prod_auth_service_account_creds_gen_java_cmd() { + local cmd_prefix="sudo docker run grpc/java"; + local test_script="/var/local/git/grpc-java/run-test-client.sh --use_tls=true"; + 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 $@"; + echo $the_cmd +} + +# constructs the full dockerized java gce auth interop test cmd. +# +# call-seq: +# flags= .... # generic flags to include the command +# cmd=$($grpc_gen_test_cmd $flags) +grpc_cloud_prod_auth_compute_engine_creds_gen_java_cmd() { + local cmd_prefix="sudo docker run grpc/java"; + local test_script="/var/local/git/grpc-java/run-test-client.sh --use_tls=true"; + 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 $@"; + echo $the_cmd +} + # constructs the full dockerized php interop test cmd. # # TODO(mlumish): update this to use the script once that's on git diff --git a/tools/gce_setup/shared_startup_funcs.sh b/tools/gce_setup/shared_startup_funcs.sh index a3a3b59c8a..60cd9f6897 100755 --- a/tools/gce_setup/shared_startup_funcs.sh +++ b/tools/gce_setup/shared_startup_funcs.sh @@ -413,6 +413,9 @@ grpc_dockerfile_install() { [[ $image_label == "grpc/java_base" ]] && { grpc_docker_sync_github_key $dockerfile_dir/.ssh 'java_base_ssh_key' || return 1; } + [[ $image_label == "grpc/java" ]] && { + grpc_docker_sync_service_account $dockerfile_dir/service_account || return 1; + } [[ $image_label == "grpc/ruby" ]] && { grpc_docker_sync_roots_pem $dockerfile_dir/cacerts || return 1; grpc_docker_sync_service_account $dockerfile_dir/service_account || return 1; -- cgit v1.2.3