← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1108574] Re: Issue with list policies v3 API

 

Thanks for the follow up!

** Changed in: keystone
       Status: Incomplete => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1108574

Title:
  Issue with list policies v3 API

Status in OpenStack Identity (Keystone):
  Invalid

Bug description:
  While trying to list the policies it is not showing all the policies
  which I have created.

  1. I am creating 3 policies in a loop and trying to verify the created
  policies by listing them, below is the python piece of code

             policy_ids = []
             for _ in range(3):
                 blob = rand_name('BlobName-')
                 policy_type = rand_name('PolicyType-')
                 resp, policy = self.policy_client.create_policy(blob, policy_type)
                 policy_ids.append(policy['id'])
             print policy_ids
             # List and Verify Policies
             resp, body = self.policy_client.list_policies()
             self.assertTrue(resp['status'].startswith('2'))
             #This returns the list of matched created ids in the listed body
             found = [policy for policy in body if policy['id'] in policy_ids]
             self.assertEqual(len(found), len(policy_ids), 'policies not found')

  2. This is resulting failures intermitently as below.

  Nosetests results:
  Attempt 1:
  nosetests -sv test_policies.py
  test_list_policies (tempest.tests.identity.admin.test_policies.PoliciesTestJSON) ... [u'bf11168c51dc4cdfa87003c8c3f9a4fe', u'57e04f6148874edebbee559decf3896c', u'4902d429f00d4d5e9fb8e2668b4f0421']
  ok

  ----------------------------------------------------------------------
  Ran 1 test in 0.500s

  OK
  Attempt 2:
  nosetests -sv test_policies.py
  test_list_policies (tempest.tests.identity.admin.test_policies.PoliciesTestJSON) ... [u'139af7990d064e418aa413427e9e2585', u'26c0a93a448c4b129cabc40fc359c8d2', u'4974bd2aaeff4134ae717e17e135ab31']
  ok

  ----------------------------------------------------------------------
  Ran 1 test in 0.526s

  OK
  Attempt 3:

  harika@hsd000284:~/today/Iden24thJan/polTem28th/tempest/tempest/tests/identity/admin$ nosetests -sv test_policies.py
  test_list_policies (tempest.tests.identity.admin.test_policies.PoliciesTestJSON) ... [u'536e79eea4254cbe99f590945d85dec5', u'17b63085c29545539766ba77941aa89e', u'fae1e59aa9d6494cbdf5d80b5d7010e6']
  FAIL
  ======================================================================
  FAIL: test_list_policies (tempest.tests.identity.admin.test_policies.PoliciesTestJSON)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/home/harika/today/Iden24thJan/polTem28th/tempest/tempest/tests/identity/admin/test_policies.py", line 73, in test_list_policies
      self.assertEqual(len(found), len(policy_ids), 'policies not found')
  AssertionError: 2 != 3 : policies not found
  -------------------- >> begin captured logging << --------------------
  tempest.tests.identity: DEBUG: Entering tempest.tests.identity.setup_package
  tempest.config: INFO: Using tempest config file /home/harika/today/Iden24thJan/polTem28th/tempest/etc/tempest.conf
  tempest.common.rest_client: ERROR: Request URL: http://10.233.52.240:35357/v3/policies/536e79eea4254cbe99f590945d85dec5
  tempest.common.rest_client: ERROR: Request Body: None
  tempest.common.rest_client: ERROR: Response Headers: {'date': 'Tue, 29 Jan 2013 09:20:16 GMT', 'transfer-encoding': 'chunked', 'status': '404', 'content-type': 'application/json', 'vary': 'X-Auth-Token'}
  tempest.common.rest_client: ERROR: Response Body: {"error": {"message": "Could not find policy: 536e79eea4254cbe99f590945d85dec5", "code": 404, "title": "Not Found"}}
  tempest.common.rest_client: ERROR: Request URL: http://10.233.52.240:35357/v3/policies/17b63085c29545539766ba77941aa89e
  tempest.common.rest_client: ERROR: Request Body: None
  tempest.common.rest_client: ERROR: Response Headers: {'date': 'Tue, 29 Jan 2013 09:20:16 GMT', 'transfer-encoding': 'chunked', 'status': '404', 'content-type': 'application/json', 'vary': 'X-Auth-Token'}
  tempest.common.rest_client: ERROR: Response Body: {"error": {"message": "Could not find policy: 17b63085c29545539766ba77941aa89e", "code": 404, "title": "Not Found"}}
  tempest.common.rest_client: ERROR: Request URL: http://10.233.52.240:35357/v3/policies/fae1e59aa9d6494cbdf5d80b5d7010e6
  tempest.common.rest_client: ERROR: Request Body: None
  tempest.common.rest_client: ERROR: Response Headers: {'date': 'Tue, 29 Jan 2013 09:20:16 GMT', 'transfer-encoding': 'chunked', 'status': '404', 'content-type': 'application/json', 'vary': 'X-Auth-Token'}
  tempest.common.rest_client: ERROR: Response Body: {"error": {"message": "Could not find policy: fae1e59aa9d6494cbdf5d80b5d7010e6", "code": 404, "title": "Not Found"}}
  --------------------- >> end captured logging << ---------------------

  ----------------------------------------------------------------------
  Ran 1 test in 0.650s

  FAILED (failures=1)

  Below are the curl commands

  To list policies: curl -i http://host:35357/v3/policies -X GET -H
  "User-Agent: python-keystone "X-Auth-Token: <Auth-Token>"

  To create policy: curl -i http://hostip:35357/v3/policies -X POST -H
  "User-Agent: python-keystoneclient -H "Content-Type: application/json"
  -H "X-Auth-Token: <token>" -d '{"policy": {"type": "PolicyType-
  7120s5asasdd0sbe", "blob": "BlobName-282asasdw3d4asd1aq"}}'

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1108574/+subscriptions