Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
4e085a21
Commit
4e085a21
authored
Mar 01, 2012
by
Jim Morrison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verify that the expected version of spdy is used.
parent
3b1b4a6c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
19 deletions
+27
-19
tests/end_to_end.py
tests/end_to_end.py
+27
-19
No files found.
tests/end_to_end.py
View file @
4e085a21
...
...
@@ -12,7 +12,6 @@ __author__ = 'Jim Morrison <jim@twist.com>'
import
os
import
subprocess
import
sys
import
time
import
unittest
...
...
@@ -24,10 +23,11 @@ def _run_server(port, args):
srcdir
=
os
.
environ
.
get
(
'srcdir'
,
'.'
)
testdata
=
'%s/testdata'
%
srcdir
top_builddir
=
os
.
environ
.
get
(
'top_builddir'
,
'..'
)
base_args
=
[
'%s/examples/spdyd'
%
top_builddir
,
str
(
port
),
'-d'
,
testdata
,
'%s/privkey.pem'
%
testdata
,
'%s/cacert.pem'
%
testdata
]
base_args
=
[
'%s/examples/spdyd'
%
top_builddir
,
'-d'
,
testdata
]
if
args
:
base_args
.
extend
(
args
)
base_args
.
extend
([
str
(
port
),
'%s/privkey.pem'
%
testdata
,
'%s/cacert.pem'
%
testdata
])
return
subprocess
.
Popen
(
base_args
)
def
_check_server_up
(
port
):
...
...
@@ -44,7 +44,11 @@ def _kill_server(server):
class
EndToEndSpdyTests
(
unittest
.
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
cls
.
server
=
_run_server
(
_PORT
,
None
)
cls
.
setUpServer
([])
@
classmethod
def
setUpServer
(
cls
,
args
):
cls
.
server
=
_run_server
(
_PORT
,
args
)
_check_server_up
(
_PORT
)
@
classmethod
...
...
@@ -54,29 +58,33 @@ class EndToEndSpdyTests(unittest.TestCase):
def
setUp
(
self
):
build_dir
=
os
.
environ
.
get
(
'top_builddir'
,
'..'
)
self
.
client
=
'%s/examples/spdycat'
%
build_dir
self
.
stdout
=
'No output'
def
call
(
self
,
path
,
args
):
full_args
=
[
self
.
client
,
'http://localhost:%d%s'
%
(
_PORT
,
path
)]
+
args
p
=
subprocess
.
Popen
(
full_args
,
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
)
self
.
stdout
,
self
.
stderr
=
p
.
communicate
()
return
p
.
returncode
class
EndToEndSpdy2Tests
(
EndToEndSpdyTests
):
def
testSimpleRequest
(
self
):
self
.
assertEquals
(
0
,
subprocess
.
call
([
self
.
client
,
'http://localhost:%d/'
%
_PORT
]))
self
.
assertEquals
(
0
,
self
.
call
(
'/'
,
[]))
def
testSimpleRequestSpdy3
(
self
):
self
.
assertEquals
(
0
,
self
.
call
(
'/'
,
[
'-v'
,
'-3'
]))
self
.
assertIn
(
'NPN selected the protocol: spdy/3'
,
self
.
stdout
)
class
EndToEndSpdy3Tests
(
unittest
.
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
cls
.
server
=
_run_server
(
_PORT
,
'-3'
)
_check_server_up
(
_PORT
)
class
EndToEndSpdy3Tests
(
EndToEndSpdyTests
):
@
classmethod
def
tearDownClass
(
cls
):
_kill_server
(
cls
.
server
)
def
setUp
(
self
):
build_dir
=
os
.
environ
.
get
(
'top_builddir'
,
'..'
)
self
.
client
=
'%s/examples/spdycat'
%
build_dir
def
setUpClass
(
cls
):
cls
.
setUpServer
([
'-3'
])
def
testSimpleRequest
(
self
):
self
.
assertEquals
(
0
,
subprocess
.
call
([
self
.
client
,
'http://localhost:%d/'
%
_PORT
])
)
self
.
assertEquals
(
0
,
self
.
call
(
'/'
,
[
'-v'
]))
self
.
assertIn
(
'NPN selected the protocol: spdy/3'
,
self
.
stdout
)
if
__name__
==
'__main__'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment