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 | |
Felipe Monteiro | 739041f | 2018-03-25 00:24:03 -0400 | [diff] [blame] | 13 | function install_patrole_tempest_plugin { |
| 14 | setup_package $PATROLE_DIR -e |
Felipe Monteiro | a44dddf | 2017-05-26 18:39:37 +0100 | [diff] [blame] | 15 | |
Felipe Monteiro | 739041f | 2018-03-25 00:24:03 -0400 | [diff] [blame] | 16 | if [[ "$RBAC_TEST_ROLE" == "member" ]]; then |
| 17 | RBAC_TEST_ROLE="Member" |
| 18 | fi |
Felipe Monteiro | a44dddf | 2017-05-26 18:39:37 +0100 | [diff] [blame] | 19 | |
Felipe Monteiro | 739041f | 2018-03-25 00:24:03 -0400 | [diff] [blame] | 20 | iniset $TEMPEST_CONFIG patrole enable_rbac True |
| 21 | iniset $TEMPEST_CONFIG patrole rbac_test_role $RBAC_TEST_ROLE |
| 22 | |
| 23 | if [[ ${DEVSTACK_SERIES} == 'pike' ]]; then |
| 24 | # Policies used by Patrole testing that were changed in a backwards-incompatible way. |
| 25 | # TODO(fmontei): Remove these once stable/pike becomes EOL. |
| 26 | iniset $TEMPEST_CONFIG policy-feature-enabled create_port_fixed_ips_ip_address_policy False |
| 27 | iniset $TEMPEST_CONFIG policy-feature-enabled update_port_fixed_ips_ip_address_policy False |
| 28 | iniset $TEMPEST_CONFIG policy-feature-enabled limits_extension_used_limits_policy False |
| 29 | iniset $TEMPEST_CONFIG policy-feature-enabled volume_extension_volume_actions_attach_policy False |
| 30 | iniset $TEMPEST_CONFIG policy-feature-enabled volume_extension_volume_actions_reserve_policy False |
| 31 | iniset $TEMPEST_CONFIG policy-feature-enabled volume_extension_volume_actions_unreserve_policy False |
Felipe Monteiro | a44dddf | 2017-05-26 18:39:37 +0100 | [diff] [blame] | 32 | fi |
| 33 | } |
| 34 | |
| 35 | if is_service_enabled tempest; then |
| 36 | if [[ "$1" == "stack" && "$2" == "test-config" ]]; then |
| 37 | echo_summary "Installing Patrole Tempest plugin" |
| 38 | install_patrole_tempest_plugin |
| 39 | fi |
| 40 | fi |
| 41 | |
| 42 | # Restore xtrace |
| 43 | $XTRACE |