#!/usr/bin/env bash # # Copyright 2013 Red Hat # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. set -eux set -o pipefail cd /opt/stack/tempest # Tempest needs 2 users, we add them here so that we know their passwords keystone tenant-get demo_t1 || keystone tenant-create --name demo_t1 keystone user-get demo_t1 || keystone user-create --name demo_t1 --tenant demo_t1 --pass secret keystone tenant-get demo_t2 || keystone tenant-create --name demo_t2 keystone user-get demo_t2 || keystone user-create --name demo_t2 --tenant demo_t2 --pass secret # the orchestration tests need this keystone user-role-add --user admin --role admin --tenant demo_t1 || true # Users need either this or the admin role to use swift keystone user-role-add --user demo_t1 --role swiftoperator --tenant demo_t1 || true keystone user-role-add --user demo_t2 --role swiftoperator --tenant demo_t2 || true # We require that a image is present with a name of user USER_IMAGE_ID=$(nova image-show user | grep id | awk '$2=="id" {print $4}') # And then copy it for tempest test that require a second image if ! nova image-show user-copy 2> /dev/null ; then glance image-download user | glance image-create --name user-copy --disk-format qcow2 --container-format bare --is-public 1 fi USER_IMAGE_ID2=$(nova image-show user-copy | grep id | awk '$2=="id" {print $4}') EXTNET=$(neutron net-show ext-net | awk '/ id / {print $4}') # tempest requires two distinct flavors to use, but using m1.small would # increase the amount of memory needed on the compute node. Instead we create # an alternative m1.tiny, this will allow tests with only 4G of memory on # compute nodes. nova flavor-create m1.tiny_alt 99 512 2 1 || true LOCK_PATH=`mktemp -d` trap "rm -rf $LOCK_PATH" EXIT # TODO : see what other defaults can be used # cp the tempest config file and edit the settings cp etc/tempest.conf.sample etc/tempest.conf cat - <