aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Masood Malekghassemi <soltanmm@users.noreply.github.com>2015-10-20 15:44:21 -0700
committerGravatar Masood Malekghassemi <soltanmm@users.noreply.github.com>2015-10-20 15:44:21 -0700
commit63544f78083fa03bbbf7c2c212c9f5ba968425e2 (patch)
tree0fc4f5af3727dcda99e72003c5fcd719527ae8d9
parent2da13a0e3725c44748dd12739188d611bf8eb823 (diff)
parent3b6fef129212155cb34f8cb36c0e328decb6aa8f (diff)
Merge pull request #3892 from jtattermusch/python_fix_auth_tests
Fix python compute_engine_creds and oauth2_auth_token interop tests.
-rw-r--r--src/python/grpcio_test/grpc_interop/client.py9
-rwxr-xr-xtools/run_tests/run_interop_tests.py2
2 files changed, 8 insertions, 3 deletions
diff --git a/src/python/grpcio_test/grpc_interop/client.py b/src/python/grpcio_test/grpc_interop/client.py
index 01928886b4..21e344ca35 100644
--- a/src/python/grpcio_test/grpc_interop/client.py
+++ b/src/python/grpcio_test/grpc_interop/client.py
@@ -71,12 +71,17 @@ def _oauth_access_token(args):
def _stub(args):
if args.oauth_scope:
if args.test_case == 'oauth2_auth_token':
+ # TODO(jtattermusch): This testcase sets the auth metadata key-value
+ # manually, which also means that the user would need to do the same
+ # thing every time he/she would like to use and out of band oauth token.
+ # The transformer function that produces the metadata key-value from
+ # the access token should be provided by gRPC auth library.
access_token = _oauth_access_token(args)
metadata_transformer = lambda x: [
- ('Authorization', 'Bearer %s' % access_token)]
+ ('authorization', 'Bearer %s' % access_token)]
else:
metadata_transformer = lambda x: [
- ('Authorization', 'Bearer %s' % _oauth_access_token(args))]
+ ('authorization', 'Bearer %s' % _oauth_access_token(args))]
else:
metadata_transformer = lambda x: []
if args.use_tls:
diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py
index 61b9faa963..dc110cfb83 100755
--- a/tools/run_tests/run_interop_tests.py
+++ b/tools/run_tests/run_interop_tests.py
@@ -350,7 +350,7 @@ def add_auth_options(language, test_case, cmdline, env):
default_account_arg = '--default_service_account=830293263384-compute@developer.gserviceaccount.com'
if test_case in ['jwt_token_creds', 'per_rpc_creds', 'oauth2_auth_token']:
- if language in ['csharp', 'node', 'php', 'ruby']:
+ if language in ['csharp', 'node', 'php', 'python', 'ruby']:
env['GOOGLE_APPLICATION_CREDENTIALS'] = key_filepath
else:
cmdline += [key_file_arg]