Merge "move setup_quantum to stack.sh"

This commit is contained in:
Jenkins 2012-12-06 16:44:09 +00:00 committed by Gerrit Code Review
commit 2e69ba7918
9 changed files with 39 additions and 44 deletions

View File

@ -35,7 +35,6 @@ source $TOP_DIR/openrc
# Import quantum functions if needed # Import quantum functions if needed
if is_service_enabled quantum; then if is_service_enabled quantum; then
source $TOP_DIR/lib/quantum source $TOP_DIR/lib/quantum
setup_quantum
fi fi
# Import exercise configuration # Import exercise configuration
@ -174,10 +173,6 @@ nova floating-ip-delete $FLOATING_IP || \
# Delete a secgroup # Delete a secgroup
nova secgroup-delete $SECGROUP || die "Failure deleting security group $SECGROUP" nova secgroup-delete $SECGROUP || die "Failure deleting security group $SECGROUP"
if is_service_enabled quantum; then
teardown_quantum
fi
set +o xtrace set +o xtrace
echo "*********************************************************************" echo "*********************************************************************"
echo "SUCCESS: End DevStack Exercise: $0" echo "SUCCESS: End DevStack Exercise: $0"

View File

@ -36,7 +36,6 @@ source $TOP_DIR/eucarc
# Import quantum functions if needed # Import quantum functions if needed
if is_service_enabled quantum; then if is_service_enabled quantum; then
source $TOP_DIR/lib/quantum source $TOP_DIR/lib/quantum
setup_quantum
fi fi
# Import exercise configuration # Import exercise configuration
@ -175,10 +174,6 @@ fi
# Delete group # Delete group
euca-delete-group $SECGROUP || die "Failure deleting security group $SECGROUP" euca-delete-group $SECGROUP || die "Failure deleting security group $SECGROUP"
if is_service_enabled quantum; then
teardown_quantum
fi
set +o xtrace set +o xtrace
echo "*********************************************************************" echo "*********************************************************************"
echo "SUCCESS: End DevStack Exercise: $0" echo "SUCCESS: End DevStack Exercise: $0"

View File

@ -34,7 +34,6 @@ source $TOP_DIR/openrc
# Import quantum functions if needed # Import quantum functions if needed
if is_service_enabled quantum; then if is_service_enabled quantum; then
source $TOP_DIR/lib/quantum source $TOP_DIR/lib/quantum
setup_quantum
fi fi
# Import exercise configuration # Import exercise configuration
@ -202,10 +201,6 @@ fi
# Delete a secgroup # Delete a secgroup
nova secgroup-delete $SECGROUP || die "Failure deleting security group $SECGROUP" nova secgroup-delete $SECGROUP || die "Failure deleting security group $SECGROUP"
if is_service_enabled quantum; then
teardown_quantum
fi
set +o xtrace set +o xtrace
echo "*********************************************************************" echo "*********************************************************************"
echo "SUCCESS: End DevStack Exercise: $0" echo "SUCCESS: End DevStack Exercise: $0"

View File

@ -58,7 +58,6 @@ is_service_enabled quantum && is_service_enabled q-agt && is_service_enabled q-d
# Import quantum fucntions # Import quantum fucntions
source $TOP_DIR/lib/quantum source $TOP_DIR/lib/quantum
setup_quantum
# Import exercise configuration # Import exercise configuration
source $TOP_DIR/exerciserc source $TOP_DIR/exerciserc
@ -475,7 +474,6 @@ main() {
} }
teardown_quantum
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Kick off script. # Kick off script.
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------

View File

@ -33,7 +33,6 @@ source $TOP_DIR/openrc
# Import quantum functions if needed # Import quantum functions if needed
if is_service_enabled quantum; then if is_service_enabled quantum; then
source $TOP_DIR/lib/quantum source $TOP_DIR/lib/quantum
setup_quantum
fi fi
# Import exercise configuration # Import exercise configuration
@ -212,10 +211,6 @@ fi
# Delete a secgroup # Delete a secgroup
nova secgroup-delete $SECGROUP || die "Failure deleting security group $SECGROUP" nova secgroup-delete $SECGROUP || die "Failure deleting security group $SECGROUP"
if is_service_enabled quantum; then
teardown_quantum
fi
set +o xtrace set +o xtrace
echo "*********************************************************************" echo "*********************************************************************"
echo "SUCCESS: End DevStack Exercise: $0" echo "SUCCESS: End DevStack Exercise: $0"

View File

