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
Alain Takoudjou
slapos.toolbox
Commits
b293c320
Commit
b293c320
authored
Aug 28, 2014
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner: tests adapted to the use of supervisord
parent
504c884b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
13 deletions
+9
-13
slapos/runner/runnertest.py
slapos/runner/runnertest.py
+9
-13
No files found.
slapos/runner/runnertest.py
View file @
b293c320
...
...
@@ -17,6 +17,7 @@ import hashlib
import
json
import
os
import
shutil
import
sup_process
import
time
import
unittest
...
...
@@ -137,9 +138,9 @@ class SlaprunnerTestCase(unittest.TestCase):
if
os
.
path
.
exists
(
self
.
app
.
config
[
'software_link'
]):
shutil
.
rmtree
(
self
.
app
.
config
[
'software_link'
])
#Stop process
killRunningProcess
(
'slapproxy'
,
recursive
=
True
)
killRunningProcess
(
'slapgrid-cp'
,
recursive
=
True
)
killRunningProcess
(
'slapgrid-sr'
,
recursive
=
True
)
sup_process
.
killRunningProcess
(
self
.
app
.
config
,
'slapproxy'
)
sup_process
.
killRunningProcess
(
self
.
app
.
config
,
'slapgrid-cp'
)
sup_process
.
killRunningProcess
(
self
.
app
.
config
,
'slapgrid-sr'
)
def
updateConfigParameter
(
self
,
parameter
,
value
):
config_parser
=
ConfigParser
.
SafeConfigParser
()
...
...
@@ -186,10 +187,10 @@ class SlaprunnerTestCase(unittest.TestCase):
def
proxyStatus
(
self
,
status
=
True
,
sleep_time
=
0
):
"""Helper for testslapproxy status"""
proxy
=
isRunning
(
'slapproxy'
)
proxy
=
sup_process
.
isRunning
(
self
.
app
.
config
,
'slapproxy'
)
if
proxy
!=
status
and
sleep_time
!=
0
:
time
.
sleep
(
sleep_time
)
proxy
=
isRunning
(
'slapproxy'
)
proxy
=
sup_process
.
isRunning
(
self
.
app
.
config
,
'slapproxy'
)
self
.
assertEqual
(
proxy
,
status
)
def
setupProjectFolder
(
self
,
withSoftware
=
False
):
...
...
@@ -232,7 +233,7 @@ class SlaprunnerTestCase(unittest.TestCase):
def
stopSlapproxy
(
self
):
"""Kill slapproxy process"""
killRunningProcess
(
'slapproxy'
,
recursive
=
True
)
pass
def
test_configAccount
(
self
):
"""For the first lauch of slaprunner user need do create first account"""
...
...
@@ -256,12 +257,8 @@ class SlaprunnerTestCase(unittest.TestCase):
def
test_startStopProxy
(
self
):
"""Test slapproxy"""
self
.
stopSlapproxy
()
self
.
proxyStatus
(
False
)
startProxy
(
self
.
app
.
config
)
self
.
proxyStatus
(
True
)
self
.
stopSlapproxy
()
self
.
proxyStatus
(
False
,
sleep_time
=
1
)
def
test_cloneProject
(
self
):
"""Start scenario 1 for deploying SR: Clone a project from git repository"""
...
...
@@ -408,7 +405,6 @@ class SlaprunnerTestCase(unittest.TestCase):
def
test_requestInstance
(
self
):
"""Scenarion 6: request software instance"""
self
.
test_updateInstanceParameter
()
self
.
proxyStatus
(
False
,
sleep_time
=
1
)
#run Software profile
response
=
loadJson
(
self
.
app
.
post
(
'/runSoftwareProfile'
,
data
=
dict
(),
...
...
@@ -459,7 +455,7 @@ class SlaprunnerTestCase(unittest.TestCase):
self
.
assertEqual
(
response
,
"2"
)
# Test that the new call to isSoftwareReleaseReady
# doesn't overwrite the previous installed one
killRunningProcess
(
'slapgrid-sr'
)
sup_process
.
killRunningProcess
(
self
.
app
.
config
,
'slapgrid-sr'
)
completed_path
=
os
.
path
.
join
(
self
.
app
.
config
[
'runner_workdir'
],
'softwareLink'
,
'slaprunner-test'
,
'.completed'
)
completed_text
=
".completed file: test"
...
...
@@ -538,7 +534,7 @@ class SlaprunnerTestCase(unittest.TestCase):
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'
)
config_file
=
os
.
path
.
join
(
self
.
app
.
config
[
'etc_dir'
],
'slapos
-test
.cfg'
)
runner_config_old
=
os
.
environ
[
'RUNNER_CONFIG'
]
os
.
environ
[
'RUNNER_CONFIG'
]
=
config_file
open
(
config_file
,
'w'
).
write
(
"[section]
\
n
var=value"
)
...
...
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