Modifying unit tests according to policy.json

asked 2015-09-30 13:58:01 -0500

anonymous user


I'd like to know what changes need to be made to unit tests when role changes for an action in policy.json.

For example, I made the below change to Neutron policy.json

From: "create_port": "" to "create_port": "role:my_network_role".

Neutron unit test "test_create_port_public_network" fails due to this change. I can make it work by making a code change to get the admin context but my mind tells me this is not the way. The current code generates neutron context the below way which is not admin context...

 port_req.environ['neutron.context'] = context.Context("'', kwargs['tenant_id'])

Can someone help me with it? How do I change the tests to use my newly created role?


edit retag flag offensive close merge delete