Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Georgios Dagkakis
erp5
Commits
b69d02b0
Commit
b69d02b0
authored
Mar 01, 2013
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
after resetting software, retry_software_count was not resetted correctly
parent
4975e31d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
1 deletion
+41
-1
erp5/tests/testERP5TestNode.py
erp5/tests/testERP5TestNode.py
+38
-1
erp5/util/testnode/testnode.py
erp5/util/testnode/testnode.py
+3
-0
No files found.
erp5/tests/testERP5TestNode.py
View file @
b69d02b0
...
...
@@ -606,4 +606,41 @@ branch = foo
# then we set keep time to 0, folder will be deleted
test_node
.
max_temp_time
=
0
test_node
.
_cleanupTemporaryFiles
()
check
(
set
([
'something'
]))
\ No newline at end of file
check
(
set
([
'something'
]))
def
test_18_resetSoftwareAfterManyBuildFailures
(
self
):
"""
Check that after several building failures that the software is resetted
"""
initial_initializeSlapOSControler
=
\
SlapOSControler
.
initializeSlapOSControler
initial_runSoftwareRelease
=
SlapOSControler
.
runSoftwareRelease
test_node
=
self
.
getTestNode
()
node_test_suite
=
test_node
.
getNodeTestSuite
(
'foo'
)
init_call_kw_list
=
[]
def
initializeSlapOSControler
(
self
,
**
kw
):
init_call_kw_list
.
append
(
kw
)
def
runSoftwareRelease
(
self
,
*
args
,
**
kw
):
return
{
"status_code"
:
1
}
SlapOSControler
.
initializeSlapOSControler
=
initializeSlapOSControler
SlapOSControler
.
runSoftwareRelease
=
runSoftwareRelease
def
callPrepareSlapOS
():
test_node
.
_prepareSlapOS
(
self
.
working_directory
,
node_test_suite
,
test_node
.
log
,
create_partition
=
0
)
def
callRaisingPrepareSlapos
():
self
.
assertRaises
(
SubprocessError
,
callPrepareSlapOS
)
self
.
assertEquals
(
node_test_suite
.
retry_software_count
,
0
)
for
x
in
xrange
(
0
,
11
):
callRaisingPrepareSlapos
()
self
.
assertEquals
(
len
(
init_call_kw_list
),
11
)
self
.
assertEquals
(
init_call_kw_list
[
-
1
][
'reset_software'
],
False
)
self
.
assertEquals
(
node_test_suite
.
retry_software_count
,
11
)
callRaisingPrepareSlapos
()
self
.
assertEquals
(
init_call_kw_list
[
-
1
][
'reset_software'
],
True
)
self
.
assertEquals
(
node_test_suite
.
retry_software_count
,
1
)
callRaisingPrepareSlapos
()
self
.
assertEquals
(
init_call_kw_list
[
-
1
][
'reset_software'
],
False
)
self
.
assertEquals
(
node_test_suite
.
retry_software_count
,
2
)
SlapOSControler
.
initializeSlapOSControler
=
\
initial_initializeSlapOSControler
SlapOSControler
.
runSoftwareRelease
=
initial_runSoftwareRelease
erp5/util/testnode/testnode.py
View file @
b69d02b0
...
...
@@ -149,6 +149,7 @@ class TestNode(object):
for
y
in
to_remove_reference_set
:
fpath
=
os
.
path
.
join
(
config
[
'working_directory'
],
y
)
self
.
delNodeTestSuite
(
y
)
self
.
log
(
"testnode.checkOldTestSuite, DELETING : %r"
%
(
fpath
,))
if
os
.
path
.
isdir
(
fpath
):
shutil
.
rmtree
(
fpath
)
else
:
...
...
@@ -290,6 +291,8 @@ branch = %(branch)s
'slapproxy.log'
)
log
(
'Configured slapproxy log to %r'
%
slapproxy_log
)
reset_software
=
slapos_instance
.
retry_software_count
>
10
if
reset_software
:
slapos_instance
.
retry_software_count
=
0
log
(
'testnode, retry_software_count : %r'
%
\
slapos_instance
.
retry_software_count
)
self
.
slapos_controler
=
SlapOSControler
.
SlapOSControler
(
...
...
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