Commit 1995f3c0 authored by Łukasz Nowak's avatar Łukasz Nowak

Speedup preparation.

Jump directly into proper inital state of the tree.
parent 3f957fbd
...@@ -71,9 +71,7 @@ ...@@ -71,9 +71,7 @@
<item> <item>
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple/>
<string>specialise/hosting_subscription_module/template_hosting_subscription</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -25,10 +25,9 @@ class TestSlapOSCoreSoftwareInstanceRequest(testSlapOSMixin): ...@@ -25,10 +25,9 @@ class TestSlapOSCoreSoftwareInstanceRequest(testSlapOSMixin):
self.setupPortalCertificateAuthority() self.setupPortalCertificateAuthority()
safe_xml = '<?xml version="1.0" encoding="utf-8"?><instance></instance>' safe_xml = '<?xml version="1.0" encoding="utf-8"?><instance></instance>'
title = self.generateNewSoftwareTitle()
self.request_kw = dict( self.request_kw = dict(
software_release=self.generateNewSoftwareReleaseUrl(), software_release=self.generateNewSoftwareReleaseUrl(),
software_title=title, software_title=self.generateNewSoftwareTitle(),
software_type=self.generateNewSoftwareType(), software_type=self.generateNewSoftwareType(),
instance_xml=safe_xml, instance_xml=safe_xml,
sla_xml=safe_xml, sla_xml=safe_xml,
...@@ -39,18 +38,36 @@ class TestSlapOSCoreSoftwareInstanceRequest(testSlapOSMixin): ...@@ -39,18 +38,36 @@ class TestSlapOSCoreSoftwareInstanceRequest(testSlapOSMixin):
# prepare part of tree # prepare part of tree
hosting_subscription = portal.hosting_subscription_module\ hosting_subscription = portal.hosting_subscription_module\
.template_hosting_subscription.Base_createCloneDocument(batch_mode=1) .template_hosting_subscription.Base_createCloneDocument(batch_mode=1)
self.software_instance = portal.software_instance_module\
.template_software_instance.Base_createCloneDocument(batch_mode=1)
hosting_subscription.edit( hosting_subscription.edit(
title=title, title=self.request_kw['software_title'],
reference="TESTHS-%s" % new_id reference="TESTHS-%s" % new_id,
root_software_release_url=self.request_kw['software_release'],
source_reference=self.request_kw['software_type'],
text_content=self.request_kw['instance_xml'],
sla_xml=self.request_kw['sla_xml'],
root_slave=self.request_kw['shared'],
predecessor=self.software_instance.getRelativeUrl()
) )
hosting_subscription.updateLocalRolesOnSecurityGroups() hosting_subscription.updateLocalRolesOnSecurityGroups()
hosting_subscription.validate() hosting_subscription.validate()
hosting_subscription.requestStart(**self.request_kw) self.portal.portal_workflow._jumpToStateFor(hosting_subscription, 'start_requested')
hosting_subscription.requestInstance(**self.request_kw)
self.software_instance.edit(
self.software_instance = hosting_subscription.getPredecessorValue( title=self.request_kw['software_title'],
portal_type='Software Instance') reference="TESTSI-%s" % new_id,
root_software_release_url=self.request_kw['software_release'],
source_reference=self.request_kw['software_type'],
text_content=self.request_kw['instance_xml'],
sla_xml=self.request_kw['sla_xml'],
specialise=hosting_subscription.getRelativeUrl()
)
self.portal.portal_workflow._jumpToStateFor(self.software_instance, 'start_requested')
self.software_instance.validate()
self.software_instance.updateLocalRolesOnSecurityGroups()
self.tic() self.tic()
# Login as new Software Instance # Login as new Software Instance
......
69 70
\ No newline at end of file \ No newline at end of file
...@@ -3,4 +3,5 @@ computer_module/template_computer ...@@ -3,4 +3,5 @@ computer_module/template_computer
computer_module/template_computer/** computer_module/template_computer/**
hosting_subscription_module/template_hosting_subscription hosting_subscription_module/template_hosting_subscription
person_module/template_member person_module/template_member
person_module/template_member/** person_module/template_member/**
\ No newline at end of file software_instance_module/template_software_instance
\ No newline at end of file
84 85
\ No newline at end of file \ No newline at end of file
software_instance_module/template_software_instance
\ No newline at end of file
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