Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
19
Merge Requests
19
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
9faa825e
Commit
9faa825e
authored
Jun 29, 2018
by
Guillaume Hervier
Committed by
Rafael Monnerat
Jul 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapgrid_tests: Add tests for SlapObject supervisor config manipulation methods
parent
a6a347d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
slapos/tests/slapobject.py
slapos/tests/slapobject.py
+47
-0
No files found.
slapos/tests/slapobject.py
View file @
9faa825e
...
...
@@ -400,6 +400,53 @@ class TestPartitionSlapObject(MasterMixin, unittest.TestCase):
# XXX: What should it raise?
self
.
assertRaises
(
IOError
,
partition
.
install
)
class
TestPartitionSupervisorConfig
(
MasterMixin
,
unittest
.
TestCase
):
def
setUp
(
self
):
MasterMixin
.
setUp
(
self
)
self
.
software
=
self
.
createSoftware
()
self
.
partition
=
self
.
createPartition
(
self
.
software
.
url
)
self
.
partition
.
generateSupervisorConfiguration
()
utils
.
bootstrapBuildout
=
FakeCallAndNoop
()
utils
.
launchBuildout
=
FakeCallAndNoop
()
def
test_grouped_program
(
self
):
self
.
assertEqual
(
self
.
partition
.
supervisor_configuration_group
,
''
)
self
.
assertEqual
(
self
.
partition
.
partition_supervisor_configuration
,
''
)
partition_id
=
self
.
partition
.
partition_id
group_id
=
self
.
partition
.
addCustomGroup
(
'test'
,
partition_id
,
[
'sample-1'
])
self
.
assertIn
(
'group:{}-test'
.
format
(
partition_id
),
self
.
partition
.
supervisor_configuration_group
)
self
.
partition
.
addProgramToGroup
(
group_id
,
'sample-1'
,
'sample-1'
,
'/bin/ls'
)
self
.
assertIn
(
'program:{}-test_sample-1'
.
format
(
partition_id
),
self
.
partition
.
partition_supervisor_configuration
)
def
test_simple_service
(
self
):
self
.
assertEqual
(
self
.
partition
.
supervisor_configuration_group
,
''
)
self
.
assertEqual
(
self
.
partition
.
partition_supervisor_configuration
,
''
)
partition_id
=
self
.
partition
.
partition_id
runners
=
[
'runner-{}'
.
format
(
i
)
for
i
in
range
(
3
)]
path
=
os
.
path
.
join
(
self
.
partition
.
instance_path
,
'etc/run'
)
self
.
partition
.
addServiceToGroup
(
partition_id
,
runners
,
path
)
for
i
in
range
(
3
):
self
.
assertIn
(
'program:{}_runner-{}'
.
format
(
partition_id
,
i
),
self
.
partition
.
partition_supervisor_configuration
)
runner_path
=
os
.
path
.
join
(
self
.
partition
.
instance_path
,
'etc/run'
,
'runner-{}'
.
format
(
i
))
class
TestPartitionDestructionLock
(
MasterMixin
,
unittest
.
TestCase
):
def
setUp
(
self
):
MasterMixin
.
setUp
(
self
)
...
...
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