Skip to content

Commit 2e69ba7

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "move setup_quantum to stack.sh"
2 parents fb501d0 + 8bc21f6 commit 2e69ba7

9 files changed

Lines changed: 39 additions & 44 deletions

File tree

exercises/boot_from_volume.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ source $TOP_DIR/openrc
3535
# Import quantum functions if needed
3636
if is_service_enabled quantum; then
3737
source $TOP_DIR/lib/quantum
38-
setup_quantum
3938
fi
4039

4140
# Import exercise configuration
@@ -174,10 +173,6 @@ nova floating-ip-delete $FLOATING_IP || \
174173
# Delete a secgroup
175174
nova secgroup-delete $SECGROUP || die "Failure deleting security group $SECGROUP"
176175

177-
if is_service_enabled quantum; then
178-
teardown_quantum
179-
fi
180-
181176
set +o xtrace
182177
echo "*********************************************************************"
183178
echo "SUCCESS: End DevStack Exercise: $0"

exercises/euca.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ source $TOP_DIR/eucarc
3636
# Import quantum functions if needed
3737
if is_service_enabled quantum; then
3838
source $TOP_DIR/lib/quantum
39-
setup_quantum
4039
fi
4140

4241
# Import exercise configuration
@@ -175,10 +174,6 @@ fi
175174
# Delete group
176175
euca-delete-group $SECGROUP || die "Failure deleting security group $SECGROUP"
177176

178-
if is_service_enabled quantum; then
179-
teardown_quantum
180-
fi
181-
182177
set +o xtrace
183178
echo "*********************************************************************"
184179
echo "SUCCESS: End DevStack Exercise: $0"

exercises/floating_ips.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ source $TOP_DIR/openrc
3434
# Import quantum functions if needed
3535
if is_service_enabled quantum; then
3636
source $TOP_DIR/lib/quantum
37-
setup_quantum
3837
fi
3938

4039
# Import exercise configuration
@@ -202,10 +201,6 @@ fi
202201
# Delete a secgroup
203202
nova secgroup-delete $SECGROUP || die "Failure deleting security group $SECGROUP"
204203

205-
if is_service_enabled quantum; then
206-
teardown_quantum
207-
fi
208-
209204
set +o xtrace
210205
echo "*********************************************************************"
211206
echo "SUCCESS: End DevStack Exercise: $0"

exercises/quantum-adv-test.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ is_service_enabled quantum && is_service_enabled q-agt && is_service_enabled q-d
5858

5959
# Import quantum fucntions
6060
source $TOP_DIR/lib/quantum
61-
setup_quantum
6261

6362
# Import exercise configuration
6463
source $TOP_DIR/exerciserc
@@ -475,7 +474,6 @@ main() {
475474
}
476475

477476

478-
teardown_quantum
479477
#-------------------------------------------------------------------------------
480478
# Kick off script.
481479
#-------------------------------------------------------------------------------

exercises/volumes.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ source $TOP_DIR/openrc
3333
# Import quantum functions if needed
3434
if is_service_enabled quantum; then
3535
source $TOP_DIR/lib/quantum
36-
setup_quantum
3736
fi
3837

3938
# Import exercise configuration
@@ -212,10 +211,6 @@ fi
212211
# Delete a secgroup
213212
nova secgroup-delete $SECGROUP || die "Failure deleting security group $SECGROUP"
214213

215-
if is_service_enabled quantum; then
216-
teardown_quantum
217-
fi
218-
219214
set +o xtrace
220215
echo "*********************************************************************"
221216
echo "SUCCESS: End DevStack Exercise: $0"

lib/quantum

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,20 @@
55
XTRACE=$(set +o | grep xtrace)
66
set +o xtrace
77

8+
QUANTUM_DIR=$DEST/quantum
89
export QUANTUM_TEST_CONFIG_FILE=${QUANTUM_TEST_CONFIG_FILE:-"/etc/quantum/debug.ini"}
910
QUANTUM_AUTH_CACHE_DIR=${QUANTUM_AUTH_CACHE_DIR:-/var/cache/quantum}
1011