@ -5,9 +5,20 @@
XTRACE=$(set +o | grep xtrace) XTRACE=$(set +o | grep xtrace)
set +o xtrace set +o xtrace
QUANTUM_DIR=$DEST/quantum
export QUANTUM_TEST_CONFIG_FILE=${QUANTUM_TEST_CONFIG_FILE:-"/etc/quantum/debug.ini"} export QUANTUM_TEST_CONFIG_FILE=${QUANTUM_TEST_CONFIG_FILE:-"/etc/quantum/debug.ini"}
QUANTUM_AUTH_CACHE_DIR=${QUANTUM_AUTH_CACHE_DIR:-/var/cache/quantum} 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 # Configures keystone integration for quantum service and agents
function quantum_setup_keystone() { function quantum_setup_keystone() {
local conf_file=$1 local conf_file=$1
@ -74,7 +85,7 @@ function _get_probe_cmd_prefix() {
local from_net="$1" local from_net="$1"
net_id=`_get_net_id $from_net` 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` 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() { function delete_probe() {
@ -92,9 +103,9 @@ function _ping_check_quantum() {
local check_command="" local check_command=""
probe_cmd=`_get_probe_cmd_prefix $from_net` probe_cmd=`_get_probe_cmd_prefix $from_net`
if [[ "$expected" = "True" ]]; then 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 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 fi
if ! timeout $timeout_sec sh -c "$check_command"; then if ! timeout $timeout_sec sh -c "$check_command"; then
if [[ "$expected" = "True" ]]; then if [[ "$expected" = "True" ]]; then

3
openrc
View File

@ -72,6 +72,3 @@ export COMPUTE_API_VERSION=${COMPUTE_API_VERSION:-$NOVA_VERSION}
# set log level to DEBUG (helps debug issues) # set log level to DEBUG (helps debug issues)
# export KEYSTONECLIENT_DEBUG=1 # export KEYSTONECLIENT_DEBUG=1
# export NOVACLIENT_DEBUG=1 # export NOVACLIENT_DEBUG=1
# set quantum debug command
export QUANTUM_TEST_CONFIG_FILE=${QUANTUM_TEST_CONFIG_FILE:-"/etc/quantum/debug.ini"}

View File

@ -321,7 +321,6 @@ HORIZON_DIR=$DEST/horizon
OPENSTACKCLIENT_DIR=$DEST/python-openstackclient OPENSTACKCLIENT_DIR=$DEST/python-openstackclient
NOVNC_DIR=$DEST/noVNC NOVNC_DIR=$DEST/noVNC
SWIFT3_DIR=$DEST/swift3 SWIFT3_DIR=$DEST/swift3
QUANTUM_DIR=$DEST/quantum
QUANTUM_CLIENT_DIR=$DEST/python-quantumclient QUANTUM_CLIENT_DIR=$DEST/python-quantumclient
# Default Quantum Plugin # Default Quantum Plugin
@ -1153,14 +1152,7 @@ if is_service_enabled quantum; then
iniset /$Q_PLUGIN_CONF_FILE DATABASE sql_connection $dburl iniset /$Q_PLUGIN_CONF_FILE DATABASE sql_connection $dburl
unset dburl unset dburl
Q_CONF_FILE=/etc/quantum/quantum.conf
cp $QUANTUM_DIR/etc/quantum.conf $Q_CONF_FILE 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 cp -p $QUANTUM_DIR/etc/rootwrap.conf $Q_RR_CONF_FILE
# Copy over the config and filter bits # Copy over the config and filter bits
@ -1400,13 +1392,22 @@ if is_service_enabled quantum; then
iniset $Q_CONF_FILE DEFAULT rabbit_password $RABBIT_PASSWORD iniset $Q_CONF_FILE DEFAULT rabbit_password $RABBIT_PASSWORD
fi fi
if [[ "$Q_USE_DEBUG_COMMAND" == "True" ]]; then if [[ "$Q_USE_DEBUG_COMMAND" == "True" ]]; then
Q_DEBUG_CONF_FILE=/etc/quantum/debug.ini cp $QUANTUM_DIR/etc/l3_agent.ini $QUANTUM_TEST_CONFIG_FILE
cp $QUANTUM_DIR/etc/l3_agent.ini $Q_DEBUG_CONF_FILE iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT verbose False
iniset $Q_L3_CONF_FILE DEFAULT verbose False iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT debug False
iniset $Q_L3_CONF_FILE DEFAULT debug False iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE
iniset $Q_L3_CONF_FILE DEFAULT metadata_ip $Q_META_DATA_IP quantum_setup_keystone $QUANTUM_TEST_CONFIG_FILE DEFAULT set_auth_url
iniset $Q_L3_CONF_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE if [[ "$Q_PLUGIN" == "openvswitch" ]]; then
iniset $Q_L3_CONF_FILE DEFAULT root_helper "sudo" 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
fi fi
@ -1633,7 +1634,9 @@ if is_service_enabled q-svc; then
iniset $Q_L3_CONF_FILE DEFAULT router_id $ROUTER_ID iniset $Q_L3_CONF_FILE DEFAULT router_id $ROUTER_ID
fi fi
fi fi
if [[ "$Q_USE_DEBUG_COMMAND" == "True" ]]; then
setup_quantum
fi
elif is_service_enabled $DATABASE_BACKENDS && is_service_enabled n-net; then elif is_service_enabled $DATABASE_BACKENDS && is_service_enabled n-net; then
# Create a small network # Create a small network
$NOVA_BIN_DIR/nova-manage network create "$PRIVATE_NETWORK_NAME" $FIXED_RANGE 1 $FIXED_NETWORK_SIZE $NETWORK_CREATE_ARGS $NOVA_BIN_DIR/nova-manage network create "$PRIVATE_NETWORK_NAME" $FIXED_RANGE 1 $FIXED_NETWORK_SIZE $NETWORK_CREATE_ARGS

View File

@ -37,6 +37,12 @@ if [[ "$1" == "--all" ]]; then
UNSTACK_ALL=${UNSTACK_ALL:-1} UNSTACK_ALL=${UNSTACK_ALL:-1}
fi 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 # Shut down devstack's screen to get the bulk of OpenStack services in one shot
SCREEN=$(which screen) SCREEN=$(which screen)
if [[ -n "$SCREEN" ]]; then if [[ -n "$SCREEN" ]]; then