← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1679223] Re: tempest.api.compute.servers.test_server_tags.ServerTagsTestJSON fail on centos7 nodes

 

Reviewed:  https://review.openstack.org/453220
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=7db528379ac8bd9a1f2101a73f78f882884825da
Submitter: Jenkins
Branch:    master

commit 7db528379ac8bd9a1f2101a73f78f882884825da
Author: Markus Zoeller <mzoeller@xxxxxxxxxx>
Date:   Tue Apr 4 17:23:09 2017 +0200

    API: accept None as content-length in HTTP requests
    
    The API defines PUT and POST as HTTP methods which need a request body.
    It is allowed, that this request body might be of zero length. What was
    missing is, that the "content-length" of the request also might be None.
    
    The tempest test cases of servers.test_server_tags.ServerTagsTestJSON
    revealed that a PUT with a non-existing body raises a BadRequest exception
    because of the missing "content-length".
    
      [tempest.lib.common.rest_client]
      Request - Headers:
      {'Content-Type': 'application/json', 'Accept': 'application/json',
      'X-OpenStack-Nova-API-Version': '2.26', 'X-Auth-Token': '<omitted>'}
      Body: None
    
      Response - Headers: {'status': '400', u'content-length': '66',
      u'server': 'Apache/2.4.6 (CentOS)
                  OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5',
      u'date': 'Mon, 03 Apr 2017 10:15:12 GMT',
      u'x-openstack-nova-api-version': '2.26',
      u'x-compute-request-id': 'req-1f8726fc-df20-4592-a214-cff3fa73c8e6',
      u'content-type': 'application/json; charset=UTF-8',
      content-location': 'https://ctrl:8774/v2.1/servers/<uuid>/tags/mytag',
      u'vary': 'OpenStack-API-Version,X-OpenStack-Nova-API-Version',
      u'openstack-api-version': 'compute 2.26',
      u'connection': 'close'}
      Body: {"badRequest":
              {"message": "Malformed request body", "code": 400}
            }
    
    For some reason this, this seems to only occur on centos7 test nodes,
    but not on ubuntu xenial nodes. The root cause is still unclear to me.
    I suspect the underlying "webob.Request" object which is used in Nova's
    API, but I don't have proof for that.
    
    This change checks for "content-length is None". The logic to determine the
    request content was part of a very long method which is hard to test. That's
    why I extracted the code paths to a new method. That made the unit test much
    easier.
    
    Change I3236648f79f44d2758bb7ab0d64d58b0143f6bdb alters the tempest test
    cases which revealed the missing handling of "content-length is None".
    
    Change-Id: Id0b0ab5050a4ec15ab2a0d0dd67fcefe4b1ecb39
    Closes-Bug: #1679223


** Changed in: nova
       Status: In Progress => Fix Released

-- 
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/1679223

Title:
  tempest.api.compute.servers.test_server_tags.ServerTagsTestJSON fail
  on centos7 nodes

Status in OpenStack Compute (nova):
  Fix Released
Status in tempest:
  In Progress

Bug description:
  Description
  ===========
  These tempest test cases fail on centos7 nodes:
      test_server_tags.ServerTagsTestJSON.test_create_delete_tag
      test_server_tags.ServerTagsTestJSON.test_delete_all_tags
      test_server_tags.ServerTagsTestJSON.test_update_all_tags
      test_server_tags.ServerTagsTestJSON.test_check_tag_existence

  http://logstash.openstack.org/#/dashboard/file/logstash.json?from=7d&query=message:%5C%22Malformed%20request%20body%5C%22

  
  Steps to reproduce
  ==================
  See any test run of the 3rd party CI "IBM zKVM CI" after the last successful run from 2017-03-30T06:22:14:
  http://ci-watch.tintri.com/project?project=nova&time=7+days

  
  Expected result
  ===============
  The server tagging functionality tests should work since they got introduced with https://github.com/openstack/tempest/commit/7c95befefb7db27296114f87cf49e8f2b8f43a59

  
  Actual result
  =============

  As an example:

      [tempest.lib.common.rest_client] 
      Request (ServerTagsTestJSON:test_check_tag_existence): 
      400 PUT https://15.184.67.250:8774/v2.1/servers/b56af78e-d406-4858-9509-473863275223/tags/tempest-tag-151463324

      [tempest.lib.common.rest_client] 
      Request - Headers: 
      {'Content-Type': 'application/json', 'Accept': 'application/json', 
      'X-OpenStack-Nova-API-Version': '2.26', 'X-Auth-Token': '<omitted>'}
       Body: None

      Response - Headers: {'status': '400', u'content-length': '66', 
      u'server': 'Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5',
      u'date': 'Mon, 03 Apr 2017 10:15:12 GMT', 
      u'x-openstack-nova-api-version': '2.26', 
      u'x-compute-request-id': 'req-1f8726fc-df20-4592-a214-cff3fa73c8e6', 
      u'content-type': 'application/json; charset=UTF-8', 
      content-location': 'https://15.184.67.250:8774/v2.1/servers/b56af78e-d406-4858-9509-473863275223/tags/tempest-tag-151463324', 
      u'vary': 'OpenStack-API-Version,X-OpenStack-Nova-API-Version', 
      u'openstack-api-version': 'compute 2.26', 
      u'connection': 'close'}
      Body: {"badRequest": {"message": "Malformed request body", "code": 400}}

  Traceback: http://paste.openstack.org/show/605262/

  
  Environment
  ===========
  This happens in various gate test jobs. The common theme is that the build
  node is centos7 based. 
  Logstash query: http://logstash.openstack.org/#/dashboard/file/logstash.json?from=7d&query=message:%5C%22Malformed%20request%20body%5C%22

  You can also see this constantly on the centos based 3rd party CI "IBM zKVM CI":
  https://review.openstack.org/#/q/reviewer:%22IBM+zKVM+CI%22

  Logs & Configs
  ==============
  See any test run of the 3rd party CI "IBM zKVM CI" after the last successful run from 2017-03-30T06:22:14:
  http://ci-watch.tintri.com/project?project=nova&time=7+days

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


References