Commit 515bb9c3 authored by Romain Courteaud's avatar Romain Courteaud

slapos_json_rpc_api: rename tests

parent 0440484d
...@@ -163,7 +163,7 @@ class TestSlapOSJsonRpcMixin(SlapOSTestCaseMixin): ...@@ -163,7 +163,7 @@ class TestSlapOSJsonRpcMixin(SlapOSTestCaseMixin):
self._cleaupREQUEST() self._cleaupREQUEST()
class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin): class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin):
def test_01_getFullComputerInformationInstanceList(self): def test_ComputeNodeAccess_01_getFullComputerInformationInstanceList(self):
self._makeComplexComputeNode(self.project, with_slave=True) self._makeComplexComputeNode(self.project, with_slave=True)
self.callUpdateRevisionAndTic() self.callUpdateRevisionAndTic()
...@@ -251,7 +251,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin): ...@@ -251,7 +251,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin):
"portal_type": instance.getPortalType(), "portal_type": instance.getPortalType(),
}, instance_dict) }, instance_dict)
def test_01_bis_getFullComputerInformationSoftwareList(self): def test_ComputeNodeAccess_01_bis_getFullComputerInformationSoftwareList(self):
self._makeComplexComputeNode(self.project, with_slave=True) self._makeComplexComputeNode(self.project, with_slave=True)
self.callUpdateRevisionAndTic() self.callUpdateRevisionAndTic()
...@@ -317,7 +317,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin): ...@@ -317,7 +317,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin):
"status_message": status_dict.get("text"), "status_message": status_dict.get("text"),
}, software_dict) }, software_dict)
def test_02_computerBang(self): def test_ComputeNodeAccess_02_computerBang(self):
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
self.called_banged_kw = "" self.called_banged_kw = ""
...@@ -345,7 +345,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin): ...@@ -345,7 +345,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin):
finally: finally:
self.compute_node.__class__.reportComputeNodeBang = reportComputeNodeBang self.compute_node.__class__.reportComputeNodeBang = reportComputeNodeBang
def test_03_not_accessed_getSoftwareInstallationStatus(self): def test_ComputeNodeAccess_03_not_accessed_getSoftwareInstallationStatus(self):
""" """
xXXX TODO Cedric Make sure we can create and modifiy when using weird url strings xXXX TODO Cedric Make sure we can create and modifiy when using weird url strings
""" """
...@@ -381,7 +381,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin): ...@@ -381,7 +381,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin):
self.assertEqual(expected_dict, software_dict) self.assertEqual(expected_dict, software_dict)
def test_04_destroyedSoftwareRelease_noSoftwareInstallation(self): def test_ComputeNodeAccess_04_destroyedSoftwareRelease_noSoftwareInstallation(self):
self.login(self.compute_node_user_id) self.login(self.compute_node_user_id)
start_time = DateTime() start_time = DateTime()
software_release_uri = "http://example.org/foo" software_release_uri = "http://example.org/foo"
...@@ -411,7 +411,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin): ...@@ -411,7 +411,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin):
self.assertTrue(error_log.getCreationDate() >= start_time) self.assertTrue(error_log.getCreationDate() >= start_time)
self.assertTrue(software_release_uri in error_log.getTextContent()) self.assertTrue(software_release_uri in error_log.getTextContent())
def test_05_destroyedSoftwareRelease_noDestroyRequested(self): def test_ComputeNodeAccess_05_destroyedSoftwareRelease_noDestroyRequested(self):
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
start_time = DateTime() start_time = DateTime()
...@@ -445,7 +445,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin): ...@@ -445,7 +445,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin):
self.assertTrue(error_log.getCreationDate() >= start_time) self.assertTrue(error_log.getCreationDate() >= start_time)
self.assertTrue(urllib.quote(software_release_uri) in error_log.getTextContent()) self.assertTrue(urllib.quote(software_release_uri) in error_log.getTextContent())
def test_06_destroyedSoftwareRelease_destroyRequested(self): def test_ComputeNodeAccess_06_destroyedSoftwareRelease_destroyRequested(self):
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
destroy_requested = self.destroy_requested_software_installation destroy_requested = self.destroy_requested_software_installation
...@@ -462,7 +462,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin): ...@@ -462,7 +462,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin):
) )
self.assertEqual(destroy_requested.getValidationState(), "invalidated") self.assertEqual(destroy_requested.getValidationState(), "invalidated")
def test_07_availableSoftwareRelease(self): def test_ComputeNodeAccess_07_availableSoftwareRelease(self):
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
self.callUpdateRevisionAndTic() self.callUpdateRevisionAndTic()
...@@ -497,7 +497,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin): ...@@ -497,7 +497,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin):
} }
self.assertEqual(expected_dict, software_dict) self.assertEqual(expected_dict, software_dict)
def test_08_buildingSoftwareRelease(self): def test_ComputeNodeAccess_08_buildingSoftwareRelease(self):
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
self.callUpdateRevisionAndTic() self.callUpdateRevisionAndTic()
...@@ -532,7 +532,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin): ...@@ -532,7 +532,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin):
} }
self.assertEqual(expected_dict, software_dict) self.assertEqual(expected_dict, software_dict)
def test_09_softwareReleaseError(self): def test_ComputeNodeAccess_09_softwareReleaseError(self):
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
self.callUpdateRevisionAndTic() self.callUpdateRevisionAndTic()
...@@ -568,7 +568,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin): ...@@ -568,7 +568,7 @@ class TestSlapOSSlapToolComputeNodeAccess(TestSlapOSJsonRpcMixin):
self.assertEqual(expected_dict, software_dict) self.assertEqual(expected_dict, software_dict)
class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin): class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
def test_10_getComputerPartitionCertificate(self): def test_InstanceAccess_10_getComputerPartitionCertificate(self):
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
self.login(self.start_requested_software_instance.getUserId()) self.login(self.start_requested_software_instance.getUserId())
...@@ -591,7 +591,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin): ...@@ -591,7 +591,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
"reference": self.start_requested_software_instance.getReference(), "reference": self.start_requested_software_instance.getReference(),
}) })
def test_11_getFullComputerInformationWithSharedInstance(self, with_slave=True): def test_InstanceAccess_11_getFullComputerInformationWithSharedInstance(self, with_slave=True):
self._makeComplexComputeNode(self.project, with_slave=with_slave) self._makeComplexComputeNode(self.project, with_slave=with_slave)
self.callUpdateRevisionAndTic() self.callUpdateRevisionAndTic()
instance = self.start_requested_software_instance instance = self.start_requested_software_instance
...@@ -667,10 +667,10 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin): ...@@ -667,10 +667,10 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
"portal_type": instance.getPortalType(), "portal_type": instance.getPortalType(),
}, instance_dict) }, instance_dict)
def test_11_bis_getFullComputerInformationNoSharedInstance(self): def test_InstanceAccess_11_bis_getFullComputerInformationNoSharedInstance(self):
self.test_11_getFullComputerInformationWithSharedInstance(with_slave=False) self.test_11_getFullComputerInformationWithSharedInstance(with_slave=False)
def test_12_getSharedInstance(self): def test_InstanceAccess_12_getSharedInstance(self):
self._makeComplexComputeNode(self.project, with_slave=True) self._makeComplexComputeNode(self.project, with_slave=True)
self.callUpdateRevisionAndTic() self.callUpdateRevisionAndTic()
instance = self.start_requested_software_instance instance = self.start_requested_software_instance
...@@ -740,7 +740,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin): ...@@ -740,7 +740,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
"portal_type": "Slave Instance", "portal_type": "Slave Instance",
}, instance_dict) }, instance_dict)
def test_13_setConnectionXml_withSlave(self): def test_InstanceAccess_13_setConnectionXml_withSlave(self):
# XXX CLN No idea how to deal with ascii # XXX CLN No idea how to deal with ascii
self._makeComplexComputeNode(self.project, with_slave=True) self._makeComplexComputeNode(self.project, with_slave=True)
connection_parameters_dict = { connection_parameters_dict = {
...@@ -770,7 +770,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin): ...@@ -770,7 +770,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
finally: finally:
self.start_requested_slave_instance.__class__.updateConnection = updateConnection self.start_requested_slave_instance.__class__.updateConnection = updateConnection
def test_14_setConnectionXml(self): def test_InstanceAccess_14_setConnectionXml(self):
# XXX CLN No idea how to deal with ascii # XXX CLN No idea how to deal with ascii
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
connection_parameters_dict = { connection_parameters_dict = {
...@@ -800,7 +800,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin): ...@@ -800,7 +800,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
finally: finally:
self.start_requested_software_instance.__class__.updateConnection = updateConnection self.start_requested_software_instance.__class__.updateConnection = updateConnection
def test_15_softwareInstanceError(self): def test_InstanceAccess_15_softwareInstanceError(self):
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
instance = self.start_requested_software_instance instance = self.start_requested_software_instance
self.login(instance.getUserId()) self.login(instance.getUserId())
...@@ -826,7 +826,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin): ...@@ -826,7 +826,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
"#error while instanciating: %s" % error_log "#error while instanciating: %s" % error_log
) )
def test_16_softwareInstanceError_twice(self): def test_InstanceAccess_16_softwareInstanceError_twice(self):
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
instance = self.start_requested_software_instance instance = self.start_requested_software_instance
self.login(instance.getUserId()) self.login(instance.getUserId())
...@@ -873,7 +873,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin): ...@@ -873,7 +873,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
"#error while instanciating: %s" % error_log "#error while instanciating: %s" % error_log
) )
def test_17_softwareInstanceBang(self): def test_InstanceAccess_17_softwareInstanceBang(self):
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
instance = self.start_requested_software_instance instance = self.start_requested_software_instance
...@@ -913,7 +913,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin): ...@@ -913,7 +913,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
"#error bang called" "#error bang called"
) )
def test_18_softwareInstanceRename(self): def test_InstanceAccess_18_softwareInstanceRename(self):
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
instance = self.start_requested_software_instance instance = self.start_requested_software_instance
new_name = 'new me' new_name = 'new me'
...@@ -944,7 +944,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin): ...@@ -944,7 +944,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
finally: finally:
instance.__class__.rename = rename instance.__class__.rename = rename
def test_19_destroyedComputePartition(self): def test_InstanceAccess_19_destroyedComputePartition(self):
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
self.login(self.destroy_requested_software_instance.getUserId()) self.login(self.destroy_requested_software_instance.getUserId())
self.callInstancePutToApiAndCheck({ self.callInstancePutToApiAndCheck({
...@@ -957,7 +957,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin): ...@@ -957,7 +957,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
self.assertEqual(None, self.destroy_requested_software_instance.getSslKey()) self.assertEqual(None, self.destroy_requested_software_instance.getSslKey())
self.assertEqual(None, self.destroy_requested_software_instance.getSslCertificate()) self.assertEqual(None, self.destroy_requested_software_instance.getSslCertificate())
def test_20_request_withSlave(self): def test_InstanceAccess_20_request_withSlave(self):
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
instance = self.start_requested_software_instance instance = self.start_requested_software_instance
...@@ -1004,7 +1004,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin): ...@@ -1004,7 +1004,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
finally: finally:
instance.__class__.requestInstance = requestInstance instance.__class__.requestInstance = requestInstance
def test_21_request(self): def test_InstanceAccess_21_request(self):
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
instance = self.start_requested_software_instance instance = self.start_requested_software_instance
...@@ -1050,7 +1050,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin): ...@@ -1050,7 +1050,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
finally: finally:
instance.__class__.requestInstance = requestInstance instance.__class__.requestInstance = requestInstance
def test_22_request_stopped(self): def test_InstanceAccess_22_request_stopped(self):
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
instance = self.stop_requested_software_instance instance = self.stop_requested_software_instance
...@@ -1097,7 +1097,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin): ...@@ -1097,7 +1097,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
finally: finally:
instance.__class__.requestInstance = requestInstance instance.__class__.requestInstance = requestInstance
def test_23_updateInstanceSuccessorList(self): def test_InstanceAccess_23_updateInstanceSuccessorList(self):
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
self.login(self.start_requested_software_instance.getUserId()) self.login(self.start_requested_software_instance.getUserId())
...@@ -1141,7 +1141,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin): ...@@ -1141,7 +1141,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
self.assertSameSet(['Instance1'], self.assertSameSet(['Instance1'],
self.start_requested_software_instance.getSuccessorTitleList()) self.start_requested_software_instance.getSuccessorTitleList())
def test_24_updateInstanceSuccessorList_one_child(self): def test_InstanceAccess_24_updateInstanceSuccessorList_one_child(self):
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
self.login(self.start_requested_software_instance.getUserId()) self.login(self.start_requested_software_instance.getUserId())
...@@ -1172,7 +1172,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin): ...@@ -1172,7 +1172,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
self.assertEqual([], self.assertEqual([],
self.start_requested_software_instance.getSuccessorTitleList()) self.start_requested_software_instance.getSuccessorTitleList())
def test_25_updateInstanceSuccessorList_no_child(self): def test_InstanceAccess_25_updateInstanceSuccessorList_no_child(self):
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
self.login(self.start_requested_software_instance.getUserId()) self.login(self.start_requested_software_instance.getUserId())
...@@ -1199,7 +1199,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin): ...@@ -1199,7 +1199,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
self.assertEqual([], self.assertEqual([],
self.start_requested_software_instance.getSuccessorTitleList()) self.start_requested_software_instance.getSuccessorTitleList())
def test_26_stoppedComputePartition(self): def test_InstanceAccess_26_stoppedComputePartition(self):
# XXX Should reported_state added to Instance returned json? # XXX Should reported_state added to Instance returned json?
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
instance = self.start_requested_software_instance instance = self.start_requested_software_instance
...@@ -1223,7 +1223,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin): ...@@ -1223,7 +1223,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSJsonRpcMixin):
"started" "started"
) )
def test_27_startedComputePartition(self): def test_InstanceAccess_27_startedComputePartition(self):
# XXX Should reported_state added to Instance returned json? # XXX Should reported_state added to Instance returned json?
self._makeComplexComputeNode(self.project) self._makeComplexComputeNode(self.project)
instance = self.start_requested_software_instance instance = self.start_requested_software_instance
......
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