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
Klaus Wölfel
slapos.toolbox
Commits
a763160b
Commit
a763160b
authored
Jul 28, 2014
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner-tests: code apdated to the new behaviour of getting app parameters'value
parent
5bebf9d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
slapos/runner/runnertest.py
slapos/runner/runnertest.py
+16
-3
No files found.
slapos/runner/runnertest.py
View file @
a763160b
...
...
@@ -120,6 +120,10 @@ class SlaprunnerTestCase(unittest.TestCase):
project
=
os
.
path
.
join
(
self
.
app
.
config
[
'etc_dir'
],
'.project'
)
users
=
os
.
path
.
join
(
self
.
app
.
config
[
'etc_dir'
],
'.users'
)
#reset tested parameters
self
.
updateConfigParameter
(
'autorun'
,
False
)
self
.
updateConfigParameter
(
'auto_deploy'
,
True
)
if
os
.
path
.
exists
(
users
):
os
.
unlink
(
users
)
if
os
.
path
.
exists
(
project
):
...
...
@@ -137,6 +141,15 @@ class SlaprunnerTestCase(unittest.TestCase):
killRunningProcess
(
'slapgrid-cp'
,
recursive
=
True
)
killRunningProcess
(
'slapgrid-sr'
,
recursive
=
True
)
def
updateConfigParameter
(
self
,
parameter
,
value
):
config_parser
=
ConfigParser
.
SafeConfigParser
()
config_parser
.
read
(
os
.
getenv
(
'RUNNER_CONFIG'
))
for
section
in
config_parser
.
sections
():
if
config_parser
.
has_option
(
section
,
parameter
):
config_parser
.
set
(
section
,
parameter
,
str
(
value
))
with
open
(
os
.
getenv
(
'RUNNER_CONFIG'
),
'wb'
)
as
configfile
:
config_parser
.
write
(
configfile
)
def
configAccount
(
self
,
username
,
password
,
email
,
name
,
rcode
):
"""Helper for configAccount"""
return
self
.
app
.
post
(
'/configAccount'
,
...
...
@@ -431,8 +444,8 @@ class SlaprunnerTestCase(unittest.TestCase):
"""Scenario 7: isSRReady won't overwrite the existing
Sofware Instance if it has been deployed yet"""
# Test that SR won't be deployed with auto_deploy=False
self
.
app
.
config
[
'auto_deploy'
]
=
False
self
.
app
.
config
[
'autorun'
]
=
False
self
.
updateConfigParameter
(
'auto_deploy'
,
False
)
self
.
updateConfigParameter
(
'autorun'
,
False
)
project
=
open
(
os
.
path
.
join
(
self
.
app
.
config
[
'etc_dir'
],
'.project'
),
"w"
)
project
.
write
(
self
.
software
+
'slaprunner-test'
)
...
...
@@ -440,7 +453,7 @@ class SlaprunnerTestCase(unittest.TestCase):
response
=
isSoftwareReleaseReady
(
self
.
app
.
config
)
self
.
assertEqual
(
response
,
"0"
)
# Test if auto_deploy parameter starts the deployment of SR
self
.
app
.
config
[
'auto_deploy'
]
=
True
self
.
updateConfigParameter
(
'auto_deploy'
,
True
)
self
.
setupSoftwareFolder
()
response
=
isSoftwareReleaseReady
(
self
.
app
.
config
)
self
.
assertEqual
(
response
,
"2"
)
...
...
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