aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Tim Emiola <tbetbetbe@users.noreply.github.com>2015-05-05 09:50:00 -0700
committerGravatar Tim Emiola <tbetbetbe@users.noreply.github.com>2015-05-05 09:50:00 -0700
commit97c5559040204dcff338df79b16390014fbc82c9 (patch)
tree003d3b0a810f5bdcead97e2a8390c9323e26119d /src
parenta0e14540210d856c09da184ecd5da7b414056cc9 (diff)
parente19497a9d5e50ce47fb4bc0046aa6b239a15549d (diff)
Merge pull request #1476 from stanley-cheung/php_gce_auth_test
add php compute_engine_creds auth interop test
Diffstat (limited to 'src')
-rwxr-xr-xsrc/php/tests/interop/interop_client.php24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/php/tests/interop/interop_client.php b/src/php/tests/interop/interop_client.php
index 22f85aa322..98a367a905 100755
--- a/src/php/tests/interop/interop_client.php
+++ b/src/php/tests/interop/interop_client.php
@@ -126,6 +126,24 @@ function serviceAccountCreds($stub, $args) {
}
/**
+ * Run the compute engine credentials auth test.
+ * Has not been run from gcloud as of 2015-05-05
+ * @param $stub Stub object that has service methods
+ * @param $args array command line args
+ */
+function computeEngineCreds($stub, $args) {
+ if (!array_key_exists('oauth_scope', $args)) {
+ throw new Exception('Missing oauth scope');
+ }
+ if (!array_key_exists('default_service_account', $args)) {
+ throw new Exception('Missing default_service_account');
+ }
+ $result = performLargeUnary($stub, $fillUsername=true, $fillOauthScope=true);
+ hardAssert($args['default_service_account'] == $result->getUsername(),
+ 'invalid email returned');
+}
+
+/**
* Run the client_streaming test.
* Passes when run against the Node server as of 2015-04-30
* @param $stub Stub object that has service methods
@@ -240,7 +258,8 @@ function cancelAfterFirstResponse($stub) {
}
$args = getopt('', array('server_host:', 'server_port:', 'test_case:',
- 'server_host_override:', 'oauth_scope:'));
+ 'server_host_override:', 'oauth_scope:',
+ 'default_service_account:'));
if (!array_key_exists('server_host', $args) ||
!array_key_exists('server_port', $args) ||
!array_key_exists('test_case', $args)) {
@@ -301,6 +320,9 @@ switch ($args['test_case']) {
case 'service_account_creds':
serviceAccountCreds($stub, $args);
break;
+ case 'compute_engine_creds':
+ computeEngineCreds($stub, $args);
+ break;
default:
exit(1);
}