Add support for multiple policy files
Most of the neutron plugins provide an updated version of policy.json
file with full list of rules, but at the same time there are a lot of
other plugins which provide their own policy files and store them in
the policy.d/ folder: neutron-fwaas, networking-bgpvpn, vmware-nsx,
ect...
To implement the tests for such plugins the Patrole should be able to
load and merge multiple policy files for any of the services.
Modify the discover_policy_files function to discover all policy files
for each of the services. Using glob.glob() function makes it possible
to use patterns like '*.json' to discover the policy files.
Modify the _get_policy_data function to load a data from all discovered
policy files for a service.
Update the unit test according to the changes.
Change-Id: Ib24f3d6d7a5ffdeaecce579af9795fd897dce872
diff --git a/patrole_tempest_plugin/config.py b/patrole_tempest_plugin/config.py
index 47b76d4..5818843 100644
--- a/patrole_tempest_plugin/config.py
+++ b/patrole_tempest_plugin/config.py
@@ -39,8 +39,9 @@
help="""List of the paths to search for policy files. Each
policy path assumes that the service name is included in the path once. Also
assumes Patrole is on the same host as the policy files. The paths should be
-ordered by precedence, with high-priority paths before low-priority paths. The
-first path that is found to contain the service's policy file will be used.
+ordered by precedence, with high-priority paths before low-priority paths. All
+the paths that are found to contain the service's policy file will be used and
+all policy files will be merged.
"""),
cfg.BoolOpt('test_custom_requirements',
default=False,