Felipe Monteiro | 313a7f8 | 2017-03-03 09:27:42 -0500 | [diff] [blame] | 1 | #!/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 | |
| 19 | sudo chown -R jenkins:stack $BASE/new/tempest |
| 20 | sudo chown -R jenkins:stack $BASE/data/tempest |
| 21 | |
| 22 | # Import devstack function 'iniset' |
| 23 | source $BASE/new/devstack/functions |
| 24 | |
| 25 | export 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). |
| 29 | RBAC_ROLE=$1 |
| 30 | |
| 31 | if [[ "$RBAC_ROLE" == "member" ]]; then |
| 32 | $RBAC_ROLE = "Member" |
| 33 | fi |
| 34 | |
| 35 | # Set rbac_flag=True under [rbac] section in tempest.conf |
| 36 | iniset $TEMPEST_CONFIG rbac rbac_flag True |
| 37 | |
| 38 | # Set rbac_test_role=$RBAC_ROLE under [rbac] section in tempest.conf |
| 39 | iniset $TEMPEST_CONFIG rbac rbac_test_role $RBAC_ROLE |