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