12+
if is_service_enabled quantum; then
13+
Q_CONF_FILE=/etc/quantum/quantum.conf
14+
Q_RR_CONF_FILE=/etc/quantum/rootwrap.conf
15+
if [[ "$Q_USE_ROOTWRAP" == "False" ]]; then
16+
Q_RR_COMMAND="sudo"
17+
else
18+
Q_RR_COMMAND="sudo $QUANTUM_DIR/bin/quantum-rootwrap $Q_RR_CONF_FILE"
19+
fi
20+
fi
21+
1122
# Configures keystone integration for quantum service and agents
1223
function quantum_setup_keystone() {
1324
local conf_file=$1
@@ -74,7 +85,7 @@ function _get_probe_cmd_prefix() {
7485
local from_net="$1"
7586
net_id=`_get_net_id $from_net`
7687
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`
77-
echo "sudo ip netns exec qprobe-$probe_id"
88+
echo "$Q_RR_COMMAND ip netns exec qprobe-$probe_id"
7889
}
7990

8091
function delete_probe() {
@@ -92,9 +103,9 @@ function _ping_check_quantum() {
92103
local check_command=""
93104
probe_cmd=`_get_probe_cmd_prefix $from_net`
94105
if [[ "$expected" = "True" ]]; then
95-
check_command="while ! $probe_cmd ping -c1 -w1 $ip; do sleep 1; done"
106+
check_command="while ! $probe_cmd ping -w 1 -c 1 $ip; do sleep 1; done"
96107
else
97-
check_command="while $probe_cmd ping -c1 -w1 $ip; do sleep 1; done"
108+
check_command="while $probe_cmd ping -w 1 -c 1 $ip; do sleep 1; done"
98109
fi
99110
if ! timeout $timeout_sec sh -c "$check_command"; then
100111
if [[ "$expected" = "True" ]]; then

openrc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,3 @@ export COMPUTE_API_VERSION=${COMPUTE_API_VERSION:-$NOVA_VERSION}
7272
# set log level to DEBUG (helps debug issues)
7373
# export KEYSTONECLIENT_DEBUG=1
7474
# export NOVACLIENT_DEBUG=1
75-
76-
# set quantum debug command
77-
export QUANTUM_TEST_CONFIG_FILE=${QUANTUM_TEST_CONFIG_FILE:-"/etc/quantum/debug.ini"}

stack.sh

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ HORIZON_DIR=$DEST/horizon
321321
OPENSTACKCLIENT_DIR=$DEST/python-openstackclient
322322
NOVNC_DIR=$DEST/noVNC
323323
SWIFT3_DIR=$DEST/swift3
324-
QUANTUM_DIR=$DEST/quantum
325324
QUANTUM_CLIENT_DIR=$DEST/python-quantumclient
326325

327326
# Default Quantum Plugin
@@ -1153,14 +1152,7 @@ if is_service_enabled quantum; then
11531152
iniset /$Q_PLUGIN_CONF_FILE DATABASE sql_connection $dburl
11541153
unset dburl
11551154

1156-
Q_CONF_FILE=/etc/quantum/quantum.conf
11571155
cp $QUANTUM_DIR/etc/quantum.conf $Q_CONF_FILE
1158-
Q_RR_CONF_FILE=/etc/quantum/rootwrap.conf
1159-
if [[ "$Q_USE_ROOTWRAP" == "False" ]]; then
1160-
Q_RR_COMMAND="sudo"
1161-
else
1162-
Q_RR_COMMAND="sudo $QUANTUM_DIR/bin/quantum-rootwrap $Q_RR_CONF_FILE"
1163-
fi
11641156
cp -p $QUANTUM_DIR/etc/rootwrap.conf $Q_RR_CONF_FILE
11651157

11661158
# Copy over the config and filter bits
@@ -1400,13 +1392,22 @@ if is_service_enabled quantum; then
14001392
iniset $Q_CONF_FILE DEFAULT rabbit_password $RABBIT_PASSWORD
14011393
fi
14021394
if [[ "$Q_USE_DEBUG_COMMAND" == "True" ]]; then
1403-
Q_DEBUG_CONF_FILE=/etc/quantum/debug.ini
1404-
cp $QUANTUM_DIR/etc/l3_agent.ini $Q_DEBUG_CONF_FILE
1405-
iniset $Q_L3_CONF_FILE DEFAULT verbose False
1406-
iniset $Q_L3_CONF_FILE DEFAULT debug False
1407-
iniset $Q_L3_CONF_FILE DEFAULT metadata_ip $Q_META_DATA_IP
1408-
iniset $Q_L3_CONF_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE
1409-
iniset $Q_L3_CONF_FILE DEFAULT root_helper "sudo"
1395+
cp $QUANTUM_DIR/etc/l3_agent.ini $QUANTUM_TEST_CONFIG_FILE
1396+
iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT verbose False
1397+
iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT debug False
1398+
iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE
1399+
quantum_setup_keystone $QUANTUM_TEST_CONFIG_FILE DEFAULT set_auth_url
1400+
if [[ "$Q_PLUGIN" == "openvswitch" ]]; then
1401+
iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT interface_driver quantum.agent.linux.interface.OVSInterfaceDriver
1402+
iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT external_network_bridge $PUBLIC_BRIDGE
1403+
elif [[ "$Q_PLUGIN" = "linuxbridge" ]]; then
1404+
iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT interface_driver quantum.agent.linux.interface.BridgeInterfaceDriver
1405+
iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT external_network_bridge ''
1406+
elif [[ "$Q_PLUGIN" = "ryu" ]]; then
1407+
iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT interface_driver quantum.agent.linux.interface.RyuInterfaceDriver
1408+
iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT external_network_bridge $PUBLIC_BRIDGE
1409+
iniset $QUANTUM_TEST_CONFIG_FILE DEFAULT ryu_api_host $RYU_API_HOST:$RYU_API_PORT
1410+
fi
14101411
fi
14111412
fi
14121413

@@ -1633,7 +1634,9 @@ if is_service_enabled q-svc; then
16331634
iniset $Q_L3_CONF_FILE DEFAULT router_id $ROUTER_ID
16341635
fi
16351636
fi
1636-
1637+
if [[ "$Q_USE_DEBUG_COMMAND" == "True" ]]; then
1638+
setup_quantum
1639+
fi
16371640
elif is_service_enabled $DATABASE_BACKENDS && is_service_enabled n-net; then
16381641
# Create a small network
16391642
$NOVA_BIN_DIR/nova-manage network create "$PRIVATE_NETWORK_NAME" $FIXED_RANGE 1 $FIXED_NETWORK_SIZE $NETWORK_CREATE_ARGS

unstack.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ if [[ "$1" == "--all" ]]; then
3737
UNSTACK_ALL=${UNSTACK_ALL:-1}
3838
fi
3939

40+
if [[ "$Q_USE_DEBUG_COMMAND" == "True" ]]; then
41+
source $TOP_DIR/openrc
42+
source $TOP_DIR/lib/quantum
43+
teardown_quantum
44+
fi
45+
4046
# Shut down devstack's screen to get the bulk of OpenStack services in one shot
4147
SCREEN=$(which screen)
4248
if [[ -n "$SCREEN" ]]; then

0 commit comments

Comments
 (0)