Patrole devstack plugin
Adds devstack plugin for Patrole in order to correctly deploy
Patrole.
This commit:
- Adds the plugin.sh for orchestrating Patrole installation
via devstack
- The settings file for declaring global variables; allow
RBAC_TEST_ROLE to be overriden by global variable
RBAC_TEST_ROLE (i.e. export RBAC_TEST_ROLE=Member
from shell will override the rbac role at run time)
- Removes pre/post_test_hook since that logic is now
handled by updated infra jobs [0] and by
the devstack patrole plugin.
[0] https://review.openstack.org/#/c/468939/3/jenkins/jobs/patrole.yaml
Change-Id: I38c02cbcfea9334c9c0c10096e383efa9a9fc474
Implements: blueprint patrole-devstack-plugin
diff --git a/devstack/plugin.sh b/devstack/plugin.sh
new file mode 100644
index 0000000..1066136
--- /dev/null
+++ b/devstack/plugin.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+# Plugin file for Patrole Tempest plugin
+# --------------------------------------
+
+# Dependencies:
+# ``functions`` file
+# ``DEST`` must be defined
+
+# Save trace setting
+XTRACE=$(set +o | grep xtrace)
+set -o xtrace
+
+function install_patrole_tempest_plugin() {
+ if is_service_enabled tempest; then
+ setup_package $PATROLE_DIR -e
+
+ if [[ "$RBAC_TEST_ROLE" == "member" ]]; then
+ RBAC_TEST_ROLE="Member"
+ fi
+
+ iniset $TEMPEST_CONFIG rbac enable_rbac True
+ iniset $TEMPEST_CONFIG rbac rbac_test_role $RBAC_TEST_ROLE
+ iniset $TEMPEST_CONFIG rbac strict_policy_check False
+ fi
+}
+
+if is_service_enabled tempest; then
+ if [[ "$1" == "stack" && "$2" == "test-config" ]]; then
+ echo_summary "Installing Patrole Tempest plugin"
+ install_patrole_tempest_plugin
+ fi
+fi
+
+# Restore xtrace
+$XTRACE