blob: af71066e4d90c620581a331912a351710b4dff4e [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
Felipe Monteiroa44dddf2017-05-26 18:39:37 +010050 fi
Felipe Monteiro2fc29292018-06-15 18:26:27 -040051
52 if [[ ${DEVSTACK_SERIES} == 'queens' ]]; then
Mykola Yakovlieve0f35502018-09-26 18:26:57 -050053 IFS=',' read -ra roles_array <<< "$RBAC_TEST_ROLES"
54 RBAC_TEST_ROLES=""
55 for i in "${roles_array[@]}"; do
56 if [[ $i == "member" ]]; then
57 i="Member"
58 fi
59 RBAC_TEST_ROLES="$i,$RBAC_TEST_ROLES"
60 done
Felipe Monteiro6bffc5c2018-08-19 22:54:33 +010061
Felipe Monteiroc38aca72018-10-31 01:21:48 -040062 # TODO(cl566n): Remove these once stable/queens becomes EOL.
Felipe Monteiro6bffc5c2018-08-19 22:54:33 +010063 # These policies were removed in Stein but are available in Queens.
64 iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_stein False
Felipe Monteiroc38aca72018-10-31 01:21:48 -040065 iniset $TEMPEST_CONFIG policy-feature-enabled removed_keystone_policies_stein False
Chi Lo8c04bd82018-06-01 16:21:50 -050066 iniset $TEMPEST_CONFIG policy-feature-enabled added_cinder_policies_stein False
Rick Bartra97fffed2019-09-12 13:35:10 -040067
68 # TODO(rb560u): Remove this once stable/queens becomes EOL.
69 # Make the 'test_list_trusts' test backwards compatible.
70 # The Keystone Trust API is enforced differently depending on passed
71 # arguments
72 iniset $TEMPEST_CONFIG policy-feature-enabled keystone_policy_enforcement_train False
Rick Bartraf8923d12020-01-02 17:25:30 -050073
74 # TODO(rb560u): Remove this once stable/queens becomes EOL.
75 # These policies were removed in Ussuri but are available in Queens.
76 iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_ussuri False
Chi Lo8c04bd82018-06-01 16:21:50 -050077 fi
78
79 if [[ ${DEVSTACK_SERIES} == 'rocky' ]]; then
80 # TODO(cl566n): Policies used by Patrole testing. Remove these once stable/rocky becomes EOL.
Ghanshyam Mann70856222020-01-03 19:08:08 +000081 iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_stein False
Chi Lo8c04bd82018-06-01 16:21:50 -050082 iniset $TEMPEST_CONFIG policy-feature-enabled added_cinder_policies_stein False
Felipe Monteiroc38aca72018-10-31 01:21:48 -040083 iniset $TEMPEST_CONFIG policy-feature-enabled removed_keystone_policies_stein False
Rick Bartra97fffed2019-09-12 13:35:10 -040084
85 # TODO(rb560u): Remove this once stable/rocky becomes EOL.
86 # Make the 'test_list_trusts' test backwards compatible.
87 # The Keystone Trust API is enforced differently depending on passed
88 # arguments
89 iniset $TEMPEST_CONFIG policy-feature-enabled keystone_policy_enforcement_train False
Rick Bartraf8923d12020-01-02 17:25:30 -050090
91 # TODO(rb560u): Remove this once stable/rocky becomes EOL.
92 # These policies were removed in Ussuri but are available in Rocky.
93 iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_ussuri False
Rick Bartra97fffed2019-09-12 13:35:10 -040094 fi
95
96 if [[ ${DEVSTACK_SERIES} == 'stein' ]]; then
97 # TODO(rb560u): Remove this once stable/stein becomes EOL.
98 # Make the 'test_list_trusts' test backwards compatible.
99 # The Keystone Trust API is enforced differently depending on passed
100 # arguments
101 iniset $TEMPEST_CONFIG policy-feature-enabled keystone_policy_enforcement_train False
Rick Bartraf8923d12020-01-02 17:25:30 -0500102
103 # TODO(rb560u): Remove this once stable/stein becomes EOL.
104 # These policies were removed in Ussuri but are available in Stein.
105 iniset $TEMPEST_CONFIG policy-feature-enabled changed_nova_policies_ussuri False
Felipe Monteiro2fc29292018-06-15 18:26:27 -0400106 fi
107
Mykola Yakovlieve0f35502018-09-26 18:26:57 -0500108 iniset $TEMPEST_CONFIG patrole rbac_test_roles $RBAC_TEST_ROLES
Felipe Monteiroa44dddf2017-05-26 18:39:37 +0100109}
110
111if is_service_enabled tempest; then
112 if [[ "$1" == "stack" && "$2" == "test-config" ]]; then
113 echo_summary "Installing Patrole Tempest plugin"
114 install_patrole_tempest_plugin
115 fi
116fi
117
118# Restore xtrace
119$XTRACE