Commit 53d51edc authored by Cédric de Saint Martin's avatar Cédric de Saint Martin

Merge branch 'master' into slapgrid_test

Conflicts:
	slapos/tests/slapgrid.py
parents 9bedce75 7b3cbc2c
...@@ -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 ] if [ ! -f %(lockfile)s ]
then then
touch "%(lockfile)s" touch "%(lockfile)s"
else else
=======
if [ ! -f %(lockfile)s ]
then
touch "%(lockfile)s"
else
>>>>>>> master
sleep 5 sleep 5
fi fi
exit 0""" % {'worked_file': worked_file, 'lockfile': lockfile}) exit 0""" % {'worked_file': worked_file, 'lockfile': lockfile})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment