← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1258376] [NEW] Tempest test_list_instance_usage_audit_logs fails if the hostname of the instance begins with a number

 

Public bug reported:

In the list instance usage audit logs XML response, the element <10-150-10-15>  in <log></log>  is against the XML schema.
http://www.w3schools.com/xml/xml_elements.asp
XML Naming Rules
XML elements must follow these naming rules:

Names can contain letters, numbers, and other characters
Names cannot start with a number or punctuation character
Names cannot start with the letters xml (or XML, or Xml, etc)
Names cannot contain spaces

So if the hostname of the instance begin with number, punctuation character, etc,  the list usage audio logs response will be against the rule. 
We either don't use host name as the element name or add a prefix before the host name for the tag. 


22:04:48 ======================================================================
22:04:48 FAIL: tempest.api.compute.admin.test_instance_usage_audit_log.InstanceUsageAuditLogTestXML.test_list_instance_usage_audit_logs[gate]
22:04:48 tempest.api.compute.admin.test_instance_usage_audit_log.InstanceUsageAuditLogTestXML.test_list_instance_usage_audit_logs[gate]
22:04:48 ----------------------------------------------------------------------
22:04:48 _StringException: Empty attachments:
22:04:48   stderr
22:04:48   stdout
22:04:48 
22:04:48 pythonlogging:'': {{{
22:04:48 2013-12-05 07:31:08,331 Request: GET http://127.0.0.1:8774/v2/08aefd9fa58347028eec8e5969cdc26a/os-instance_usage_audit_log
22:04:48 2013-12-05 07:31:08,332 Request Headers: {'Content-Type': 'application/xml', 'Accept': 'application/xml', 'X-Auth-Token': '<Token omitted>'}
22:04:48 2013-12-05 07:31:08,791 Response Status: 200
22:04:48 2013-12-05 07:31:08,792 Nova request id: req-d858e0ec-6047-4ecc-a81b-c5bcf99f3f87
22:04:48 2013-12-05 07:31:08,792 Response Headers: {'content-length': '646', 'content-location': u'http://127.0.0.1:8774/v2/08aefd9fa58347028eec8e5969cdc26a/os-instance_usage_audit_log', 'date': 'Thu, 05 Dec 2013 13:31:08 GMT', 'content-type': 'application/xml', 'connection': 'close'}
22:04:48 2013-12-05 07:31:08,792 Response Body: <instance_usage_audit_logs><total_errors>0</total_errors><total_instances>0</total_instances><log><10-150-10-15><instances>0</instances><message>Instance usage audit ran for host 10-150-10-15, 0 instances in 0.0541520118713 seconds.</message><errors>0</errors><state>DONE</state></10-150-10-15></log><num_hosts_running>0</num_hosts_running><num_hosts_done>1</num_hosts_done><num_hosts_not_run>0</num_hosts_not_run><hosts_not_run/><overall_status>ALL hosts done. 0 errors.</overall_status><period_ending>2013-12-05 13:00:00</period_ending><period_beginning>2013-12-05 12:00:00</period_beginning><num_hosts>1</num_hosts></instance_usage_audit_logs>
22:04:48 }}}
22:04:48 
22:04:48 Traceback (most recent call last):
22:04:48   File "tempest/api/compute/admin/test_instance_usage_audit_log.py", line 37, in test_list_instance_usage_audit_logs
22:04:48     resp, body = self.adm_client.list_instance_usage_audit_logs()
22:04:48   File "tempest/services/compute/xml/instance_usage_audit_log_client.py", line 34, in list_instance_usage_audit_logs
22:04:48     instance_usage_audit_logs = xml_to_json(etree.fromstring(body))
22:04:48   File "lxml.etree.pyx", line 2754, in lxml.etree.fromstring (src/lxml/lxml.etree.c:54631)
22:04:48   File "parser.pxi", line 1578, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:82748)
22:04:48   File "parser.pxi", line 1457, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:81546)
22:04:48   File "parser.pxi", line 965, in lxml.etree._BaseParser._parseDoc (src/lxml/lxml.etree.c:78216)
22:04:48   File "parser.pxi", line 569, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:74472)
22:04:48   File "parser.pxi", line 650, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:75363)
22:04:48   File "parser.pxi", line 590, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:74696)
22:04:48 XMLSyntaxError: StartTag: invalid element name, line 1, column 71
22:04:48 
22:04:48 
22:04:48 ======================================================================
22:04:48 FAIL: process-returncode
22:04:48 process-returncode
22:04:48 ----------------------------------------------------------------------
22:04:48 _StringException: Binary content:
22:04:48   traceback (test/plain; charset="utf8")
22:04:48

** Affects: nova
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1258376

Title:
  Tempest test_list_instance_usage_audit_logs fails if the hostname of
  the instance begins with a number

