5
# Set serverstack defaults, if not already set.
6
[[ -z "$GATEWAY" ]] && export GATEWAY="10.5.0.1"
7
[[ -z "$CIDR_EXT" ]] && export CIDR_EXT="10.5.0.0/16"
8
[[ -z "$FIP_RANGE" ]] && export FIP_RANGE="10.5.150.0:10.5.200.254"
9
[[ -z "$NAMESERVER" ]] && export NAMESERVER="10.245.160.2"
10
[[ -z "$CIDR_PRIV" ]] && export CIDR_PRIV="192.168.21.0/24"
12
# Accept network type as first parameter, assume gre if unspecified
5
13
net_type=${1:-"gre"}
6
# Add extra port to quantum-gateway and configure charm to use it
15
# Add extra port to overcloud neutron-gateway and configure charm to use it
8
17
./bin/post-deploy-config
10
# Configure neutron networking on serverstack
19
# Configure neutron networking on overcloud
12
./bin/quantum-ext-net --network-type $net_type -g 10.5.0.1 -c 10.5.0.0/16 -f 10.5.150.0:10.5.200.254 ext_net
13
./bin/quantum-tenant-net --network-type $net_type -t admin -r provider-router -N 10.245.160.2 private 192.168.21.0/24
21
./bin/quantum-ext-net --network-type $net_type -g $GATEWAY -c $CIDR_EXT -f $FIP_RANGE ext_net
22
./bin/quantum-tenant-net --network-type $net_type -t admin -r provider-router -N $NAMESERVER private $CIDR_PRIV
24
# Download images if not already present
26
[ -f ~/images/vivid-server-cloudimg-amd64-disk1.img ] || {
27
wget -O ~/images/vivid-server-cloudimg-amd64-disk1.img http://cloud-images.ubuntu.com/vivid/current/vivid-server-cloudimg-amd64-disk1.img
15
29
[ -f ~/images/utopic-server-cloudimg-amd64-disk1.img ] || {
16
30
wget -O ~/images/utopic-server-cloudimg-amd64-disk1.img http://cloud-images.ubuntu.com/utopic/current/utopic-server-cloudimg-amd64-disk1.img
29
43
(cd ~/images && tar -xzf cirros-0.3.3-x86_64-uec.tar.gz)
32
# Load an image for testing
46
# Upload glance images to overcloud
47
glance image-create --name="vivid" --is-public=true --progress \
48
--container-format=bare --disk-format=qcow2 < ~/images/vivid-server-cloudimg-amd64-disk1.img
33
49
glance image-create --name="utopic" --is-public=true --progress \
34
50
--container-format=bare --disk-format=qcow2 < ~/images/utopic-server-cloudimg-amd64-disk1.img
35
51
glance image-create --name="trusty" --is-public=true --progress \
39
55
glance image-create --name="cirros" --is-public=true --progress \
40
56
--container-format=bare --disk-format=qcow2 < ~/images/cirros-0.3.3-x86_64-disk.img
58
# Create demo/testing users, tenants and flavor
42
59
keystone tenant-create --name demo
43
60
keystone user-create --name demo --tenant demo --pass pass --enabled true --email demo@dev.null
44
61
keystone user-role-add --user demo --role Member --tenant demo || :
49
66
nova flavor-create m1.cirros 6 64 1 1
68
# Gather vars for tempest template
51
69
access=$(keystone --os-username demo --os-password pass --os-tenant-name demo ec2-credentials-create | grep access | awk '{ print $4 }')
52
70
secret=$(keystone ec2-credentials-get --access $access | grep secret | awk '{ print $4 }')
53
71
image_id=$(glance image-list | grep cirros | awk '{ print $2 }')
59
77
ncc=$(juju-deployer -f nova-cloud-controller)
60
78
http=${OS_AUTH_PROTOCOL:-http}
80
# Insert vars into tempest conf
62
81
sed -e "s/__IMAGE_ID__/$image_id/g" -e "s/__IMAGE_ALT_ID__/$image_alt_id/g" \
63
82
-e "s/__DASHBOARD__/$dashboard/g" -e "s/__KEYSTONE__/$keystone/g" \
64
83
-e "s/__EXT_NET__/$ext_net/g" -e "s/__PROTO__/$http/g" \
65
84
-e "s/__NCC__/$ncc/g" -e "s/__SECRET__/$secret/g" -e "s/__ACCESS__/$access/g" \
66
tempest.conf.template > tempest.conf
85
tempest-templates/tempest.conf.template > tempest.conf
87
# Install dependencies and CLI tools
88
# See also requirements.txt in tempest (probably need to sudo pip install -r requirements.txt)
68
89
sudo apt-get install git testrepository subunit python-nose python-lxml python-boto \
69
90
python-junitxml python-subunit python-testresources python-oslotest python-stevedore \
70
91
python-cinderclient python-glanceclient python-heatclient python-keystoneclient \
71
92
python-neutronclient python-novaclient python-swiftclient python-ceilometerclient \
72
93
openvswitch-test openvswitch-common -y
95
# Git tempest, place the rendered tempest template
74
96
[ -d tempest ] || git clone https://github.com/openstack/tempest
75
97
cp tempest.conf tempest/etc