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
0
Merge Requests
0
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
Rafael Monnerat
slapos.core
Commits
2638f574
Commit
2638f574
authored
Jun 23, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: do not rotate supervisor logs when testing
parent
24451a06
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
5 deletions
+30
-5
slapos/grid/SlapObject.py
slapos/grid/SlapObject.py
+4
-3
slapos/tests/slapgrid.py
slapos/tests/slapgrid.py
+26
-2
No files found.
slapos/grid/SlapObject.py
View file @
2638f574
...
@@ -53,6 +53,9 @@ from slapos.grid.watchdog import getWatchdogID
...
@@ -53,6 +53,9 @@ from slapos.grid.watchdog import getWatchdogID
REQUIRED_COMPUTER_PARTITION_PERMISSION
=
0o750
REQUIRED_COMPUTER_PARTITION_PERMISSION
=
0o750
# XXX not very clean. this is changed when testing
PROGRAM_PARTITION_TEMPLATE
=
pkg_resources
.
resource_stream
(
__name__
,
'templates/program_partition_supervisord.conf.in'
).
read
()
class
Software
(
object
):
class
Software
(
object
):
"""This class is responsible for installing a software release"""
"""This class is responsible for installing a software release"""
...
@@ -343,11 +346,9 @@ class Partition(object):
...
@@ -343,11 +346,9 @@ class Partition(object):
def
addServiceToGroup
(
self
,
partition_id
,
def
addServiceToGroup
(
self
,
partition_id
,
runner_list
,
path
,
extension
=
''
):
runner_list
,
path
,
extension
=
''
):
uid
,
gid
=
self
.
getUserGroupId
()
uid
,
gid
=
self
.
getUserGroupId
()
program_partition_template
=
pkg_resources
.
resource_stream
(
__name__
,
'templates/program_partition_supervisord.conf.in'
).
read
()
for
runner
in
runner_list
:
for
runner
in
runner_list
:
self
.
partition_supervisor_configuration
+=
'
\
n
'
+
\
self
.
partition_supervisor_configuration
+=
'
\
n
'
+
\
program_partition_template
%
{
PROGRAM_PARTITION_TEMPLATE
%
{
'program_id'
:
'_'
.
join
([
partition_id
,
runner
]),
'program_id'
:
'_'
.
join
([
partition_id
,
runner
]),
'program_directory'
:
self
.
instance_path
,
'program_directory'
:
self
.
instance_path
,
'program_command'
:
os
.
path
.
join
(
path
,
runner
),
'program_command'
:
os
.
path
.
join
(
path
,
runner
),
...
...
slapos/tests/slapgrid.py
View file @
2638f574
...
@@ -47,6 +47,7 @@ from slapos.grid import slapgrid
...
@@ -47,6 +47,7 @@ from slapos.grid import slapgrid
from
slapos.cli_legacy.slapgrid
import
parseArgumentTupleAndReturnSlapgridObject
from
slapos.cli_legacy.slapgrid
import
parseArgumentTupleAndReturnSlapgridObject
from
slapos.grid.utils
import
md5digest
from
slapos.grid.utils
import
md5digest
from
slapos.grid.watchdog
import
Watchdog
,
getWatchdogID
from
slapos.grid.watchdog
import
Watchdog
,
getWatchdogID
from
slapos.grid
import
SlapObject
dummylogger
=
logging
.
getLogger
()
dummylogger
=
logging
.
getLogger
()
...
@@ -132,6 +133,29 @@ class BasicMixin:
...
@@ -132,6 +133,29 @@ class BasicMixin:
slapos
.
grid
.
utils
.
bootstrapBuildout
=
dummy
slapos
.
grid
.
utils
.
bootstrapBuildout
=
dummy
SlapObject
.
PROGRAM_PARTITION_TEMPLATE
=
textwrap
.
dedent
(
"""
\
[program:%(program_id)s]
directory=%(program_directory)s
command=%(program_command)s
process_name=%(program_name)s
autostart=false
autorestart=false
startsecs=0
startretries=0
exitcodes=0
stopsignal=TERM
stopwaitsecs=60
stopasgroup=true
killasgroup=true
user=%(user_id)s
group=%(group_id)s
serverurl=AUTO
redirect_stderr=true
stdout_logfile=%(instance_path)s/.%(program_id)s.log
stderr_logfile=%(instance_path)s/.%(program_id)s.log
environment=USER="%(USER)s",LOGNAME="%(USER)s",HOME="%(HOME)s"
"""
)
def
launchSlapgrid
(
self
,
develop
=
False
):
def
launchSlapgrid
(
self
,
develop
=
False
):
self
.
setSlapgrid
(
develop
=
develop
)
self
.
setSlapgrid
(
develop
=
develop
)
return
self
.
grid
.
processComputerPartitionList
()
return
self
.
grid
.
processComputerPartitionList
()
...
@@ -608,7 +632,7 @@ chmod 755 etc/run/wrapper
...
@@ -608,7 +632,7 @@ chmod 755 etc/run/wrapper
self
.
assertEqual
(
self
.
launchSlapgrid
(),
slapgrid
.
SLAPGRID_SUCCESS
)
self
.
assertEqual
(
self
.
launchSlapgrid
(),
slapgrid
.
SLAPGRID_SUCCESS
)
self
.
assertItemsEqual
(
os
.
listdir
(
self
.
instance_root
),
[
'0'
,
'etc'
,
'var'
])
self
.
assertItemsEqual
(
os
.
listdir
(
self
.
instance_root
),
[
'0'
,
'etc'
,
'var'
])
self
.
assertItemsEqual
(
os
.
listdir
(
instance
.
partition_path
),
self
.
assertItemsEqual
(
os
.
listdir
(
instance
.
partition_path
),
[
'.0_wrapper.log'
,
'
.0_wrapper.log.1'
,
'
buildout.cfg'
,
'etc'
,
'software_release'
,
'worked'
])
[
'.0_wrapper.log'
,
'buildout.cfg'
,
'etc'
,
'software_release'
,
'worked'
])
tries
=
50
tries
=
50
expected_text
=
'Signal handler called with signal 15'
expected_text
=
'Signal handler called with signal 15'
while
tries
>
0
:
while
tries
>
0
:
...
@@ -680,7 +704,7 @@ exit 1
...
@@ -680,7 +704,7 @@ exit 1
self
.
assertItemsEqual
(
os
.
listdir
(
self
.
instance_root
),
self
.
assertItemsEqual
(
os
.
listdir
(
self
.
instance_root
),
[
'0'
,
'etc'
,
'var'
])
[
'0'
,
'etc'
,
'var'
])
self
.
assertItemsEqual
(
os
.
listdir
(
instance
.
partition_path
),
self
.
assertItemsEqual
(
os
.
listdir
(
instance
.
partition_path
),
[
'.0_wrapper.log'
,
'
.0_wrapper.log.1'
,
'
buildout.cfg'
,
'etc'
,
'software_release'
,
'worked'
])
[
'.0_wrapper.log'
,
'buildout.cfg'
,
'etc'
,
'software_release'
,
'worked'
])
tries
=
50
tries
=
50
expected_text
=
'Signal handler called with signal 15'
expected_text
=
'Signal handler called with signal 15'
while
tries
>
0
:
while
tries
>
0
:
...
...
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