Status in OpenStack Compute (Nova):
  New

Bug description:
  In the list instance usage audit logs XML response, the element <10-150-10-15>  in <log></log>  is against the XML schema.
  http://www.w3schools.com/xml/xml_elements.asp
  XML Naming Rules
  XML elements must follow these naming rules:

  Names can contain letters, numbers, and other characters
  Names cannot start with a number or punctuation character
  Names cannot start with the letters xml (or XML, or Xml, etc)
  Names cannot contain spaces

  So if the hostname of the instance begin with number, punctuation character, etc,  the list usage audio logs response will be against the rule. 
  We either don't use host name as the element name or add a prefix before the host name for the tag. 

  
  22:04:48 ======================================================================
  22:04:48 FAIL: tempest.api.compute.admin.test_instance_usage_audit_log.InstanceUsageAuditLogTestXML.test_list_instance_usage_audit_logs[gate]
  22:04:48 tempest.api.compute.admin.test_instance_usage_audit_log.InstanceUsageAuditLogTestXML.test_list_instance_usage_audit_logs[gate]
  22:04:48 ----------------------------------------------------------------------
  22:04:48 _StringException: Empty attachments:
  22:04:48   stderr
  22:04:48   stdout
  22:04:48 
  22:04:48 pythonlogging:'': {{{
  22:04:48 2013-12-05 07:31:08,331 Request: GET http://127.0.0.1:8774/v2/08aefd9fa58347028eec8e5969cdc26a/os-instance_usage_audit_log
  22:04:48 2013-12-05 07:31:08,332 Request Headers: {'Content-Type': 'application/xml', 'Accept': 'application/xml', 'X-Auth-Token': '<Token omitted>'}
  22:04:48 2013-12-05 07:31:08,791 Response Status: 200
  22:04:48 2013-12-05 07:31:08,792 Nova request id: req-d858e0ec-6047-4ecc-a81b-c5bcf99f3f87
  22:04:48 2013-12-05 07:31:08,792 Response Headers: {'content-length': '646', 'content-location': u'http://127.0.0.1:8774/v2/08aefd9fa58347028eec8e5969cdc26a/os-instance_usage_audit_log', 'date': 'Thu, 05 Dec 2013 13:31:08 GMT', 'content-type': 'application/xml', 'connection': 'close'}
  22:04:48 2013-12-05 07:31:08,792 Response Body: <instance_usage_audit_logs><total_errors>0</total_errors><total_instances>0</total_instances><log><10-150-10-15><instances>0</instances><message>Instance usage audit ran for host 10-150-10-15, 0 instances in 0.0541520118713 seconds.</message><errors>0</errors><state>DONE</state></10-150-10-15></log><num_hosts_running>0</num_hosts_running><num_hosts_done>1</num_hosts_done><num_hosts_not_run>0</num_hosts_not_run><hosts_not_run/><overall_status>ALL hosts done. 0 errors.</overall_status><period_ending>2013-12-05 13:00:00</period_ending><period_beginning>2013-12-05 12:00:00</period_beginning><num_hosts>1</num_hosts></instance_usage_audit_logs>
  22:04:48 }}}
  22:04:48 
  22:04:48 Traceback (most recent call last):
  22:04:48   File "tempest/api/compute/admin/test_instance_usage_audit_log.py", line 37, in test_list_instance_usage_audit_logs
  22:04:48     resp, body = self.adm_client.list_instance_usage_audit_logs()
  22:04:48   File "tempest/services/compute/xml/instance_usage_audit_log_client.py", line 34, in list_instance_usage_audit_logs
  22:04:48     instance_usage_audit_logs = xml_to_json(etree.fromstring(body))
  22:04:48   File "lxml.etree.pyx", line 2754, in lxml.etree.fromstring (src/lxml/lxml.etree.c:54631)
  22:04:48   File "parser.pxi", line 1578, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:82748)
  22:04:48   File "parser.pxi", line 1457, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:81546)
  22:04:48   File "parser.pxi", line 965, in lxml.etree._BaseParser._parseDoc (src/lxml/lxml.etree.c:78216)
  22:04:48   File "parser.pxi", line 569, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:74472)
  22:04:48   File "parser.pxi", line 650, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:75363)
  22:04:48   File "parser.pxi", line 590, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:74696)
  22:04:48 XMLSyntaxError: StartTag: invalid element name, line 1, column 71
  22:04:48 
  22:04:48 
  22:04:48 ======================================================================
  22:04:48 FAIL: process-returncode
  22:04:48 process-returncode
  22:04:48 ----------------------------------------------------------------------
  22:04:48 _StringException: Binary content:
  22:04:48   traceback (test/plain; charset="utf8")
  22:04:48

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1258376/+subscriptions


Follow ups

References