Additional properties in os-extended-volumes:volumes_attached for v2.3 microversion

Bug #1600186 reported by Evgeny Antyshev
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
tempest
Fix Released
High
Eli Qiao

Bug Description

AttachVolumeShelveTestJSON.test_attach_detach_volume TC fails, as it uses v2.20 api for getting server details, but schema does not allow additional properties in items of os-extended-volumes:volumes_attached (delete_on_termination is provided since v2.20)

identical testcase AttachVolumeTestJSON.test_attach_detach_volume which uses v2.19 passes

tempest.api.compute.volumes.test_attach_volume.AttachVolumeShelveTestJSON.test_attach_detach_volume[id-52e9045a-e90d-4c0d-9087-79d657faffff]
--------------------------------------------------------------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "/opt/stack/new/tempest/tempest/api/compute/volumes/test_attach_volume.py", line 122, in test_attach_detach_volume
        'SHUTOFF')
      File "/opt/stack/new/tempest/tempest/common/waiters.py", line 39, in wait_for_server_status
        body = client.show_server(server_id)['server']
      File "/opt/stack/new/tempest/tempest/lib/services/compute/servers_client.py", line 106, in show_server
        self.validate_response(schema.get_server, resp, body)
      File "/opt/stack/new/tempest/tempest/lib/common/rest_client.py", line 896, in validate_response
        raise exceptions.InvalidHTTPResponseBody(msg)
    tempest.lib.exceptions.InvalidHTTPResponseBody: HTTP response body is invalid json or xml
    Details: HTTP response body is invalid (Additional properties are not allowed (u'delete_on_termination' was unexpected)

    Failed validating 'additionalProperties' in schema['properties']['server']['properties']['os-extended-volumes:volumes_attached']['items']:
        {'additionalProperties': False,
         'properties': {'id': {'type': 'string'}},
         'type': 'object'}

    On instance['server']['os-extended-volumes:volumes_attached'][0]:
        {u'delete_on_termination': False,
         u'id': u'a38cfda7-4e69-48b6-b0ff-ad38cf56154d'})

