Commit 07849d75 authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: project in test

parent 450019fe
...@@ -47,8 +47,9 @@ class TestSlapOSCloudSlapOSCacheMixin( ...@@ -47,8 +47,9 @@ class TestSlapOSCloudSlapOSCacheMixin(
def afterSetUp(self): def afterSetUp(self):
SlapOSTestCaseMixin.afterSetUp(self) SlapOSTestCaseMixin.afterSetUp(self)
self.pinDateTime(DateTime()) self.pinDateTime(DateTime())
self._makeComputeNode() project = self.addProject()
self._makeComplexComputeNode(with_slave=True) self._makeComputeNode(project)
self._makeComplexComputeNode(project, with_slave=True)
self.tic() self.tic()
def beforeTearDown(self): def beforeTearDown(self):
...@@ -368,7 +369,8 @@ class TestSlapOSCloudSoftwareInstance( ...@@ -368,7 +369,8 @@ class TestSlapOSCloudSoftwareInstance(
def afterSetUp(self): def afterSetUp(self):
SlapOSTestCaseMixin.afterSetUp(self) SlapOSTestCaseMixin.afterSetUp(self)
self._makeTree() self.project = self.addProject()
self._makeTree(self.project)
def test_getXmlAsDict(self): def test_getXmlAsDict(self):
simple_parameter_sample_xml = """<?xml version='1.0' encoding='utf-8'?> simple_parameter_sample_xml = """<?xml version='1.0' encoding='utf-8'?>
...@@ -431,8 +433,8 @@ class TestSlapOSCloudSoftwareInstance( ...@@ -431,8 +433,8 @@ class TestSlapOSCloudSoftwareInstance(
self.software_instance._asParameterDict) self.software_instance._asParameterDict)
def test_asParameterDict(self): def test_asParameterDict(self):
self._makeComputeNode() self._makeComputeNode(self.project)
self._makeComplexComputeNode(with_slave=True) self._makeComplexComputeNode(self.project, with_slave=True)
as_parameter_dict = self.start_requested_software_instance._asParameterDict() as_parameter_dict = self.start_requested_software_instance._asParameterDict()
...@@ -477,8 +479,8 @@ class TestSlapOSCloudSoftwareInstance( ...@@ -477,8 +479,8 @@ class TestSlapOSCloudSoftwareInstance(
self.assertEqual(as_parameter_dict["full_ip_list"], []) self.assertEqual(as_parameter_dict["full_ip_list"], [])
def test_getInstanceTreeIpList(self): def test_getInstanceTreeIpList(self):
self._makeComputeNode() self._makeComputeNode(self.project)
self._makeComplexComputeNode(with_slave=True) self._makeComplexComputeNode(self.project, with_slave=True)
self.tic() self.tic()
self.assertEqual([(u'', u'ip_address_1')], self.assertEqual([(u'', u'ip_address_1')],
...@@ -489,18 +491,16 @@ class TestSlapOSCloudSlapOSComputeNodeMixin_getCacheComputeNodeInformation( ...@@ -489,18 +491,16 @@ class TestSlapOSCloudSlapOSComputeNodeMixin_getCacheComputeNodeInformation(
def afterSetUp(self): def afterSetUp(self):
SlapOSTestCaseMixin.afterSetUp(self) SlapOSTestCaseMixin.afterSetUp(self)
self.project = self.addProject()
# Prepare compute_node # Prepare compute_node
self.compute_node = self.portal.compute_node_module.template_compute_node\ self.compute_node = self.portal.compute_node_module.template_compute_node\
.Base_createCloneDocument(batch_mode=1) .Base_createCloneDocument(batch_mode=1)
self.compute_node.edit( self.compute_node.edit(
title="Compute Node %s" % self.new_id, title="Compute Node %s" % self.new_id,
reference="TESTCOMP-%s" % self.new_id reference="TESTCOMP-%s" % self.new_id,
follow_up_value=self.project
) )
if getattr(self, "person", None) is not None:
self.compute_node.edit(
source_administration_value=getattr(self, "person", None),
)
self.compute_node.validate() self.compute_node.validate()
self._addCertificateLogin(self.compute_node) self._addCertificateLogin(self.compute_node)
...@@ -521,7 +521,7 @@ class TestSlapOSCloudSlapOSComputeNodeMixin_getCacheComputeNodeInformation( ...@@ -521,7 +521,7 @@ class TestSlapOSCloudSlapOSComputeNodeMixin_getCacheComputeNodeInformation(
# TestSlapOSSlapToolgetFullComputerInformation.test_activate_getFullComputerInformation_first_access # TestSlapOSSlapToolgetFullComputerInformation.test_activate_getFullComputerInformation_first_access
# #
self._makeComplexComputeNode(with_slave=True) self._makeComplexComputeNode(self.project, with_slave=True)
self.portal.REQUEST['disable_isTestRun'] = True self.portal.REQUEST['disable_isTestRun'] = True
self.login(self.compute_node_user_id) self.login(self.compute_node_user_id)
......
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