blob: d56c963703a4fcde446a37689e8732296e890a46 [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 [[ "$RBAC_TEST_ROLE" == "member" ]]; then
17 RBAC_TEST_ROLE="Member"
18 fi
Felipe Monteiroa44dddf2017-05-26 18:39:37 +010019
Felipe Monteiro739041f2018-03-25 00:24:03 -040020 iniset $TEMPEST_CONFIG patrole enable_rbac True
21 iniset $TEMPEST_CONFIG patrole rbac_test_role $RBAC_TEST_ROLE
22
23 if [[ ${DEVSTACK_SERIES} == 'pike' ]]; then
24 # Policies used by Patrole testing that were changed in a backwards-incompatible way.
25 # TODO(fmontei): Remove these once stable/pike becomes EOL.
26 iniset $TEMPEST_CONFIG policy-feature-enabled create_port_fixed_ips_ip_address_policy False
27 iniset $TEMPEST_CONFIG policy-feature-enabled update_port_fixed_ips_ip_address_policy False
28 iniset $TEMPEST_CONFIG policy-feature-enabled limits_extension_used_limits_policy False
29 iniset $TEMPEST_CONFIG policy-feature-enabled volume_extension_volume_actions_attach_policy False
30 iniset $TEMPEST_CONFIG policy-feature-enabled volume_extension_volume_actions_reserve_policy False
31 iniset $TEMPEST_CONFIG policy-feature-enabled volume_extension_volume_actions_unreserve_policy False
Felipe Monteiroa44dddf2017-05-26 18:39:37 +010032 fi
33}
34
35if is_service_enabled tempest; then
36 if [[ "$1" == "stack" && "$2" == "test-config" ]]; then
37 echo_summary "Installing Patrole Tempest plugin"
38 install_patrole_tempest_plugin
39 fi
40fi
41
42# Restore xtrace
43$XTRACE