Commit e45a44a3 authored by Łukasz Nowak's avatar Łukasz Nowak

Check for state parmeter functionality.

parent 01ba9050
...@@ -203,6 +203,15 @@ class TestVifibSlapWebService(testVifibMixin): ...@@ -203,6 +203,15 @@ class TestVifibSlapWebService(testVifibMixin):
and q.getSimulationState() == state] and q.getSimulationState() == state]
self.assertEqual(1, len(delivery_line_list)) self.assertEqual(1, len(delivery_line_list))
def _checkComputerPartitionNoSalePackingList(self, resource, sequence):
computer_partition = self.portal.portal_catalog.getResultValue(
uid=sequence['computer_partition_uid'])
delivery_line_list = [q for q in computer_partition
.getAggregateRelatedValueList(
portal_type=self.sale_packing_list_line_portal_type)
if q.getResource() == resource]
self.assertEqual(0, len(delivery_line_list))
def stepCheckComputerPartitionInstanceCleanupSalePackingListDoesNotExists(self, def stepCheckComputerPartitionInstanceCleanupSalePackingListDoesNotExists(self,
sequence, **kw): sequence, **kw):
self._checkComputerPartitionSalePackingListDoesNotExists( self._checkComputerPartitionSalePackingListDoesNotExists(
...@@ -287,6 +296,12 @@ class TestVifibSlapWebService(testVifibMixin): ...@@ -287,6 +296,12 @@ class TestVifibSlapWebService(testVifibMixin):
self.portal.portal_preferences.getPreferredInstanceHostingResource(), self.portal.portal_preferences.getPreferredInstanceHostingResource(),
sequence) sequence)
def stepCheckComputerPartitionNoInstanceHostingSalePackingList(self,
sequence, **kw):
self._checkComputerPartitionNoSalePackingList(
self.portal.portal_preferences.getPreferredInstanceHostingResource(),
sequence)
def stepCheckComputerPartitionAccoutingResourceSalePackingListCancelled(self, def stepCheckComputerPartitionAccoutingResourceSalePackingListCancelled(self,
sequence, **kw): sequence, **kw):
self._checkComputerPartitionSalePackingListState('cancelled', self._checkComputerPartitionSalePackingListState('cancelled',
...@@ -1329,7 +1344,8 @@ class TestVifibSlapWebService(testVifibMixin): ...@@ -1329,7 +1344,8 @@ class TestVifibSlapWebService(testVifibMixin):
partition_reference=sequence.get('requested_reference', partition_reference=sequence.get('requested_reference',
'requested_reference'), 'requested_reference'),
partition_parameter_kw=sequence.get('requested_parameter_dict', {}), partition_parameter_kw=sequence.get('requested_parameter_dict', {}),
filter_kw=sequence.get('requested_filter_dict', {})) filter_kw=sequence.get('requested_filter_dict', {}),
state=sequence.get('instance_state'))
sequence.edit( sequence.edit(
requested_slap_computer_partition=requested_slap_computer_partition, requested_slap_computer_partition=requested_slap_computer_partition,
...@@ -1348,7 +1364,8 @@ class TestVifibSlapWebService(testVifibMixin): ...@@ -1348,7 +1364,8 @@ class TestVifibSlapWebService(testVifibMixin):
partition_reference=sequence.get('requested_reference', partition_reference=sequence.get('requested_reference',
'requested_reference'), 'requested_reference'),
partition_parameter_kw=sequence.get('requested_parameter_dict', {}), partition_parameter_kw=sequence.get('requested_parameter_dict', {}),
filter_kw=sequence.get('requested_filter_dict', {})) filter_kw=sequence.get('requested_filter_dict', {}),
state=sequence.get('instance_state'))
def stepRequestComputerPartitionNotFoundResponse(self, sequence, **kw): def stepRequestComputerPartitionNotFoundResponse(self, sequence, **kw):
self.slap = slap.slap() self.slap = slap.slap()
...@@ -1362,7 +1379,8 @@ class TestVifibSlapWebService(testVifibMixin): ...@@ -1362,7 +1379,8 @@ class TestVifibSlapWebService(testVifibMixin):
partition_reference=sequence.get('requested_reference', partition_reference=sequence.get('requested_reference',
'requested_reference'), 'requested_reference'),
partition_parameter_kw=sequence.get('requested_parameter_dict', {}), partition_parameter_kw=sequence.get('requested_parameter_dict', {}),
filter_kw=sequence.get('requested_filter_dict', {})) filter_kw=sequence.get('requested_filter_dict', {}),
state=sequence.get('instance_state'))
def stepSetSoftwareInstanceChildrenA(self, sequence, **kw): def stepSetSoftwareInstanceChildrenA(self, sequence, **kw):
software_instance_uid = sequence['root_software_instance_uid'] software_instance_uid = sequence['root_software_instance_uid']
...@@ -3636,6 +3654,73 @@ class TestVifibSlapWebService(testVifibMixin): ...@@ -3636,6 +3654,73 @@ class TestVifibSlapWebService(testVifibMixin):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
def stepSetInstanceStateStopped(self, sequence=None, **kw):
sequence['instance_state'] = 'stopped'
def test_ComputerPartition_request_instantiate_state_stopped(self):
"""
Check that after computer partition is requested it is possible to
instantiate it and it is started correctly.
"""
self.computer_partition_amount = 2
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + '\
SetInstanceStateStopped \
SlapLoginCurrentSoftwareInstance \
RequestComputerPartitionNotReadyResponse \
Tic \
SlapLogout \
\
SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \
Tic \
SlapLogout \
\
LoginDefaultUser \
CheckSoftwareInstanceAndRelatedComputerPartition \
CheckRequestedSoftwareInstanceAndRelatedComputerPartition \
Logout \
\
SlapLoginCurrentSoftwareInstance \
CheckRequestedComputerPartitionCleanParameterList \
Logout \
\
LoginDefaultUser \
SetCurrentSoftwareInstanceRequested \
SetSelectedComputerPartition \
SelectCurrentlyUsedSalePackingListUid \
Logout \
\
SlapLoginCurrentComputer \
SoftwareInstanceBuilding \
Tic \
SlapLogout \
\
LoginDefaultUser \
CheckComputerPartitionInstanceSetupSalePackingListStarted \
Logout \
\
SlapLoginCurrentComputer \
SoftwareInstanceAvailable \
Tic \
SlapLogout \
\
LoginDefaultUser \
CheckComputerPartitionInstanceSetupSalePackingListStopped \
Logout \
\
SlapLoginCurrentComputer \
SoftwareInstanceStopped \
Tic \
SlapLogout \
\
LoginDefaultUser \
stepCheckComputerPartitionNoInstanceHostingSalePackingList \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
# XXX: This test fails because test_vifib_customer security is cached # XXX: This test fails because test_vifib_customer security is cached
# and this user is not in SOFTINST-x group. We do not want to clear # and this user is not in SOFTINST-x group. We do not want to clear
# cache in tests. # cache in tests.
......
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