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
3b1b4a6c
Commit
3b1b4a6c
authored
Mar 01, 2012
by
Jim Morrison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test for spdy version 3.
parent
9c50bd4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
18 deletions
+32
-18
tests/end_to_end.py
tests/end_to_end.py
+32
-18
No files found.
tests/end_to_end.py
View file @
3b1b4a6c
...
...
@@ -20,15 +20,15 @@ import unittest
_PORT
=
9893
def
_run_server
(
port
):
def
_run_server
(
port
,
args
):
srcdir
=
os
.
environ
.
get
(
'srcdir'
,
'.'
)
testdata
=
'%s/testdata'
%
srcdir
top_builddir
=
os
.
environ
.
get
(
'top_builddir'
,
'..'
)
return
subprocess
.
Popen
([
'%s/examples/spdyd'
%
top_builddir
,
str
(
port
),
'-d'
,
testdata
,
'%s/privkey.pem'
%
testdata
,
'%s/cacert.pem'
%
testdata
]
)
base_args
=
[
'%s/examples/spdyd'
%
top_builddir
,
str
(
port
),
'-d'
,
testdata
,
'%s/privkey.pem'
%
testdata
,
'%s/cacert.pem'
%
testdata
]
if
args
:
base_args
.
extend
(
args
)
return
subprocess
.
Popen
(
base_args
)
def
_check_server_up
(
port
):
# Check this check for now.
...
...
@@ -42,6 +42,15 @@ def _kill_server(server):
class
EndToEndSpdyTests
(
unittest
.
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
cls
.
server
=
_run_server
(
_PORT
,
None
)
_check_server_up
(
_PORT
)
@
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
...
...
@@ -51,19 +60,24 @@ class EndToEndSpdyTests(unittest.TestCase):
0
,
subprocess
.
call
([
self
.
client
,
'http://localhost:%d/'
%
_PORT
]))
class
TestProgram
(
unittest
.
TestProgram
):
def
runTests
(
self
):
self
.
testRunner
=
unittest
.
TextTestRunner
()
result
=
self
.
testRunner
.
run
(
self
.
test
)
self
.
successful
=
result
.
wasSuccessful
()
class
EndToEndSpdy3Tests
(
unittest
.
TestCase
):
@
classmethod
def
setUpClass
(
cls
):
cls
.
server
=
_run_server
(
_PORT
,
'-3'
)
_check_server_up
(
_PORT
)
@
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
testSimpleRequest
(
self
):
self
.
assertEquals
(
0
,
subprocess
.
call
([
self
.
client
,
'http://localhost:%d/'
%
_PORT
]))
def
main
():
server
=
_run_server
(
_PORT
)
_check_server_up
(
_PORT
)
result
=
TestProgram
()
_kill_server
(
server
)
return
not
result
.
successful
if
__name__
==
'__main__'
:
sys
.
exit
(
main
()
)
unittest
.
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