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

Check that it is possible to request with another software release.

parent 504266f8
...@@ -1512,23 +1512,7 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -1512,23 +1512,7 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
portal_type="Slave Instance").getUid() portal_type="Slave Instance").getUid()
sequence.edit(software_instance_uid=slave_instance_uid) sequence.edit(software_instance_uid=slave_instance_uid)
def stepRequestComputerPartitionWithAnotherSoftwareType(self, sequence, **kw): def stepCheckRequestComputerPartitionWithAnotherSoftwareRelease(
self.slap = slap.slap()
self.slap.initializeConnection(self.server_url, timeout=None)
slap_computer_partition = self.slap.registerComputerPartition(
sequence['computer_reference'],
sequence['computer_partition_reference'])
kw = dict(software_release=sequence['software_release_uri'],
software_type="SecondSoftwareType",
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 stepCheckRequestComputerPartitionWithAnotherSoftwareType(
self, sequence, **kw): self, sequence, **kw):
self.slap = slap.slap() self.slap = slap.slap()
self.slap.initializeConnection(self.server_url, timeout=None) self.slap.initializeConnection(self.server_url, timeout=None)
...@@ -1536,7 +1520,7 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -1536,7 +1520,7 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
sequence['computer_reference'], sequence['computer_reference'],
sequence['computer_partition_reference']) sequence['computer_partition_reference'])
kw = dict(software_release=sequence['software_release_uri'], kw = dict(software_release=sequence['software_release_uri'],
software_type="SecondSoftwareType", software_type=sequence.get('requested_software_type', 'software_type'),
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', {}),
...@@ -1547,8 +1531,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -1547,8 +1531,8 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
self.assertEquals(sequence.get('requested_computer_partition_reference'), self.assertEquals(sequence.get('requested_computer_partition_reference'),
requested_slap_computer_partition.getId()) requested_slap_computer_partition.getId())
self.assertEquals("SecondSoftwareType", self.assertEquals(sequence['software_release_uri'],
requested_slap_computer_partition.getInstanceParameterDict()['slap_software_type']) requested_slap_computer_partition.getSoftwareRelease().getURI())
self.assertEquals(1, self.assertEquals(1,
requested_slap_computer_partition._need_modification) requested_slap_computer_partition._need_modification)
...@@ -1591,6 +1575,54 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin): ...@@ -1591,6 +1575,54 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
def test_ComputerPartition_request_changeSoftwareRelease(self):
"""
Check that requesting the same instance with a different software release
does not create a new instance
"""
self.computer_partition_amount = 3
sequence_list = SequenceList()
sequence_string = self.prepare_install_requested_computer_partition_sequence_string + '\
SelectRequestedReference \
SelectEmptyRequestedParameterDict \
\
SlapLoginCurrentSoftwareInstance \
RequestComputerPartition \
Tic \
LoginDefaultUser \
CallConfirmOrderedSaleOrderAlarm \
Tic \
Logout \
RequestComputerPartition \
Tic ' + self.prepare_published_software_release + '\
LoginTestVifibAdmin \
RequestSoftwareInstallation \
Tic \
Logout \
\
SlapLoginCurrentComputer \
ComputerSoftwareReleaseAvailable \
Tic \
SlapLogout \
\
RequestComputerPartition \
Tic \
RequestComputerPartition \
Tic \
LoginDefaultUser \
CallConfirmOrderedSaleOrderAlarm \
Tic \
Logout \
CheckRequestComputerPartitionWithAnotherSoftwareRelease \
Tic \
SlapLogout \
LoginERP5TypeTestCase \
CheckSiteConsistency \
Logout \
'
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestVifibSlapComputerPartitionRequest)) suite.addTest(unittest.makeSuite(TestVifibSlapComputerPartitionRequest))
......
...@@ -225,6 +225,39 @@ class TestVifibSlapOpenOrderRequest(TestVifibSlapWebServiceMixin): ...@@ -225,6 +225,39 @@ class TestVifibSlapOpenOrderRequest(TestVifibSlapWebServiceMixin):
self.assertEquals(1, self.assertEquals(1,
requested_slap_computer_partition._need_modification) requested_slap_computer_partition._need_modification)
def stepPersonRequestSlapSoftwareInstanceWithAnotherSoftwareRelease(
self, sequence, **kw):
software_release = sequence['another_software_release_uri']
self.slap = slap.slap()
self.slap.initializeConnection(self.server_url, timeout=None)
open_order = self.slap.registerOpenOrder()
open_order.request(
software_release=software_release,
software_type=sequence.get('requested_software_type', 'software_type'),
partition_reference=sequence['requested_reference'],
partition_parameter_kw=sequence.get('requested_parameter_dict', {}),
filter_kw=sequence.get('requested_filter_dict', {}))
def stepCheckPersonRequestSlapSoftwareInstanceWithAnotherSoftwareRelease(
self, sequence, **kw):
software_release = sequence['another_software_release_uri']
self.slap = slap.slap()
self.slap.initializeConnection(self.server_url, timeout=None)
open_order = self.slap.registerOpenOrder()
requested_slap_computer_partition = open_order.request(
software_release=software_release,
software_type=sequence.get('requested_software_type', 'software_type'),
partition_reference=sequence['requested_reference'],
partition_parameter_kw=sequence.get('requested_parameter_dict', {}),
filter_kw=sequence.get('requested_filter_dict', {}))
self.assertEquals(sequence.get('requested_computer_partition_reference'),
requested_slap_computer_partition.getId())
self.assertEquals(software_release,
requested_slap_computer_partition.getSoftwareRelease().getURI())
self.assertEquals(1,
requested_slap_computer_partition._need_modification)
def test_OpenOrder_request_changeSoftwareType(self): def test_OpenOrder_request_changeSoftwareType(self):
""" """
Check that requesting the same instance with a different software type Check that requesting the same instance with a different software type
...@@ -272,6 +305,69 @@ class TestVifibSlapOpenOrderRequest(TestVifibSlapWebServiceMixin): ...@@ -272,6 +305,69 @@ class TestVifibSlapOpenOrderRequest(TestVifibSlapWebServiceMixin):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
def stepStoreAnotherSoftwareRelease(self, sequence, **kw):
sequence['another_software_release_uri'] = sequence['software_release_uri']
def test_OpenOrder_request_changeSoftwareRelease(self):
"""
Check that requesting the same instance with a different software release
does not create a new instance
"""
self.computer_partition_amount = 1
sequence_list = SequenceList()
sequence_string = self.prepare_published_software_release + \
self.prepare_formated_computer + """
LoginTestVifibAdmin
RequestSoftwareInstallation
Tic
Logout
SlapLoginCurrentComputer
ComputerSoftwareReleaseAvailable
Tic
SlapLogout
StoreAnotherSoftwareRelease
""" + self.prepare_published_software_release + \
"""
LoginTestVifibAdmin
RequestSoftwareInstallation
Tic
Logout
SlapLoginCurrentComputer
ComputerSoftwareReleaseAvailable
Tic
SlapLogout
SetRandomRequestedReference
SlapLoginTestVifibCustomer
SetFirstSoftwareType
PersonRequestSlapSoftwareInstancePrepare
Tic
SlapLogout
LoginDefaultUser
CallConfirmOrderedSaleOrderAlarm
Tic
Logout
SlapLoginTestVifibCustomer
PersonRequestSlapSoftwareInstance
Tic
PersonRequestSlapSoftwareInstanceWithAnotherSoftwareRelease
Tic
CheckPersonRequestSlapSoftwareInstanceWithAnotherSoftwareRelease
Tic
SlapLogout
LoginERP5TypeTestCase
CheckSiteConsistency
Logout
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestVifibSlapOpenOrderRequest)) suite.addTest(unittest.makeSuite(TestVifibSlapOpenOrderRequest))
......
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