Bug 1615238

Summary: [UPDATE] after overcloud update tempest test "tempest.api.identity.admin.v3.test_roles.RolesV3TestJSON" fails with error "Unexpected http success status code 200,expected status code is 204"
Product: Red Hat OpenStack Reporter: Raviv Bar-Tal <rbartal>
Component: openstack-keystoneAssignee: Nathan Kinder <nkinder>
Status: CLOSED WORKSFORME QA Contact: Raviv Bar-Tal <rbartal>
Severity: low Docs Contact:
Priority: medium    
Version: 13.0 (Queens)CC: alee, apevec, chkumar, dmendiza, hrybacki, jschluet, lhh, mkopec, moguimar, nkinder, slinaber, srevivo, udesale
Target Milestone: ---Keywords: Triaged, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1617929 (view as bug list) Environment:
Last Closed: 2020-03-19 20:14:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1466799    
Bug Blocks: 1617929    
Attachments:
Description Flags
tempest dir none

Description Raviv Bar-Tal 2018-08-13 06:26:13 UTC
Description of problem:
After updating overcloud from osp13 ga to passed_phase2 (z2)
the test tempest.api.identity.admin.v3.test_roles.RolesV3TestJSON fails with the following error:
        
ft1.9: tempest.api.identity.admin.v3.test_roles.RolesV3TestJSON.test_implied_roles_create_check_show_delete[id-c90c316c-d706-4728-bcba-eb1912081b69]_StringException: pythonlogging:'': {{{
2018-08-12 13:52:00,796 7589 INFO     [tempest.lib.common.rest_client] Request (RolesV3TestJSON:test_implied_roles_create_check_show_delete): 201 PUT http://192.168.24.9:35357/v3/roles/d20f2c42e0ec4e24af008a81aa1ffc67/implies/2246bc6fe7c34588b02bd167515113bf 0.354s
2018-08-12 13:52:00,797 7589 DEBUG    [tempest.lib.common.rest_client] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
        Body: None
    Response - Headers: {'status': '201', u'content-length': '513', 'content-location': 'http://192.168.24.9:35357/v3/roles/d20f2c42e0ec4e24af008a81aa1ffc67/implies/2246bc6fe7c34588b02bd167515113bf', u'vary': 'X-Auth-Token', u'server': 'Apache', u'connection': 'close', u'date': 'Sun, 12 Aug 2018 17:52:00 GMT', u'content-type': 'application/json', u'x-openstack-request-id': 'req-2980b312-f813-4c90-9a6d-93e436efb25e'}
        Body: {"role_inference": {"implies": {"id": "2246bc6fe7c34588b02bd167515113bf", "links": {"self": "http://192.168.24.9:35357/v3/roles/2246bc6fe7c34588b02bd167515113bf"}, "name": "tempest-role-1735135783"}, "prior_role": {"id": "d20f2c42e0ec4e24af008a81aa1ffc67", "links": {"self": "http://192.168.24.9:35357/v3/roles/d20f2c42e0ec4e24af008a81aa1ffc67"}, "name": "tempest-role-754464861"}}, "links": {"self": "http://192.168.24.9:35357/v3/roles/d20f2c42e0ec4e24af008a81aa1ffc67/implies/2246bc6fe7c34588b02bd167515113bf"}}
2018-08-12 13:52:01,252 7589 INFO     [tempest.lib.common.rest_client] Request (RolesV3TestJSON:test_implied_roles_create_check_show_delete): 200 HEAD http://192.168.24.9:35357/v3/roles/d20f2c42e0ec4e24af008a81aa1ffc67/implies/2246bc6fe7c34588b02bd167515113bf 0.455s
2018-08-12 13:52:01,253 7589 DEBUG    [tempest.lib.common.rest_client] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
        Body: None
    Response - Headers: {'status': '200', u'content-length': '513', 'content-location': 'http://192.168.24.9:35357/v3/roles/d20f2c42e0ec4e24af008a81aa1ffc67/implies/2246bc6fe7c34588b02bd167515113bf', u'vary': 'X-Auth-Token,Accept-Encoding', u'server': 'Apache', u'connection': 'close', u'date': 'Sun, 12 Aug 2018 17:52:01 GMT', u'content-type': 'application/json', u'x-openstack-request-id': 'req-df9012e3-656b-4fb7-b554-f7b62f48e351'}
        Body: 
2018-08-12 13:52:01,649 7589 INFO     [tempest.lib.common.rest_client] Request (RolesV3TestJSON:_run_cleanups): 204 DELETE http://192.168.24.9:35357/v3/roles/d20f2c42e0ec4e24af008a81aa1ffc67/implies/2246bc6fe7c34588b02bd167515113bf 0.381s
2018-08-12 13:52:01,650 7589 DEBUG    [tempest.lib.common.rest_client] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
        Body: None
    Response - Headers: {'status': '204', 'content-location': 'http://192.168.24.9:35357/v3/roles/d20f2c42e0ec4e24af008a81aa1ffc67/implies/2246bc6fe7c34588b02bd167515113bf', u'vary': 'X-Auth-Token', u'server': 'Apache', u'connection': 'close', u'date': 'Sun, 12 Aug 2018 17:52:01 GMT', u'content-type': 'text/plain', u'x-openstack-request-id': 'req-01a37bb5-9e73-4ea6-8bf6-5afc9859ee55'}
        Body:
}}}

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/tempest/api/identity/admin/v3/test_roles.py", line 208, in test_implied_roles_create_check_show_delete
    prior_role_id, implies_role_id)
  File "/usr/lib/python2.7/site-packages/tempest/lib/services/identity/v3/roles_client.py", line 233, in check_role_inference_rule
    self.expected_success(204, resp.status)
  File "/usr/lib/python2.7/site-packages/tempest/lib/common/rest_client.py", line 261, in expected_success
    raise exceptions.InvalidHttpSuccessCode(details)
tempest.lib.exceptions.InvalidHttpSuccessCode: The success code is different than the expected one
Details: Unexpected http success status code 200, The expected status code is 204

Version-Release number of selected component (if applicable):
python2-tempest-18.0.0-2.el7ost.noarch
openstack-tempest-18.0.0-2.el7ost.noarch
python2-tempestconf-1.1.5-0.20180326143753.f9d956f.el7ost.noarch


How reproducible:


Steps to Reproduce:
1. Install osp13 ga 
2. update to passed_phase2 (in this case 2018-08-03.3)
3. Run tempest suite "all"

Actual results:


Expected results:


Additional info:

Comment 1 Raviv Bar-Tal 2018-08-13 06:36:56 UTC
Created attachment 1475479 [details]
tempest dir

Comment 2 Martin Kopec 2018-08-15 08:03:11 UTC
Tempest in that tests creates an implied role and then contacts keystone to confirm that there is an inference rule between them. Tempest expects return code equals to 204, but gets 200 instead. 
The documentation [1] says, keystone should return 204 in case of a success not 200.
It seems it's related to one upstream bug [2]. Therefore I'm moving the bug to openstack-keystone component.

[1] https://developer.openstack.org/api-ref/identity/v3/index.html#confirm-role-inference-rule
[2] https://bugs.launchpad.net/keystone/+bug/1660603