blob: 7c641d28e5b868e915ee0eea163be15102bd3439 [file] [log] [blame]
Anthony Youngccd4ea32011-11-08 17:25:12 -06001#!/bin/bash
2
3EXECUTOR_NUMBER=$1
4CONFIGURATION=$2
Anthony Young6ecc4f22011-11-09 22:38:48 -08005ADAPTER=$3
Anthony Young053906d2011-11-10 11:38:09 -08006RC=$4
Anthony Youngccd4ea32011-11-08 17:25:12 -06007
8function usage() {
9 echo "Usage: $0 - Build a test configuration"
10 echo ""
Anthony Young053906d2011-11-10 11:38:09 -080011 echo "$0 [EXECUTOR_NUMBER] [CONFIGURATION] [ADAPTER] [RC (optional)]"
Anthony Youngccd4ea32011-11-08 17:25:12 -060012 exit 1
13}
14
15# Validate inputs
Anthony Young0ae5fd02011-11-09 22:39:56 -080016if [[ "$EXECUTOR_NUMBER" = "" || "$CONFIGURATION" = "" || "$ADAPTER" = "" ]]; then
Anthony Youngccd4ea32011-11-08 17:25:12 -060017 usage
18fi
19
20# This directory
21CUR_DIR=$(cd $(dirname "$0") && pwd)
22
23# devstack directory
24cd ../../..
25TOP_DIR=(pwd)
26
27# Name test instance based on executor
Anthony Young6ecc4f22011-11-09 22:38:48 -080028BASE_NAME=executor-`printf "%02d" $EXECUTOR_NUMBER`
29GUEST_NAME=$BASE_NAME.$ADAPTER
Anthony Youngdbcdf902011-11-10 11:14:16 -080030virsh list | grep $BASE_NAME | cut -d " " -f1 | xargs -n 1 virsh destroy || true
31virsh net-list | grep $BASE_NAME | cut -d " " -f1 | xargs -n 1 virsh net-destroy || true
Anthony Youngccd4ea32011-11-08 17:25:12 -060032
33# Configure localrc
34cat <<EOF >localrc
35RECLONE=yes
36GUEST_NETWORK=$EXECUTOR_NUMBER
Anthony Young6ecc4f22011-11-09 22:38:48 -080037GUEST_NAME=$GUEST_NAME
Anthony Youngccd4ea32011-11-08 17:25:12 -060038FLOATING_RANGE=192.168.$EXECUTOR_NUMBER.128/27
39GUEST_CORES=4
Anthony Youngc18af142011-11-09 12:20:37 -080040GUEST_RAM=1000000
Anthony Youngccd4ea32011-11-08 17:25:12 -060041MYSQL_PASSWORD=chicken
42RABBIT_PASSWORD=chicken
43SERVICE_TOKEN=chicken
44ADMIN_PASSWORD=chicken
45USERNAME=admin
46TENANT=admin
Anthony Youngea1a5862011-11-10 11:27:51 -080047NET_NAME=$BASE_NAME
Anthony Young053906d2011-11-10 11:38:09 -080048$RC
Anthony Youngccd4ea32011-11-08 17:25:12 -060049EOF
50cd tools
51sudo ./build_uec.sh