image.v1.test_image_members failed for “The success code is different than the expected one“

Bug #1733498 reported by lihaijing
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Invalid
Undecided
Unassigned
tempest
Invalid
Undecided
Unassigned

Bug Description

Openstck version: Pike
tempest version: 17.1.0

When I run tempest.api.image.v1.test_image_members.ImageMembersTest, the test cases failed.

_StringException: pythonlogging:'': {{{
2017-11-21 08:42:38,999 5434 INFO [tempest.lib.common.rest_client] Request (ImageMembersTest:test_add_image_member): 201 POST https://10.127.2.30:9292/v1/images 0.659s
2017-11-21 08:42:38,999 5434 DEBUG [tempest.lib.common.rest_client] Request - Headers: {'x-image-meta-container_format': 'bare', 'X-Auth-Token': '<omitted>', 'x-image-meta-is_public': 'False', 'Content-Type': 'application/octet-stream', 'x-image-meta-disk_format': 'raw', 'x-image-meta-name': 'tempest-ImageMembersTest-image-608197243'}
        Body: <callable-iterator object at 0x7fbdbf65c910>
    Response - Headers: {'status': '201', u'content-length': '521', 'content-location': 'https://10.127.2.30:9292/v1/images', u'connection': 'close', u'etag': 'fd3e0d53babf78fdc2cdaca026be16b2', u'location': 'https://10.127.2.30:9292/v1/images/59f6c720-37a1-4441-a39f-fdec7a1237e7', u'date': 'Tue, 21 Nov 2017 00:52:28 GMT', u'content-type': 'application/json', u'x-openstack-request-id': 'req-661452b2-db33-46a3-8673-5b9c06f9ef04'}
        Body: {"image": {"status": "active", "deleted": false, "container_format": "bare", "min_ram": 0, "updated_at": "2017-11-21T00:52:28.000000", "owner": "db4bbe131a8f458ab3af53e400e5d927", "min_disk": 0, "is_public": false, "deleted_at": null, "id": "59f6c720-37a1-4441-a39f-fdec7a1237e7", "size": 1024, "virtual_size": null, "name": "tempest-ImageMembersTest-image-608197243", "checksum": "fd3e0d53babf78fdc2cdaca026be16b2", "created_at": "2017-11-21T00:52:27.000000", "disk_format": "raw", "properties": {}, "protected": false}}
2017-11-21 08:42:39,197 5434 INFO [tempest.lib.common.rest_client] Request (ImageMembersTest:test_add_image_member): 200 PUT https://10.127.2.30:9292/v1/images/59f6c720-37a1-4441-a39f-fdec7a1237e7/members/6436a595aed34d679cb521da235aa744 0.197s
2017-11-21 08:42:39,197 5434 DEBUG [tempest.lib.common.rest_client] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '<omitted>'}
        Body: {"member": {}}
    Response - Headers: {'status': '200', u'content-length': '45', 'content-location': 'https://10.127.2.30:9292/v1/images/59f6c720-37a1-4441-a39f-fdec7a1237e7/members/6436a595aed34d679cb521da235aa744', u'date': 'Tue, 21 Nov 2017 00:52:28 GMT', u'content-type': 'application/json', u'connection': 'close', u'x-openstack-request-id': 'req-c7e2e557-a40b-4471-8f0f-87d9aa239dec'}
        Body: "<HTTPNoContent at 0x4417fa0 204 No Content>"
}}}

Traceback (most recent call last):
  File "/home/jenkins/workspace/deploy-manually-test-cd-pm/fitos_test/tests/api_test/tempest/api/image/v1/test_image_members.py", line 26, in test_add_image_member
    self.image_member_client.create_image_member(image, self.alt_tenant_id)
  File "/home/jenkins/workspace/deploy-manually-test-cd-pm/fitos_test/tests/api_test/tempest/lib/services/image/v1/image_members_client.py", line 53, in create_image_member
    self.expected_success(204, resp.status)
  File "/home/jenkins/workspace/deploy-manually-test-cd-pm/fitos_test/tests/api_test/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

So I execute the cmd directly by 'curl'.The result as follow:
[root@cdpm02 ~]# curl -g -i --cacert "/etc/keystone/ssl/ca.crt" -X PUT https://10.127.2.30:9292/v1/images/1a87cfcb-71c9-4d86-a2ea-0f0bb98fcf1f/members/218030757f8348848e6bdab3eca7cb27 -H "User-Agent: python-glanceclient" -H "Content-Type: application/json" -H "X-Auth-Token: $token" -d '{"member": {"can_share": false}}'
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 45
X-Openstack-Request-Id: req-0deecacc-1e2f-4dd9-8a02-a7e261839d6a
Date: Tue, 21 Nov 2017 04:14:00 GMT

lihaijing (lihaijing)
description: updated
lihaijing (lihaijing)
description: updated
Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :

glance seems to return 204 only as per api-ref and source code

- https://github.com/openstack/glance/blob/stable/pike/glance/api/v1/members.py#L171
-http://developer.openstack.org/api-ref/image/v1/#add-member-to-image

we do not run v2 API tests on gate as that is deprecated feature. we should delete all tests of v1 from tempest.

But i will verify this bug first and then we can take action.

Changed in tempest:
assignee: nobody → Ghanshyam Mann (ghanshyammann)
Revision history for this message
zhufl (zhu-fanglei) wrote :

I seem can not reproduce this in my system(Pike version),

Request (ImageMembersTest:test_add_image_member): 204 PUT http://10.43.239.6:9292/v1/images/c8185b83-bced-436a-acc0-2b8eb825ca12/members/e86f497825ea47c9832e17a1c20cd409 1.753s
Request-Head: {}
    Request-Body: {"member": {}}

Revision history for this message
chandan kumar (chkumar246) wrote :

Is it still reproducible?

Revision history for this message
Martin Kopec (mkopec) wrote :

image.v1 is deprecated so I think this bug is not valid anymore.

Changed in tempest:
assignee: Ghanshyam Mann (ghanshyammann) → nobody
status: New → Invalid
Revision history for this message
Cyril Roelandt (cyril-roelandt) wrote :

Glance will not fix v1 code as it has been deprecated for quite some time.

Changed in glance:
status: New → Invalid
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.