Merge "Move tempest config to lib/tempest"
diff --git a/exercises/boot_from_volume.sh b/exercises/boot_from_volume.sh
index 4c2f279..5ebdecc 100755
--- a/exercises/boot_from_volume.sh
+++ b/exercises/boot_from_volume.sh
@@ -35,7 +35,6 @@
# Import quantum functions if needed
if is_service_enabled quantum; then
source $TOP_DIR/lib/quantum
- setup_quantum
fi
# Import exercise configuration
@@ -174,10 +173,6 @@
# Delete a secgroup
nova secgroup-delete $SECGROUP || die "Failure deleting security group $SECGROUP"
-if is_service_enabled quantum; then
- teardown_quantum
-fi
-
set +o xtrace
echo "*********************************************************************"
echo "SUCCESS: End DevStack Exercise: $0"
diff --git a/exercises/euca.sh b/exercises/euca.sh
index c307a06..67da1be 100755
--- a/exercises/euca.sh
+++ b/exercises/euca.sh
@@ -36,7 +36,6 @@
# Import quantum functions if needed
if is_service_enabled quantum; then
source $TOP_DIR/lib/quantum
- setup_quantum
fi
# Import exercise configuration
@@ -175,10 +174,6 @@
# Delete group
euca-delete-group $SECGROUP || die "Failure deleting security group $SECGROUP"
-if is_service_enabled quantum; then
- teardown_quantum
-fi
-
set +o xtrace
echo "*********************************************************************"
echo "SUCCESS: End DevStack Exercise: $0"
diff --git a/exercises/floating_ips.sh b/exercises/floating_ips.sh
index ae5691f..8b18e6f 100755
--- a/exercises/floating_ips.sh
+++ b/exercises/floating_ips.sh
@@ -34,7 +34,6 @@
# Import quantum functions if needed
if is_service_enabled quantum; then
source $TOP_DIR/lib/quantum
- setup_quantum
fi
# Import exercise configuration
@@ -202,10 +201,6 @@
# Delete a secgroup
nova secgroup-delete $SECGROUP || die "Failure deleting security group $SECGROUP"
-if is_service_enabled quantum; then
- teardown_quantum
-fi
-
set +o xtrace
echo "*********************************************************************"
echo "SUCCESS: End DevStack Exercise: $0"
diff --git a/exercises/quantum-adv-test.sh b/exercises/quantum-adv-test.sh
index 2ee82ff..493e223 100755
--- a/exercises/quantum-adv-test.sh
+++ b/exercises/quantum-adv-test.sh
@@ -58,7 +58,6 @@
# Import quantum fucntions
source $TOP_DIR/lib/quantum
-setup_quantum
# Import exercise configuration
source $TOP_DIR/exerciserc
@@ -475,7 +474,6 @@
}
-teardown_quantum
#-------------------------------------------------------------------------------
# Kick off script.
#-------------------------------------------------------------------------------
diff --git a/exercises/volumes.sh b/exercises/volumes.sh
index 3432763..42f9cb4 100755
--- a/exercises/volumes.sh
+++ b/exercises/volumes.sh
@@ -33,7 +33,6 @@
# Import quantum functions if needed
if is_service_enabled quantum; then
source $TOP_DIR/lib/quantum
- setup_quantum
fi
# Import exercise configuration
@@ -212,10 +211,6 @@
# Delete a secgroup
nova secgroup-delete $SECGROUP || die "Failure deleting security group $SECGROUP"
-if is_service_enabled quantum; then
- teardown_quantum
-fi
-
set +o xtrace
echo "*********************************************************************"
echo "SUCCESS: End DevStack Exercise: $0"
diff --git a/lib/cinder b/lib/cinder
index ce160bf..039c5cb 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -9,12 +9,12 @@
# stack.sh
# ---------
-# install_XXX
-# configure_XXX
-# init_XXX
-# start_XXX
-# stop_XXX
-# cleanup_XXX
+# install_cinder
+# configure_cinder
+# init_cinder
+# start_cinder
+# stop_cinder
+# cleanup_cinder
# Save trace setting
XTRACE=$(set +o | grep xtrace)
@@ -229,7 +229,7 @@
# apply config.d approach (e.g. Oneiric does not have this)
function _configure_tgt_for_config_d() {
if [[ ! -d /etc/tgt/conf.d/ ]]; then
- sudo mkdir /etc/tgt/conf.d
+ sudo mkdir -p /etc/tgt/conf.d
echo "include /etc/tgt/conf.d/*.conf" | sudo tee -a /etc/tgt/targets.conf
fi
}
@@ -237,11 +237,11 @@
# start_cinder() - Start running processes, including screen
function start_cinder() {
if is_service_enabled c-vol; then
+ _configure_tgt_for_config_d
+ if [[ ! -f /etc/tgt/conf.d/stack.conf ]]; then
+ echo "include $CINDER_STATE_PATH/volumes/*" | sudo tee /etc/tgt/conf.d/stack.conf
+ fi
if is_ubuntu; then
- _configure_tgt_for_config_d
- if [[ ! -f /etc/tgt/conf.d/cinder.conf ]]; then
- echo "include $CINDER_STATE_PATH/volumes/*" | sudo tee /etc/tgt/conf.d/cinder.conf
- fi
# tgt in oneiric doesn't restart properly if tgtd isn't running
# do it in two steps
sudo stop tgt || true
diff --git a/lib/quantum b/lib/quantum
index 373d521..14a3a4a 100644
--- a/lib/quantum
+++ b/lib/quantum
@@ -5,9 +5,20 @@
XTRACE=$(set +o | grep xtrace)
set +o xtrace
+QUANTUM_DIR=$DEST/quantum
export QUANTUM_TEST_CONFIG_FILE=${QUANTUM_TEST_CONFIG_FILE:-"/etc/quantum/debug.ini"}
QUANTUM_AUTH_CACHE_DIR=${QUANTUM_AUTH_CACHE_DIR:-/var/cache/quantum}
+if is_service_enabled quantum; then
+ Q_CONF_FILE=/etc/quantum/quantum.conf
+ Q_RR_CONF_FILE=/etc/quantum/rootwrap.conf
+ if [[ "$Q_USE_ROOTWRAP" == "False" ]]; then
+ Q_RR_COMMAND="sudo"
+ else
+ Q_RR_COMMAND="sudo $QUANTUM_DIR/bin/quantum-rootwrap $Q_RR_CONF_FILE"
+ fi
+fi
+
# Configures keystone integration for quantum service and agents
function quantum_setup_keystone() {
local conf_file=$1
@@ -74,7 +85,7 @@
local from_net="$1"
net_id=`_get_net_id $from_net`
probe_id=`quantum-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-list -c id -c network_id | grep $net_id | awk '{print $2}' | head -n 1`
- echo "sudo ip netns exec qprobe-$probe_id"
+ echo "$Q_RR_COMMAND ip netns exec qprobe-$probe_id"
}
function delete_probe() {
@@ -92,9 +103,9 @@
local check_command=""
probe_cmd=`_get_probe_cmd_prefix $from_net`
if [[ "$expected" = "True" ]]; then
- check_command="while ! $probe_cmd ping -c1 -w1 $ip; do sleep 1; done"
+ check_command="while ! $probe_cmd ping -w 1 -c 1 $ip; do sleep 1; done"
else
- check_command="while $probe_cmd ping -c1 -w1 $ip; do sleep 1; done"
+ check_command="while $probe_cmd ping -w 1 -c 1 $ip; do sleep 1; done"
fi
if ! timeout $timeout_sec sh -c "$check_command"; then
if [[ "$expected" = "True" ]]; then
diff --git a/openrc b/openrc
index 4b6b9b2..08ef98b 100644
--- a/openrc
+++ b/openrc
@@ -72,6 +72,3 @@
# set log level to DEBUG (helps debug issues)
# export KEYSTONECLIENT_DEBUG=1
# export NOVACLIENT_DEBUG=1
-
-# set quantum debug command
-export QUANTUM_TEST_CONFIG_FILE=${QUANTUM_TEST_CONFIG_FILE:-"/etc/quantum/debug.ini"}
diff --git a/stack.sh b/stack.sh
index c4f26f4..cddb64e 100755
--- a/stack.sh
+++ b/stack.sh
@@ -321,7 +321,6 @@
OPENSTACKCLIENT_DIR=$DEST/python-openstackclient
NOVNC_DIR=$DEST/noVNC
SWIFT3_DIR=$DEST/swift3
-QUANTUM_DIR=$DEST/quantum
QUANTUM_CLIENT_DIR=$DEST/python-quantumclient
# Default Quantum Plugin
@@ -753,10 +752,6 @@
$DEST/.venv/bin/pip freeze > $DEST/requires-pre-pip
fi
-# Install python requirements
-echo_summary "Installing Python prerequisites"
-pip_install $(get_packages $FILES/pips | sort -u)
-
# Check Out Source
# ----------------
@@ -1153,14 +1148,7 @@
iniset /$Q_PLUGIN_CONF_FILE DATABASE sql_connection $dburl
unset dburl
- Q_CONF_FILE=/etc/quantum/quantum.conf
cp $QUANTUM_DIR/etc/quantum.conf $Q_CONF_FILE
- Q_RR_CONF_FILE=/etc/quantum/rootwrap.conf
- if [[ "$Q_USE_ROOTWRAP" == "False" ]]; then
- Q_RR_COMMAND="sudo"
- else
- Q_RR_COMMAND="sudo $QUANTUM_DIR/bin/quantum-rootwrap $Q_RR_CONF_FILE"
- fi
cp -p $QUANTUM_DIR/etc/rootwrap.conf $Q_RR_CONF_FILE
# Copy over the config and filter bits
@@ -1400,13 +1388,22 @@
iniset $Q_CONF_FILE DEFAULT rabbit_password $RABBIT_PASSWORD
fi
if [[ "$Q_USE_DEBUG_COMMAND" == "True" ]]; then
- Q_DEBUG_CONF_FILE=/etc/quantum/debug.ini
- cp $QUANTUM_DIR/etc/l3_agent.ini $Q_DEBUG_CONF_FILE
- iniset $Q_L3_CONF_FILE DEFAULT verbose False
- iniset $Q_L3_CONF_FILE DEFAULT debug False
- iniset $Q_L3_CONF_FILE DEFAULT metadata_ip $Q_META_DATA_IP
- iniset $Q_L3_CONF_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE
- iniset $Q_L3_CONF_FILE DEFAULT root_helper "sudo"
+ cp $QUANTUM_DIR/etc/l3_agent.ini $QUANTUM_TEST_CONFIG_FILE
+ iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT verbose False
+ iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT debug False
+ iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE
+ quantum_setup_keystone $QUANTUM_TEST_CONFIG_FILE DEFAULT set_auth_url
+ if [[ "$Q_PLUGIN" == "openvswitch" ]]; then
+ iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT interface_driver quantum.agent.linux.interface.OVSInterfaceDriver
+ iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT external_network_bridge $PUBLIC_BRIDGE
+ elif [[ "$Q_PLUGIN" = "linuxbridge" ]]; then
+ iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT interface_driver quantum.agent.linux.interface.BridgeInterfaceDriver
+ iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT external_network_bridge ''
+ elif [[ "$Q_PLUGIN" = "ryu" ]]; then
+ iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT interface_driver quantum.agent.linux.interface.RyuInterfaceDriver
+ iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT external_network_bridge $PUBLIC_BRIDGE
+ iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
+ fi
fi
fi
@@ -1633,7 +1630,9 @@
iniset $Q_L3_CONF_FILE DEFAULT router_id $ROUTER_ID
fi
fi
-
+ if [[ "$Q_USE_DEBUG_COMMAND" == "True" ]]; then
+ setup_quantum
+ fi
elif is_service_enabled $DATABASE_BACKENDS && is_service_enabled n-net; then
# Create a small network
$NOVA_BIN_DIR/nova-manage network create "$PRIVATE_NETWORK_NAME" $FIXED_RANGE 1 $FIXED_NETWORK_SIZE $NETWORK_CREATE_ARGS
diff --git a/tools/build_ramdisk.sh b/tools/build_ramdisk.sh
index 8e2c0be..5ff05b0 100755
--- a/tools/build_ramdisk.sh
+++ b/tools/build_ramdisk.sh
@@ -108,7 +108,7 @@
echo $NBD
}
-# Prime image with as many apt/pips as we can
+# Prime image with as many apt as we can
DEV_FILE=$CACHEDIR/$DIST_NAME-dev.img
DEV_FILE_TMP=`mktemp $DEV_FILE.XXXXXX`
if [ ! -r $DEV_FILE ]; then
@@ -121,7 +121,6 @@
chroot $MNTDIR apt-get install -y --download-only `cat files/apts/* | grep NOPRIME | cut -d\# -f1`
chroot $MNTDIR apt-get install -y --force-yes `cat files/apts/* | grep -v NOPRIME | cut -d\# -f1`
- chroot $MNTDIR pip install `cat files/pips/*`
# Create a stack user that is a member of the libvirtd group so that stack
# is able to interact with libvirt.
diff --git a/tools/build_tempest.sh b/tools/build_tempest.sh
index e72355c..1758e7d 100755
--- a/tools/build_tempest.sh
+++ b/tools/build_tempest.sh
@@ -48,8 +48,6 @@
TEMPEST_DIR=$DEST/tempest
# Install tests and prerequisites
-pip_install `cat $TOP_DIR/files/pips/tempest`
-
git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH
trap - SIGHUP SIGINT SIGTERM SIGQUIT EXIT
diff --git a/tools/build_uec.sh b/tools/build_uec.sh
index 48819c9..58c5425 100755
--- a/tools/build_uec.sh
+++ b/tools/build_uec.sh
@@ -68,7 +68,7 @@
# Option to warm the base image with software requirements.
if [ $WARM_CACHE ]; then
cd $TOOLS_DIR
- ./warm_apts_and_pips_for_uec.sh $image_dir/disk
+ ./warm_apts_for_uec.sh $image_dir/disk
fi
# Name of our instance, used by libvirt
diff --git a/tools/build_uec_ramdisk.sh b/tools/build_uec_ramdisk.sh
index 150ecab..3ab5daf 100755
--- a/tools/build_uec_ramdisk.sh
+++ b/tools/build_uec_ramdisk.sh
@@ -98,7 +98,7 @@
# Pre-load the image with basic environment
if [ ! -e $image_dir/disk-primed ]; then
cp $image_dir/disk $image_dir/disk-primed
- $TOOLS_DIR/warm_apts_and_pips_for_uec.sh $image_dir/disk-primed
+ $TOOLS_DIR/warm_apts_for_uec.sh $image_dir/disk-primed
$TOOLS_DIR/copy_dev_environment_to_uec.sh $image_dir/disk-primed
fi
diff --git a/tools/warm_apts_and_pips_for_uec.sh b/tools/warm_apts_for_uec.sh
similarity index 88%
rename from tools/warm_apts_and_pips_for_uec.sh
rename to tools/warm_apts_for_uec.sh
index fe389ff..3c15f52 100755
--- a/tools/warm_apts_and_pips_for_uec.sh
+++ b/tools/warm_apts_for_uec.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-# **warm_apts_and_pips_for_uec.sh**
+# **warm_apts_for_uec.sh**
# Echo commands
set -o xtrace
@@ -48,8 +48,6 @@
chroot $STAGING_DIR apt-get update
chroot $STAGING_DIR apt-get install -y --download-only `cat files/apts/* | grep NOPRIME | cut -d\# -f1`
chroot $STAGING_DIR apt-get install -y --force-yes `cat files/apts/* | grep -v NOPRIME | cut -d\# -f1` || true
-mkdir -p $STAGING_DIR/var/cache/pip
-PIP_DOWNLOAD_CACHE=/var/cache/pip chroot $STAGING_DIR pip install `cat files/pips/*` || true
# Unmount
umount $STAGING_DIR
diff --git a/unstack.sh b/unstack.sh
index 81ce088..34195c2 100755
--- a/unstack.sh
+++ b/unstack.sh
@@ -37,6 +37,12 @@
UNSTACK_ALL=${UNSTACK_ALL:-1}
fi
+if [[ "$Q_USE_DEBUG_COMMAND" == "True" ]]; then
+ source $TOP_DIR/openrc
+ source $TOP_DIR/lib/quantum
+ teardown_quantum
+fi
+
# Shut down devstack's screen to get the bulk of OpenStack services in one shot
SCREEN=$(which screen)
if [[ -n "$SCREEN" ]]; then