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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
slapos.toolbox
Commits
f7aa38b5
Commit
f7aa38b5
authored
Jul 28, 2014
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner-tests: new test for the new behaviour of getting parameters' value
parent
a763160b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
slapos/runner/runnertest.py
slapos/runner/runnertest.py
+17
-0
No files found.
slapos/runner/runnertest.py
View file @
f7aa38b5
...
...
@@ -533,6 +533,23 @@ class SlaprunnerTestCase(unittest.TestCase):
self
.
assertEqual
(
response
,
(
1
,
MAX_RUN_INSTANCE
))
def
test_dynamicParametersReading
(
self
):
"""Test if the value of a parameter can change in the flask application
only by changing the value of slapos.cfg config file. This can happen when
slapgrid processes the webrunner's partition.
"""
config_file
=
os
.
path
.
join
(
self
.
app
.
config
[
'etc_dir'
],
'slapos.cfg'
)
runner_config_old
=
os
.
environ
[
'RUNNER_CONFIG'
]
os
.
environ
[
'RUNNER_CONFIG'
]
=
config_file
open
(
config_file
,
'w'
).
write
(
"[section]
\
n
var=value"
)
config
=
self
.
app
.
config
self
.
assertEqual
(
config
[
'var'
],
"value"
)
open
(
config_file
,
'w'
).
write
(
"[section]
\
n
var=value_changed"
)
self
.
assertEqual
(
config
[
'var'
],
"value_changed"
)
# cleanup
os
.
environ
[
'RUNNER_CONFIG'
]
=
runner_config_old
def
main
():
# Empty parser for now - so that erp5testnode is happy when doing --help
parser
=
argparse
.
ArgumentParser
()
...
...
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