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
80f164b3
Commit
80f164b3
authored
Oct 09, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PEP8
parent
f68eb2cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
slapos/tests/slapgrid.py
slapos/tests/slapgrid.py
+9
-8
No files found.
slapos/tests/slapgrid.py
View file @
80f164b3
...
...
@@ -662,24 +662,25 @@ class TestSlapgridCPWithMasterWatchdog(MasterMixin, unittest.TestCase):
4.Wait for it to fail
5.Wait for file generated by monkeypacthed bang to appear
"""
computer
=
ComputerForTest
(
self
.
software_root
,
self
.
instance_root
)
computer
=
ComputerForTest
(
self
.
software_root
,
self
.
instance_root
)
partition
=
computer
.
instance_list
[
0
]
partition
.
requested_state
=
'started'
partition
.
software
.
setBuildout
(
DAEMON_CONTENT
)
# Prepare watchdog
watchdog_path
=
os
.
path
.
join
(
self
.
_tempdir
,
'watchdog'
)
watchdog_banged
=
os
.
path
.
join
(
self
.
_tempdir
,
'watchdog_banged'
)
open
(
watchdog_path
,
'w'
).
write
(
watchdog_path
=
os
.
path
.
join
(
self
.
_tempdir
,
'watchdog'
)
watchdog_banged
=
os
.
path
.
join
(
self
.
_tempdir
,
'watchdog_banged'
)
open
(
watchdog_path
,
'w'
).
write
(
WATCHDOG_TEMPLATE
%
dict
(
python_path
=
sys
.
executable
,
sys_path
=
sys
.
path
,
watchdog_banged
=
watchdog_banged
))
os
.
chmod
(
watchdog_path
,
0755
)
os
.
chmod
(
watchdog_path
,
0755
)
self
.
grid
.
watchdog_path
=
watchdog_path
self
.
assertTrue
(
self
.
grid
.
processComputerPartitionList
())
self
.
assertSortedListEqual
(
os
.
listdir
(
self
.
instance_root
),
[
'0'
,
'etc'
,
'var'
])
self
.
assertSortedListEqual
(
os
.
listdir
(
partition
.
partition_path
),
[
'.0_daemon.log'
,
'worked'
,
'buildout.cfg'
,
'etc'
])
self
.
assertSortedListEqual
(
os
.
listdir
(
partition
.
partition_path
),
[
'.0_daemon.log'
,
'worked'
,
'buildout.cfg'
,
'etc'
])
tries
=
50
daemon_log
=
os
.
path
.
join
(
partition
.
partition_path
,
'.0_daemon.log'
)
while
tries
>
0
:
...
...
@@ -695,7 +696,7 @@ class TestSlapgridCPWithMasterWatchdog(MasterMixin, unittest.TestCase):
break
time
.
sleep
(
0.1
)
self
.
assertTrue
(
os
.
path
.
exists
(
watchdog_banged
))
self
.
assertTrue
(
'daemon'
in
open
(
watchdog_banged
,
'r'
).
read
())
self
.
assertTrue
(
'daemon'
in
open
(
watchdog_banged
,
'r'
).
read
())
RUN_CONTENT
=
"""#!/bin/sh
mkdir -p etc/run &&
...
...
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