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
2f390676
Commit
2f390676
authored
8 years ago
by
makdharma
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #9282 from makdharma/http2_interop
changes to http2 test server
parents
2c4a364e
7fc6f3be
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/http2_test/http2_base_server.py
+0
-1
0 additions, 1 deletion
test/http2_test/http2_base_server.py
test/http2_test/http2_test_server.py
+24
-10
24 additions, 10 deletions
test/http2_test/http2_test_server.py
with
24 additions
and
11 deletions
test/http2_test/http2_base_server.py
+
0
−
1
View file @
2f390676
...
...
@@ -73,7 +73,6 @@ class H2ProtocolBaseServer(twisted.internet.protocol.Protocol):
def
on_connection_lost
(
self
,
reason
):
logging
.
info
(
'
Disconnected %s
'
%
reason
)
twisted
.
internet
.
reactor
.
callFromThread
(
twisted
.
internet
.
reactor
.
stop
)
def
dataReceived
(
self
,
data
):
try
:
...
...
This diff is collapsed.
Click to expand it.
test/http2_test/http2_test_server.py
+
24
−
10
View file @
2f390676
...
...
@@ -73,18 +73,32 @@ class H2Factory(twisted.internet.protocol.Factory):
else
:
return
t
().
get_base_server
()
def
parse_arguments
():
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'
--base_port
'
,
type
=
int
,
default
=
8080
,
help
=
'
base port to run the servers (default: 8080). One test server is
'
'
started on each incrementing port, beginning with base_port, in the
'
'
following order: goaway,max_streams,ping,rst_after_data,rst_after_header,
'
'
rst_during_data
'
)
return
parser
.
parse_args
()
def
start_test_servers
(
base_port
):
"""
Start one server per test case on incrementing port numbers
beginning with base_port
"""
index
=
0
for
test_case
in
sorted
(
_TEST_CASE_MAPPING
.
keys
()):
portnum
=
base_port
+
index
logging
.
warning
(
'
serving on port %d : %s
'
%
(
portnum
,
test_case
))
endpoint
=
twisted
.
internet
.
endpoints
.
TCP4ServerEndpoint
(
twisted
.
internet
.
reactor
,
portnum
,
backlog
=
128
)
endpoint
.
listen
(
H2Factory
(
test_case
))
index
+=
1
if
__name__
==
'
__main__
'
:
logging
.
basicConfig
(
format
=
'
%(levelname) -10s %(asctime)s %(module)s:%(lineno)s | %(message)s
'
,
level
=
logging
.
INFO
)
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'
--test_case
'
,
choices
=
sorted
(
_TEST_CASE_MAPPING
.
keys
()),
help
=
'
test case to run
'
,
required
=
True
)
parser
.
add_argument
(
'
--port
'
,
type
=
int
,
default
=
8080
,
help
=
'
port to run the server (default: 8080)
'
)
args
=
parser
.
parse_args
()
logging
.
info
(
'
Running test case %s on port %d
'
%
(
args
.
test_case
,
args
.
port
))
endpoint
=
twisted
.
internet
.
endpoints
.
TCP4ServerEndpoint
(
twisted
.
internet
.
reactor
,
args
.
port
,
backlog
=
128
)
endpoint
.
listen
(
H2Factory
(
args
.
test_case
))
args
=
parse_arguments
()
start_test_servers
(
args
.
base_port
)
twisted
.
internet
.
reactor
.
run
()
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