Commit 0737bcf0 authored by Łukasz Nowak's avatar Łukasz Nowak

Follow changes in slap library.

First request is not returning the whole object, so second one have to be done.

In some places redo a logic a bit in order to follow new way of slap library
usage.
parent 1bf16f86
...@@ -341,6 +341,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin): ...@@ -341,6 +341,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance SlapLoginCurrentSoftwareInstance
RequestComputerPartition RequestComputerPartition
Tic Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout SlapLogout
LoginDefaultUser LoginDefaultUser
...@@ -720,6 +724,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin): ...@@ -720,6 +724,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance SlapLoginCurrentSoftwareInstance
RequestComputerPartition RequestComputerPartition
Tic Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout SlapLogout
LoginDefaultUser LoginDefaultUser
...@@ -742,6 +750,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin): ...@@ -742,6 +750,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance SlapLoginCurrentSoftwareInstance
RequestComputerPartition RequestComputerPartition
Tic Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout SlapLogout
LoginDefaultUser LoginDefaultUser
...@@ -859,6 +871,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin): ...@@ -859,6 +871,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance SlapLoginCurrentSoftwareInstance
RequestComputerPartition RequestComputerPartition
Tic Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout SlapLogout
LoginDefaultUser LoginDefaultUser
...@@ -881,6 +897,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin): ...@@ -881,6 +897,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance SlapLoginCurrentSoftwareInstance
RequestComputerPartition RequestComputerPartition
Tic Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout SlapLogout
LoginDefaultUser LoginDefaultUser
...@@ -1008,6 +1028,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin): ...@@ -1008,6 +1028,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance SlapLoginCurrentSoftwareInstance
RequestComputerPartition RequestComputerPartition
Tic Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout SlapLogout
LoginDefaultUser LoginDefaultUser
......
...@@ -76,6 +76,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -76,6 +76,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance \ SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \ RequestComputerPartition \
Tic \ Tic \
CheckRaisesNotFoundComputerPartitionParameterDict \
Tic \
SlapLogout \ SlapLogout \
\ \
LoginDefaultUser \ LoginDefaultUser \
...@@ -84,6 +86,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -84,6 +86,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
Logout \ Logout \
\ \
SlapLoginCurrentSoftwareInstance \ SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \
Tic \
CheckRequestedComputerPartitionCleanParameterList \ CheckRequestedComputerPartitionCleanParameterList \
Logout \ Logout \
\ \
...@@ -139,6 +143,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -139,6 +143,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance \ SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \ RequestComputerPartition \
Tic \ Tic \
CheckRaisesNotFoundComputerPartitionParameterDict \
Tic \
SlapLogout \ SlapLogout \
\ \
LoginDefaultUser \ LoginDefaultUser \
...@@ -147,6 +153,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -147,6 +153,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
Logout \ Logout \
\ \
SlapLoginCurrentSoftwareInstance \ SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \
Tic \
CheckRequestedComputerPartitionCleanParameterList \ CheckRequestedComputerPartitionCleanParameterList \
Logout \ Logout \
\ \
...@@ -198,6 +206,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -198,6 +206,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance \ SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \ RequestComputerPartition \
Tic \ Tic \
CheckRaisesNotFoundComputerPartitionParameterDict \
Tic \
SlapLogout \ SlapLogout \
\ \
LoginDefaultUser \ LoginDefaultUser \
...@@ -206,6 +216,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -206,6 +216,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
Logout \ Logout \
\ \
SlapLoginCurrentSoftwareInstance \ SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \
Tic \
CheckRequestedComputerPartitionCleanParameterList \ CheckRequestedComputerPartitionCleanParameterList \
Logout \ Logout \
\ \
...@@ -410,6 +422,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -410,6 +422,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance \ SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \ RequestComputerPartition \
Tic \ Tic \
CheckRaisesNotFoundComputerPartitionParameterDict \
Tic \
SlapLogout \ SlapLogout \
\ \
LoginDefaultUser \ LoginDefaultUser \
...@@ -418,6 +432,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -418,6 +432,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
Logout \ Logout \
\ \
SlapLoginCurrentSoftwareInstance \ SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \
Tic \
CheckRequestedComputerPartitionRequestedParameter \ CheckRequestedComputerPartitionRequestedParameter \
SlapLogout \ SlapLogout \
' '
...@@ -437,6 +453,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -437,6 +453,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance \ SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \ RequestComputerPartition \
Tic \ Tic \
CheckRaisesNotFoundComputerPartitionParameterDict \
Tic \
SlapLogout \ SlapLogout \
\ \
LoginDefaultUser \ LoginDefaultUser \
...@@ -445,6 +463,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -445,6 +463,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
Logout \ Logout \
\ \
SlapLoginCurrentSoftwareInstance \ SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \
Tic \
CheckRequestedComputerPartitionCleanParameterList \ CheckRequestedComputerPartitionCleanParameterList \
SlapLogout \ SlapLogout \
\ \
...@@ -505,6 +525,10 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -505,6 +525,10 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance SlapLoginCurrentSoftwareInstance
RequestComputerPartition RequestComputerPartition
Tic Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout SlapLogout
LoginDefaultUser LoginDefaultUser
...@@ -531,6 +555,10 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -531,6 +555,10 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance SlapLoginCurrentSoftwareInstance
RequestComputerPartition RequestComputerPartition
Tic Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout SlapLogout
LoginDefaultUser LoginDefaultUser
...@@ -614,6 +642,10 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -614,6 +642,10 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance SlapLoginCurrentSoftwareInstance
RequestComputerPartition RequestComputerPartition
Tic Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout SlapLogout
LoginDefaultUser LoginDefaultUser
...@@ -628,6 +660,10 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -628,6 +660,10 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance SlapLoginCurrentSoftwareInstance
RequestComputerPartition RequestComputerPartition
Tic Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout SlapLogout
LoginDefaultUser LoginDefaultUser
...@@ -800,6 +836,10 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -800,6 +836,10 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SetRandomRequestedReference SetRandomRequestedReference
RequestSlaveInstanceFromComputerPartition RequestSlaveInstanceFromComputerPartition
Tic Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestSlaveInstanceFromComputerPartition
Tic
SlapLogout SlapLogout
LoginDefaultUser LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense ConfirmOrderedSaleOrderActiveSense
...@@ -1075,6 +1115,10 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -1075,6 +1115,10 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SetFirstSoftwareType \ SetFirstSoftwareType \
RequestComputerPartition \ RequestComputerPartition \
Tic \ Tic \
RequestComputerPartition \
Tic \
RequestComputerPartitionWithAnotherSoftwareType \
Tic \
RequestComputerPartitionWithAnotherSoftwareType \ RequestComputerPartitionWithAnotherSoftwareType \
Tic \ Tic \
CheckRequestComputerPartitionWithAnotherSoftwareType \ CheckRequestComputerPartitionWithAnotherSoftwareType \
......
...@@ -3,6 +3,7 @@ import unittest ...@@ -3,6 +3,7 @@ import unittest
from testVifibSlapWebService import TestVifibSlapWebServiceMixin from testVifibSlapWebService import TestVifibSlapWebServiceMixin
from Products.DCWorkflow.DCWorkflow import ValidationFailed from Products.DCWorkflow.DCWorkflow import ValidationFailed
from random import random from random import random
from slapos import slap
class TestVifibSlapComputerPartitionUpdate(TestVifibSlapWebServiceMixin): class TestVifibSlapComputerPartitionUpdate(TestVifibSlapWebServiceMixin):
def stepRequestSoftwareInstanceUpdate(self, sequence, **kw): def stepRequestSoftwareInstanceUpdate(self, sequence, **kw):
...@@ -502,9 +503,25 @@ class TestVifibSlapComputerPartitionUpdate(TestVifibSlapWebServiceMixin): ...@@ -502,9 +503,25 @@ class TestVifibSlapComputerPartitionUpdate(TestVifibSlapWebServiceMixin):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
def stepRequestComputerPartitionNoTic(self, sequence, **kw):
self.slap = slap.slap()
self.slap.initializeConnection(self.server_url)
slap_computer_partition = self.slap.registerComputerPartition(
sequence['computer_reference'],
sequence['computer_partition_reference'])
kw = dict(software_release=sequence['software_release_uri'],
software_type=sequence.get('requested_software_type',
'requested_software_type'),
partition_reference=sequence.get('requested_reference',
'requested_reference'),
partition_parameter_kw=sequence.get('requested_parameter_dict', {}),
filter_kw=sequence.get('requested_filter_dict', {}),
state=sequence.get('instance_state'))
slap_computer_partition.request(**kw)
def stepCheckActivityRequestInProgress(self, sequence, **kw): def stepCheckActivityRequestInProgress(self, sequence, **kw):
software_instance_uid = sequence['software_instance_uid'] software_instance_uid = sequence['software_instance_uid']
software_type = sequence.get('software_type', 'requested_reference')
requested_partition_reference = sequence.get('software_type', 'requested_reference') requested_partition_reference = sequence.get('software_type', 'requested_reference')
tag = "%s_%s_inProgress" % (software_instance_uid, tag = "%s_%s_inProgress" % (software_instance_uid,
requested_partition_reference) requested_partition_reference)
...@@ -518,7 +535,7 @@ class TestVifibSlapComputerPartitionUpdate(TestVifibSlapWebServiceMixin): ...@@ -518,7 +535,7 @@ class TestVifibSlapComputerPartitionUpdate(TestVifibSlapWebServiceMixin):
sequence_string = self\ sequence_string = self\
.prepare_install_requested_computer_partition_sequence_string + """ .prepare_install_requested_computer_partition_sequence_string + """
SlapLoginCurrentSoftwareInstance SlapLoginCurrentSoftwareInstance
RequestComputerPartition RequestComputerPartitionNoTic
SlapLogout SlapLogout
LoginDefaultUser LoginDefaultUser
...@@ -540,7 +557,6 @@ class TestVifibSlapComputerPartitionUpdate(TestVifibSlapWebServiceMixin): ...@@ -540,7 +557,6 @@ class TestVifibSlapComputerPartitionUpdate(TestVifibSlapWebServiceMixin):
def stepCheckActivityPersonRequestInProgress(self, sequence, **kw): def stepCheckActivityPersonRequestInProgress(self, sequence, **kw):
person_uid = self.portal.ERP5Site_getAuthenticatedMemberPersonValue( person_uid = self.portal.ERP5Site_getAuthenticatedMemberPersonValue(
'test_vifib_customer').getUid() 'test_vifib_customer').getUid()
software_type = sequence.get('software_type', 'RootSoftwareInstance')
software_title = sequence['root_software_instance_title'] software_title = sequence['root_software_instance_title']
tag = "%s_%s_inProgress" % (person_uid, tag = "%s_%s_inProgress" % (person_uid,
software_title) software_title)
......
...@@ -893,6 +893,10 @@ class TestVifibSlapWebServiceMixin(testVifibMixin): ...@@ -893,6 +893,10 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
SlapLoginCurrentSoftwareInstance SlapLoginCurrentSoftwareInstance
RequestComputerPartition RequestComputerPartition
Tic Tic
CheckRaisesNotFoundComputerPartitionParameterDict \
Tic \
RequestComputerPartition \
Tic \
SlapLogout SlapLogout
LoginDefaultUser LoginDefaultUser
...@@ -904,6 +908,10 @@ class TestVifibSlapWebServiceMixin(testVifibMixin): ...@@ -904,6 +908,10 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
SlapLoginCurrentSoftwareInstance SlapLoginCurrentSoftwareInstance
RequestComputerPartition RequestComputerPartition
Tic Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout SlapLogout
LoginDefaultUser LoginDefaultUser
...@@ -1516,6 +1524,12 @@ class TestVifibSlapWebServiceMixin(testVifibMixin): ...@@ -1516,6 +1524,12 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
software_type, software_type + str(2)) software_type, software_type + str(2))
transaction.commit() transaction.commit()
self.tic() self.tic()
first = slap_computer_partition.request(software_release,
software_type, software_type + str(1))
second = slap_computer_partition.request(software_release,
software_type, software_type + str(2))
transaction.commit()
self.tic()
self.assertNotEqual(first.getId(), second.getId()) self.assertNotEqual(first.getId(), second.getId())
def stepRequestComputerPartition(self, sequence, **kw): def stepRequestComputerPartition(self, sequence, **kw):
...@@ -2925,6 +2939,11 @@ class TestVifibSlapWebServiceMixin(testVifibMixin): ...@@ -2925,6 +2939,11 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
[q for q in instance_parameter_dict.keys() \ [q for q in instance_parameter_dict.keys() \
if q not in DEFAULT_INSTANCE_DICT_PARAMETER_LIST]) if q not in DEFAULT_INSTANCE_DICT_PARAMETER_LIST])
def stepCheckRaisesNotFoundComputerPartitionParameterDict(self, sequence, **kw):
requested_slap_computer_partition = sequence['requested_slap_computer_partition']
self.assertRaises(slap.NotFoundError,
requested_slap_computer_partition.getInstanceParameterDict)
def stepCheckRequestedComputerPartitionTestParameter(self, sequence, **kw): def stepCheckRequestedComputerPartitionTestParameter(self, sequence, **kw):
requested_slap_computer_partition = sequence['requested_slap_computer_partition'] requested_slap_computer_partition = sequence['requested_slap_computer_partition']
instance_parameter_dict = requested_slap_computer_partition\ instance_parameter_dict = requested_slap_computer_partition\
......
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