blob: d61c78dcb25cdf5f64d1bcf88721448804daedb9 [file] [log] [blame]
Felipe Monteirof9ace2b2018-02-27 09:43:51 -05001.. _patrole-testing:
2
3===============
4Patrole Testing
5===============
6
7Testing Scope
8=============
9
10Patrole testing scope is strictly confined to Role-Based Access Control
11(RBAC). In OpenStack, ``oslo.policy`` is the RBAC library used by all
12major services. Thus, Patrole is concerned with validating that public API
13endpoints are correctly using ``oslo.policy`` for authorization.
14
15In other words, all tests in Patrole are RBAC tests.
16
17Stable Tests
18============
19
20In the discussion below, "correct" means that a test is consistent with
21a service's API-to-policy mapping and "stable" means that a test should
22require minimal maintenance for the supported releases.
23
24Present
25-------
26
27During the Queens release, a `governance spec`_ was pushed to support policy
28in code, which documents the mapping between APIs and each of their policies.
29
30This documentation is an important prerequisite for ensuring that Patrole
31tests for a given service are correct. This mapping can be referenced to
32confirm that Patrole's assumed mapping for a test is correct. For
33example, Nova has implemented policy in code which can be used to verify
34that Patrole's Nova RBAC tests use the same mapping.
35
36If 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
39is difficult for Patrole maintainers to verify that tests for that service
40are correct.
41
42Future
43------
44
45Once all services that Patrole tests have implemented policy in code --
46and once Patrole has updated all its tests in accordance with the policy in
47code documentation -- then Patrole tests can guaranteed to be stable.
48
49This 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