Felipe Monteiro | a44dddf | 2017-05-26 18:39:37 +0100 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | # Plugin file for Patrole Tempest plugin |
| 3 | # -------------------------------------- |
| 4 | |
| 5 | # Dependencies: |
| 6 | # ``functions`` file |
| 7 | # ``DEST`` must be defined |
| 8 | |
| 9 | # Save trace setting |
| 10 | XTRACE=$(set +o | grep xtrace) |
| 11 | set -o xtrace |
| 12 | |
| 13 | function install_patrole_tempest_plugin() { |
| 14 | if is_service_enabled tempest; then |
| 15 | setup_package $PATROLE_DIR -e |
| 16 | |
| 17 | if [[ "$RBAC_TEST_ROLE" == "member" ]]; then |
| 18 | RBAC_TEST_ROLE="Member" |
| 19 | fi |
| 20 | |
| 21 | iniset $TEMPEST_CONFIG rbac enable_rbac True |
| 22 | iniset $TEMPEST_CONFIG rbac rbac_test_role $RBAC_TEST_ROLE |
| 23 | iniset $TEMPEST_CONFIG rbac strict_policy_check False |
| 24 | fi |
| 25 | } |
| 26 | |
| 27 | if is_service_enabled tempest; then |
| 28 | if [[ "$1" == "stack" && "$2" == "test-config" ]]; then |
| 29 | echo_summary "Installing Patrole Tempest plugin" |
| 30 | install_patrole_tempest_plugin |
| 31 | fi |
| 32 | fi |
| 33 | |
| 34 | # Restore xtrace |
| 35 | $XTRACE |