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
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
Cédric Le Ninivin
slapos.core
Commits
53d51edc
Commit
53d51edc
authored
Sep 13, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into slapgrid_test
Conflicts: slapos/tests/slapgrid.py
parents
9bedce75
7b3cbc2c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
slapos/tests/slapgrid.py
slapos/tests/slapgrid.py
+8
-9
No files found.
slapos/tests/slapgrid.py
View file @
53d51edc
...
@@ -38,6 +38,7 @@ class BasicMixin:
...
@@ -38,6 +38,7 @@ class BasicMixin:
self
.
supervisord_configuration_path
,
self
.
usage_report_periodicity
,
self
.
supervisord_configuration_path
,
self
.
usage_report_periodicity
,
self
.
buildout
,
develop
=
develop
)
self
.
buildout
,
develop
=
develop
)
def
tearDown
(
self
):
def
tearDown
(
self
):
# XXX: Hardcoded pid, as it is not configurable in slapos
# XXX: Hardcoded pid, as it is not configurable in slapos
svc
=
os
.
path
.
join
(
self
.
instance_root
,
'var'
,
'run'
,
'supervisord.pid'
)
svc
=
os
.
path
.
join
(
self
.
instance_root
,
'var'
,
'run'
,
'supervisord.pid'
)
...
@@ -177,8 +178,6 @@ def _server_response (self_test,_requested_state,timestamp=None):
...
@@ -177,8 +178,6 @@ def _server_response (self_test,_requested_state,timestamp=None):
return
server_response
return
server_response
class
TestSlapgridCPWithMaster
(
MasterMixin
,
unittest
.
TestCase
):
class
TestSlapgridCPWithMaster
(
MasterMixin
,
unittest
.
TestCase
):
def
test_nothing_to_do
(
self
):
def
test_nothing_to_do
(
self
):
...
@@ -203,7 +202,6 @@ class TestSlapgridCPWithMaster(MasterMixin, unittest.TestCase):
...
@@ -203,7 +202,6 @@ class TestSlapgridCPWithMaster(MasterMixin, unittest.TestCase):
self
.
assertSortedListEqual
(
os
.
listdir
(
self
.
software_root
),
[])
self
.
assertSortedListEqual
(
os
.
listdir
(
self
.
software_root
),
[])
def
test_one_partition
(
self
):
def
test_one_partition
(
self
):
self
.
sequence
=
[]
self
.
sequence
=
[]
httplib
.
HTTPConnection
.
_callback
=
_server_response
(
self
,
httplib
.
HTTPConnection
.
_callback
=
_server_response
(
self
,
_requested_state
=
'stopped'
)
_requested_state
=
'stopped'
)
...
@@ -235,11 +233,9 @@ touch worked""")
...
@@ -235,11 +233,9 @@ touch worked""")
'stoppedComputerPartition'
])
'stoppedComputerPartition'
])
def
test_one_partition_started
(
self
):
def
test_one_partition_started
(
self
):
self
.
sequence
=
[]
self
.
sequence
=
[]
self
.
started
=
False
self
.
started
=
False
httplib
.
HTTPConnection
.
_callback
=
_server_response
(
self
,
'started'
)
httplib
.
HTTPConnection
.
_callback
=
_server_response
(
self
,
'started'
)
os
.
mkdir
(
self
.
software_root
)
os
.
mkdir
(
self
.
software_root
)
os
.
mkdir
(
self
.
instance_root
)
os
.
mkdir
(
self
.
instance_root
)
partition_path
=
os
.
path
.
join
(
self
.
instance_root
,
'0'
)
partition_path
=
os
.
path
.
join
(
self
.
instance_root
,
'0'
)
...
@@ -281,7 +277,6 @@ chmod 755 etc/run/wrapper
...
@@ -281,7 +277,6 @@ chmod 755 etc/run/wrapper
def
test_one_partition_started_stopped
(
self
):
def
test_one_partition_started_stopped
(
self
):
self
.
started
=
True
self
.
started
=
True
self
.
sequence
=
[]
self
.
sequence
=
[]
httplib
.
HTTPConnection
.
_callback
=
_server_response
(
self
,
'started'
)
httplib
.
HTTPConnection
.
_callback
=
_server_response
(
self
,
'started'
)
...
@@ -363,7 +358,6 @@ chmod 755 etc/run/wrapper
...
@@ -363,7 +358,6 @@ chmod 755 etc/run/wrapper
def
test_one_partition_stopped_started
(
self
):
def
test_one_partition_stopped_started
(
self
):
self
.
stopped
=
False
self
.
stopped
=
False
self
.
sequence
=
[]
self
.
sequence
=
[]
httplib
.
HTTPConnection
.
_callback
=
_server_response
(
self
,
'stopped'
)
httplib
.
HTTPConnection
.
_callback
=
_server_response
(
self
,
'stopped'
)
...
@@ -635,8 +629,6 @@ touch worked""")
...
@@ -635,8 +629,6 @@ touch worked""")
'availableComputerPartition'
,
'stoppedComputerPartition'
,])
'availableComputerPartition'
,
'stoppedComputerPartition'
,])
class
TestSlapgridArgumentTuple
(
unittest
.
TestCase
):
class
TestSlapgridArgumentTuple
(
unittest
.
TestCase
):
"""
"""
"""
"""
...
@@ -1177,10 +1169,17 @@ fi""" % {'worked_file': worked_file, 'lockfile': lockfile})
...
@@ -1177,10 +1169,17 @@ fi""" % {'worked_file': worked_file, 'lockfile': lockfile})
with
open
(
promise
,
'w'
)
as
f
:
with
open
(
promise
,
'w'
)
as
f
:
f
.
write
(
"""#!/usr/bin/env sh
f
.
write
(
"""#!/usr/bin/env sh
touch "%(worked_file)s"
touch "%(worked_file)s"
<<<<<<< HEAD
if [ ! -f %(lockfile)s ]
then
touch "%(lockfile)s"
else
=======
if [ ! -f %(lockfile)s ]
if [ ! -f %(lockfile)s ]
then
then
touch "%(lockfile)s"
touch "%(lockfile)s"
else
else
>>>>>>> master
sleep 5
sleep 5
fi
fi
exit 0"""
%
{
'worked_file'
:
worked_file
,
'lockfile'
:
lockfile
})
exit 0"""
%
{
'worked_file'
:
worked_file
,
'lockfile'
:
lockfile
})
...
...
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