Commit 032ab585 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud: Update constraints to prevent set improper data on request

   Try to guarantee that data is consistent and wont fail later on
   while been converted to XML with special attention to non-XML
   compatibles characters, like backspace.

   Include constraint to ensure title is XML compatible on Software
   Instance, Instance Tree and Slave Instance. (Not required for Compute
   Node as far as I checked).

   Copy text_content (parameter), sla_xml constraints from
   Software Instance to Instance Tree and Slave Instance.

   Copy connection_xml constraint from Software to Slave Instance for
   consistency.

   Add more tests to ensure that an Instance cannot be created if data
   is invalid, or not XML compatible.

   Add utility scripts to validate XML and XML Marshaller compatibility
parent d4d2fe4b
...@@ -34,7 +34,8 @@ from zExceptions import Unauthorized ...@@ -34,7 +34,8 @@ from zExceptions import Unauthorized
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
from Acquisition import aq_base, aq_inner from Acquisition import aq_base, aq_inner
from slapos.util import dumps
from lxml import etree
def cloneDocumentWithANewPortalType(obj, portal_type): def cloneDocumentWithANewPortalType(obj, portal_type):
import erp5.portal_type import erp5.portal_type
...@@ -324,7 +325,7 @@ def Base_updateRelatedContentWithoutReindextion(self, previous_category_url, new ...@@ -324,7 +325,7 @@ def Base_updateRelatedContentWithoutReindextion(self, previous_category_url, new
previous_category_url, previous_category_url,
new_category_url) new_category_url)
membership_list.append(new_category) membership_list.append(new_category)
# I'm preserving reindexation here in case, since I'm not entire sure the # I'm preserving reindexation here in case, since I'm not entire sure the
# Impact # Impact
predicate.edit(membership_criterion_category_list=membership_list, predicate.edit(membership_criterion_category_list=membership_list,
...@@ -345,3 +346,17 @@ def Base_updateRelatedContentWithoutReindextion(self, previous_category_url, new ...@@ -345,3 +346,17 @@ def Base_updateRelatedContentWithoutReindextion(self, previous_category_url, new
o.Base_updateRelatedContentWithoutReindextion(previous_o_category_url, o.Base_updateRelatedContentWithoutReindextion(previous_o_category_url,
new_o_category_url) new_o_category_url)
def isValidXml(self, value, REQUEST=None):
if REQUEST is not None:
raise Unauthorized
# No better way them this for now
etree.fromstring(value)
return True
def isValidXmlMarshaller(self, value, REQUEST=None):
if REQUEST is not None:
raise Unauthorized
# No better way them this for now
dumps(value)
return True
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TALES Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>expression</string> </key>
<value> <string>python: context.Base_isValidXml(context.getSlaXml())</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>sla_xml_valid_xml_constraint</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>message_expression_error</string> </key>
<value> <string>Sla XML is invalid: ${error}</string> </value>
</item>
<item>
<key> <string>message_expression_false</string> </key>
<value> <string>Sla XML expression was false</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>TALES Constraint</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.getSlaXml() is not None</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TALES Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>expression</string> </key>
<value> <string>python: context.Base_isValidXml(context.getTextContent())</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>text_content_valid_xml_constraint</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>message_expression_error</string> </key>
<value> <string>Instance XML is invalid: ${error}</string> </value>
</item>
<item>
<key> <string>message_expression_false</string> </key>
<value> <string>Instance XML expression was false</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>TALES Constraint</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.getTextContent() is not None</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TALES Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>expression</string> </key>
<value> <string>python: context.Base_isValidXmlMarshaller(context.getTitle())</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>title_xml_marshaller_constraint</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>message_expression_error</string> </key>
<value> <string>Title is invalid: ${error}</string> </value>
</item>
<item>
<key> <string>message_expression_false</string> </key>
<value> <string>Title expression was false</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>TALES Constraint</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.getTextContent() is not None</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TALES Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>expression</string> </key>
<value> <string>python: context.getConnectionXmlAsDict() or True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>connection_xml_valid_xml_constraint</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>message_expression_error</string> </key>
<value> <string>Connection XML is invalid: ${error}</string> </value>
</item>
<item>
<key> <string>message_expression_false</string> </key>
<value> <string>Connection XML expression was false</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>TALES Constraint</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.getConnectionXml() is not None</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TALES Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>expression</string> </key>
<value> <string>python: context.getSlaXmlAsDict() or True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>sla_xml_valid_xml_constraint</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>message_expression_error</string> </key>
<value> <string>Sla XML is invalid: ${error}</string> </value>
</item>
<item>
<key> <string>message_expression_false</string> </key>
<value> <string>Sla XML expression was false</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>TALES Constraint</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.getSlaXml() is not None</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TALES Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>expression</string> </key>
<value> <string>python: context.getInstanceXmlAsDict() or True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>text_content_valid_xml_constraint</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>message_expression_error</string> </key>
<value> <string>Instance XML is invalid: ${error}</string> </value>
</item>
<item>
<key> <string>message_expression_false</string> </key>
<value> <string>Instance XML expression was false</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>TALES Constraint</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.getTextContent() is not None</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TALES Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>expression</string> </key>
<value> <string>python: context.Base_isValidXmlMarshaller(context.getTitle())</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>title_xml_marshaller_constraint</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>message_expression_error</string> </key>
<value> <string>Title is invalid: ${error}</string> </value>
</item>
<item>
<key> <string>message_expression_false</string> </key>
<value> <string>Title expression was false</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>TALES Constraint</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.getTextContent() is not None</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TALES Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>expression</string> </key>
<value> <string>python: context.Base_isValidXmlMarshaller(context.getTitle())</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>title_xml_marshaller_constraint</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>message_expression_error</string> </key>
<value> <string>Title is invalid: ${error}</string> </value>
</item>
<item>
<key> <string>message_expression_false</string> </key>
<value> <string>Title expression was false</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>TALES Constraint</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: context.getTextContent() is not None</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>isValidXml</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>SlapOSCloud</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_isValidXml</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>isValidXmlMarshaller</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>SlapOSCloud</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_isValidXmlMarshaller</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -51,7 +51,9 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin): ...@@ -51,7 +51,9 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
<instance> <instance>
</instance> </instance>
""" """
sla_xml = "test" sla_xml = """<?xml version="1.0" encoding="utf-8"?>
<instance />
"""
shared = True shared = True
state = "started" state = "started"
...@@ -165,7 +167,9 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin): ...@@ -165,7 +167,9 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
<instance> <instance>
</instance> </instance>
""" """
sla_xml = "test" sla_xml = """<?xml version="1.0" encoding="utf-8"?>
<instance />
"""
shared = True shared = True
# Only started, stopped, destroyed # Only started, stopped, destroyed
...@@ -229,7 +233,9 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin): ...@@ -229,7 +233,9 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
<instance> <instance>
</instance> </instance>
""" """
sla_xml = "test" sla_xml = """<?xml version="1.0" encoding="utf-8"?>
<instance />
"""
shared = True shared = True
state = "started" state = "started"
...@@ -257,7 +263,9 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin): ...@@ -257,7 +263,9 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
<instance> <instance>
</instance> </instance>
""" """
sla_xml = "test" sla_xml = """<?xml version="1.0" encoding="utf-8"?>
<instance />
"""
shared = True shared = True
state = "started" state = "started"
...@@ -298,7 +306,9 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin): ...@@ -298,7 +306,9 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
<instance> <instance>
</instance> </instance>
""" """
sla_xml = "test" sla_xml = """<?xml version="1.0" encoding="utf-8"?>
<instance />
"""
shared = True shared = True
state = "started" state = "started"
...@@ -335,7 +345,9 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin): ...@@ -335,7 +345,9 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
<instance> <instance>
</instance> </instance>
""" """
sla_xml = "test" sla_xml = """<?xml version="1.0" encoding="utf-8"?>
<instance />
"""
shared = True shared = True
state = "started" state = "started"
...@@ -404,7 +416,9 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin): ...@@ -404,7 +416,9 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
<instance> <instance>
</instance> </instance>
""" """
sla_xml = "test" sla_xml = """<?xml version="1.0" encoding="utf-8"?>
<instance />
"""
shared = True shared = True
state = "started" state = "started"
...@@ -518,7 +532,9 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin): ...@@ -518,7 +532,9 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
<instance> <instance>
</instance> </instance>
""" """
sla_xml = "test" sla_xml = """<?xml version="1.0" encoding="utf-8"?>
<instance />
"""
shared = True shared = True
person.requestSoftwareInstance( person.requestSoftwareInstance(
...@@ -559,7 +575,9 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin): ...@@ -559,7 +575,9 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
<instance> <instance>
</instance> </instance>
""" """
sla_xml = "test" sla_xml = """<?xml version="1.0" encoding="utf-8"?>
<instance />
"""
shared = True shared = True
person.requestSoftwareInstance( person.requestSoftwareInstance(
......
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