Tempest assert wrong exception when validating service token

Bug #2049228 reported by bryan
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
New
Undecided
Unassigned

Bug Description

We are running OpenStack Zed and Antelope version, in test case "tempest.scenario.test_server_volume_attachment.TestServerVolumeAttachmentScenario", I called OpenStack volume detach API when an invalid token, it returns 401 to me, here it is:

curl -g -i -X DELETE http://10.250.21.200:8774/v2.1/servers/6ff1e2bc-c217-4644-966b-806bed2d8b62/os-volume_attachments/58912c35-6ada-4b70-9270-964faf3905f4 -H "Accept: application/json" -H "OpenStack-API-Version: compute 2.92" -H "User-Agent: python-novaclient" -H "X-Auth-Token: gAAAAABloY4PTFppEBWxft0hhBtN0rLAM-LEN0-QI5UnkhHQ60mXwiemez0WG9oy6gbYyXp5gzaSgVwW_LL290elqUDARHMQ7crhHNgjjdgosHai8JMPni4pk-i7PLcaCfTRvfp5ayHNczJaKTMIwKdfbdsTpgsZ_QSX23ADvWuVEVlU12PZ5iI1111" -H "X-OpenStack-Nova-API-Version: 2.93"
HTTP/1.1 401 Unauthorized
date: Fri, 12 Jan 2024 19:15:36 GMT
server: Apache
www-authenticate: Keystone uri="http://10.250.21.200:5000"
content-length: 114
x-openstack-request-id: req-3ad4eef4-eff0-4d1f-8f01-dab3d398189c
x-compute-request-id: req-3ad4eef4-eff0-4d1f-8f01-dab3d398189c
content-type: application/json

{"error": {"code": 401, "title": "Unauthorized", "message": "The request you have made requires authentication."}}

However, the test case is expecting [exceptions.Forbidden, exceptions.Conflict] when the token is invalid, this is not the same return with the actual result.

Here is a samilar patch: https://review.opendev.org/c/openstack/tempest/+/893334

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.