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
b39bf85d
Commit
b39bf85d
authored
8 years ago
by
Mark D. Roth
Browse files
Options
Downloads
Patches
Plain Diff
Fix test for CLIENT_DIRECT_CHANNEL fixtures.
parent
e645d13b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/core/end2end/tests/filter_call_init_fails.c
+14
-10
14 additions, 10 deletions
test/core/end2end/tests/filter_call_init_fails.c
with
14 additions
and
10 deletions
test/core/end2end/tests/filter_call_init_fails.c
+
14
−
10
View file @
b39bf85d
...
@@ -107,7 +107,7 @@ static void end_test(grpc_end2end_test_fixture *f) {
...
@@ -107,7 +107,7 @@ static void end_test(grpc_end2end_test_fixture *f) {
grpc_completion_queue_destroy
(
f
->
cq
);
grpc_completion_queue_destroy
(
f
->
cq
);
}
}
// Simple request via a
server channel
filter that always fails to
// Simple request via a
SERVER_CHANNEL
filter that always fails to
// initialize the call.
// initialize the call.
static
void
test_server_channel_filter
(
grpc_end2end_test_config
config
)
{
static
void
test_server_channel_filter
(
grpc_end2end_test_config
config
)
{
grpc_call
*
c
;
grpc_call
*
c
;
...
@@ -203,8 +203,8 @@ static void test_server_channel_filter(grpc_end2end_test_config config) {
...
@@ -203,8 +203,8 @@ static void test_server_channel_filter(grpc_end2end_test_config config) {
config
.
tear_down_data
(
&
f
);
config
.
tear_down_data
(
&
f
);
}
}
// Simple request via a
client channel filter that always
f
a
il
s to
// Simple request via a
CLIENT_CHANNEL or CLIENT_DIRECT_CHANNEL
fil
ter
// initialize the call.
//
that always fails to
initialize the call.
static
void
test_client_channel_filter
(
grpc_end2end_test_config
config
)
{
static
void
test_client_channel_filter
(
grpc_end2end_test_config
config
)
{
grpc_call
*
c
;
grpc_call
*
c
;
grpc_slice
request_payload_slice
=
grpc_slice
request_payload_slice
=
...
@@ -293,7 +293,7 @@ static void test_client_channel_filter(grpc_end2end_test_config config) {
...
@@ -293,7 +293,7 @@ static void test_client_channel_filter(grpc_end2end_test_config config) {
config
.
tear_down_data
(
&
f
);
config
.
tear_down_data
(
&
f
);
}
}
// Simple request via a
client subchannel
filter that always fails to
// Simple request via a
CLIENT_SUBCHANNEL
filter that always fails to
// initialize the call.
// initialize the call.
static
void
test_client_subchannel_filter
(
grpc_end2end_test_config
config
)
{
static
void
test_client_subchannel_filter
(
grpc_end2end_test_config
config
)
{
grpc_call
*
c
;
grpc_call
*
c
;
...
@@ -517,23 +517,27 @@ static void init_plugin(void) {
...
@@ -517,23 +517,27 @@ static void init_plugin(void) {
maybe_add_client_channel_filter
,
NULL
);
maybe_add_client_channel_filter
,
NULL
);
grpc_channel_init_register_stage
(
GRPC_CLIENT_SUBCHANNEL
,
INT_MAX
,
grpc_channel_init_register_stage
(
GRPC_CLIENT_SUBCHANNEL
,
INT_MAX
,
maybe_add_client_subchannel_filter
,
NULL
);
maybe_add_client_subchannel_filter
,
NULL
);
grpc_channel_init_register_stage
(
GRPC_CLIENT_DIRECT_CHANNEL
,
INT_MAX
,
maybe_add_client_channel_filter
,
NULL
);
}
}
static
void
destroy_plugin
(
void
)
{}
static
void
destroy_plugin
(
void
)
{}
void
filter_call_init_fails
(
grpc_end2end_test_config
config
)
{
void
filter_call_init_fails
(
grpc_end2end_test_config
config
)
{
gpr_log
(
GPR_INFO
,
"Testing
server channel
filter."
);
gpr_log
(
GPR_INFO
,
"Testing
SERVER_CHANNEL
filter."
);
g_enable_server_channel_filter
=
true
;
g_enable_server_channel_filter
=
true
;
test_server_channel_filter
(
config
);
test_server_channel_filter
(
config
);
g_enable_server_channel_filter
=
false
;
g_enable_server_channel_filter
=
false
;
gpr_log
(
GPR_INFO
,
"Testing
client channel
filter."
);
gpr_log
(
GPR_INFO
,
"Testing
CLIENT_CHANNEL / CLIENT_DIRECT_CHANNEL
filter."
);
g_enable_client_channel_filter
=
true
;
g_enable_client_channel_filter
=
true
;
test_client_channel_filter
(
config
);
test_client_channel_filter
(
config
);
g_enable_client_channel_filter
=
false
;
g_enable_client_channel_filter
=
false
;
gpr_log
(
GPR_INFO
,
"Testing client subchannel filter."
);
if
(
config
.
feature_mask
&
FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL
)
{
g_enable_client_subchannel_filter
=
true
;
gpr_log
(
GPR_INFO
,
"Testing CLIENT_SUBCHANNEL filter."
);
test_client_subchannel_filter
(
config
);
g_enable_client_subchannel_filter
=
true
;
g_enable_client_subchannel_filter
=
false
;
test_client_subchannel_filter
(
config
);
g_enable_client_subchannel_filter
=
false
;
}
}
}
void
filter_call_init_fails_pre_init
(
void
)
{
void
filter_call_init_fails_pre_init
(
void
)
{
...
...
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