2011-11-08 23:25:12 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
EXECUTOR_NUMBER=$1
|
|
|
|
CONFIGURATION=$2
|
2011-11-10 06:38:48 +00:00
|
|
|
ADAPTER=$3
|
2011-11-08 23:25:12 +00:00
|
|
|
|
|
|
|
function usage() {
|
|
|
|
echo "Usage: $0 - Build a test configuration"
|
|
|
|
echo ""
|
2011-11-10 06:38:48 +00:00
|
|
|
echo "$0 [EXECUTOR_NUMBER] [CONFIGURATION] [ADAPTER]"
|
2011-11-08 23:25:12 +00:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
# Validate inputs
|
2011-11-10 06:39:56 +00:00
|
|
|
if [[ "$EXECUTOR_NUMBER" = "" || "$CONFIGURATION" = "" || "$ADAPTER" = "" ]]; then
|
2011-11-08 23:25:12 +00:00
|
|
|
usage
|
|
|
|
fi
|
|
|
|
|
|
|
|
# This directory
|
|
|
|
CUR_DIR=$(cd $(dirname "$0") && pwd)
|
|
|
|
|
|
|
|
# devstack directory
|
|
|
|
cd ../../..
|
|
|
|
TOP_DIR=(pwd)
|
|
|
|
|
|
|
|
# Name test instance based on executor
|
2011-11-10 06:38:48 +00:00
|
|
|
BASE_NAME=executor-`printf "%02d" $EXECUTOR_NUMBER`
|
|
|
|
GUEST_NAME=$BASE_NAME.$ADAPTER
|
|
|
|
virsh destroy `virsh list | grep $BASE_NAME | cut -d " " -f1` || true
|
2011-11-08 23:25:12 +00:00
|
|
|
|
|
|
|
# Configure localrc
|
|
|
|
cat <<EOF >localrc
|
|
|
|
RECLONE=yes
|
|
|
|
GUEST_NETWORK=$EXECUTOR_NUMBER
|
2011-11-10 06:38:48 +00:00
|
|
|
GUEST_NAME=$GUEST_NAME
|
2011-11-08 23:25:12 +00:00
|
|
|
FLOATING_RANGE=192.168.$EXECUTOR_NUMBER.128/27
|
|
|
|
GUEST_CORES=4
|
2011-11-09 20:20:37 +00:00
|
|
|
GUEST_RAM=1000000
|
2011-11-08 23:25:12 +00:00
|
|
|
MYSQL_PASSWORD=chicken
|
|
|
|
RABBIT_PASSWORD=chicken
|
|
|
|
SERVICE_TOKEN=chicken
|
|
|
|
ADMIN_PASSWORD=chicken
|
|
|
|
USERNAME=admin
|
|
|
|
TENANT=admin
|
2011-11-10 07:36:18 +00:00
|
|
|
NET_NAME=$GUEST_NAME
|
2011-11-08 23:25:12 +00:00
|
|
|
EOF
|
|
|
|
cd tools
|
|
|
|
sudo ./build_uec.sh
|