Fwd: Regarding RBAC tests

Ghanshyam Mann gmann at ghanshyammann.com
Wed Jun 16 16:05:30 UTC 2021


 ---- On Wed, 16 Jun 2021 10:33:31 -0500 Soniya Vyas <svyas at redhat.com> wrote ----
 > Hello everyone,
 > I was just curious about writing RBAC tests, hence while writing them I came across certain analysis and confusions.
 > Analysis:-
 > Whenever an api is called within patrole for its testing, it's the call to its respective service client. Like, let's say we need to test 'create_network:is_default', naturally for expected result we need to call the api first, which would be a call to neutron client's create_network[1].
 > Question:-
 > 
 > But which api's to call for logging resource[2]?For example, let's say we need to write a RBAC test for Create log.
 > As far as I know, Openstack uses python's default logging extension. So the question is which api's to call for the expected result.
 > 
 > In Patrole, there are no assertions with expected and actual data. So, How do RBAC-tests test the api?
 > Any help with these confusions would be greatly appreciated. 

Thanks, Sonia for improving the test coverage. 

For any Tempest-like tests (Patrole tests are Tempest-like tests, we have implemented the service clients for each required API. We do not use
the python-based client in Tempest for debugging reason etc.

We have all the service clients either present in tempest/lib/services/ [1] or on the tempest plugin side. For neutron's log API we do not have
any service client written yet so you need to write the service client in Tempest for that first and then add RBAC test in patrole. You can do in
parallel and test with depends-on.

You can write new service client here https://opendev.org/openstack/tempest/src/branch/master/tempest/lib/services/network. 
Example: https://review.opendev.org/c/openstack/tempest/+/465810

[1] https://opendev.org/openstack/tempest/src/branch/master/tempest/lib/services

-gmann

 > 
 > [1] https://review.opendev.org/c/openstack/patrole/+/583340/4/patrole_tempest_plugin/tests/api/network/test_networks_rbac.py#100[2] https://docs.openstack.org/api-ref/network/v2/?expanded=#log-resource
 > Thanks and Regards,Soniya Vyas



More information about the openstack-discuss mailing list