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 |
Mykola Yakovliev | e0f3550 | 2018-09-26 18:26:57 -0500 | [diff] [blame] | 17 | IFS=',' read -ra roles_array <<< "$RBAC_TEST_ROLES" |
| 18 | RBAC_TEST_ROLES="" |
| 19 | for i in "${roles_array[@]}"; do |
| 20 | if [[ $i == "member" ]]; then |
| 21 | i="Member" |
| 22 | fi |
| 23 | RBAC_TEST_ROLES="$i,$RBAC_TEST_ROLES" |
| 24 | done |
Felipe Monteiro | 2fc2929 | 2018-06-15 18:26:27 -0400 | [diff] [blame] | 25 | |
Felipe Monteiro | 739041f | 2018-03-25 00:24:03 -0400 | [diff] [blame] | 26 | # 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] | 27 | # TODO(felipemonteiro): Remove these once stable/pike becomes EOL. |
Felipe Monteiro | 739041f | 2018-03-25 00:24:03 -0400 | [diff] [blame] | 28 | iniset $TEMPEST_CONFIG policy-feature-enabled create_port_fixed_ips_ip_address_policy False |
| 29 | iniset $TEMPEST_CONFIG policy-feature-enabled update_port_fixed_ips_ip_address_policy False |
| 30 | iniset $TEMPEST_CONFIG policy-feature-enabled limits_extension_used_limits_policy False |
| 31 | iniset $TEMPEST_CONFIG policy-feature-enabled volume_extension_volume_actions_attach_policy False |
| 32 | iniset $TEMPEST_CONFIG policy-feature-enabled volume_extension_volume_actions_reserve_policy False |
| 33 | 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] | 34 | |
Felipe Monteiro | c38aca7 | 2018-10-31 01:21:48 -0400 | [diff] [blame] | 35 | # TODO(cl566n): Remove these once stable/pike becomes EOL. |
Felipe Monteiro | 6bffc5c | 2018-08-19 22:54:33 +0100 | [diff] [blame] | 36 | # These policies were removed in Stein but are available in Pike. |
| 37 | iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_stein False |
Felipe Monteiro | c38aca7 | 2018-10-31 01:21:48 -0400 | [diff] [blame] | 38 | iniset $TEMPEST_CONFIG policy-feature-enabled removed_keystone_policies_stein False |
Chi Lo | 8c04bd8 | 2018-06-01 16:21:50 -0500 | [diff] [blame] | 39 | iniset $TEMPEST_CONFIG policy-feature-enabled added_cinder_policies_stein False |
Rick Bartra | 97fffed | 2019-09-12 13:35:10 -0400 | [diff] [blame] | 40 | |
| 41 | # TODO(rb560u): Remove this once stable/pike becomes EOL. |
| 42 | # Make the 'test_list_trusts' test backwards compatible. |
| 43 | # The Keystone Trust API is enforced differently depending on passed |
| 44 | # arguments |
| 45 | iniset $TEMPEST_CONFIG policy-feature-enabled keystone_policy_enforcement_train False |
Rick Bartra | f8923d1 | 2020-01-02 17:25:30 -0500 | [diff] [blame] | 46 | |
| 47 | # TODO(rb560u): Remove this once stable/pike becomes EOL. |
| 48 | # These policies were removed in Ussuri but are available in Pike. |
| 49 | iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_ussuri False |
Ghanshyam Mann | cfac16a | 2020-07-26 12:48:10 -0500 | [diff] [blame] | 50 | iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_victoria False |
Felipe Monteiro | a44dddf | 2017-05-26 18:39:37 +0100 | [diff] [blame] | 51 | fi |
Felipe Monteiro | 2fc2929 | 2018-06-15 18:26:27 -0400 | [diff] [blame] | 52 | |
| 53 | if [[ ${DEVSTACK_SERIES} == 'queens' ]]; then |
Mykola Yakovliev | e0f3550 | 2018-09-26 18:26:57 -0500 | [diff] [blame] | 54 | IFS=',' read -ra roles_array <<< "$RBAC_TEST_ROLES" |
| 55 | RBAC_TEST_ROLES="" |
| 56 | for i in "${roles_array[@]}"; do |
| 57 | if [[ $i == "member" ]]; then |
| 58 | i="Member" |
| 59 | fi |
| 60 | RBAC_TEST_ROLES="$i,$RBAC_TEST_ROLES" |
| 61 | done |
Felipe Monteiro | 6bffc5c | 2018-08-19 22:54:33 +0100 | [diff] [blame] | 62 | |
Felipe Monteiro | c38aca7 | 2018-10-31 01:21:48 -0400 | [diff] [blame] | 63 | # TODO(cl566n): Remove these once stable/queens becomes EOL. |
Felipe Monteiro | 6bffc5c | 2018-08-19 22:54:33 +0100 | [diff] [blame] | 64 | # These policies were removed in Stein but are available in Queens. |
| 65 | iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_stein False |
Felipe Monteiro | c38aca7 | 2018-10-31 01:21:48 -0400 | [diff] [blame] | 66 | iniset $TEMPEST_CONFIG policy-feature-enabled removed_keystone_policies_stein False |
Chi Lo | 8c04bd8 | 2018-06-01 16:21:50 -0500 | [diff] [blame] | 67 | iniset $TEMPEST_CONFIG policy-feature-enabled added_cinder_policies_stein False |
Rick Bartra | 97fffed | 2019-09-12 13:35:10 -0400 | [diff] [blame] | 68 | |
| 69 | # TODO(rb560u): Remove this once stable/queens becomes EOL. |
| 70 | # Make the 'test_list_trusts' test backwards compatible. |
| 71 | # The Keystone Trust API is enforced differently depending on passed |
| 72 | # arguments |
| 73 | iniset $TEMPEST_CONFIG policy-feature-enabled keystone_policy_enforcement_train False |
Rick Bartra | f8923d1 | 2020-01-02 17:25:30 -0500 | [diff] [blame] | 74 | |
| 75 | # TODO(rb560u): Remove this once stable/queens becomes EOL. |
| 76 | # These policies were removed in Ussuri but are available in Queens. |
| 77 | iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_ussuri False |
Ghanshyam Mann | cfac16a | 2020-07-26 12:48:10 -0500 | [diff] [blame] | 78 | iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_victoria False |
Chi Lo | 8c04bd8 | 2018-06-01 16:21:50 -0500 | [diff] [blame] | 79 | fi |
| 80 | |
| 81 | if [[ ${DEVSTACK_SERIES} == 'rocky' ]]; then |
| 82 | # TODO(cl566n): Policies used by Patrole testing. Remove these once stable/rocky becomes EOL. |
Ghanshyam Mann | 7085622 | 2020-01-03 19:08:08 +0000 | [diff] [blame] | 83 | iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_stein False |
Chi Lo | 8c04bd8 | 2018-06-01 16:21:50 -0500 | [diff] [blame] | 84 | iniset $TEMPEST_CONFIG policy-feature-enabled added_cinder_policies_stein False |
Felipe Monteiro | c38aca7 | 2018-10-31 01:21:48 -0400 | [diff] [blame] | 85 | iniset $TEMPEST_CONFIG policy-feature-enabled removed_keystone_policies_stein False |
Rick Bartra | 97fffed | 2019-09-12 13:35:10 -0400 | [diff] [blame] | 86 | |
| 87 | # TODO(rb560u): Remove this once stable/rocky becomes EOL. |
| 88 | # Make the 'test_list_trusts' test backwards compatible. |
| 89 | # The Keystone Trust API is enforced differently depending on passed |
| 90 | # arguments |
| 91 | iniset $TEMPEST_CONFIG policy-feature-enabled keystone_policy_enforcement_train False |
Rick Bartra | f8923d1 | 2020-01-02 17:25:30 -0500 | [diff] [blame] | 92 | |
| 93 | # TODO(rb560u): Remove this once stable/rocky becomes EOL. |
| 94 | # These policies were removed in Ussuri but are available in Rocky. |
| 95 | iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_ussuri False |
Ghanshyam Mann | cfac16a | 2020-07-26 12:48:10 -0500 | [diff] [blame] | 96 | iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_victoria False |
Rick Bartra | 97fffed | 2019-09-12 13:35:10 -0400 | [diff] [blame] | 97 | fi |
| 98 | |
| 99 | if [[ ${DEVSTACK_SERIES} == 'stein' ]]; then |
| 100 | # TODO(rb560u): Remove this once stable/stein becomes EOL. |
| 101 | # Make the 'test_list_trusts' test backwards compatible. |
| 102 | # The Keystone Trust API is enforced differently depending on passed |
| 103 | # arguments |
| 104 | iniset $TEMPEST_CONFIG policy-feature-enabled keystone_policy_enforcement_train False |
Rick Bartra | f8923d1 | 2020-01-02 17:25:30 -0500 | [diff] [blame] | 105 | |
| 106 | # TODO(rb560u): Remove this once stable/stein becomes EOL. |
| 107 | # These policies were removed in Ussuri but are available in Stein. |
| 108 | iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_ussuri False |
Ghanshyam Mann | cfac16a | 2020-07-26 12:48:10 -0500 | [diff] [blame] | 109 | iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_victoria False |
Felipe Monteiro | 2fc2929 | 2018-06-15 18:26:27 -0400 | [diff] [blame] | 110 | fi |
| 111 | |
Ghanshyam Mann | 6d97d0f | 2020-01-06 19:58:59 +0000 | [diff] [blame] | 112 | if [[ ${DEVSTACK_SERIES} == 'train' ]]; then |
| 113 | # Remove this once stable/train becomes EOL. |
| 114 | iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_ussuri False |
Ghanshyam Mann | cfac16a | 2020-07-26 12:48:10 -0500 | [diff] [blame] | 115 | iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_victoria False |
| 116 | fi |
| 117 | |
| 118 | if [[ ${DEVSTACK_SERIES} == 'ussuri' ]]; then |
| 119 | # Remove this once stable/ussuri becomes EOL. |
| 120 | iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_victoria False |
Ghanshyam Mann | 6d97d0f | 2020-01-06 19:58:59 +0000 | [diff] [blame] | 121 | fi |
| 122 | |
Mykola Yakovliev | e0f3550 | 2018-09-26 18:26:57 -0500 | [diff] [blame] | 123 | iniset $TEMPEST_CONFIG patrole rbac_test_roles $RBAC_TEST_ROLES |
Felipe Monteiro | a44dddf | 2017-05-26 18:39:37 +0100 | [diff] [blame] | 124 | } |
| 125 | |
| 126 | if is_service_enabled tempest; then |
| 127 | if [[ "$1" == "stack" && "$2" == "test-config" ]]; then |
| 128 | echo_summary "Installing Patrole Tempest plugin" |
| 129 | install_patrole_tempest_plugin |
| 130 | fi |
| 131 | fi |
| 132 | |
| 133 | # Restore xtrace |
| 134 | $XTRACE |