Commit 7d778383 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_*: Bootstrap caucase server/connector

  Only launch caucase when needed.  Not all tests need
  caucase, this saves a bit the overhead to run it
parent e82e27ba
...@@ -13,6 +13,7 @@ def convertCategoryList(base, l): ...@@ -13,6 +13,7 @@ def convertCategoryList(base, l):
class TestSlapOSBuilderMixin(SlapOSTestCaseMixin): class TestSlapOSBuilderMixin(SlapOSTestCaseMixin):
launch_caucase = 1
def checkSimulationMovement(self, simulation_movement): def checkSimulationMovement(self, simulation_movement):
self.assertEqual(1.0, simulation_movement.getDeliveryRatio()) self.assertEqual(1.0, simulation_movement.getDeliveryRatio())
...@@ -1798,4 +1799,4 @@ class TestSlapOSAggregatedDeliveryBuilder(SlapOSTestCaseMixin): ...@@ -1798,4 +1799,4 @@ class TestSlapOSAggregatedDeliveryBuilder(SlapOSTestCaseMixin):
self.assertEqual(0.0, built_delivery_line.getPrice()) self.assertEqual(0.0, built_delivery_line.getPrice())
self.assertEqual(delivery_line_2.getResource(), self.assertEqual(delivery_line_2.getResource(),
built_delivery_line.getResource()) built_delivery_line.getResource())
""" """
\ No newline at end of file
...@@ -28,6 +28,8 @@ def getSimulationStatePlannedDelivered(self, *args, **kwargs): ...@@ -28,6 +28,8 @@ def getSimulationStatePlannedDelivered(self, *args, **kwargs):
return 'planned' return 'planned'
class TestDefaultInvoiceTransactionRule(SlapOSTestCaseMixin): class TestDefaultInvoiceTransactionRule(SlapOSTestCaseMixin):
launch_caucase = 1
@withAbort @withAbort
def test_simulation(self): def test_simulation(self):
SimulationMovement.original_getSimulationState = SimulationMovement\ SimulationMovement.original_getSimulationState = SimulationMovement\
...@@ -169,6 +171,8 @@ class TestDefaultInvoiceTransactionRule(SlapOSTestCaseMixin): ...@@ -169,6 +171,8 @@ class TestDefaultInvoiceTransactionRule(SlapOSTestCaseMixin):
class TestDefaultInvoiceRule(SlapOSTestCaseMixin): class TestDefaultInvoiceRule(SlapOSTestCaseMixin):
launch_caucase = 1
@withAbort @withAbort
def test_simulation(self): def test_simulation(self):
SimulationMovement.original_getSimulationState = SimulationMovement\ SimulationMovement.original_getSimulationState = SimulationMovement\
...@@ -249,6 +253,8 @@ class TestDefaultInvoiceRule(SlapOSTestCaseMixin): ...@@ -249,6 +253,8 @@ class TestDefaultInvoiceRule(SlapOSTestCaseMixin):
class TestDefaultInvoicingRule(SlapOSTestCaseMixin): class TestDefaultInvoicingRule(SlapOSTestCaseMixin):
launch_caucase = 1
@withAbort @withAbort
def test_simulation(self): def test_simulation(self):
SimulationMovement.original_getSimulationState = SimulationMovement\ SimulationMovement.original_getSimulationState = SimulationMovement\
...@@ -381,6 +387,8 @@ class TestDefaultInvoicingRule(SlapOSTestCaseMixin): ...@@ -381,6 +387,8 @@ class TestDefaultInvoicingRule(SlapOSTestCaseMixin):
.original_getSimulationState .original_getSimulationState
class TestDefaultPaymentRule(SlapOSTestCaseMixin): class TestDefaultPaymentRule(SlapOSTestCaseMixin):
launch_caucase = 1
@withAbort @withAbort
def test_simulation(self): def test_simulation(self):
SimulationMovement.original_getSimulationState = SimulationMovement\ SimulationMovement.original_getSimulationState = SimulationMovement\
...@@ -856,6 +864,7 @@ class TestDefaultTradeModelRule(SlapOSTestCaseMixin): ...@@ -856,6 +864,7 @@ class TestDefaultTradeModelRule(SlapOSTestCaseMixin):
.original_getSimulationState .original_getSimulationState
class TestDefaultDeliveryRule(SlapOSTestCaseMixin): class TestDefaultDeliveryRule(SlapOSTestCaseMixin):
launch_caucase = 1
def test(self): def test(self):
resource, _, _, _, _, aggregate = self.bootstrapAllocableInstanceTree(is_accountable=True) resource, _, _, _, _, aggregate = self.bootstrapAllocableInstanceTree(is_accountable=True)
...@@ -949,6 +958,8 @@ class TestDefaultDeliveryRule(SlapOSTestCaseMixin): ...@@ -949,6 +958,8 @@ class TestDefaultDeliveryRule(SlapOSTestCaseMixin):
for q in simulation_movement.contentValues(portal_type='Applied Rule')]) for q in simulation_movement.contentValues(portal_type='Applied Rule')])
class TestDefaultDeliveryRuleConsumption(SlapOSTestCaseMixin): class TestDefaultDeliveryRuleConsumption(SlapOSTestCaseMixin):
launch_caucase = 1
def test(self): def test(self):
resource, _, _, _, _, aggregate = self.bootstrapAllocableInstanceTree(is_accountable=True) resource, _, _, _, _, aggregate = self.bootstrapAllocableInstanceTree(is_accountable=True)
project = aggregate.getFollowUpValue() project = aggregate.getFollowUpValue()
......
...@@ -257,6 +257,8 @@ class TestSlapOSComputerConsumptionTioXMLFile_parseXml(SlapOSTestCaseMixinWithAb ...@@ -257,6 +257,8 @@ class TestSlapOSComputerConsumptionTioXMLFile_parseXml(SlapOSTestCaseMixinWithAb
class TestSlapOSComputerConsumptionTioXMLFile_solveInvoicingGeneration( class TestSlapOSComputerConsumptionTioXMLFile_solveInvoicingGeneration(
SlapOSTestCaseMixin): SlapOSTestCaseMixin):
launch_caucase = 1
def createTioXMLFile(self): def createTioXMLFile(self):
document = self.portal.consumption_document_module.newContent( document = self.portal.consumption_document_module.newContent(
title=self.generateNewId(), title=self.generateNewId(),
......
...@@ -30,6 +30,8 @@ from AccessControl.SecurityManagement import getSecurityManager, \ ...@@ -30,6 +30,8 @@ from AccessControl.SecurityManagement import getSecurityManager, \
class DefaultScenarioMixin(TestSlapOSSecurityMixin): class DefaultScenarioMixin(TestSlapOSSecurityMixin):
launch_caucase = 1
def afterSetUp(self): def afterSetUp(self):
TestSlapOSSecurityMixin.afterSetUp(self) TestSlapOSSecurityMixin.afterSetUp(self)
preference = self.portal.portal_preferences.slapos_default_system_preference preference = self.portal.portal_preferences.slapos_default_system_preference
......
...@@ -44,6 +44,8 @@ def hashData(data): ...@@ -44,6 +44,8 @@ def hashData(data):
class TestSlapOSCloudSlapOSCacheMixin( class TestSlapOSCloudSlapOSCacheMixin(
SlapOSTestCaseMixin): SlapOSTestCaseMixin):
launch_caucase = 1
def afterSetUp(self): def afterSetUp(self):
SlapOSTestCaseMixin.afterSetUp(self) SlapOSTestCaseMixin.afterSetUp(self)
self.pinDateTime(DateTime()) self.pinDateTime(DateTime())
...@@ -375,6 +377,8 @@ class TestSlapOSCloudSlapOSCacheMixin( ...@@ -375,6 +377,8 @@ class TestSlapOSCloudSlapOSCacheMixin(
class TestSlapOSCloudSoftwareInstance( class TestSlapOSCloudSoftwareInstance(
SlapOSTestCaseMixin): SlapOSTestCaseMixin):
launch_caucase = 1
def afterSetUp(self): def afterSetUp(self):
SlapOSTestCaseMixin.afterSetUp(self) SlapOSTestCaseMixin.afterSetUp(self)
self.project = self.addProject() self.project = self.addProject()
...@@ -496,6 +500,7 @@ class TestSlapOSCloudSoftwareInstance( ...@@ -496,6 +500,7 @@ class TestSlapOSCloudSoftwareInstance(
class TestSlapOSCloudSlapOSComputeNodeMixin_getCacheComputeNodeInformation( class TestSlapOSCloudSlapOSComputeNodeMixin_getCacheComputeNodeInformation(
SlapOSTestCaseMixin): SlapOSTestCaseMixin):
launch_caucase = 1
def afterSetUp(self): def afterSetUp(self):
SlapOSTestCaseMixin.afterSetUp(self) SlapOSTestCaseMixin.afterSetUp(self)
...@@ -705,4 +710,3 @@ class TestSlapOSCloudSlapOSComputeNodeMixin_getCacheComputeNodeInformation( ...@@ -705,4 +710,3 @@ class TestSlapOSCloudSlapOSComputeNodeMixin_getCacheComputeNodeInformation(
self.assertEqual(fourth_body_fingerprint, hashData(body)) self.assertEqual(fourth_body_fingerprint, hashData(body))
self.assertEqual(0, len(self.portal.portal_activities.getMessageList())) self.assertEqual(0, len(self.portal.portal_activities.getMessageList()))
...@@ -7,6 +7,7 @@ from erp5.component.module.DateUtils import addToDate ...@@ -7,6 +7,7 @@ from erp5.component.module.DateUtils import addToDate
class TestSlapOSCoreSlapOSAssertInstanceTreeSuccessorAlarm(SlapOSTestCaseMixin): class TestSlapOSCoreSlapOSAssertInstanceTreeSuccessorAlarm(SlapOSTestCaseMixin):
launch_caucase = 1
################################################################# #################################################################
# slapos_assert_instance_tree_successor # slapos_assert_instance_tree_successor
################################################################# #################################################################
...@@ -115,6 +116,7 @@ class TestSlapOSCoreSlapOSAssertInstanceTreeSuccessorAlarm(SlapOSTestCaseMixin): ...@@ -115,6 +116,7 @@ class TestSlapOSCoreSlapOSAssertInstanceTreeSuccessorAlarm(SlapOSTestCaseMixin):
class TestSlapOSFreeComputePartitionAlarm(SlapOSTestCaseMixin): class TestSlapOSFreeComputePartitionAlarm(SlapOSTestCaseMixin):
launch_caucase = 1
################################################################# #################################################################
# slapos_free_compute_partition # slapos_free_compute_partition
################################################################# #################################################################
...@@ -335,6 +337,7 @@ class TestSlapOSFreeComputePartitionAlarm(SlapOSTestCaseMixin): ...@@ -335,6 +337,7 @@ class TestSlapOSFreeComputePartitionAlarm(SlapOSTestCaseMixin):
class TestSlapOSGarbageCollectDestroyedRootTreeAlarm(SlapOSTestCaseMixin): class TestSlapOSGarbageCollectDestroyedRootTreeAlarm(SlapOSTestCaseMixin):
launch_caucase = 1
################################################################# #################################################################
# slapos_garbage_collect_destroyed_root_tree # slapos_garbage_collect_destroyed_root_tree
################################################################# #################################################################
...@@ -452,6 +455,7 @@ class TestSlapOSGarbageCollectDestroyedRootTreeAlarm(SlapOSTestCaseMixin): ...@@ -452,6 +455,7 @@ class TestSlapOSGarbageCollectDestroyedRootTreeAlarm(SlapOSTestCaseMixin):
class TestSlapOSUpdateComputeNodeCapacityScopeAlarm(SlapOSTestCaseMixin): class TestSlapOSUpdateComputeNodeCapacityScopeAlarm(SlapOSTestCaseMixin):
launch_caucase = 1
################################################################# #################################################################
# slapos_update_compute_node_capacity_scope # slapos_update_compute_node_capacity_scope
################################################################# #################################################################
...@@ -628,6 +632,7 @@ class TestSlapOSUpdateComputeNodeCapacityScopeAlarm(SlapOSTestCaseMixin): ...@@ -628,6 +632,7 @@ class TestSlapOSUpdateComputeNodeCapacityScopeAlarm(SlapOSTestCaseMixin):
class TestSlapOSGarbageCollectStoppedRootTreeAlarm(SlapOSTestCaseMixin): class TestSlapOSGarbageCollectStoppedRootTreeAlarm(SlapOSTestCaseMixin):
launch_caucase = 1
################################################################# #################################################################
# slapos_stop_collect_instance # slapos_stop_collect_instance
################################################################# #################################################################
...@@ -694,6 +699,7 @@ class TestSlapOSGarbageCollectStoppedRootTreeAlarm(SlapOSTestCaseMixin): ...@@ -694,6 +699,7 @@ class TestSlapOSGarbageCollectStoppedRootTreeAlarm(SlapOSTestCaseMixin):
class TestSlapOSGarbageCollectNonAllocatedRootTreeAlarm(SlapOSTestCaseMixin): class TestSlapOSGarbageCollectNonAllocatedRootTreeAlarm(SlapOSTestCaseMixin):
launch_caucase = 1
################################################################# #################################################################
# slapos_garbage_collect_non_allocated_root_tree # slapos_garbage_collect_non_allocated_root_tree
################################################################# #################################################################
...@@ -908,6 +914,7 @@ class TestSlapOSGarbageCollectNonAllocatedRootTreeAlarm(SlapOSTestCaseMixin): ...@@ -908,6 +914,7 @@ class TestSlapOSGarbageCollectNonAllocatedRootTreeAlarm(SlapOSTestCaseMixin):
class TestSlapOSInvalidateDestroyedInstance(SlapOSTestCaseMixin): class TestSlapOSInvalidateDestroyedInstance(SlapOSTestCaseMixin):
launch_caucase = 1
################################################################# #################################################################
# slapos_cloud_invalidate_destroyed_instance # slapos_cloud_invalidate_destroyed_instance
################################################################# #################################################################
...@@ -1085,6 +1092,8 @@ class TestSlapOSInvalidateDestroyedInstance(SlapOSTestCaseMixin): ...@@ -1085,6 +1092,8 @@ class TestSlapOSInvalidateDestroyedInstance(SlapOSTestCaseMixin):
class TestSlapOSPropagateRemoteNodeInstance(SlapOSTestCaseMixin): class TestSlapOSPropagateRemoteNodeInstance(SlapOSTestCaseMixin):
launch_caucase = 1
################################################################# #################################################################
# slapos_cloud_propagate_remote_node_instance # slapos_cloud_propagate_remote_node_instance
################################################################# #################################################################
......
...@@ -6,6 +6,8 @@ from unittest import skip ...@@ -6,6 +6,8 @@ from unittest import skip
class TestSlapOSAllocation(SlapOSTestCaseMixin): class TestSlapOSAllocation(SlapOSTestCaseMixin):
launch_caucase = 1
def makeAllocableComputeNode(self, project, software_product, def makeAllocableComputeNode(self, project, software_product,
release_variation, type_variation): release_variation, type_variation):
with TemporaryAlarmScript(self.portal, 'SoftwareInstance_tryToAllocatePartition'): with TemporaryAlarmScript(self.portal, 'SoftwareInstance_tryToAllocatePartition'):
......
...@@ -22,10 +22,13 @@ from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin ...@@ -22,10 +22,13 @@ from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin
from erp5.component.document.SoftwareInstance import SoftwareInstance, \ from erp5.component.document.SoftwareInstance import SoftwareInstance, \
DisconnectedSoftwareTree, CyclicSoftwareTree DisconnectedSoftwareTree, CyclicSoftwareTree
import transaction import transaction
from cryptography import x509
from cryptography.x509.oid import NameOID
class TestSlapOSCoreInstanceSlapInterfaceWorkflow(SlapOSTestCaseMixin): class TestSlapOSCoreInstanceSlapInterfaceWorkflow(SlapOSTestCaseMixin):
"""Tests instance.requestInstance""" """Tests instance.requestInstance"""
launch_caucase = 1
def afterSetUp(self): def afterSetUp(self):
SlapOSTestCaseMixin.afterSetUp(self) SlapOSTestCaseMixin.afterSetUp(self)
...@@ -1050,6 +1053,7 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(SlapOSTestCaseMixin): ...@@ -1050,6 +1053,7 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(SlapOSTestCaseMixin):
class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin): class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin):
"""Tests instance.requestTransfer""" """Tests instance.requestTransfer"""
launch_caucase = 1
def afterSetUp(self): def afterSetUp(self):
SlapOSTestCaseMixin.afterSetUp(self) SlapOSTestCaseMixin.afterSetUp(self)
...@@ -1142,7 +1146,6 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin): ...@@ -1142,7 +1146,6 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin):
self.software_instance.generateCertificate() self.software_instance.generateCertificate()
self.assertNotEqual(self.software_instance.getSslKey(), None) self.assertNotEqual(self.software_instance.getSslKey(), None)
self.assertNotEqual(self.software_instance.getSslCertificate(), None) self.assertNotEqual(self.software_instance.getSslCertificate(), None)
self.assertEqual(self.software_instance.getDestinationReference(), None)
certificate_login_list = self.software_instance.objectValues(portal_type="Certificate Login") certificate_login_list = self.software_instance.objectValues(portal_type="Certificate Login")
self.assertEqual(len(certificate_login_list), 1) self.assertEqual(len(certificate_login_list), 1)
...@@ -1150,11 +1153,11 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin): ...@@ -1150,11 +1153,11 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin):
self.assertEqual(certificate_login.getValidationState(), 'validated') self.assertEqual(certificate_login.getValidationState(), 'validated')
self.assertNotEqual(certificate_login.getReference(), None) self.assertNotEqual(certificate_login.getReference(), None)
self.assertNotEqual(certificate_login.getDestinationReference(), None) self.assertNotEqual(certificate_login.getCsrId(), None)
serial = '0x%x' % int(certificate_login.getDestinationReference(), 16) ssl_certificate = x509.load_pem_x509_certificate(self.software_instance.getSslCertificate())
self.assertIn(serial, self.software_instance.getSslCertificate()) self.assertEqual(len(ssl_certificate.subject), 2)
self.assertIn(certificate_login.getReference(), \ cn = [i.value for i in ssl_certificate.subject if i.oid == NameOID.COMMON_NAME][0]
self.software_instance.getSslCertificate().decode('string_escape')) self.assertEqual(certificate_login.getReference().decode("UTF-8"), cn)
self.assertRaises(ValueError, self.software_instance.generateCertificate) self.assertRaises(ValueError, self.software_instance.generateCertificate)
def test_revokeCertificate(self): def test_revokeCertificate(self):
...@@ -1183,7 +1186,7 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin): ...@@ -1183,7 +1186,7 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin):
certificate_login = certificate_login_list[0] certificate_login = certificate_login_list[0]
self.assertEqual(certificate_login.getValidationState(), 'validated') self.assertEqual(certificate_login.getValidationState(), 'validated')
self.assertNotEqual(certificate_login.getReference(), None) self.assertNotEqual(certificate_login.getReference(), None)
self.assertNotEqual(certificate_login.getDestinationReference(), None) self.assertNotEqual(certificate_login.getCsrId(), None)
self.assertNotEqual(self.software_instance.getSslKey(), self.assertNotEqual(self.software_instance.getSslKey(),
ssl_key) ssl_key)
...@@ -1210,12 +1213,11 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin): ...@@ -1210,12 +1213,11 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin):
self.assertEqual(another_certificate_login.getValidationState(), 'validated') self.assertEqual(another_certificate_login.getValidationState(), 'validated')
self.assertNotEqual(another_certificate_login.getReference(), None) self.assertNotEqual(another_certificate_login.getReference(), None)
self.assertNotEqual(another_certificate_login.getDestinationReference(), None) self.assertNotEqual(another_certificate_login.getCsrId(), None)
self.assertEqual(certificate_login.getValidationState(), 'invalidated') self.assertEqual(certificate_login.getValidationState(), 'invalidated')
self.assertNotEqual(certificate_login.getReference(), self.assertNotEqual(certificate_login.getReference(),
another_certificate_login.getReference()) another_certificate_login.getReference())
self.assertNotEqual(certificate_login.getDestinationReference(), self.assertNotEqual(certificate_login.getCsrId(),
another_certificate_login.getDestinationReference()) another_certificate_login.getCsrId())
...@@ -25,6 +25,7 @@ from AccessControl.SecurityManagement import getSecurityManager, \ ...@@ -25,6 +25,7 @@ from AccessControl.SecurityManagement import getSecurityManager, \
class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin): class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
launch_caucase = 1
def afterSetUp(self): def afterSetUp(self):
SlapOSTestCaseMixin.afterSetUp(self) SlapOSTestCaseMixin.afterSetUp(self)
......
...@@ -1031,6 +1031,7 @@ class TestSlapOSCrmStopInstanceTree(SlapOSTestCaseMixinWithAbort): ...@@ -1031,6 +1031,7 @@ class TestSlapOSCrmStopInstanceTree(SlapOSTestCaseMixinWithAbort):
class TestSlapOSCrmDeleteInstanceTree(SlapOSTestCaseMixinWithAbort): class TestSlapOSCrmDeleteInstanceTree(SlapOSTestCaseMixinWithAbort):
launch_caucase = 1
def createRegularisationRequest(self): def createRegularisationRequest(self):
new_id = self.generateNewId() new_id = self.generateNewId()
...@@ -1252,6 +1253,7 @@ class TestSlapOSCrmDeleteInstanceTree(SlapOSTestCaseMixinWithAbort): ...@@ -1252,6 +1253,7 @@ class TestSlapOSCrmDeleteInstanceTree(SlapOSTestCaseMixinWithAbort):
class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort): class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort):
launch_caucase = 1
################################################################# #################################################################
# slapos_crm_check_compute_node_state # slapos_crm_check_compute_node_state
...@@ -1528,6 +1530,8 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort) ...@@ -1528,6 +1530,8 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCaseMixinWithAbort): class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCaseMixinWithAbort):
launch_caucase = 1
################################################################# #################################################################
# slapos_crm_check_software_installation_state # slapos_crm_check_software_installation_state
################################################################# #################################################################
...@@ -1770,6 +1774,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase ...@@ -1770,6 +1774,7 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
class TestSlapOSCrmMonitoringCheckInstanceInError(SlapOSTestCaseMixinWithAbort): class TestSlapOSCrmMonitoringCheckInstanceInError(SlapOSTestCaseMixinWithAbort):
launch_caucase = 1
def _makeInstanceTree(self): def _makeInstanceTree(self):
person = self.portal.person_module\ person = self.portal.person_module\
......
...@@ -108,9 +108,12 @@ class TestCRMSkinsMixin(SlapOSTestCaseMixinWithAbort): ...@@ -108,9 +108,12 @@ class TestCRMSkinsMixin(SlapOSTestCaseMixinWithAbort):
return software_installation return software_installation
class TestSlapOSSupportRequestModule_getMonitoringUrlList(TestCRMSkinsMixin): class TestSlapOSSupportRequestModule_getMonitoringUrlList(TestCRMSkinsMixin):
launch_caucase = 1
def test_SupportRequestModule_getMonitoringUrlList(self): def test_SupportRequestModule_getMonitoringUrlList(self):
module = self.portal.support_request_module module = self.portal.support_request_module
# Tic to ensure caucase is indexed
self.tic()
# We assume here that several objects created by others tests don't influentiate # We assume here that several objects created by others tests don't influentiate
# this test. # this test.
self.assertEqual(module.SupportRequestModule_getMonitoringUrlList(), []) self.assertEqual(module.SupportRequestModule_getMonitoringUrlList(), [])
......
...@@ -543,6 +543,7 @@ class TestPerson_newLogin(TestSlapOSHalJsonStyleMixin): ...@@ -543,6 +543,7 @@ class TestPerson_newLogin(TestSlapOSHalJsonStyleMixin):
self.assertIn(person.getRelativeUrl(), result) self.assertIn(person.getRelativeUrl(), result)
class TestPerson_get_Certificate(TestSlapOSHalJsonStyleMixin): class TestPerson_get_Certificate(TestSlapOSHalJsonStyleMixin):
launch_caucase = 1
def test_Person_getCertificate_unauthorized(self): def test_Person_getCertificate_unauthorized(self):
person = self._makePerson(user=1) person = self._makePerson(user=1)
self.assertEqual(1 , len(person.objectValues(portal_type="ERP5 Login"))) self.assertEqual(1 , len(person.objectValues(portal_type="ERP5 Login")))
...@@ -562,7 +563,7 @@ class TestPerson_get_Certificate(TestSlapOSHalJsonStyleMixin): ...@@ -562,7 +563,7 @@ class TestPerson_get_Certificate(TestSlapOSHalJsonStyleMixin):
self.assertSameSet(response_dict.keys(), ["common_name", "certificate", "id", "key"]) self.assertSameSet(response_dict.keys(), ["common_name", "certificate", "id", "key"])
self.assertEqual(response_dict["id"], login.getDestinationReference()) self.assertEqual(response_dict["id"], login.getCsrId())
self.assertEqual(json.dumps(response_dict["common_name"]), json.dumps(login.getReference())) self.assertEqual(json.dumps(response_dict["common_name"]), json.dumps(login.getReference()))
self.assertEqual(self.portal.REQUEST.RESPONSE.getStatus(), 200) self.assertEqual(self.portal.REQUEST.RESPONSE.getStatus(), 200)
...@@ -576,11 +577,11 @@ class TestPerson_get_Certificate(TestSlapOSHalJsonStyleMixin): ...@@ -576,11 +577,11 @@ class TestPerson_get_Certificate(TestSlapOSHalJsonStyleMixin):
self.assertEqual("validated" , login.getValidationState()) self.assertEqual("validated" , login.getValidationState())
self.assertEqual("validated" , new_login.getValidationState()) self.assertEqual("validated" , new_login.getValidationState())
self.assertNotEqual(login.getReference(), new_login.getReference()) self.assertNotEqual(login.getReference(), new_login.getReference())
self.assertNotEqual(login.getDestinationReference(), new_login.getDestinationReference()) self.assertNotEqual(login.getCsrId(), new_login.getCsrId())
self.assertSameSet(new_response_dict.keys(), ["common_name", "certificate", "id", "key"]) self.assertSameSet(new_response_dict.keys(), ["common_name", "certificate", "id", "key"])
self.assertEqual(json.dumps(new_response_dict["common_name"]), json.dumps(new_login.getReference())) self.assertEqual(json.dumps(new_response_dict["common_name"]), json.dumps(new_login.getReference()))
self.assertEqual(new_response_dict["id"], new_login.getDestinationReference()) self.assertEqual(new_response_dict["id"], new_login.getCsrId())
self.assertNotEqual(new_response_dict["common_name"], response_dict["common_name"]) self.assertNotEqual(new_response_dict["common_name"], response_dict["common_name"])
self.assertNotEqual(new_response_dict["id"], response_dict["id"]) self.assertNotEqual(new_response_dict["id"], response_dict["id"])
...@@ -645,6 +646,7 @@ class TestERP5Site_invalidate(TestSlapOSHalJsonStyleMixin): ...@@ -645,6 +646,7 @@ class TestERP5Site_invalidate(TestSlapOSHalJsonStyleMixin):
class TestComputeNode_get_revoke_Certificate(TestSlapOSHalJsonStyleMixin): class TestComputeNode_get_revoke_Certificate(TestSlapOSHalJsonStyleMixin):
launch_caucase = 1
def test_ComputeNode_getCertificate(self): def test_ComputeNode_getCertificate(self):
compute_node = self._makeComputeNode() compute_node = self._makeComputeNode()
self.assertEqual(0, len(compute_node.objectValues(portal_type=["ERP5 Login", "Certificate Login"]))) self.assertEqual(0, len(compute_node.objectValues(portal_type=["ERP5 Login", "Certificate Login"])))
...@@ -1517,6 +1519,8 @@ return []""") ...@@ -1517,6 +1519,8 @@ return []""")
class TestSoftwareInstance_getAllocationInformation(TestSlapOSHalJsonStyleMixin): class TestSoftwareInstance_getAllocationInformation(TestSlapOSHalJsonStyleMixin):
launch_caucase = 1
def test_SoftwareInstance_getAllocationInformation_not_allocated(self): def test_SoftwareInstance_getAllocationInformation_not_allocated(self):
self._makeTree() self._makeTree()
self.changeSkin('RJS') self.changeSkin('RJS')
......
...@@ -32,6 +32,7 @@ from Products.ERP5Type.tests.ERP5TypeFunctionalTestCase import ERP5TypeFunctiona ...@@ -32,6 +32,7 @@ from Products.ERP5Type.tests.ERP5TypeFunctionalTestCase import ERP5TypeFunctiona
class TestSlapOSUIHalStyle(SlapOSTestCaseMixin, ERP5TypeFunctionalTestCase): class TestSlapOSUIHalStyle(SlapOSTestCaseMixin, ERP5TypeFunctionalTestCase):
foreground = 0 foreground = 0
run_only = "slaposjs_zuite" run_only = "slaposjs_zuite"
launch_caucase = 1
def afterSetUp(self): def afterSetUp(self):
ERP5TypeFunctionalTestCase.afterSetUp(self) ERP5TypeFunctionalTestCase.afterSetUp(self)
......
...@@ -32,6 +32,7 @@ from Products.ERP5Type.tests.ERP5TypeFunctionalTestCase import ERP5TypeFunctiona ...@@ -32,6 +32,7 @@ from Products.ERP5Type.tests.ERP5TypeFunctionalTestCase import ERP5TypeFunctiona
class TestSlapOSUIZHHalStyle(SlapOSTestCaseMixin, ERP5TypeFunctionalTestCase): class TestSlapOSUIZHHalStyle(SlapOSTestCaseMixin, ERP5TypeFunctionalTestCase):
foreground = 0 foreground = 0
run_only = "slaposjs_zuite" run_only = "slaposjs_zuite"
launch_caucase = 1
def afterSetUp(self): def afterSetUp(self):
ERP5TypeFunctionalTestCase.afterSetUp(self) ERP5TypeFunctionalTestCase.afterSetUp(self)
......
...@@ -32,6 +32,7 @@ from Products.ERP5Type.tests.ERP5TypeFunctionalTestCase import ERP5TypeFunctiona ...@@ -32,6 +32,7 @@ from Products.ERP5Type.tests.ERP5TypeFunctionalTestCase import ERP5TypeFunctiona
class TestSlapOSPanelStyle(SlapOSTestCaseMixin, ERP5TypeFunctionalTestCase): class TestSlapOSPanelStyle(SlapOSTestCaseMixin, ERP5TypeFunctionalTestCase):
foreground = 0 foreground = 0
run_only = "slapos_panel_zuite" run_only = "slapos_panel_zuite"
launch_caucase = 1
def afterSetUp(self): def afterSetUp(self):
ERP5TypeFunctionalTestCase.afterSetUp(self) ERP5TypeFunctionalTestCase.afterSetUp(self)
......
...@@ -23,6 +23,8 @@ from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin ...@@ -23,6 +23,8 @@ from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin
class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin): class TestSlapOSPDMCreateUpgradeDecisionSkins(SlapOSTestCaseMixin):
launch_caucase = 1
def test_createUpgradeDecision_destroyed_instance(self): def test_createUpgradeDecision_destroyed_instance(self):
instance_tree = self.portal.instance_tree_module.newContent( instance_tree = self.portal.instance_tree_module.newContent(
portal_type="Instance Tree" portal_type="Instance Tree"
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin
class TestSlapOSDestroySoftwareInstallation(SlapOSTestCaseMixin): class TestSlapOSDestroySoftwareInstallation(SlapOSTestCaseMixin):
launch_caucase = 1
def bootstrapSoftwareInstallation(self, is_allocated=True, is_supplied=True): def bootstrapSoftwareInstallation(self, is_allocated=True, is_supplied=True):
if is_allocated: if is_allocated:
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin
class TestSlapOSPDMSkins(SlapOSTestCaseMixin): class TestSlapOSPDMSkins(SlapOSTestCaseMixin):
launch_caucase = 1
def test_requestUpgrade(self): def test_requestUpgrade(self):
software_product, _, type_variation, compute_node, _, instance_tree = self.bootstrapAllocableInstanceTree() software_product, _, type_variation, compute_node, _, instance_tree = self.bootstrapAllocableInstanceTree()
......
...@@ -49,6 +49,7 @@ def canonical_xml(xml): ...@@ -49,6 +49,7 @@ def canonical_xml(xml):
class TestSlapOSSlapToolMixin(SlapOSTestCaseMixin): class TestSlapOSSlapToolMixin(SlapOSTestCaseMixin):
launch_caucase = 1
def afterSetUp(self): def afterSetUp(self):
SlapOSTestCaseMixin.afterSetUp(self) SlapOSTestCaseMixin.afterSetUp(self)
self.portal_slap = self.portal.portal_slap self.portal_slap = self.portal.portal_slap
......
...@@ -30,6 +30,7 @@ import random ...@@ -30,6 +30,7 @@ import random
import transaction import transaction
import unittest import unittest
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.ERP5TypeCaucaseTestCase import ERP5TypeCaucaseTestCase
from Products.ERP5Type.Utils import convertToUpperCase from Products.ERP5Type.Utils import convertToUpperCase
import os import os
import glob import glob
...@@ -40,9 +41,10 @@ from App.config import getConfiguration ...@@ -40,9 +41,10 @@ from App.config import getConfiguration
config = getConfiguration() config = getConfiguration()
class testSlapOSMixin(ERP5TypeTestCase): class testSlapOSMixin(ERP5TypeCaucaseTestCase):
abort_transaction = 0 abort_transaction = 0
launch_caucase = 0
def clearCache(self): def clearCache(self):
self.portal.portal_caches.clearAllCache() self.portal.portal_caches.clearAllCache()
...@@ -96,6 +98,8 @@ class testSlapOSMixin(ERP5TypeTestCase): ...@@ -96,6 +98,8 @@ class testSlapOSMixin(ERP5TypeTestCase):
self.portal.email_from_address = 'romain@nexedi.com' self.portal.email_from_address = 'romain@nexedi.com'
self.portal.email_to_address = 'romain@nexedi.com' self.portal.email_to_address = 'romain@nexedi.com'
if not self.isLiveTest() and self.launch_caucase:
self.setUpCaucase()
if getattr(self.portal.portal_caches, 'erp5_site_global_id', None): if getattr(self.portal.portal_caches, 'erp5_site_global_id', None):
# we are not on live test so multiple tests can run in parallel # we are not on live test so multiple tests can run in parallel
...@@ -103,8 +107,6 @@ class testSlapOSMixin(ERP5TypeTestCase): ...@@ -103,8 +107,6 @@ class testSlapOSMixin(ERP5TypeTestCase):
self.portal.portal_caches.erp5_site_global_id = '%s' % random.random() self.portal.portal_caches.erp5_site_global_id = '%s' % random.random()
self.portal.portal_caches._p_changed = 1 self.portal.portal_caches._p_changed = 1
if self.isLiveTest():
return
self.commit() self.commit()
self.portal.portal_caches.updateCache() self.portal.portal_caches.updateCache()
......
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