Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
e19497a9
Commit
e19497a9
authored
9 years ago
by
Stanley Cheung
Browse files
Options
Downloads
Patches
Plain Diff
add php compute_engine_creds auth interop test
parent
a0e14540
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/php/tests/interop/interop_client.php
+23
-1
23 additions, 1 deletion
src/php/tests/interop/interop_client.php
tools/gce_setup/grpc_docker.sh
+31
-0
31 additions, 0 deletions
tools/gce_setup/grpc_docker.sh
with
54 additions
and
1 deletion
src/php/tests/interop/interop_client.php
+
23
−
1
View file @
e19497a9
...
@@ -125,6 +125,24 @@ function serviceAccountCreds($stub, $args) {
...
@@ -125,6 +125,24 @@ function serviceAccountCreds($stub, $args) {
'invalid oauth scope returned'
);
'invalid oauth scope returned'
);
}
}
/**
* 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.
* Run the client_streaming test.
* Passes when run against the Node server as of 2015-04-30
* Passes when run against the Node server as of 2015-04-30
...
@@ -240,7 +258,8 @@ function cancelAfterFirstResponse($stub) {
...
@@ -240,7 +258,8 @@ function cancelAfterFirstResponse($stub) {
}
}
$args
=
getopt
(
''
,
array
(
'server_host:'
,
'server_port:'
,
'test_case:'
,
$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
)
||
if
(
!
array_key_exists
(
'server_host'
,
$args
)
||
!
array_key_exists
(
'server_port'
,
$args
)
||
!
array_key_exists
(
'server_port'
,
$args
)
||
!
array_key_exists
(
'test_case'
,
$args
))
{
!
array_key_exists
(
'test_case'
,
$args
))
{
...
@@ -301,6 +320,9 @@ switch ($args['test_case']) {
...
@@ -301,6 +320,9 @@ switch ($args['test_case']) {
case
'service_account_creds'
:
case
'service_account_creds'
:
serviceAccountCreds
(
$stub
,
$args
);
serviceAccountCreds
(
$stub
,
$args
);
break
;
break
;
case
'compute_engine_creds'
:
computeEngineCreds
(
$stub
,
$args
);
break
;
default
:
default
:
exit
(
1
);
exit
(
1
);
}
}
This diff is collapsed.
Click to expand it.
tools/gce_setup/grpc_docker.sh
+
31
−
0
View file @
e19497a9
...
@@ -1250,6 +1250,37 @@ grpc_interop_gen_php_cmd() {
...
@@ -1250,6 +1250,37 @@ grpc_interop_gen_php_cmd() {
echo
$the_cmd
echo
$the_cmd
}
}
# constructs the full dockerized php 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_php_cmd
()
{
local
env_flag
=
"-e SSL_CERT_FILE=/cacerts/roots.pem "
env_flag+
=
"-e GOOGLE_APPLICATION_CREDENTIALS=/service_account/stubbyCloudTestingTest-7dd63462c60c.json "
local
cmd_prefix
=
"sudo docker run
$env_flag
grpc/php"
;
local
test_script
=
"/var/local/git/grpc/src/php/bin/interop_client.sh"
;
local
gfe_flags
=
$(
_grpc_prod_gfe_flags
)
;
local
added_gfe_flags
=
$(
_grpc_default_creds_test_flags
)
local
the_cmd
=
"
$cmd_prefix
$test_script
$gfe_flags
$added_gfe_flags
$@
"
;
echo
$the_cmd
}
# constructs the full dockerized php compute_engine 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_php_cmd
()
{
local
env_flag
=
"-e SSL_CERT_FILE=/cacerts/roots.pem "
local
cmd_prefix
=
"sudo docker run
$env_flag
grpc/php"
;
local
test_script
=
"/var/local/git/grpc/src/php/bin/interop_client.sh"
;
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 node interop test cmd.
# constructs the full dockerized node interop test cmd.
#
#
# call-seq:
# call-seq:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment