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 | 6bffc5c | 2018-08-19 22:54:33 +0100 | [diff] [blame] | 29 | |
Felipe Monteiro | c38aca7 | 2018-10-31 01:21:48 -0400 | [diff] [blame] | 30 | # TODO(cl566n): Remove these once stable/pike becomes EOL. |
Felipe Monteiro | 6bffc5c | 2018-08-19 22:54:33 +0100 | [diff] [blame] | 31 | # These policies were removed in Stein but are available in Pike. |
| 32 | iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_stein False |
Felipe Monteiro | c38aca7 | 2018-10-31 01:21:48 -0400 | [diff] [blame] | 33 | iniset $TEMPEST_CONFIG policy-feature-enabled removed_keystone_policies_stein False |
Chi Lo | 8c04bd8 | 2018-06-01 16:21:50 -0500 | [diff] [blame] | 34 | iniset $TEMPEST_CONFIG policy-feature-enabled added_cinder_policies_stein False |
Felipe Monteiro | a44dddf | 2017-05-26 18:39:37 +0100 | [diff] [blame] | 35 | fi |
Felipe Monteiro | 2fc2929 | 2018-06-15 18:26:27 -0400 | [diff] [blame] | 36 | |
| 37 | if [[ ${DEVSTACK_SERIES} == 'queens' ]]; then |
| 38 | if [[ "$RBAC_TEST_ROLE" == "member" ]]; then |
| 39 | RBAC_TEST_ROLE="Member" |
| 40 | fi |
Felipe Monteiro | 6bffc5c | 2018-08-19 22:54:33 +0100 | [diff] [blame] | 41 | |
Felipe Monteiro | c38aca7 | 2018-10-31 01:21:48 -0400 | [diff] [blame] | 42 | # TODO(cl566n): Remove these once stable/queens becomes EOL. |
Felipe Monteiro | 6bffc5c | 2018-08-19 22:54:33 +0100 | [diff] [blame] | 43 | # These policies were removed in Stein but are available in Queens. |
| 44 | iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_stein False |
Felipe Monteiro | c38aca7 | 2018-10-31 01:21:48 -0400 | [diff] [blame] | 45 | iniset $TEMPEST_CONFIG policy-feature-enabled removed_keystone_policies_stein False |
Chi Lo | 8c04bd8 | 2018-06-01 16:21:50 -0500 | [diff] [blame] | 46 | iniset $TEMPEST_CONFIG policy-feature-enabled added_cinder_policies_stein False |
| 47 | fi |
| 48 | |
| 49 | if [[ ${DEVSTACK_SERIES} == 'rocky' ]]; then |
| 50 | # TODO(cl566n): Policies used by Patrole testing. Remove these once stable/rocky becomes EOL. |
| 51 | iniset $TEMPEST_CONFIG policy-feature-enabled added_cinder_policies_stein False |
Felipe Monteiro | c38aca7 | 2018-10-31 01:21:48 -0400 | [diff] [blame] | 52 | iniset $TEMPEST_CONFIG policy-feature-enabled removed_keystone_policies_stein False |
Felipe Monteiro | 2fc2929 | 2018-06-15 18:26:27 -0400 | [diff] [blame] | 53 | fi |
| 54 | |
Felipe Monteiro | 2fc2929 | 2018-06-15 18:26:27 -0400 | [diff] [blame] | 55 | iniset $TEMPEST_CONFIG patrole rbac_test_role $RBAC_TEST_ROLE |
Felipe Monteiro | a44dddf | 2017-05-26 18:39:37 +0100 | [diff] [blame] | 56 | } |
| 57 | |
| 58 | if is_service_enabled tempest; then |
| 59 | if [[ "$1" == "stack" && "$2" == "test-config" ]]; then |
| 60 | echo_summary "Installing Patrole Tempest plugin" |
| 61 | install_patrole_tempest_plugin |
| 62 | fi |
| 63 | fi |
| 64 | |
| 65 | # Restore xtrace |
| 66 | $XTRACE |