blob: bd0068b076067bc92562849d845f7d8ad1e160d6 [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 Monteiroa44dddf2017-05-26 18:39:37 +010029 fi
Felipe Monteiro2fc29292018-06-15 18:26:27 -040030
31 if [[ ${DEVSTACK_SERIES} == 'queens' ]]; then
32 if [[ "$RBAC_TEST_ROLE" == "member" ]]; then
33 RBAC_TEST_ROLE="Member"
34 fi
35 fi
36
37 iniset $TEMPEST_CONFIG patrole enable_rbac True
38 iniset $TEMPEST_CONFIG patrole rbac_test_role $RBAC_TEST_ROLE
Felipe Monteiroa44dddf2017-05-26 18:39:37 +010039}
40
41if is_service_enabled tempest; then
42 if [[ "$1" == "stack" && "$2" == "test-config" ]]; then
43 echo_summary "Installing Patrole Tempest plugin"
44 install_patrole_tempest_plugin
45 fi
46fi
47
48# Restore xtrace
49$XTRACE