Commit 81b74b86 authored by Antoine Catton's avatar Antoine Catton

Merge branch 'promises' of https://git.erp5.org/repos/slapos.core into promises

parents 8cedfd1f acba79ce
...@@ -36,6 +36,15 @@ class BasicMixin: ...@@ -36,6 +36,15 @@ class BasicMixin:
self.buildout) self.buildout)
def tearDown(self): def tearDown(self):
# XXX: Hardcoded pid, as it is not configurable in slapos
svc = os.path.join(self.instance_root, 'var', 'run', 'supervisord.pid')
if os.path.exists(svc):
try:
pid = int(open(svc).read().strip())
except ValueError:
pass
else:
os.kill(pid, signal.SIGTERM)
shutil.rmtree(self._tempdir, True) shutil.rmtree(self._tempdir, True)
class TestBasicSlapgridCP(BasicMixin, unittest.TestCase): class TestBasicSlapgridCP(BasicMixin, unittest.TestCase):
...@@ -99,15 +108,6 @@ touch worked""") ...@@ -99,15 +108,6 @@ touch worked""")
def tearDown(self): def tearDown(self):
self._unpatchHttplib() self._unpatchHttplib()
# XXX: Hardcoded pid, as it is not configurable in slapos
svc = os.path.join(self.instance_root, 'var', 'run', 'supervisord.pid')
if os.path.exists(svc):
try:
pid = int(open(svc).read().strip())
except ValueError:
pass
else:
os.kill(pid, signal.SIGTERM)
BasicMixin.tearDown(self) BasicMixin.tearDown(self)
class TestSlapgridCPWithMaster(MasterMixin, unittest.TestCase): class TestSlapgridCPWithMaster(MasterMixin, unittest.TestCase):
...@@ -329,13 +329,14 @@ chmod 755 etc/run/wrapper ...@@ -329,13 +329,14 @@ chmod 755 etc/run/wrapper
self.assertSortedListEqual(os.listdir(partition_path), ['.0_wrapper.log', self.assertSortedListEqual(os.listdir(partition_path), ['.0_wrapper.log',
'.0_wrapper.log.1', 'worked', 'buildout.cfg', 'etc']) '.0_wrapper.log.1', 'worked', 'buildout.cfg', 'etc'])
tries = 10 tries = 10
expected_text = 'Signal handler called with signal 15'
while tries > 0: while tries > 0:
tries -= 1 tries -= 1
if os.path.getsize(wrapper_log) > last_size: found = expected_text in open(wrapper_log, 'r').read()
if found:
break break
time.sleep(0.2) time.sleep(0.2)
self.assertTrue('Signal handler called with signal 15' in self.assertTrue(found)
open(wrapper_log, 'r').read())
def test_one_partition_stopped_started(self): def test_one_partition_stopped_started(self):
......
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