...
22016-07-07 11:09:10.674 69769 INFO tempest.lib.common.rest_client [req-72829c8d-cd8b-4384-9c1c-e6f4561bb8c1 ] Request (AttachVolumeShelveTestJSON:test_attach_detach_volume): 200 GET http://127.0.0.1:8774/v2.1/servers/7903f672-d9ca-4312-a60d-f26375656c2d 0.496s
2016-07-07 11:09:10.674 69769 DEBUG tempest.lib.common.rest_client [req-72829c8d-cd8b-4384-9c1c-e6f4561bb8c1 ] Request - Headers: {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-OpenStack-Nova-API-Version': '2.20', 'X-Auth-Token': '<omitted>'}
        Body: None
    Response - Headers: {'status': '200', 'content-length': '1724', 'content-location': 'http://127.0.0.1:8774/v2.1/servers/7903f672-d9ca-4312-a60d-f26375656c2d', 'x-compute-request-id': 'req-72829c8d-cd8b-4384-9c1c-e6f4561bb8c1', 'vary': 'X-OpenStack-Nova-API-Version', 'openstack-api-version': 'compute 2.20', 'connection': 'close', 'x-openstack-nova-api-version': '2.20', 'date': 'Thu, 07 Jul 2016 11:09:10 GMT', 'content-type': 'application/json'}
        Body: {"server": {"OS-EXT-STS:task_state": "powering-off", "addresses": {"private": [{"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:ab:4d:f7", "version": 4, "addr": "10.1.15.0", "OS-EXT-IPS:type": "fixed"}, {"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:ab:4d:f7", "version": 4, "addr": "172.24.5.2", "OS-EXT-IPS:type": "floating"}]}, "links": [{"href": "http://127.0.0.1:8774/v2.1/servers/7903f672-d9ca-4312-a60d-f26375656c2d", "rel": "self"}, {"href": "http://127.0.0.1:8774/servers/7903f672-d9ca-4312-a60d-f26375656c2d", "rel": "bookmark"}], "image": {"id": "07f9a49d-ea1a-4c3a-a669-ff3020baf67d", "links": [{"href": "http://127.0.0.1:8774/images/07f9a49d-ea1a-4c3a-a669-ff3020baf67d", "rel": "bookmark"}]}, "OS-EXT-STS:vm_state": "active", "OS-SRV-USG:launched_at": "2016-07-07T11:08:52.000000", "flavor": {"id": "42", "links": [{"href": "http://127.0.0.1:8774/flavors/42", "rel": "bookmark"}]}, "id": "7903f672-d9ca-4312-a60d-f26375656c2d", "security_groups": [{"name": "tempest-securitygroup--133906238"}], "OS-SRV-USG:terminated_at": null, "user_id": "83da61292ed64aa88e96fde195e55efe", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 1, "OS-EXT-AZ:availability_zone": "nova", "metadata": {}, "status": "ACTIVE", "updated": "2016-07-07T11:09:09Z", "hostId": "926bf6df0ffbd026495dda6a405a418753130578037f040f9562be35", "description": null, "key_name": "tempest-keypair-910368243", "locked": false, "name": "tempest.common.compute-instance-1437032414", "created": "2016-07-07T11:08:33Z", "tenant_id": "ea5d804196454943beedda2db3dc9243", "os-extended-volumes:volumes_attached": [{"id": "cfbbc7be-cc22-425e-a534-e01e9d9ddfbd", "delete_on_termination": false}], "config_drive": "True"}} _log_request_full /opt/stack/new/tempest/tempest/lib/common/rest_client.py:430

^^^
here "delete_on_termination" was unexpected in current schema

Changed in tempest:
assignee: nobody → Evgeny Antyshev (eantyshev)
Revision history for this message
Andrea Frittoli (andrea-frittoli) wrote :

This issue was not detected by the gate because we skip test_attach_detach_volume (except for in the neutron-ssh job which is non-voting).

Changed in tempest:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest (master)

Fix proposed to branch: master
Review: https://review.openstack.org/339559

Changed in tempest:
status: Confirmed → In Progress
Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote : Re: Additional properties in os-extended-volumes:volumes_attached for v2.20 microversion

Actually there were issue of dependency of patches when this got merged - Icf6148017cdbc4f48d3ef9a964ee39fedda72b4e
My bad I should have make below one as base patch.
https://review.openstack.org/#/c/337598/ this patch fix the issue.

Changed in tempest:
assignee: Evgeny Antyshev (eantyshev) → Matt Riedemann (mriedem)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest (master)

Fix proposed to branch: master
Review: https://review.openstack.org/344202

Changed in tempest:
assignee: Matt Riedemann (mriedem) → Ghanshyam Mann (ghanshyammann)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/344827

Changed in tempest:
assignee: Ghanshyam Mann (ghanshyammann) → Ken'ichi Ohmichi (oomichi)
Revision history for this message
Matt Riedemann (mriedem) wrote :
summary: - Additional properties in os-extended-volumes:volumes_attached for v2.20
+ Additional properties in os-extended-volumes:volumes_attached for v2.3
microversion
Changed in tempest:
assignee: Ken'ichi Ohmichi (oomichi) → Eli Qiao (taget-9)
Changed in tempest:
status: In Progress → Fix Committed
Anna Babich (ababich)
tags: added: on-verification
Revision history for this message
Anna Babich (ababich) wrote :

At the moment the AttachVolumeShelveTestJSON.test_attach_detach_volume test case passes against env with Tempest cloned from master:

${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} ${OS_TEST_PATH:-./tempest/test_discover} --load-list /tmp/tmpDcmrig
{0} tempest.api.compute.volumes.test_attach_volume.AttachVolumeShelveTestJSON.test_attach_detach_volume [150.412356s] ... ok

Although it's impossible to check it against upstream CI because it's still skipped with "SSH required for this test" status, but we can see that schema is already fixed, and I propose to assign the given bug with Fix Released status.

tags: removed: on-verification
Anna Babich (ababich)
Changed in tempest:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tempest (master)

Change abandoned by Ghanshyam Mann (<email address hidden>) on branch: master
Review: https://review.openstack.org/344202
Reason: not needed now as this merged -https://review.openstack.org/#/c/287605/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Ken'ichi Ohmichi (<email address hidden>) on branch: master
Review: https://review.openstack.org/344827
Reason: Yeah, I am pretty sure I misunderstood due to just seeing v2.20 gate failure.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Matthew Treinish (<email address hidden>) on branch: master
Review: https://review.openstack.org/339559
Reason: This patch is completely superseded and can't land anymore.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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