test_ec2_list_credentials does a wrong test

Bug #1413459 reported by wanghong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Low
wanghong

Bug Description

https://github.com/openstack/keystone/blob/master/keystone/tests/test_v3_credential.py#L370
    def test_ec2_list_credentials(self):
        """Test ec2 credential listing."""
        self._get_ec2_cred_uri()
        uri = self._get_ec2_cred_uri()
        r = self.get(uri)
        cred_list = r.result
        self.assertEqual(1, len(cred_list))
According to current code, I think the test steps is:
1. create a ec2 credential
2. list all credentials
3. assert that list method can get the ec2 credential created before
But, the author used a wrong method to create ec2 credential and asserted the wrong data:
1. The method which creates a ec2 credential is self._get_ec2_cred()
2. cred_list should be r.result['credentials']

wanghong (w-wanghong)
Changed in keystone:
assignee: nobody → wanghong (w-wanghong)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

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

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

Reviewed: https://review.openstack.org/149134
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=4ae80da2af2a2c9b6245be3e3e638337b96f011c
Submitter: Jenkins
Branch: master

commit 4ae80da2af2a2c9b6245be3e3e638337b96f011c
Author: wanghong <email address hidden>
Date: Thu Jan 22 12:11:57 2015 +0800

    fix test_ec2_list_credentials

    The author used a wrong method to create ec2 credential and asserted
    the wrong list data:
    1. The method which creates a ec2 credential is self._get_ec2_cred()
    2. cred_list should be r.result['credentials']

    Change-Id: Ibb934ea404654adc99220096edf913a8aa8df7b3
    Closes-Bug: #1413459

Changed in keystone:
status: In Progress → Fix Committed
Changed in keystone:
milestone: none → kilo-2
importance: Undecided → Low
Thierry Carrez (ttx)
Changed in keystone:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: kilo-2 → 2015.1.0
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.