blob: 502b68c69a407e58204605c713bd47eb2c7b6dc6 [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
Felipe Monteiro2fc29292018-06-15 18:26:27 -040017 if [[ "$RBAC_TEST_ROLE" == "member" ]]; then
18 RBAC_TEST_ROLE="Member"
19 fi
20
Felipe Monteiro739041f2018-03-25 00:24:03 -040021 # Policies used by Patrole testing that were changed in a backwards-incompatible way.
Felipe Monteiro2fc29292018-06-15 18:26:27 -040022 # TODO(felipemonteiro): Remove these once stable/pike becomes EOL.
Felipe Monteiro739041f2018-03-25 00:24:03 -040023 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 Monteiro6bffc5c2018-08-19 22:54:33 +010029
Felipe Monteiroc38aca72018-10-31 01:21:48 -040030 # TODO(cl566n): Remove these once stable/pike becomes EOL.
Felipe Monteiro6bffc5c2018-08-19 22:54:33 +010031 # These policies were removed in Stein but are available in Pike.
32 iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_stein False
Felipe Monteiroc38aca72018-10-31 01:21:48 -040033 iniset $TEMPEST_CONFIG policy-feature-enabled removed_keystone_policies_stein False
Chi Lo8c04bd82018-06-01 16:21:50 -050034 iniset $TEMPEST_CONFIG policy-feature-enabled added_cinder_policies_stein False
Felipe Monteiroa44dddf2017-05-26 18:39:37 +010035 fi
Felipe Monteiro2fc29292018-06-15 18:26:27 -040036
37 if [[ ${DEVSTACK_SERIES} == 'queens' ]]; then
38 if [[ "$RBAC_TEST_ROLE" == "member" ]]; then
39 RBAC_TEST_ROLE="Member"
40 fi
Felipe Monteiro6bffc5c2018-08-19 22:54:33 +010041
Felipe Monteiroc38aca72018-10-31 01:21:48 -040042 # TODO(cl566n): Remove these once stable/queens becomes EOL.
Felipe Monteiro6bffc5c2018-08-19 22:54:33 +010043 # These policies were removed in Stein but are available in Queens.
44 iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_stein False
Felipe Monteiroc38aca72018-10-31 01:21:48 -040045 iniset $TEMPEST_CONFIG policy-feature-enabled removed_keystone_policies_stein False
Chi Lo8c04bd82018-06-01 16:21:50 -050046 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 Monteiroc38aca72018-10-31 01:21:48 -040052 iniset $TEMPEST_CONFIG policy-feature-enabled removed_keystone_policies_stein False
Felipe Monteiro2fc29292018-06-15 18:26:27 -040053 fi
54
Felipe Monteiro2fc29292018-06-15 18:26:27 -040055 iniset $TEMPEST_CONFIG patrole rbac_test_role $RBAC_TEST_ROLE
Felipe Monteiroa44dddf2017-05-26 18:39:37 +010056}
57
58if 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
63fi
64
65# Restore xtrace
66$XTRACE