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):
SlapLoginCurrentSoftwareInstance
RequestComputerPartition
Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout
LoginDefaultUser
......@@ -720,6 +724,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance
RequestComputerPartition
Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout
LoginDefaultUser
......@@ -742,6 +750,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance
RequestComputerPartition
Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout
LoginDefaultUser
......@@ -859,6 +871,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance
RequestComputerPartition
Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout
LoginDefaultUser
......@@ -881,6 +897,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance
RequestComputerPartition
Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout
LoginDefaultUser
......@@ -1008,6 +1028,10 @@ class TestVifibSlapBug(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance
RequestComputerPartition
Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout
LoginDefaultUser
......
......@@ -76,6 +76,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \
Tic \
CheckRaisesNotFoundComputerPartitionParameterDict \
Tic \
SlapLogout \
\
LoginDefaultUser \
......@@ -84,6 +86,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
Logout \
\
SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \
Tic \
CheckRequestedComputerPartitionCleanParameterList \
Logout \
\
......@@ -139,6 +143,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \
Tic \
CheckRaisesNotFoundComputerPartitionParameterDict \
Tic \
SlapLogout \
\
LoginDefaultUser \
......@@ -147,6 +153,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
Logout \
\
SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \
Tic \
CheckRequestedComputerPartitionCleanParameterList \
Logout \
\
......@@ -198,6 +206,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \
Tic \
CheckRaisesNotFoundComputerPartitionParameterDict \
Tic \
SlapLogout \
\
LoginDefaultUser \
......@@ -206,6 +216,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
Logout \
\
SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \
Tic \
CheckRequestedComputerPartitionCleanParameterList \
Logout \
\
......@@ -410,6 +422,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \
Tic \
CheckRaisesNotFoundComputerPartitionParameterDict \
Tic \
SlapLogout \
\
LoginDefaultUser \
......@@ -418,6 +432,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
Logout \
\
SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \
Tic \
CheckRequestedComputerPartitionRequestedParameter \
SlapLogout \
'
......@@ -437,6 +453,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \
Tic \
CheckRaisesNotFoundComputerPartitionParameterDict \
Tic \
SlapLogout \
\
LoginDefaultUser \
......@@ -445,6 +463,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
Logout \
\
SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \
Tic \
CheckRequestedComputerPartitionCleanParameterList \
SlapLogout \
\
......@@ -505,6 +525,10 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance
RequestComputerPartition
Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout
LoginDefaultUser
......@@ -531,6 +555,10 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance
RequestComputerPartition
Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout
LoginDefaultUser
......@@ -614,6 +642,10 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance
RequestComputerPartition
Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout
LoginDefaultUser
......@@ -628,6 +660,10 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SlapLoginCurrentSoftwareInstance
RequestComputerPartition
Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout
LoginDefaultUser
......@@ -800,6 +836,10 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SetRandomRequestedReference
RequestSlaveInstanceFromComputerPartition
Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestSlaveInstanceFromComputerPartition
Tic
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
......@@ -1075,6 +1115,10 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
SetFirstSoftwareType \
RequestComputerPartition \
Tic \
RequestComputerPartition \
Tic \
RequestComputerPartitionWithAnotherSoftwareType \
Tic \
RequestComputerPartitionWithAnotherSoftwareType \
Tic \
CheckRequestComputerPartitionWithAnotherSoftwareType \
......
......@@ -3,6 +3,7 @@ import unittest
from testVifibSlapWebService import TestVifibSlapWebServiceMixin
from Products.DCWorkflow.DCWorkflow import ValidationFailed
from random import random
from slapos import slap
class TestVifibSlapComputerPartitionUpdate(TestVifibSlapWebServiceMixin):
def stepRequestSoftwareInstanceUpdate(self, sequence, **kw):
......@@ -502,9 +503,25 @@ class TestVifibSlapComputerPartitionUpdate(TestVifibSlapWebServiceMixin):
sequence_list.addSequenceString(sequence_string)
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):
software_instance_uid = sequence['software_instance_uid']
software_type = sequence.get('software_type', 'requested_reference')
requested_partition_reference = sequence.get('software_type', 'requested_reference')
tag = "%s_%s_inProgress" % (software_instance_uid,
requested_partition_reference)
......@@ -518,7 +535,7 @@ class TestVifibSlapComputerPartitionUpdate(TestVifibSlapWebServiceMixin):
sequence_string = self\
.prepare_install_requested_computer_partition_sequence_string + """
SlapLoginCurrentSoftwareInstance
RequestComputerPartition
RequestComputerPartitionNoTic
SlapLogout
LoginDefaultUser
......@@ -540,7 +557,6 @@ class TestVifibSlapComputerPartitionUpdate(TestVifibSlapWebServiceMixin):
def stepCheckActivityPersonRequestInProgress(self, sequence, **kw):
person_uid = self.portal.ERP5Site_getAuthenticatedMemberPersonValue(
'test_vifib_customer').getUid()
software_type = sequence.get('software_type', 'RootSoftwareInstance')
software_title = sequence['root_software_instance_title']
tag = "%s_%s_inProgress" % (person_uid,
software_title)
......
......@@ -893,6 +893,10 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
SlapLoginCurrentSoftwareInstance
RequestComputerPartition
Tic
CheckRaisesNotFoundComputerPartitionParameterDict \
Tic \
RequestComputerPartition \
Tic \
SlapLogout
LoginDefaultUser
......@@ -904,6 +908,10 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
SlapLoginCurrentSoftwareInstance
RequestComputerPartition
Tic
CheckRaisesNotFoundComputerPartitionParameterDict
Tic
RequestComputerPartition
Tic
SlapLogout
LoginDefaultUser
......@@ -1516,6 +1524,12 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
software_type, software_type + str(2))
transaction.commit()
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())
def stepRequestComputerPartition(self, sequence, **kw):
......@@ -2925,6 +2939,11 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
[q for q in instance_parameter_dict.keys() \
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):
requested_slap_computer_partition = sequence['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