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
Xiaowu Zhang
slapos.toolbox
Commits
8d50d018
Commit
8d50d018
authored
Sep 08, 2020
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check_surykatka_json: make OK message consistent with / without IP check.
parent
f4b906ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
12 deletions
+10
-12
slapos/promise/plugin/check_surykatka_json.py
slapos/promise/plugin/check_surykatka_json.py
+3
-5
slapos/test/promise/plugin/test_check_surykatka_json.py
slapos/test/promise/plugin/test_check_surykatka_json.py
+7
-7
No files found.
slapos/promise/plugin/check_surykatka_json.py
View file @
8d50d018
...
...
@@ -190,12 +190,10 @@ class RunPromise(GenericPromise):
error
=
True
if
error
:
return
info_message
=
'%s: OK with status code %s'
%
(
key
,
status_code
)
if
len
(
ip_list
)
>
0
:
self
.
appendInfoMessage
(
'%s: OK status code %s on IPs %s'
%
(
key
,
status_code
,
' '
.
join
(
ip_list
)))
else
:
self
.
appendInfoMessage
(
'%s: OK with status code %s'
%
(
key
,
status_code
))
info_message
+=
' on IPs %s'
%
(
' '
.
join
(
ip_list
))
self
.
appendInfoMessage
(
info_message
)
def
senseElapsedTime
(
self
):
key
=
'elapsed_time'
...
...
slapos/test/promise/plugin/test_check_surykatka_json.py
View file @
8d50d018
...
...
@@ -284,7 +284,7 @@ class TestCheckSurykatkaJSONHttpQuery(CheckSurykatkaJSONMixin):
self
.
launcher
.
run
()
self
.
assertPassedMessage
(
self
.
getPromiseResult
(
self
.
promise_name
),
"https://www.erp5.com/ : http_query: OK status code 302 on IPs "
"https://www.erp5.com/ : http_query: OK
with
status code 302 on IPs "
"127.0.0.1 127.0.0.2 ssl_certificate: OK Certificate on 127.0.0.1 will "
"expire on Mon, 13 Jul 2020 12:00:00 -0000, which is more than 15 days"
)
...
...
@@ -345,7 +345,7 @@ class TestCheckSurykatkaJSONHttpQuery(CheckSurykatkaJSONMixin):
self
.
launcher
.
run
()
self
.
assertPassedMessage
(
self
.
getPromiseResult
(
self
.
promise_name
),
"https://www.erp5.com/ : http_query: OK status code 302 on IPs "
"https://www.erp5.com/ : http_query: OK
with
status code 302 on IPs "
"127.0.0.1 127.0.0.2 ssl_certificate: OK Certificate on 127.0.0.1 will "
"expire on Mon, 13 Jul 2020 12:00:00 -0000, which is more than 15 days "
"elapsed_time: OK IP 127.0.0.1 replied in 4.00s which is shorter than "
...
...
@@ -412,7 +412,7 @@ class TestCheckSurykatkaJSONHttpQuery(CheckSurykatkaJSONMixin):
self
.
getPromiseResult
(
self
.
promise_name
),
"https://www.erp5.com/ : elapsed_time: ERROR IP 127.0.0.1 replied in "
"6.00s which is longer than maximum 5.00s elapsed_time: ERROR IP "
"127.0.0.2 failed to reply http_query: OK status code 302 on IPs "
"127.0.0.2 failed to reply http_query: OK
with
status code 302 on IPs "
"127.0.0.1 127.0.0.2 ssl_certificate: OK Certificate on 127.0.0.1 will "
"expire on Mon, 13 Jul 2020 12:00:00 -0000, which is more than 15 days"
)
...
...
@@ -470,7 +470,7 @@ class TestCheckSurykatkaJSONHttpQuery(CheckSurykatkaJSONMixin):
self
.
launcher
.
run
()
self
.
assertPassedMessage
(
self
.
getPromiseResult
(
self
.
promise_name
),
"https://www.erp5.com/ : http_query: OK status code 302 on IPs "
"https://www.erp5.com/ : http_query: OK
with
status code 302 on IPs "
"127.0.0.1 127.0.0.2 ssl_certificate: OK Certificate on 127.0.0.1 will "
"expire on Mon, 13 Jul 2020 12:00:00 -0000, which is more than 15 days"
)
...
...
@@ -515,7 +515,7 @@ class TestCheckSurykatkaJSONHttpQuery(CheckSurykatkaJSONMixin):
self
.
launcher
.
run
()
self
.
assertPassedMessage
(
self
.
getPromiseResult
(
self
.
promise_name
),
"http://www.erp5.com/ : http_query: OK status code 302 on IPs 127.0.0.1 "
"http://www.erp5.com/ : http_query: OK
with
status code 302 on IPs 127.0.0.1 "
"127.0.0.2"
)
...
...
@@ -814,7 +814,7 @@ class TestCheckSurykatkaJSONHttpQuery(CheckSurykatkaJSONMixin):
self
.
assertFailedMessage
(
self
.
getPromiseResult
(
self
.
promise_name
),
"https://www.erp5.com/ : ssl_certificate: ERROR No data http_query: "
"OK status code 302 on IPs 127.0.0.1 127.0.0.2"
"OK
with
status code 302 on IPs 127.0.0.1 127.0.0.2"
)
def
test_no_ssl_certificate
(
self
):
...
...
@@ -858,7 +858,7 @@ class TestCheckSurykatkaJSONHttpQuery(CheckSurykatkaJSONMixin):
self
.
getPromiseResult
(
self
.
promise_name
),
"https://www.erp5.com/ : ssl_certificate: ERROR No key "
"'ssl_certificate'. If the error persist, please update surykatka. "
"http_query: OK status code 302 on IPs 127.0.0.1 127.0.0.2"
"http_query: OK
with
status code 302 on IPs 127.0.0.1 127.0.0.2"
)
def
test_bad_code
(
self
):
...
...
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