Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Steven Gueguen
slapos
Commits
07456502
Commit
07456502
authored
Dec 18, 2018
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
caddy-frontend/test: Check QUIC after USR1
Asserts Caddy issue
https://github.com/mholt/caddy/issues/2394
parent
cdd718e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
18 deletions
+31
-18
software/caddy-frontend/test/test.py
software/caddy-frontend/test/test.py
+31
-18
No files found.
software/caddy-frontend/test/test.py
View file @
07456502
...
...
@@ -35,6 +35,7 @@ import multiprocessing
import
subprocess
from
unittest
import
skip
import
ssl
import
signal
from
BaseHTTPServer
import
HTTPServer
from
BaseHTTPServer
import
BaseHTTPRequestHandler
from
forcediphttpsadapter.adapters
import
ForcedIPHTTPSAdapter
...
...
@@ -3466,26 +3467,38 @@ class TestQuicEnabled(SlaveHttpFrontendTestCase, TestDataMixin):
self.assertKeyWithPop('
Date
', result.headers)
self.assertKeyWithPop('
Content
-
Length
', result.headers)
quic_status, quic_result = getQUIC(
'
https
:
//%
s
/%
s
' % (parameter_dict['
domain
'], '
test
-
path
'),
parameter_dict['
public
-
ipv4
'],
HTTPS_PORT
)
def assertQUIC():
quic_status, quic_result = getQUIC(
'
https
:
//%
s
/%
s
' % (parameter_dict['
domain
'], '
test
-
path
'),
parameter_dict['
public
-
ipv4
'],
HTTPS_PORT
)
self.assertTrue(quic_status, quic_result)
self.assertTrue(quic_status, quic_result)
try:
quic_jsoned = quic_result.split('
body
:
')[2].split('
trailers
')[0]
except Exception:
raise ValueError('
JSON
not
found
at
all
in
QUIC
result
:
\
n
%
s
' % (
quic_result,))
try:
j = json.loads(quic_jsoned)
except Exception:
raise ValueError('
JSON
decode
problem
in
:
\
n
%
s
' % (quic_jsoned,))
key = '
Path
'
self.assertTrue(key in j, '
No
key
%
r
in
%
s
' % (key, j))
self.assertEqual('
/
test
-
path
', j[key])
try:
quic_jsoned = quic_result.split('
body
:
')[2].split('
trailers
')[0]
except Exception:
raise ValueError('
JSON
not
found
at
all
in
QUIC
result
:
\
n
%
s
' % (
quic_result,))
try:
j = json.loads(quic_jsoned)
except Exception:
raise ValueError('
JSON
decode
problem
in
:
\
n
%
s
' % (quic_jsoned,))
key = '
Path
'
self.assertTrue(key in j, '
No
key
%
r
in
%
s
' % (key, j))
self.assertEqual('
/
test
-
path
', j[key])
assertQUIC()
# https://github.com/mholt/caddy/issues/2394
# after sending USR1 to Caddy QUIC does not work, check current behaviour
caddy_pid = [
q['
pid
'] for q
in self.getSupervisorRPCServer().supervisor.getAllProcessInfo()
if '
frontend_caddy
' in q['
name
']][0]
os.kill(caddy_pid, signal.SIGUSR1)
assertQUIC()
class TestSlaveBadParameters(SlaveHttpFrontendTestCase, TestDataMixin):
...
...
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