Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
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
Thomas Leymonerie
slapos.toolbox
Commits
7338e51d
Commit
7338e51d
authored
Jan 02, 2020
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
promise: Fix check_surykatka_json http support
ssl_certificate is not important for http only checks.
parent
31a82a8e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
1 deletion
+45
-1
slapos/promise/plugin/check_surykatka_json.py
slapos/promise/plugin/check_surykatka_json.py
+1
-1
slapos/test/promise/plugin/test_check_surykatka_json.py
slapos/test/promise/plugin/test_check_surykatka_json.py
+44
-0
No files found.
slapos/promise/plugin/check_surykatka_json.py
View file @
7338e51d
...
...
@@ -99,7 +99,7 @@ class RunPromise(GenericPromise):
else
:
ssl_check
=
False
certificate_expiration_days
=
None
if
ssl_check
is
None
:
if
not
ssl_check
:
return
if
certificate_expiration_days
is
None
:
appendError
(
...
...
slapos/test/promise/plugin/test_check_surykatka_json.py
View file @
7338e51d
...
...
@@ -266,6 +266,50 @@ class TestCheckSurykatkaJSONHttpQuery(CheckSurykatkaJSONMixin):
"Fri, 27 Dec 2019 15:11:12 -0000"
)
def
test_http
(
self
):
self
.
writeSurykatkaPromise
(
{
'report'
:
'http_query'
,
'json-file'
:
self
.
json_file
,
'url'
:
'http://www.erp5.com/'
,
'status-code'
:
'302'
,
'ip-list'
:
'127.0.0.1 127.0.0.2'
,
'test-utcnow'
:
'Fri, 27 Dec 2019 15:11:12 -0000'
}
)
self
.
writeSurykatkaJson
(
"""{
"http_query": [
{
"date": "Wed, 11 Dec 2019 09:35:28 -0000",
"ip": "127.0.0.1",
"status_code": 302,
"url": "http://www.erp5.com/"
},
{
"date": "Wed, 11 Dec 2019 09:35:28 -0000",
"ip": "127.0.0.2",
"status_code": 302,
"url": "http://www.erp5.com/"
},
{
"date": "Wed, 11 Dec 2019 09:35:28 -0000",
"ip": "176.31.129.213",
"status_code": 200,
"url": "http://www.erp5.org/"
}
],
"ssl_certificate": [
]
}
"""
)
self
.
configureLauncher
()
self
.
launcher
.
run
()
self
.
assertPassedMessage
(
self
.
getPromiseResult
(
self
.
promise_name
),
"http_query: http://www.erp5.com/ replied correctly with "
"status code 302 on ip list 127.0.0.1 127.0.0.2"
)
def
test_no_ip_list
(
self
):
self
.
writeSurykatkaPromise
(
{
...
...
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