Felipe Monteiro | f9ace2b | 2018-02-27 09:43:51 -0500 | [diff] [blame] | 1 | .. _patrole-testing: |
| 2 | |
| 3 | =============== |
| 4 | Patrole Testing |
| 5 | =============== |
| 6 | |
| 7 | Testing Scope |
| 8 | ============= |
| 9 | |
| 10 | Patrole testing scope is strictly confined to Role-Based Access Control |
| 11 | (RBAC). In OpenStack, ``oslo.policy`` is the RBAC library used by all |
| 12 | major services. Thus, Patrole is concerned with validating that public API |
| 13 | endpoints are correctly using ``oslo.policy`` for authorization. |
| 14 | |
| 15 | In other words, all tests in Patrole are RBAC tests. |
| 16 | |
| 17 | Stable Tests |
| 18 | ============ |
| 19 | |
| 20 | In the discussion below, "correct" means that a test is consistent with |
| 21 | a service's API-to-policy mapping and "stable" means that a test should |
| 22 | require minimal maintenance for the supported releases. |
| 23 | |
| 24 | Present |
| 25 | ------- |
| 26 | |
| 27 | During the Queens release, a `governance spec`_ was pushed to support policy |
| 28 | in code, which documents the mapping between APIs and each of their policies. |
| 29 | |
| 30 | This documentation is an important prerequisite for ensuring that Patrole |
| 31 | tests for a given service are correct. This mapping can be referenced to |
| 32 | confirm that Patrole's assumed mapping for a test is correct. For |
| 33 | example, Nova has implemented policy in code which can be used to verify |
| 34 | that Patrole's Nova RBAC tests use the same mapping. |
| 35 | |
| 36 | If a given service does not have policy in code, this implies that it is |
| 37 | *more likely* that the RBAC tests for that service are inconsistent with the |
| 38 | *intended* policy mapping. Until that service implements policy in code, it |
| 39 | is difficult for Patrole maintainers to verify that tests for that service |
| 40 | are correct. |
| 41 | |
| 42 | Future |
| 43 | ------ |
| 44 | |
| 45 | Once all services that Patrole tests have implemented policy in code -- |
| 46 | and once Patrole has updated all its tests in accordance with the policy in |
| 47 | code documentation -- then Patrole tests can guaranteed to be stable. |
| 48 | |
| 49 | This stability will be denoted with a 1.0 version release. |
| 50 | |
| 51 | .. _governance spec: https://governance.openstack.org/tc/goals/queens/policy-in-code.html |