Pass wrong params in test_unmanage_manage_snapshot when use list_snapshot

Bug #1740811 reported by Liang Cui
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Undecided
Liang Cui

Bug Description

In tempest\api\volume\admin\test_snapshot_manage.py
@decorators.idempotent_id('0132f42d-0147-4b45-8501-cc504bbf7810')
    def test_unmanage_manage_snapshot(self):
        # Create a volume
        volume = self.create_volume()

        # Create a snapshot
        snapshot = self.create_snapshot(volume_id=volume['id'])

        # Unmanage the snapshot
        # Unmanage snapshot function works almost the same as delete snapshot,
        # but it does not delete the snapshot data
        self.admin_snapshots_client.unmanage_snapshot(snapshot['id'])
        self.admin_snapshots_client.wait_for_resource_deletion(snapshot['id'])

        # Verify the original snapshot does not exist in snapshot list
        params = {'all_tenants': 1}
        all_snapshots = self.admin_snapshots_client.list_snapshots(
            detail=True, params=params)['snapshots']

when pass params to snapshots_client.py:

    def list_snapshots(self, detail=False, **params):
        """List all the snapshot.

        For a full list of available parameters, please refer to the official
        API reference:
        http://developer.openstack.org/api-ref/block-storage/v2/#list-snapshots-with-details
        http://developer.openstack.org/api-ref/block-storage/v2/#list-snapshots
        """
        url = 'snapshots'
        if detail:
            url += '/detail'
        if params:
            url += '?%s' % urllib.urlencode(params)

        resp, body = self.get(url)
        body = json.loads(body)
        self.expected_success(200, resp.status)
        return rest_client.ResponseBody(resp, body)

the params has been changed to '{'params': {'all_tenant': 1}}', but it should be {'all_tenants': 1}
the response body is
Response - Headers: {'status': '500', u'content-length': '128', 'content-location': 'https://10.127.2.30:8776/v2/e06607c4b7094b9e83d026e3b9c9ce59/snapshots/detail?params=%7B%27all_tenants%27%3A+1%7D', u'x-compute-request-id': 'req-ba3ad22a-8485-4068-acc6-53152d3ca4ba', u'connection': 'close', u'date': 'Tue, 02 Jan 2018 01:45:20 GMT', u'content-type': 'application/json', u'x-openstack-request-id': 'req-ba3ad22a-8485-4068-acc6-53152d3ca4ba'}

Liang Cui (liangcui)
Changed in tempest:
assignee: nobody → Liang Cui (liangcui)
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/530671

Changed in tempest:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.openstack.org/530671
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=c4d1ad1e4b170e8e7e562f05623c6b0a96abae63
Submitter: Zuul
Branch: master

commit c4d1ad1e4b170e8e7e562f05623c6b0a96abae63
Author: liangcui <email address hidden>
Date: Tue Jan 2 10:51:03 2018 +0800

    modify params transfer mode in test_snapshot_manage

    In test_snapshot_manage, when use list_snapshot, the params is wrong
    used.

    Change-Id: I7567b0aa15cab851ea15da56b214cbdddcfdada1
    Closes-bug: #1740811

Changed in tempest:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tempest 18.0.0

This issue was fixed in the openstack/tempest 18.0.0 release.

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.