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
c6007954
Commit
c6007954
authored
Oct 28, 2013
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slaprunner: new test scenario on auto_deployment
(function isSoftwareReleaseReady)
parent
cf491880
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
3 deletions
+29
-3
slapos/runner/runnertest.py
slapos/runner/runnertest.py
+29
-3
No files found.
slapos/runner/runnertest.py
View file @
c6007954
...
...
@@ -21,7 +21,8 @@ import time
import
unittest
from
slapos.runner.utils
import
(
getProfilePath
,
getSession
,
isInstanceRunning
,
isSoftwareRunning
,
startProxy
)
isSoftwareRunning
,
startProxy
,
isSoftwareReleaseReady
)
from
slapos.runner.process
import
killRunningProcess
,
isRunning
from
slapos.runner
import
views
import
slapos.slap
...
...
@@ -220,11 +221,9 @@ class SlaprunnerTestCase(unittest.TestCase):
"""test Update accound, this needs the user to log in"""
self
.
setAccount
()
htpasswd
=
os
.
path
.
join
(
self
.
app
.
config
[
'etc_dir'
],
'.htpasswd'
)
import
pdb
;
pdb
.
set_trace
()
assert
self
.
users
[
0
]
in
open
(
htpasswd
).
read
()
response
=
loadJson
(
self
.
updateAccount
(
self
.
updateUser
,
self
.
rcode
))
self
.
assertEqual
(
response
[
'code'
],
1
)
import
pdb
;
pdb
.
set_trace
()
encode
=
HtpasswdFile
(
htpasswd
,
False
)
encode
.
update
(
self
.
updateUser
[
0
],
self
.
updateUser
[
1
])
assert
self
.
updateUser
[
0
]
in
open
(
htpasswd
).
read
()
...
...
@@ -411,6 +410,33 @@ class SlaprunnerTestCase(unittest.TestCase):
self
.
proxyStatus
(
True
)
self
.
stopSlapproxy
()
def
test_safeAutoDeploy
(
self
):
"""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
project
=
open
(
os
.
path
.
join
(
self
.
app
.
config
[
'etc_dir'
],
'.project'
),
"w"
)
project
.
write
(
self
.
software
+
'slaprunner-test'
+
'/'
)
project
.
close
()
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
.
setupSoftwareFolder
()
response
=
isSoftwareReleaseReady
(
self
.
app
.
config
)
self
.
assertEqual
(
response
,
"2"
)
# Test that the new call to isSoftwareReleaseReady
# doesn't overwrite the previous installed one
completed_path
=
os
.
path
.
join
(
self
.
app
.
config
[
'runner_workdir'
],
'softwareLink'
,
'slaprunner-test'
,
'.completed'
)
completed_text
=
".completed file: test"
completed
=
open
(
completed_path
,
"w"
)
completed
.
write
(
completed_text
)
completed
.
close
()
response
=
isSoftwareReleaseReady
(
self
.
app
.
config
)
self
.
assertEqual
(
response
,
"1"
)
assert
completed_text
in
open
(
completed_path
).
read
()
def
main
():
# Empty parser for now - so that erp5testnode is happy when doing --help
...
...
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