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
18
Merge Requests
18
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
7510f81d
Commit
7510f81d
authored
Nov 22, 2023
by
Jérome Perrin
Committed by
Xavier Thompson
Nov 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_object: test independence of partition start/stop
parent
14a330df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
slapos/tests/test_object.py
slapos/tests/test_object.py
+41
-0
No files found.
slapos/tests/test_object.py
View file @
7510f81d
...
...
@@ -541,6 +541,47 @@ class TestPartitionSupervisorConfig(MasterMixin, unittest.TestCase):
for
i
in
range
(
3
):
self
.
assertIn
(
'program:%s_runner-%s'
%
(
group_id
,
i
),
supervisor_conf
)
def
test_partition_independence
(
self
):
partition1a
=
self
.
createPartition
(
self
.
software
.
url
,
partition_id
=
'part1a'
)
partition1a_service_path
=
os
.
path
.
join
(
partition1a
.
instance_path
,
'etc'
,
'service'
)
os
.
makedirs
(
partition1a_service_path
)
with
open
(
os
.
path
.
join
(
partition1a_service_path
,
'test'
),
'w'
)
as
f
:
f
.
write
(
'#!/bin/sh
\
n
sleep 30'
)
os
.
fchmod
(
f
.
fileno
(),
0o750
)
partition1a
.
start
()
with
self
.
supervisor
as
s
:
part1a_pid
=
s
.
getProcessInfo
(
'part1a:test-on-watch'
)[
'pid'
]
self
.
assertTrue
(
part1a_pid
)
partition1
=
self
.
createPartition
(
self
.
software
.
url
,
partition_id
=
'part1'
)
partition1_service_path
=
os
.
path
.
join
(
partition1
.
instance_path
,
'etc'
,
'service'
)
os
.
makedirs
(
partition1_service_path
)
with
open
(
os
.
path
.
join
(
partition1_service_path
,
'test'
),
'w'
)
as
f
:
f
.
write
(
'#!/bin/sh
\
n
sleep 30'
)
os
.
fchmod
(
f
.
fileno
(),
0o750
)
partition1
.
start
()
# process is still running (it was not restarted)
with
self
.
supervisor
as
s
:
self
.
assertEqual
(
s
.
getProcessInfo
(
'part1a:test-on-watch'
)[
'pid'
],
part1a_pid
)
partition1
.
stop
()
with
self
.
supervisor
as
s
:
self
.
assertEqual
(
s
.
getProcessInfo
(
'part1a:test-on-watch'
)[
'pid'
],
part1a_pid
)
partition1
.
destroy
()
with
self
.
supervisor
as
s
:
self
.
assertEqual
(
s
.
getProcessInfo
(
'part1a:test-on-watch'
)[
'pid'
],
part1a_pid
)
class
TestPartitionDestructionLock
(
MasterMixin
,
unittest
.
TestCase
):
def
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