Commit 7be88836 authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: assignment needed to touch compute node

parent 790d8401
...@@ -25,13 +25,17 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): ...@@ -25,13 +25,17 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
def test_ComputeNode_setSubjectList(self): def test_ComputeNode_setSubjectList(self):
project = self.addProject() project = self.addProject()
self.person_user = self.makePerson(project) self.person_user = self.makePerson(project)
self.addProjectProductionManagerAssignment(self.person_user, project)
self.tic()
self.login(self.person_user.getUserId()) self.login(self.person_user.getUserId())
new_id = self.generateNewId() new_id = self.generateNewId()
compute_node = self.portal.compute_node_module.newContent( compute_node = self.portal.compute_node_module.newContent(
portal_type='Compute Node', portal_type='Compute Node',
title="Compute Node %s for %s" % (new_id, self.person_user.getReference()), title="Compute Node %s for %s" % (new_id, self.person_user.getReference()),
reference="TESTCOMP-%s" % new_id) reference="TESTCOMP-%s" % new_id,
follow_up_value=project
)
self.tic() self.tic()
assert compute_node.getDestinationSectionValue() is None assert compute_node.getDestinationSectionValue() is None
...@@ -134,17 +138,22 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): ...@@ -134,17 +138,22 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
def check_SoftwareInstallation_changeState(self, method_id): def check_SoftwareInstallation_changeState(self, method_id):
project = self.addProject() project = self.addProject()
self.person_user = self.makePerson(project) self.person_user = self.makePerson(project)
self.addProjectProductionManagerAssignment(self.person_user, project)
self.tic()
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',
title="Compute Node %s for %s" % (self.new_id, self.person_user.getReference()), title="Compute Node %s for %s" % (self.new_id, self.person_user.getReference()),
reference="TESTCOMP-%s" % self.new_id) reference="TESTCOMP-%s" % self.new_id,
follow_up_value=project
)
self._addCertificateLogin(compute_node) self._addCertificateLogin(compute_node)
installation = self.portal.software_installation_module.newContent( installation = self.portal.software_installation_module.newContent(
portal_type='Software Installation', portal_type='Software Installation',
title="Installation %s for %s" % (self.new_id, self.person_user.getReference()), title="Installation %s for %s" % (self.new_id, self.person_user.getReference()),
aggregate_value=compute_node, aggregate_value=compute_node,
follow_up_value=project
) )
self.tic() self.tic()
...@@ -176,19 +185,29 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): ...@@ -176,19 +185,29 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
def check_SoftwareInstance_changeState(self, method_id): def check_SoftwareInstance_changeState(self, method_id):
project = self.addProject() project = self.addProject()
self.person_user = self.makePerson(project) self.person_user = self.makePerson(project)
self.login(self.person_user.getUserId()) self.addProjectProductionManagerAssignment(self.person_user, project)
new_id = self.generateNewId() new_id = self.generateNewId()
compute_node = self.portal.compute_node_module.newContent( compute_node = self.portal.compute_node_module.newContent(
portal_type='Compute Node', portal_type='Compute Node',
title="Compute Node %s for %s" % (new_id, self.person_user.getReference()), title="Compute Node %s for %s" % (new_id, self.person_user.getReference()),
<<<<<<< HEAD
reference="TESTCOMP-%s" % new_id) reference="TESTCOMP-%s" % new_id)
self._addCertificateLogin(compute_node) self._addCertificateLogin(compute_node)
=======
reference="TESTCOMP-%s" % new_id,
follow_up_value=project
)
self._addERP5Login(compute_node)
>>>>>>> 1561dc0c2 (slapos_cloud: assignment needed to touch compute node)
partition = compute_node.newContent( partition = compute_node.newContent(
portal_type='Compute Partition', portal_type='Compute Partition',
title="Partition Compute Node %s for %s" % (new_id, title="Partition Compute Node %s for %s" % (new_id,
self.person_user.getReference()), self.person_user.getReference()),
reference="TESTPART-%s" % new_id) reference="TESTPART-%s" % new_id)
self.login(self.person_user.getUserId())
instance = self.portal.software_instance_module.newContent( instance = self.portal.software_instance_module.newContent(
portal_type="Software Instance", portal_type="Software Instance",
title="Instance %s for %s" % (new_id, self.person_user.getReference()), title="Instance %s for %s" % (new_id, self.person_user.getReference()),
...@@ -197,6 +216,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin): ...@@ -197,6 +216,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
) )
request_kw = dict( request_kw = dict(
......
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