Commit 76c8a5c0 authored by Romain Courteaud's avatar Romain Courteaud

Damaged XML only raise when changing instance state

parent 4f8520e5
...@@ -711,22 +711,44 @@ class TestVifibSlapComputerGetComputerPartitionList(TestVifibSlapWebServiceMixin ...@@ -711,22 +711,44 @@ class TestVifibSlapComputerGetComputerPartitionList(TestVifibSlapWebServiceMixin
software_instance.edit(connection_xml="") software_instance.edit(connection_xml="")
def stepDamageSoftwareInstanceSlaXml(self, sequence, **kw): def stepDamageSoftwareInstanceSlaXml(self, sequence, **kw):
software_instance = self.portal.portal_catalog.getResultValue( instance = self.portal.portal_catalog.getResultValue(
uid=sequence['software_instance_uid']) uid=sequence['software_instance_uid'])
software_instance.edit(sla_xml=""" if instance.getPortalType() == "Software Instance":
DAMAGED<BAD?xml XMLversion="1.0" encoding="utf-8"?>""") shared = False
elif instance.getPortalType() == "Slave Instance":
shared = True
else:
raise NotImplementedError
self.assertRaises(ValidationFailed, instance.requestStart,
software_release=instance.getRootSoftwareReleaseUrl(),
instance_xml=instance.getTextContent(),
software_type=instance.getSourceReference(),
sla_xml="""DAMAGED<BAD?xml XMLversion="1.0" encoding="utf-8"?>""",
shared=shared,
)
def stepDamageSoftwareInstanceConnectionXml(self, sequence, **kw): def stepDamageSoftwareInstanceConnectionXml(self, sequence, **kw):
software_instance = self.portal.portal_catalog.getResultValue( instance = self.portal.portal_catalog.getResultValue(
uid=sequence['software_instance_uid']) uid=sequence['software_instance_uid'])
software_instance.edit(connection_xml=""" instance.edit(connection_xml="""
DAMAGED<BAD?xml XMLversion="1.0" encoding="utf-8"?>""") DAMAGED<BAD?xml XMLversion="1.0" encoding="utf-8"?>""")
def stepDamageSoftwareInstanceXml(self, sequence, **kw): def stepDamageSoftwareInstanceXml(self, sequence, **kw):
software_instance = self.portal.portal_catalog.getResultValue( instance = self.portal.portal_catalog.getResultValue(
uid=sequence['software_instance_uid']) uid=sequence['software_instance_uid'])
self.assertRaises(ValidationFailed, software_instance.edit, if instance.getPortalType() == "Software Instance":
text_content="""DAMAGED<BAD?xml XMLversion="1.0" encoding="utf-8"?>""") shared = False
elif instance.getPortalType() == "Slave Instance":
shared = True
else:
raise NotImplementedError
self.assertRaises(ValidationFailed, instance.requestStart,
software_release=instance.getRootSoftwareReleaseUrl(),
instance_xml="""DAMAGED<BAD?xml XMLversion="1.0" encoding="utf-8"?>""",
software_type=instance.getSourceReference(),
sla_xml=instance.getSlaXml(),
shared=shared,
)
def stepCheckDamageSoftwareInstanceSiteConsistency(self, sequence, **kw): def stepCheckDamageSoftwareInstanceSiteConsistency(self, sequence, **kw):
software_instance = self.portal.portal_catalog.getResultValue( software_instance = self.portal.portal_catalog.getResultValue(
......
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