blob: 9ccc4d73c188888056d55f5677781f3c1cf0245f [file] [log] [blame]
Felipe Monteiroa44dddf2017-05-26 18:39:37 +01001#!/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
10XTRACE=$(set +o | grep xtrace)
11set -o xtrace
12
Felipe Monteiro739041f2018-03-25 00:24:03 -040013function install_patrole_tempest_plugin {
14 setup_package $PATROLE_DIR -e
Felipe Monteiroa44dddf2017-05-26 18:39:37 +010015
Felipe Monteiro739041f2018-03-25 00:24:03 -040016 if [[ ${DEVSTACK_SERIES} == 'pike' ]]; then
Mykola Yakovlieve0f35502018-09-26 18:26:57 -050017 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 Monteiro2fc29292018-06-15 18:26:27 -040025
Felipe Monteiro739041f2018-03-25 00:24:03 -040026 # Policies used by Patrole testing that were changed in a backwards-incompatible way.
Felipe Monteiro2fc29292018-06-15 18:26:27 -040027 # TODO(felipemonteiro): Remove these once stable/pike becomes EOL.
Felipe Monteiro739041f2018-03-25 00:24:03 -040028 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 Monteiro6bffc5c2018-08-19 22:54:33 +010034
Felipe Monteiroc38aca72018-10-31 01:21:48 -040035 # TODO(cl566n): Remove these once stable/pike becomes EOL.
Felipe Monteiro6bffc5c2018-08-19 22:54:33 +010036 # These policies were removed in Stein but are available in Pike.
37 iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_stein False
Felipe Monteiroc38aca72018-10-31 01:21:48 -040038 iniset $TEMPEST_CONFIG policy-feature-enabled removed_keystone_policies_stein False
Chi Lo8c04bd82018-06-01 16:21:50 -050039 iniset $TEMPEST_CONFIG policy-feature-enabled added_cinder_policies_stein False
Rick Bartra97fffed2019-09-12 13:35:10 -040040
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 Bartraf8923d12020-01-02 17:25:30 -050046
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 Manncfac16a2020-07-26 12:48:10 -050050 iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_victoria False
Ghanshyam Mann1b8838f2020-11-16 19:36:00 -060051
52 # TODO(gmann): Remove these once stable/victoria becomes EOL.
53 # These policies were removed in Wallaby.
54 iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_wallaby False
Felipe Monteiroa44dddf2017-05-26 18:39:37 +010055 fi
Felipe Monteiro2fc29292018-06-15 18:26:27 -040056
57 if [[ ${DEVSTACK_SERIES} == 'queens' ]]; then
Mykola Yakovlieve0f35502018-09-26 18:26:57 -050058 IFS=',' read -ra roles_array <<< "$RBAC_TEST_ROLES"
59 RBAC_TEST_ROLES=""
60 for i in "${roles_array[@]}"; do
61 if [[ $i == "member" ]]; then
62 i="Member"
63 fi
64 RBAC_TEST_ROLES="$i,$RBAC_TEST_ROLES"
65 done
Felipe Monteiro6bffc5c2018-08-19 22:54:33 +010066
Felipe Monteiroc38aca72018-10-31 01:21:48 -040067 # TODO(cl566n): Remove these once stable/queens becomes EOL.
Felipe Monteiro6bffc5c2018-08-19 22:54:33 +010068 # These policies were removed in Stein but are available in Queens.
69 iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_stein False
Felipe Monteiroc38aca72018-10-31 01:21:48 -040070 iniset $TEMPEST_CONFIG policy-feature-enabled removed_keystone_policies_stein False
Chi Lo8c04bd82018-06-01 16:21:50 -050071 iniset $TEMPEST_CONFIG policy-feature-enabled added_cinder_policies_stein False
Rick Bartra97fffed2019-09-12 13:35:10 -040072
73 # TODO(rb560u): Remove this once stable/queens becomes EOL.
74 # Make the 'test_list_trusts' test backwards compatible.
75 # The Keystone Trust API is enforced differently depending on passed
76 # arguments
77 iniset $TEMPEST_CONFIG policy-feature-enabled keystone_policy_enforcement_train False
Rick Bartraf8923d12020-01-02 17:25:30 -050078
79 # TODO(rb560u): Remove this once stable/queens becomes EOL.
80 # These policies were removed in Ussuri but are available in Queens.
81 iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_ussuri False
Ghanshyam Manncfac16a2020-07-26 12:48:10 -050082 iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_victoria False
Ghanshyam Mann1b8838f2020-11-16 19:36:00 -060083
84 # TODO(gmann): Remove these once stable/victoria becomes EOL.
85 # These policies were removed in Wallaby.
86 iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_wallaby False
Ghanshyam Mann588c33d2021-09-21 10:09:44 -050087
88 # TODO(gmann): Remove these once stable/xena becomes EOL.
89 iniset $TEMPEST_CONFIG policy-feature-enabled changed_cinder_policies_xena False
Chi Lo8c04bd82018-06-01 16:21:50 -050090 fi
91
92 if [[ ${DEVSTACK_SERIES} == 'rocky' ]]; then
93 # TODO(cl566n): Policies used by Patrole testing. Remove these once stable/rocky becomes EOL.
Ghanshyam Mann70856222020-01-03 19:08:08 +000094 iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_stein False
Chi Lo8c04bd82018-06-01 16:21:50 -050095 iniset $TEMPEST_CONFIG policy-feature-enabled added_cinder_policies_stein False
Felipe Monteiroc38aca72018-10-31 01:21:48 -040096 iniset $TEMPEST_CONFIG policy-feature-enabled removed_keystone_policies_stein False
Rick Bartra97fffed2019-09-12 13:35:10 -040097
98 # TODO(rb560u): Remove this once stable/rocky becomes EOL.
99 # Make the 'test_list_trusts' test backwards compatible.
100 # The Keystone Trust API is enforced differently depending on passed
101 # arguments
102 iniset $TEMPEST_CONFIG policy-feature-enabled keystone_policy_enforcement_train False
Rick Bartraf8923d12020-01-02 17:25:30 -0500103
104 # TODO(rb560u): Remove this once stable/rocky becomes EOL.
105 # These policies were removed in Ussuri but are available in Rocky.
106 iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_ussuri False
Ghanshyam Manncfac16a2020-07-26 12:48:10 -0500107 iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_victoria False
Ghanshyam Mann1b8838f2020-11-16 19:36:00 -0600108
109 # TODO(gmann): Remove these once stable/victoria becomes EOL.
110 # These policies were removed in Wallaby.
111 iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_wallaby False
Ghanshyam Mann588c33d2021-09-21 10:09:44 -0500112
113 # TODO(gmann): Remove these once stable/xena becomes EOL.
114 iniset $TEMPEST_CONFIG policy-feature-enabled changed_cinder_policies_xena False
Rick Bartra97fffed2019-09-12 13:35:10 -0400115 fi
116
117 if [[ ${DEVSTACK_SERIES} == 'stein' ]]; then
118 # TODO(rb560u): Remove this once stable/stein becomes EOL.
119 # Make the 'test_list_trusts' test backwards compatible.
120 # The Keystone Trust API is enforced differently depending on passed
121 # arguments
122 iniset $TEMPEST_CONFIG policy-feature-enabled keystone_policy_enforcement_train False
Rick Bartraf8923d12020-01-02 17:25:30 -0500123
124 # TODO(rb560u): Remove this once stable/stein becomes EOL.
125 # These policies were removed in Ussuri but are available in Stein.
126 iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_ussuri False
Ghanshyam Manncfac16a2020-07-26 12:48:10 -0500127 iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_victoria False
Ghanshyam Mann1b8838f2020-11-16 19:36:00 -0600128
129 # TODO(gmann): Remove these once stable/victoria becomes EOL.
130 # These policies were removed in Wallaby.
131 iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_wallaby False
Ghanshyam Mann588c33d2021-09-21 10:09:44 -0500132 # TODO(gmann): Remove these once stable/xena becomes EOL.
133 iniset $TEMPEST_CONFIG policy-feature-enabled changed_cinder_policies_xena False
Felipe Monteiro2fc29292018-06-15 18:26:27 -0400134 fi
135
Ghanshyam Mann6d97d0f2020-01-06 19:58:59 +0000136 if [[ ${DEVSTACK_SERIES} == 'train' ]]; then
137 # Remove this once stable/train becomes EOL.
138 iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_ussuri False
Ghanshyam Manncfac16a2020-07-26 12:48:10 -0500139 iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_victoria False
Ghanshyam Mann1b8838f2020-11-16 19:36:00 -0600140 # TODO(gmann): Remove these once stable/victoria becomes EOL.
141 # These policies were removed in Wallaby.
142 iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_wallaby False
Ghanshyam Mann588c33d2021-09-21 10:09:44 -0500143 # TODO(gmann): Remove these once stable/xena becomes EOL.
144 iniset $TEMPEST_CONFIG policy-feature-enabled changed_cinder_policies_xena False
Ghanshyam Manncfac16a2020-07-26 12:48:10 -0500145 fi
146
147 if [[ ${DEVSTACK_SERIES} == 'ussuri' ]]; then
148 # Remove this once stable/ussuri becomes EOL.
149 iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_victoria False
Ghanshyam Mann1b8838f2020-11-16 19:36:00 -0600150 # TODO(gmann): Remove these once stable/victoria becomes EOL.
151 # These policies were removed in Wallaby.
152 iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_wallaby False
Ghanshyam Mann588c33d2021-09-21 10:09:44 -0500153 # TODO(gmann): Remove these once stable/xena becomes EOL.
154 iniset $TEMPEST_CONFIG policy-feature-enabled changed_cinder_policies_xena False
Ghanshyam Mann1b8838f2020-11-16 19:36:00 -0600155 fi
156
157 if [[ ${DEVSTACK_SERIES} == 'victoria' ]]; then
158 # TODO(gmann): Remove these once stable/victoria becomes EOL.
159 # These policies were removed in Wallaby.
160 iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_wallaby False
Ghanshyam Mann588c33d2021-09-21 10:09:44 -0500161 # TODO(gmann): Remove these once stable/xena becomes EOL.
162 iniset $TEMPEST_CONFIG policy-feature-enabled changed_cinder_policies_xena False
Ghanshyam Mann6d97d0f2020-01-06 19:58:59 +0000163 fi
Ghanshyam Mann588c33d2021-09-21 10:09:44 -0500164 if [[ ${DEVSTACK_SERIES} == 'wallaby' ]]; then
165 # TODO(gmann): Remove these once stable/xena becomes EOL.
166 iniset $TEMPEST_CONFIG policy-feature-enabled changed_cinder_policies_xena False
167 fi
Mykola Yakovlieve0f35502018-09-26 18:26:57 -0500168 iniset $TEMPEST_CONFIG patrole rbac_test_roles $RBAC_TEST_ROLES
Felipe Monteiroa44dddf2017-05-26 18:39:37 +0100169}
170
171if is_service_enabled tempest; then
172 if [[ "$1" == "stack" && "$2" == "test-config" ]]; then
173 echo_summary "Installing Patrole Tempest plugin"
174 install_patrole_tempest_plugin
175 fi
176fi
177
178# Restore xtrace
179$XTRACE