Commit 978e06ef authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: project needed in test

parent d3a2ab6c
...@@ -23,7 +23,8 @@ from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin ...@@ -23,7 +23,8 @@ from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin
class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
def test_ComputeNode_setSubjectList(self): def test_ComputeNode_setSubjectList(self):
self.person_user = self.makePerson() project = self.addProject()
self.person_user = self.makePerson(project)
self.login(self.person_user.getUserId()) self.login(self.person_user.getUserId())
new_id = self.generateNewId() new_id = self.generateNewId()
...@@ -40,7 +41,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): ...@@ -40,7 +41,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
self.person_user.getRelativeUrl() self.person_user.getRelativeUrl()
def check_Instance_validate(self, portal_type): def check_Instance_validate(self, portal_type):
self.person_user = self.makePerson() project = self.addProject()
self.person_user = self.makePerson(project)
self.login(self.person_user.getUserId()) self.login(self.person_user.getUserId())
# Instance Tree required for security. # Instance Tree required for security.
...@@ -49,14 +51,17 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): ...@@ -49,14 +51,17 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
title="HS %s for %s" % (self.new_id, self.person_user.getReference()), title="HS %s for %s" % (self.new_id, self.person_user.getReference()),
reference="TESTHS-%s" % self.new_id, reference="TESTHS-%s" % self.new_id,
destination_reference="TESTHS-%s" % self.new_id, destination_reference="TESTHS-%s" % self.new_id,
destination_section=self.person_user.getRelativeUrl() destination_section=self.person_user.getRelativeUrl(),
follow_up_value=project
) )
instance = self.portal.software_instance_module.newContent( instance = self.portal.software_instance_module.newContent(
portal_type=portal_type, portal_type=portal_type,
title="Instance %s for %s" % (self.new_id, self.person_user.getReference()), title="Instance %s for %s" % (self.new_id, self.person_user.getReference()),
reference="TESTINST-%s" % self.new_id, reference="TESTINST-%s" % self.new_id,
specialise_value=hs) specialise_value=hs,
follow_up_value=project
)
if portal_type == "Software Instance": if portal_type == "Software Instance":
self._addERP5Login(instance) self._addERP5Login(instance)
...@@ -89,7 +94,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): ...@@ -89,7 +94,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
return self.check_Instance_validate("Slave Instance") return self.check_Instance_validate("Slave Instance")
def test_SlaveInstance_requestDestroy(self): def test_SlaveInstance_requestDestroy(self):
self.person_user = self.makePerson() project = self.addProject()
self.person_user = self.makePerson(project)
self.login(self.person_user.getUserId()) self.login(self.person_user.getUserId())
# Instance Tree required for security. # Instance Tree required for security.
...@@ -98,7 +104,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): ...@@ -98,7 +104,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
title="HS %s for %s" % (self.new_id, self.person_user.getReference()), title="HS %s for %s" % (self.new_id, self.person_user.getReference()),
reference="TESTHS-%s" % self.new_id, reference="TESTHS-%s" % self.new_id,
destination_reference="TESTHS-%s" % self.new_id, destination_reference="TESTHS-%s" % self.new_id,
destination_section=self.person_user.getRelativeUrl() destination_section=self.person_user.getRelativeUrl(),
follow_up_value=project
) )
instance = self.portal.software_instance_module.newContent( instance = self.portal.software_instance_module.newContent(
...@@ -107,7 +114,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): ...@@ -107,7 +114,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
reference="TESTINST-%s" % self.new_id, reference="TESTINST-%s" % self.new_id,
destination_reference="TESTINST-%s" % self.new_id, destination_reference="TESTINST-%s" % self.new_id,
destination_section=self.person_user.getRelativeUrl(), destination_section=self.person_user.getRelativeUrl(),
specialise_value=hs specialise_value=hs,
follow_up_value=project
) )
request_kw = dict( request_kw = dict(
software_release='http://example.org', software_release='http://example.org',
...@@ -124,7 +132,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): ...@@ -124,7 +132,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
self.assertEqual(instance.getValidationState(), 'invalidated') self.assertEqual(instance.getValidationState(), 'invalidated')
def check_SoftwareInstallation_changeState(self, method_id): def check_SoftwareInstallation_changeState(self, method_id):
self.person_user = self.makePerson() project = self.addProject()
self.person_user = self.makePerson(project)
self.login(self.person_user.getUserId()) self.login(self.person_user.getUserId())
compute_node = self.portal.compute_node_module.newContent( compute_node = self.portal.compute_node_module.newContent(
portal_type='Compute Node', portal_type='Compute Node',
...@@ -165,7 +174,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): ...@@ -165,7 +174,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
return self.check_SoftwareInstallation_changeState('requestDestroy') return self.check_SoftwareInstallation_changeState('requestDestroy')
def check_SoftwareInstance_changeState(self, method_id): def check_SoftwareInstance_changeState(self, method_id):
self.person_user = self.makePerson() project = self.addProject()
self.person_user = self.makePerson(project)
self.login(self.person_user.getUserId()) self.login(self.person_user.getUserId())
new_id = self.generateNewId() new_id = self.generateNewId()
...@@ -230,7 +240,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): ...@@ -230,7 +240,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
return self.check_SoftwareInstance_changeState("requestDestroy") return self.check_SoftwareInstance_changeState("requestDestroy")
def check_change_instance_parameter(self, portal_type, method_id): def check_change_instance_parameter(self, portal_type, method_id):
self.person_user = self.makePerson() project = self.addProject()
self.person_user = self.makePerson(project)
self.login(self.person_user.getUserId()) self.login(self.person_user.getUserId())
instance = self.portal.software_instance_module.newContent( instance = self.portal.software_instance_module.newContent(
...@@ -240,6 +251,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): ...@@ -240,6 +251,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
destination_reference="TESTINST-%s" % self.new_id, destination_reference="TESTINST-%s" % self.new_id,
ssl_certificate="foo", ssl_certificate="foo",
ssl_key="bar", ssl_key="bar",
follow_up_value=project
) )
self.tic() self.tic()
...@@ -286,7 +298,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): ...@@ -286,7 +298,8 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
def test_SoftwareInstance_setSuccessorList(self): def test_SoftwareInstance_setSuccessorList(self):
portal_type = "Software Instance" portal_type = "Software Instance"
self.person_user = self.makePerson() project = self.addProject()
self.person_user = self.makePerson(project)
self.login(self.person_user.getUserId()) self.login(self.person_user.getUserId())
new_id = self.generateNewId() new_id = self.generateNewId()
...@@ -297,6 +310,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): ...@@ -297,6 +310,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
destination_reference="TESTINST-%s" % new_id, destination_reference="TESTINST-%s" % new_id,
ssl_certificate="foo", ssl_certificate="foo",
ssl_key="bar", ssl_key="bar",
follow_up_value=project
) )
new_id = self.generateNewId() new_id = self.generateNewId()
...@@ -308,6 +322,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): ...@@ -308,6 +322,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
ssl_certificate="foo", ssl_certificate="foo",
ssl_key="bar", ssl_key="bar",
successor_value=instance3, successor_value=instance3,
follow_up_value=project
) )
new_id = self.generateNewId() new_id = self.generateNewId()
...@@ -319,6 +334,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): ...@@ -319,6 +334,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
ssl_certificate="foo", ssl_certificate="foo",
ssl_key="bar", ssl_key="bar",
successor_value=instance2, successor_value=instance2,
follow_up_value=project
) )
self.tic() self.tic()
......
...@@ -6,12 +6,6 @@ ...@@ -6,12 +6,6 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>testSlapOSCloudInteractionWorkflow</string> </value> <value> <string>testSlapOSCloudInteractionWorkflow</string> </value>
...@@ -61,28 +55,13 @@ ...@@ -61,28 +55,13 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -95,7 +74,7 @@ ...@@ -95,7 +74,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -104,7 +83,7 @@ ...@@ -104,7 +83,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
......
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