hacking: Add hacking rule for plugin rbac test class names

This patch set introduces a new hacking check called
`no_plugin_rbac_test_suffix_in_plugin_test_class_name` which
is responsible for enforcing that all plugin rbac test classes
end in the correct suffix in order to avoid issues like [0].

Basically, some network plugin rbac tests were skipping because
the regex in .zuul.yaml was not selecting them because the
classes were improperly named. This is to avoid that regression.

Updates documentation with P104 - alias for this new hacking
rule - and adds unit tests to validate its logic.

[0] https://review.openstack.org/#/c/612197/

Change-Id: Ia50edbe5aeb25e57756e9579da8270396bba718c
diff --git a/patrole_tempest_plugin/hacking/checks.py b/patrole_tempest_plugin/hacking/checks.py
index d106da8..853d65c 100644
--- a/patrole_tempest_plugin/hacking/checks.py
+++ b/patrole_tempest_plugin/hacking/checks.py
@@ -36,6 +36,7 @@
 RULE_VALIDATION_DECORATOR = re.compile(
     r'\s*@rbac_rule_validation.action\(.*')
 IDEMPOTENT_ID_DECORATOR = re.compile(r'\s*@decorators\.idempotent_id\((.*)\)')
+PLUGIN_RBAC_TEST = re.compile(r"class .+\(.+PluginRbacTest\)")
 
 have_rbac_decorator = False
 
@@ -211,6 +212,20 @@
             return 0, "Do not use 'self.client' as a service client alias"
 
 
+def no_plugin_rbac_test_suffix_in_plugin_test_class_name(physical_line,
+                                                         filename):
+    """Check that Plugin RBAC class names end with "PluginRbacTest"
+
+    P104
+    """
+    if "patrole_tempest_plugin/tests/api" in filename:
+        if PLUGIN_RBAC_TEST.match(physical_line):
+            subclass = physical_line.split('(')[0]
+            if not subclass.endswith("PluginRbacTest"):
+                error = "Plugin RBAC test classes must end in 'PluginRbacTest'"
+                return len(subclass) - 1, error
+
+
 def factory(register):
     register(import_no_clients_in_api_tests)
     register(no_setup_teardown_class_for_tests)
@@ -223,3 +238,4 @@
     register(no_rbac_rule_validation_decorator)
     register(no_rbac_suffix_in_test_filename)
     register(no_rbac_test_suffix_in_test_class_name)
+    register(no_plugin_rbac_test_suffix_in_plugin_test_class_name)