Commit 3d16d129 authored by Thomas Gambier's avatar Thomas Gambier

wip

parent 167ddca3
...@@ -181,6 +181,9 @@ class BasicMixin(object): ...@@ -181,6 +181,9 @@ class BasicMixin(object):
'supervisord') 'supervisord')
self.usage_report_periodicity = 1 self.usage_report_periodicity = 1
self.buildout = None self.buildout = None
self.certificate_repository_path = os.path.join(self._tempdir, 'partition_pki');
if not os.path.isdir(self.certificate_repository_path):
os.mkdir(self.certificate_repository_path)
self.grid = slapgrid.Slapgrid(self.software_root, self.grid = slapgrid.Slapgrid(self.software_root,
self.instance_root, self.instance_root,
self.master_url, self.master_url,
...@@ -189,7 +192,8 @@ class BasicMixin(object): ...@@ -189,7 +192,8 @@ class BasicMixin(object):
develop=develop, develop=develop,
logger=logging.getLogger(), logger=logging.getLogger(),
shared_part_list=self.shared_parts_root, shared_part_list=self.shared_parts_root,
force_stop=force_stop) force_stop=force_stop,
certificate_repository_path=self.certificate_repository_path)
self.grid._manager_list = self.manager_list self.grid._manager_list = self.manager_list
# monkey patch buildout bootstrap # monkey patch buildout bootstrap
...@@ -430,6 +434,11 @@ class ComputerForTest(object): ...@@ -430,6 +434,11 @@ class ComputerForTest(object):
'status_code': 200, 'status_code': 200,
'content': dumps(ip_address_list) 'content': dumps(ip_address_list)
} }
elif url.path == '/getComputerPartitionCertificate':
return {
'status_code': 200,
'content': dumps({'certificate': '', 'key': ''})
}
if req.method == 'POST' and 'computer_partition_id' in qs: if req.method == 'POST' and 'computer_partition_id' in qs:
instance = self.instance_list[int(qs['computer_partition_id'][0])] instance = self.instance_list[int(qs['computer_partition_id'][0])]
instance.sequence.append(url.path) instance.sequence.append(url.path)
...@@ -1442,9 +1451,12 @@ class TestSlapgridCPPartitionProcessing(MasterMixin, unittest.TestCase): ...@@ -1442,9 +1451,12 @@ class TestSlapgridCPPartitionProcessing(MasterMixin, unittest.TestCase):
self.assertEqual(computer.sequence, self.assertEqual(computer.sequence,
['/getHateoasUrl', ['/getHateoasUrl',
'/getFullComputerInformation', '/getFullComputerInformation',
'/getComputerPartitionCertificate',
'/stoppedComputerPartition',
'/getHateoasUrl',
'/getFullComputerInformation',
'/getComputerPartitionCertificate',
'/stoppedComputerPartition', '/stoppedComputerPartition',
'/getHateoasUrl', '/getFullComputerInformation',
'/stoppedComputerPartition',
'/getHateoasUrl', '/getHateoasUrl',
'/getFullComputerInformation']) '/getFullComputerInformation'])
...@@ -1467,9 +1479,12 @@ class TestSlapgridCPPartitionProcessing(MasterMixin, unittest.TestCase): ...@@ -1467,9 +1479,12 @@ class TestSlapgridCPPartitionProcessing(MasterMixin, unittest.TestCase):
self.assertEqual(computer.sequence, self.assertEqual(computer.sequence,
['/getHateoasUrl', ['/getHateoasUrl',
'/getFullComputerInformation', '/getFullComputerInformation',
'/getComputerPartitionCertificate',
'/stoppedComputerPartition', '/stoppedComputerPartition',
'/getHateoasUrl', '/getFullComputerInformation', '/getHateoasUrl',
'/stoppedComputerPartition']) '/getFullComputerInformation',
'/getComputerPartitionCertificate',
'/stoppedComputerPartition'])
def test_partition_periodicity_remove_timestamp(self): def test_partition_periodicity_remove_timestamp(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