blob: 550d2ce9410d1235904c82be5bc642ae9644d6bb [file] [log] [blame]
Felipe Monteiro8a5f69a2017-07-14 20:12:33 +01001.. _patrole-configuration:
2
3Patrole Configuration Guide
4===========================
5
6Patrole can be customized by updating Tempest's ``tempest.conf`` configuration
7file. All Patrole-specific configuration options should be included under
8the ``rbac`` group.
9
10RBAC Test Role
11--------------
12
13The RBAC test role governs which role is used when running Patrole tests. For
14example, setting ``rbac_test_role`` to "admin" will execute all RBAC tests
15using admin credentials. Changing the ``rbac_test_role`` value will `override`
16Tempest's primary credentials to use that role.
17
18This implies that, if ``rbac_test_role`` is "admin", regardless of the Tempest
19credentials used by a client, the client will be calling APIs using the admin
20role. That is, ``self.os_primary.servers_client`` will run as though it were
21``self.os_admin.servers_client``.
22
23Similarly, setting ``rbac_test_role`` to a non-admin role results in Tempest's
24primary credentials being overriden by the role specified by
25``rbac_test_role``.
26
27.. note::
28
29 Only the role of the primary Tempest credentials ("os_primary") is
30 modified. The ``user_id`` and ``project_id`` remain unchanged.
31
32Enable RBAC
33-----------
34
35Given the value of ``enable_rbac``, enables or disables Patrole tests. If
36``enable_rbac`` is ``False``, then Patrole tests are skipped.
37
38Strict Policy Check
39-------------------
40
41Currently, many services define their "default" rule to be "anyone allowed".
42If a policy action is not explicitly defined in a policy file, then
43``oslo.policy`` will fall back to the "default" rule. This implies that if
44there's a typo in a policy action specified in a Patrole test, ``oslo.policy``
45can report that the ``rbac_test_role`` will be able to perform the
46non-existent policy action. For a testing framework, this is undesirable
47behavior.
48
49Hence, ``strict_policy_check``, if ``True``, will throw an error in the event
50that a non-existent or bogus policy action is passed to a Patrole test. If
51``False``, however, a ``self.skipException`` will be raised.
52
53Custom Policy Files
54-------------------
55
56Patrole supports testing custom policy file definitions, along with default
57policy definitions. Default policy definitions are used if custom file
58definitions are not specified. If both are specified, the custom policy
59definition takes precedence (that is, replaces the default definition,
60as this is the default behavior in OpenStack).
61
62The ``custom_policy_files`` option allows a user to specify a comma-separated
63list of custom policy file locations that are on the same host as Patrole.
64Each policy file must include the name of the service that is being tested:
65for example, if "compute" tests are executed, then Patrole will use the first
66policy file contained in ``custom_policy_files`` that contains the "nova"
67keyword.
68
69.. note::
70
71 Patrole currently does not support policy files located on a host different
72 than the one on which it is running.
73..