Commit 96b763ff authored by Rafael Monnerat's avatar Rafael Monnerat

test: Drop boostrapSite

  Just let configuratior handle everything
parent 6e88f401
...@@ -28,11 +28,6 @@ import os ...@@ -28,11 +28,6 @@ import os
class TestSlapOSConfigurator(SlapOSTestCaseMixin): class TestSlapOSConfigurator(SlapOSTestCaseMixin):
maxDiff = None maxDiff = None
def bootstrapSite(self):
SlapOSTestCaseMixin.bootstrapSite(self)
self.getBusinessConfiguration().BusinessConfiguration_invokeSlapOSMasterPromiseAlarmList()
self.tic()
def testConfiguredModuleGeneratorIDViaConstraint(self): def testConfiguredModuleGeneratorIDViaConstraint(self):
""" Make sure Generator ID is well configured, in this """ Make sure Generator ID is well configured, in this
case we trust on promise outcome.""" case we trust on promise outcome."""
......
...@@ -160,17 +160,7 @@ class testSlapOSMixin(ERP5TypeTestCase): ...@@ -160,17 +160,7 @@ class testSlapOSMixin(ERP5TypeTestCase):
self.commit() self.commit()
self.launchConfigurator() self.launchConfigurator()
def afterSetUp(self): def updateInitSite(self):
self.login()
self.createAlarmStep()
if self.isLiveTest():
self.setUpPersistentDummyMailHost()
return
self.portal.portal_caches.erp5_site_global_id = '%s' % random.random()
self.portal.portal_caches._p_changed = 1
self.createCertificateAuthorityFile()
self.commit()
self.portal.portal_caches.updateCache() self.portal.portal_caches.updateCache()
try: try:
...@@ -182,13 +172,20 @@ class testSlapOSMixin(ERP5TypeTestCase): ...@@ -182,13 +172,20 @@ class testSlapOSMixin(ERP5TypeTestCase):
initsite["cloudooo_url"] = "https://cloudooo.erp5.net" initsite["cloudooo_url"] = "https://cloudooo.erp5.net"
config.product_config["initsite"] = initsite config.product_config["initsite"] = initsite
self.commit()
def afterSetUp(self):
self.login()
self.createAlarmStep()
if self.isLiveTest():
self.setUpPersistentDummyMailHost()
return
self.portal.portal_caches.erp5_site_global_id = '%s' % random.random()
self.portal.portal_caches._p_changed = 1
self.createCertificateAuthorityFile() self.createCertificateAuthorityFile()
if not getattr(self.portal, 'is_site_bootstrapped', 0): self.commit()
self.portal.is_site_bootstrapped = 1 self.updateInitSite()
self.bootstrapSite()
self.portal._p_changed = 1
self.commit()
def deSetUpPersistentDummyMailHost(self): def deSetUpPersistentDummyMailHost(self):
if 'MailHost' in self.portal.objectIds(): if 'MailHost' in self.portal.objectIds():
...@@ -209,8 +206,9 @@ class testSlapOSMixin(ERP5TypeTestCase): ...@@ -209,8 +206,9 @@ class testSlapOSMixin(ERP5TypeTestCase):
"slapos_master_configuration_workflow"] "slapos_master_configuration_workflow"]
def launchConfigurator(self): def launchConfigurator(self):
self.logMessage('SlapOS launchConfigurator') self.logMessage('SlapOS launchConfigurator ...\n')
self.login() self.login()
self.updateInitSite()
# Create new Configuration # Create new Configuration
business_configuration = self.getBusinessConfiguration() business_configuration = self.getBusinessConfiguration()
...@@ -226,13 +224,13 @@ class testSlapOSMixin(ERP5TypeTestCase): ...@@ -226,13 +224,13 @@ class testSlapOSMixin(ERP5TypeTestCase):
self.portal.portal_types.resetDynamicDocumentsOnceAtTransactionBoundary() self.portal.portal_types.resetDynamicDocumentsOnceAtTransactionBoundary()
self.tic(verbose=True, delay=3600) self.tic(verbose=True, delay=3600)
def bootstrapSite(self): # Set post upgrade configurations for the tests
self.logMessage('SlapOS bootstrapSite') preference_tool = self.portal.portal_preferences.portal_preferences
self.getDefaultSystemPreference().setPreferredHateoasUrl("http://dummy/") preference_tool.slapos_default_system_preference.setPreferredHateoasUrl("http://dummy/")
self.getDefaultSystemPreference().setPreferredAuthenticationPolicyEnabled(True) preference_tool.slapos_default_system_preference.setPreferredAuthenticationPolicyEnabled(True)
self.clearCache()
self.tic() self.tic()
self.clearCache()
def getExpectedBusinessTemplateInstalledAfterConfiguration(self): def getExpectedBusinessTemplateInstalledAfterConfiguration(self):
return [ 'erp5_core', return [ 'erp5_core',
......
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