blob: 4826d21fed9534067f309a46840af58af0a1864e [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
30 # These policies were removed in Stein but are available in Pike.
31 iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_stein False
Felipe Monteiroa44dddf2017-05-26 18:39:37 +010032 fi
Felipe Monteiro2fc29292018-06-15 18:26:27 -040033
34 if [[ ${DEVSTACK_SERIES} == 'queens' ]]; then
35 if [[ "$RBAC_TEST_ROLE" == "member" ]]; then
36 RBAC_TEST_ROLE="Member"
37 fi
Felipe Monteiro6bffc5c2018-08-19 22:54:33 +010038
39 # These policies were removed in Stein but are available in Queens.
40 iniset $TEMPEST_CONFIG policy-feature-enabled removed_nova_policies_stein False
Felipe Monteiro2fc29292018-06-15 18:26:27 -040041 fi
42
43 iniset $TEMPEST_CONFIG patrole enable_rbac True
44 iniset $TEMPEST_CONFIG patrole rbac_test_role $RBAC_TEST_ROLE
Felipe Monteiroa44dddf2017-05-26 18:39:37 +010045}
46
47if is_service_enabled tempest; then
48 if [[ "$1" == "stack" && "$2" == "test-config" ]]; then
49 echo_summary "Installing Patrole Tempest plugin"
50 install_patrole_tempest_plugin
51 fi
52fi
53
54# Restore xtrace
55$XTRACE