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

Check SLA in case of Person request.

parent cc6577e1
...@@ -4116,12 +4116,6 @@ class TestVifibSlapWebService(testVifibMixin): ...@@ -4116,12 +4116,6 @@ class TestVifibSlapWebService(testVifibMixin):
sequence['requested_filter_dict'] = dict( sequence['requested_filter_dict'] = dict(
computer_guid=sequence['computer_reference']) computer_guid=sequence['computer_reference'])
def test_ComputerPartition_request_filter_computer_guid(self):
"""
Check that requesting with filter computer_guid key works as expected
"""
self.computer_partition_amount = 2
sequence_list = SequenceList()
prepare_another_computer_sequence_string = """ prepare_another_computer_sequence_string = """
StoreComputerReference StoreComputerReference
LoginTestVifibAdmin LoginTestVifibAdmin
...@@ -4132,7 +4126,7 @@ class TestVifibSlapWebService(testVifibMixin): ...@@ -4132,7 +4126,7 @@ class TestVifibSlapWebService(testVifibMixin):
SlapLoginCurrentComputer SlapLoginCurrentComputer
FormatComputer FormatComputer
Tic Tic
SlapLogout""" + self.prepare_software_release_confirmed_packing_list + """ SlapLogout""" + prepare_software_release_confirmed_packing_list + """
LoginTestVifibAdmin LoginTestVifibAdmin
RequestSoftwareInstallation RequestSoftwareInstallation
...@@ -4147,12 +4141,19 @@ class TestVifibSlapWebService(testVifibMixin): ...@@ -4147,12 +4141,19 @@ class TestVifibSlapWebService(testVifibMixin):
SetRequestedFilterParameterDict SetRequestedFilterParameterDict
RestoreComputerReference RestoreComputerReference
""" """
def test_ComputerPartition_request_filter_computer_guid(self):
"""
Check that requesting with filter computer_guid key works as expected
"""
self.computer_partition_amount = 2
sequence_list = SequenceList()
# There are two partitions on another computer # There are two partitions on another computer
# so request shall be processed twice correctly, 3rd time it shall # so request shall be processed twice correctly, 3rd time it shall
# fail # fail
sequence_string = \ sequence_string = \
self.prepare_install_requested_computer_partition_sequence_string + \ self.prepare_install_requested_computer_partition_sequence_string + \
prepare_another_computer_sequence_string + '\ self.prepare_another_computer_sequence_string + '\
SlapLoginCurrentSoftwareInstance \ SlapLoginCurrentSoftwareInstance \
RequestComputerPartitionNotReadyResponse \ RequestComputerPartitionNotReadyResponse \
Tic \ Tic \
...@@ -7009,6 +7010,21 @@ class TestVifibSlapWebService(testVifibMixin): ...@@ -7009,6 +7010,21 @@ class TestVifibSlapWebService(testVifibMixin):
fails""" fails"""
raise NotImplementedError raise NotImplementedError
def stepPersonRequestSlapSoftwareInstanceNotFoundResponse(self, sequence,
**kw):
software_release = sequence['software_release_uri']
self.slap = slap.slap()
self.slap.initializeConnection(self.server_url)
open_order = self.slap.registerOpenOrder()
self.assertRaises(slap.ResourceNotFound, open_order.request,
software_release=software_release,
software_type=sequence.get('software_type', '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', {})
)
def stepPersonRequestSlapSoftwareInstanceNotReadyResponse(self, sequence, def stepPersonRequestSlapSoftwareInstanceNotReadyResponse(self, sequence,
**kw): **kw):
software_release = sequence['software_release_uri'] software_release = sequence['software_release_uri']
...@@ -7116,7 +7132,63 @@ class TestVifibSlapWebService(testVifibMixin): ...@@ -7116,7 +7132,63 @@ class TestVifibSlapWebService(testVifibMixin):
def test_person_request_ComputerPartition_filter_computer_guid(self): def test_person_request_ComputerPartition_filter_computer_guid(self):
"""Check that requesting with computer_guid in filter_kw works as """Check that requesting with computer_guid in filter_kw works as
expected in case of person request""" expected in case of person request"""
raise NotImplementedError self.computer_partition_amount = 1
sequence_list = SequenceList()
# There is only one partition on each computer, which has installed
# software release. But as request has sla parameter, the partition
# on another computer is not selected, as not following SLA.
sequence_string = self.prepare_published_software_release + \
self.prepare_formated_computer + """
LoginTestVifibAdmin
RequestSoftwareInstallation
Tic
Logout
SlapLoginCurrentComputer
ComputerSoftwareReleaseAvailable
Tic
SlapLogout
""" + \
self.prepare_another_computer_sequence_string + """
LoginTestVifibAdmin
RequestSoftwareInstallation
Tic
Logout
SetRandomRequestedReference
SlapLoginTestVifibCustomer
PersonRequestSlapSoftwareInstanceNotReadyResponse
Tic
SlapLogout
SlapLoginTestVifibCustomer
PersonRequestSlapSoftwareInstanceNotReadyResponse
Tic
SlapLogout
LoginDefaultUser
ConfirmOrderedSaleOrderActiveSense
Tic
Logout
SlapLoginTestVifibCustomer
PersonRequestSlapSoftwareInstance
Tic
SlapLogout
LoginDefaultUser
SetCurrentPersonSlapRequestedSoftwareInstance
CheckPersonRequestedSoftwareInstanceAndRelatedComputerPartition
Logout
SelectYetAnotherRequestedReference
SlapLoginTestVifibCustomer
PersonRequestSlapSoftwareInstanceNotFoundResponse
Tic
SlapLogout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
######################################## ########################################
# Bug related tests # Bug related 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