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
Joanne Hugé
slapos.toolbox
Commits
8bbf40cd
Commit
8bbf40cd
authored
Aug 08, 2014
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner: Add slave test.
parent
76166f91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
1 deletion
+47
-1
slapos/runner/runnertest.py
slapos/runner/runnertest.py
+47
-1
No files found.
slapos/runner/runnertest.py
View file @
8bbf40cd
...
@@ -24,7 +24,7 @@ from slapos.runner.utils import (getProfilePath, getRcode,
...
@@ -24,7 +24,7 @@ from slapos.runner.utils import (getProfilePath, getRcode,
getSession
,
isInstanceRunning
,
getSession
,
isInstanceRunning
,
isSoftwareRunning
,
startProxy
,
isSoftwareRunning
,
startProxy
,
isSoftwareReleaseReady
,
isSoftwareReleaseReady
,
runSlapgridUntilSuccess
,
runSlapgridUntilSuccess
,
runInstanceWithLock
,
getBuildAndRunParams
,
saveBuildAndRunParams
)
getBuildAndRunParams
,
saveBuildAndRunParams
)
from
slapos.runner.process
import
killRunningProcess
,
isRunning
from
slapos.runner.process
import
killRunningProcess
,
isRunning
from
slapos.runner
import
views
from
slapos.runner
import
views
...
@@ -532,6 +532,52 @@ class SlaprunnerTestCase(unittest.TestCase):
...
@@ -532,6 +532,52 @@ class SlaprunnerTestCase(unittest.TestCase):
response
=
runSlapgridUntilSuccess
(
self
.
app
.
config
,
'software'
)
response
=
runSlapgridUntilSuccess
(
self
.
app
.
config
,
'software'
)
self
.
assertEqual
(
response
,
(
1
,
MAX_RUN_INSTANCE
))
self
.
assertEqual
(
response
,
(
1
,
MAX_RUN_INSTANCE
))
def
test_slaveInstanceDeployment
(
self
):
"""
In order to test both slapproxy and core features of
slaprunner, will install special Software Release
into the current webrunner and fetch its instance
parameters once deployed.
"""
# XXX: This test should NOT be a unit test but should be run
# by a Test Agent running against a slapproxy.
# Deploy "test-slave-instance-deployment" Software Release
self
.
test_cloneProject
()
software
=
os
.
path
.
join
(
self
.
software
,
'test-slave-instance-deployment'
)
# Checkout to master branch
response
=
loadJson
(
self
.
app
.
post
(
'/newBranch'
,
data
=
dict
(
project
=
self
.
software
,
create
=
'0'
,
name
=
'master'
),
follow_redirects
=
True
)).
get
(
u'code'
)
self
.
assertEqual
(
response
,
1
)
response
=
loadJson
(
self
.
app
.
post
(
'/setCurrentProject'
,
data
=
dict
(
path
=
software
),
follow_redirects
=
True
)).
get
(
u'code'
)
self
.
assertEqual
(
response
,
1
)
response
=
loadJson
(
self
.
app
.
post
(
'/saveParameterXml'
,
data
=
dict
(
parameter
=
'<?xml version="1.0" encoding="utf-8"?>
\
n
<instance/>'
,
software_type
=
'default'
),
follow_redirects
=
True
))
while
self
.
app
.
get
(
'/isSRReady'
).
data
==
"2"
:
time
.
sleep
(
2
)
self
.
assertEqual
(
self
.
app
.
get
(
'/isSRReady'
).
data
,
"1"
)
# Run instance deployment 3 times
runInstanceWithLock
(
self
.
app
.
config
)
runInstanceWithLock
(
self
.
app
.
config
)
result
=
runInstanceWithLock
(
self
.
app
.
config
)
# result is True if returncode is 0 (i.e "deployed and promise passed")
self
.
assertTrue
(
result
)
self
.
proxyStatus
(
True
)
self
.
stopSlapproxy
()
def
test_dynamicParametersReading
(
self
):
def
test_dynamicParametersReading
(
self
):
"""Test if the value of a parameter can change in the flask application
"""Test if the value of a parameter can change in the flask application
...
...
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