blob: 65d1801f7f41be940f37af08937d4797c41b528b [file] [log] [blame]
Felipe Monteiro313a7f82017-03-03 09:27:42 -05001#!/bin/bash -xe
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15# This script is executed inside post_test_hook function in devstack gate.
16# First argument ($1) expects 'rbac-role' as value for setting appropriate
17# tempest rbac option 'rbac_test_role'.
18
19sudo chown -R jenkins:stack $BASE/new/tempest
20sudo chown -R jenkins:stack $BASE/data/tempest
21
22# Import devstack function 'iniset'
23source $BASE/new/devstack/functions
24
25export TEMPEST_CONFIG=${TEMPEST_CONFIG:-$BASE/new/tempest/etc/tempest.conf}
26
27# First argument is expected to contain value equal either to 'admin' or
28# 'member' (both lower-case).
29RBAC_ROLE=$1
30
31if [[ "$RBAC_ROLE" == "member" ]]; then
32 $RBAC_ROLE = "Member"
33fi
34
35# Set rbac_flag=True under [rbac] section in tempest.conf
36iniset $TEMPEST_CONFIG rbac rbac_flag True
37
38# Set rbac_test_role=$RBAC_ROLE under [rbac] section in tempest.conf
39iniset $TEMPEST_CONFIG rbac rbac_test_role $RBAC_ROLE