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
Justin
slapos.toolbox
Commits
63a514f8
Commit
63a514f8
authored
Dec 21, 2017
by
Hardik Juneja
Committed by
Rafael Monnerat
Dec 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ResiliencyTests: Use "==" for numeric comparision instead of "is"
/reviewed-on
nexedi/slapos.toolbox!25
parent
beb86eab
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
slapos/resiliencytest/suites/slaprunner.py
slapos/resiliencytest/suites/slaprunner.py
+8
-8
No files found.
slapos/resiliencytest/suites/slaprunner.py
View file @
63a514f8
...
@@ -112,20 +112,20 @@ class SlaprunnerTestSuite(ResiliencyTestSuite):
...
@@ -112,20 +112,20 @@ class SlaprunnerTestSuite(ResiliencyTestSuite):
)
)
try
:
try
:
json_data
=
json
.
loads
(
data
)
json_data
=
json
.
loads
(
data
)
if
json_data
[
'code'
]
is
0
:
if
json_data
[
'code'
]
==
0
:
raise
IOError
(
data
[
'result'
])
raise
IOError
(
json_
data
[
'result'
])
data
=
json_data
[
'result'
]
data
=
json_data
[
'result'
]
self
.
logger
.
info
(
'Retrieved data are:
\
n
%s'
%
data
)
self
.
logger
.
info
(
'Retrieved data are:
\
n
%s'
%
data
)
except
(
ValueError
,
KeyError
):
except
(
ValueError
,
KeyError
):
if
data
.
find
(
'<'
)
is
not
-
1
:
if
data
.
find
(
'<'
)
!=
-
1
:
raise
IOError
(
raise
IOError
(
'Could not retrieve logfile content: retrieved content is html.'
'Could not retrieve logfile content: retrieved content is html.'
)
)
if
data
.
find
(
'Could not load'
)
is
not
-
1
:
if
data
.
find
(
'Could not load'
)
!=
-
1
:
raise
IOError
(
raise
IOError
(
'Could not retrieve logfile content: server could not load the file.'
'Could not retrieve logfile content: server could not load the file.'
)
)
if
data
.
find
(
'Hello'
)
is
-
1
:
if
data
.
find
(
'Hello'
)
==
-
1
:
raise
IOError
(
raise
IOError
(
'Could not retrieve logfile content: retrieve content does not match "Hello".'
'Could not retrieve logfile content: retrieve content does not match "Hello".'
)
)
...
@@ -207,13 +207,13 @@ class SlaprunnerTestSuite(ResiliencyTestSuite):
...
@@ -207,13 +207,13 @@ class SlaprunnerTestSuite(ResiliencyTestSuite):
data
=
'repo=https://lab.nexedi.com/nexedi/slapos.git&name=workspace/slapos&email=slapos@slapos.org&user=slapos'
data
=
'repo=https://lab.nexedi.com/nexedi/slapos.git&name=workspace/slapos&email=slapos@slapos.org&user=slapos'
)
)
data
=
json
.
loads
(
data
)
data
=
json
.
loads
(
data
)
if
data
[
'code'
]
is
0
:
if
data
[
'code'
]
==
0
:
self
.
logger
.
warning
(
data
[
'result'
])
self
.
logger
.
warning
(
data
[
'result'
])
except
(
NotHttpOkException
,
urllib2
.
HTTPError
):
except
(
NotHttpOkException
,
urllib2
.
HTTPError
):
# cloning can be very long.
# cloning can be very long.
# XXX: quite dirty way to check.
# XXX: quite dirty way to check.
while
self
.
_connectToSlaprunner
(
'getProjectStatus'
,
data
=
'project=workspace/slapos'
).
find
(
'On branch master'
)
is
-
1
:
while
self
.
_connectToSlaprunner
(
'getProjectStatus'
,
data
=
'project=workspace/slapos'
).
find
(
'On branch master'
)
==
-
1
:
self
.
logger
.
info
(
'git-cloning ongoing, sleeping...'
)
self
.
logger
.
info
(
'git-cloning ongoing, sleeping...'
)
def
_openSoftwareRelease
(
self
,
software_release
=
'erp5testnode/testsuite/dummy'
):
def
_openSoftwareRelease
(
self
,
software_release
=
'erp5testnode/testsuite/dummy'
):
...
@@ -222,7 +222,7 @@ class SlaprunnerTestSuite(ResiliencyTestSuite):
...
@@ -222,7 +222,7 @@ class SlaprunnerTestSuite(ResiliencyTestSuite):
resource
=
'setCurrentProject'
,
resource
=
'setCurrentProject'
,
data
=
'path=workspace/slapos/software/%s/'
%
software_release
data
=
'path=workspace/slapos/software/%s/'
%
software_release
)
)
if
json
.
loads
(
data
)[
'code'
]
is
0
:
if
json
.
loads
(
data
)[
'code'
]
==
0
:
self
.
logger
.
warning
(
data
[
'result'
])
self
.
logger
.
warning
(
data
[
'result'
])
raise
IOError
(
data
[
'result'
])
raise
IOError
(
data
[
'result'
])
...
...
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