Commit 4534a1a8 authored by Titouan Soulard's avatar Titouan Soulard Committed by Romain Courteaud

slapos_jio_api_style: update calls to _makeComplexComputeNode

parent 614ceba6
......@@ -76,6 +76,8 @@ class TestSlapOSJIOAPIMixin(SlapOSTestCaseMixin):
SlapOSTestCaseMixin.afterSetUp(self)
self.portal_slap = self.portal.portal_slap
self.web_site = self.portal.web_site_module.hostingjs
self.project = self.addProject()
self._makeTree(self.project)
# Prepare compute_node
self.compute_node = self.portal.compute_node_module.template_compute_node\
......@@ -172,7 +174,7 @@ class TestSlapOSJIOAPIMixin(SlapOSTestCaseMixin):
class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJIOAPIMixin):
def test_01_getFullComputerInformationInstanceList(self):
self._makeComplexComputeNode(with_slave=True)
self._makeComplexComputeNode(self.project, with_slave=True)
self.callUpdateRevisionAndTic()
instance_1 = self.compute_node.partition1.getAggregateRelatedValue(portal_type='Software Instance')
......@@ -259,7 +261,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJIOAPIMixin):
}, instance_dict)
def test_01_bis_getFullComputerInformationSoftwareList(self):
self._makeComplexComputeNode(with_slave=True)
self._makeComplexComputeNode(self.project, with_slave=True)
self.callUpdateRevisionAndTic()
self.login(self.compute_node_user_id)
......@@ -325,7 +327,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJIOAPIMixin):
}, software_dict)
def test_02_computerBang(self):
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
self.called_banged_kw = ""
def calledBang(*args, **kw):
......@@ -356,7 +358,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJIOAPIMixin):
xXXX TODO Cedric Make sure we can create and modifiy when using weird url strings
"""
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
self.callUpdateRevisionAndTic()
self.login(self.compute_node_user_id)
......@@ -418,7 +420,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJIOAPIMixin):
self.assertTrue(software_release_uri in error_log.getTextContent())
def test_05_destroyedSoftwareRelease_noDestroyRequested(self):
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
start_time = DateTime()
software_installation = self.start_requested_software_installation
......@@ -452,7 +454,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJIOAPIMixin):
self.assertTrue(urllib.quote(software_release_uri) in error_log.getTextContent())
def test_06_destroyedSoftwareRelease_destroyRequested(self):
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
destroy_requested = self.destroy_requested_software_installation
self.assertEqual(destroy_requested.getValidationState(), "validated")
......@@ -469,7 +471,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJIOAPIMixin):
self.assertEqual(destroy_requested.getValidationState(), "invalidated")
def test_07_availableSoftwareRelease(self):
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
self.callUpdateRevisionAndTic()
software_installation = self.start_requested_software_installation
......@@ -503,7 +505,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJIOAPIMixin):
self.assertEqual(expected_dict, software_dict)
def test_08_buildingSoftwareRelease(self):
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
self.callUpdateRevisionAndTic()
software_installation = self.start_requested_software_installation
......@@ -537,7 +539,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJIOAPIMixin):
self.assertEqual(expected_dict, software_dict)
def test_09_softwareReleaseError(self):
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
self.callUpdateRevisionAndTic()
software_installation = self.start_requested_software_installation
......@@ -572,7 +574,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJIOAPIMixin):
class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
def test_10_getComputerPartitionCertificate(self):
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
self.login(self.start_requested_software_instance.getUserId())
certificate_dict = self.getToApi({
......@@ -595,7 +597,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
})
def test_11_getFullComputerInformationWithSharedInstance(self, with_slave=True):
self._makeComplexComputeNode(with_slave=with_slave)
self._makeComplexComputeNode(self.project, with_slave=with_slave)
self.callUpdateRevisionAndTic()
instance = self.start_requested_software_instance
self.login(instance.getUserId())
......@@ -674,7 +676,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
self.test_11_getFullComputerInformationWithSharedInstance(with_slave=False)
def test_12_getSharedInstance(self):
self._makeComplexComputeNode(with_slave=True)
self._makeComplexComputeNode(self.project, with_slave=True)
self.callUpdateRevisionAndTic()
instance = self.start_requested_software_instance
# Check Slaves
......@@ -745,7 +747,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
def test_13_setConnectionXml_withSlave(self):
# XXX CLN No idea how to deal with ascii
self._makeComplexComputeNode(with_slave=True)
self._makeComplexComputeNode(self.project, with_slave=True)
connection_parameters_dict = {
"p1e": "v1e",
"p2e": "v2e",
......@@ -775,7 +777,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
def test_14_setConnectionXml(self):
# XXX CLN No idea how to deal with ascii
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
connection_parameters_dict = {
"p1e": "v1e",
"p2e": "v2e",
......@@ -804,7 +806,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
self.start_requested_software_instance.__class__.updateConnection = updateConnection
def test_15_softwareInstanceError(self):
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
instance = self.start_requested_software_instance
self.login(instance.getUserId())
error_log = 'The error'
......@@ -830,7 +832,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
)
def test_16_softwareInstanceError_twice(self):
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
instance = self.start_requested_software_instance
self.login(instance.getUserId())
error_log = 'The error'
......@@ -876,7 +878,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
)
def test_17_softwareInstanceBang(self):
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
instance = self.start_requested_software_instance
self.called_instance_bang = ""
......@@ -916,7 +918,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
)
def test_18_softwareInstanceRename(self):
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
instance = self.start_requested_software_instance
new_name = 'new me'
......@@ -947,7 +949,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
instance.__class__.rename = rename
def test_19_destroyedComputePartition(self):
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
self.login(self.destroy_requested_software_instance.getUserId())
self.callInstancePutToApiAndCheck({
"reference": self.destroy_requested_software_instance.getReference(),
......@@ -960,7 +962,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
self.assertEqual(None, self.destroy_requested_software_instance.getSslCertificate())
def test_20_request_withSlave(self):
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
instance = self.start_requested_software_instance
self.called_instance_request = ""
......@@ -1006,7 +1008,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
instance.__class__.requestInstance = requestInstance
def test_21_request(self):
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
instance = self.start_requested_software_instance
self.called_instance_request = ""
......@@ -1051,7 +1053,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
instance.__class__.requestInstance = requestInstance
def test_22_request_stopped(self):
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
instance = self.stop_requested_software_instance
self.called_instance_request = ""
......@@ -1097,7 +1099,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
instance.__class__.requestInstance = requestInstance
def test_23_updateInstanceSuccessorList(self):
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
self.login(self.start_requested_software_instance.getUserId())
......@@ -1141,7 +1143,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
self.start_requested_software_instance.getSuccessorTitleList())
def test_24_updateInstanceSuccessorList_one_child(self):
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
self.login(self.start_requested_software_instance.getUserId())
......@@ -1172,7 +1174,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
self.start_requested_software_instance.getSuccessorTitleList())
def test_25_updateInstanceSuccessorList_no_child(self):
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
self.login(self.start_requested_software_instance.getUserId())
......@@ -1200,7 +1202,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
def test_26_stoppedComputePartition(self):
# XXX Should reported_state added to Instance returned json?
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
instance = self.start_requested_software_instance
self.login(instance.getUserId())
self.callInstancePutToApiAndCheck({
......@@ -1223,7 +1225,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJIOAPIMixin):
def test_27_startedComputePartition(self):
# XXX Should reported_state added to Instance returned json?
self._makeComplexComputeNode()
self._makeComplexComputeNode(self.project)
instance = self.start_requested_software_instance
self.login(instance.getUserId())
self.callInstancePutToApiAndCheck({
......@@ -1287,7 +1289,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
self.compute_node.__class__.reportComputeNodeBang = reportComputeNodeBang
def test_31_getInstanceWithSharedInstance(self, with_slave=True):
self._makeComplexComputeNode(person=self.person, with_slave=with_slave)
self._makeComplexComputeNode(self.project, person=self.person, with_slave=with_slave)
self.callUpdateRevisionAndTic()
instance = self.start_requested_software_instance
self.login(self.person_user_id)
......@@ -1336,7 +1338,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
def test_32_softwareInstanceBang(self):
self._makeComplexComputeNode(person=self.person)
self._makeComplexComputeNode(self.project, person=self.person)
self.called_instance_bang = ""
def calledBanged(*args, **kw):
self.called_instance_bang = kw
......@@ -1376,7 +1378,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
)
def test_33_softwareInstanceRename(self):
self._makeComplexComputeNode(person=self.person)
self._makeComplexComputeNode(self.project, person=self.person)
new_name = 'new me'
self.called_instance_rename = ""
......@@ -1491,7 +1493,7 @@ class TestSlapOSSlapToolPersonAccess(TestSlapOSJIOAPIMixin):
default_email_coordinate_text="%s@example.org" % self.person.getReference(),
career_role='member',
)
self._makeComplexComputeNode(person=self.person)
self._makeComplexComputeNode(self.project, person=self.person)
instance = self.start_requested_software_instance
instance.updateLocalRolesOnSecurityGroups()
self.callUpdateRevision()
......
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