Compare commits
92 Commits
master
...
icehouse-eol
| Author | SHA1 | Date | |
|---|---|---|---|
| ea32a648e4 | |||
| e842c13fa5 | |||
| 1f1a48ff2f | |||
| 1961c33c8f | |||
| cea2ab3668 | |||
| d795232370 | |||
| 33680e3689 | |||
| 444274e8a1 | |||
| 8c528042c4 | |||
| 6b1198b830 | |||
| db7581cbff | |||
| ed04926923 | |||
| c120998e43 | |||
| 397f7de54d | |||
| b947896751 | |||
| 44ef0eebac | |||
| ace3bdbbec | |||
| e1d57fff96 | |||
| 9ad08ba1f0 | |||
| 36ca8fbf8b | |||
| de1fd97a42 | |||
| 301144b527 | |||
| afd4ba425d | |||
| ad3817dae8 | |||
| 92144cc785 | |||
| 0caf2e4dd2 | |||
| 31d0649d4b | |||
| 7aa7699acb | |||
| 0070dbf05d | |||
| fa145efdc7 | |||
| 55a6f3ae67 | |||
| 9ad198337d | |||
| 77ab54d3a6 | |||
| e5f8d21aae | |||
| 81dcbbdca8 | |||
| 279a6b32d8 | |||
| 1c2698dbac | |||
| ef7470e5da | |||
| e8fb615a4d | |||
| 0b05258913 | |||
| fa9c672ce6 | |||
| 0547e43824 | |||
| 9e28fa92d3 | |||
| 40b4f04862 | |||
| c83aec452b | |||
| 80cad72055 | |||
| 8208398568 | |||
| 1921be9226 | |||
| 99f796ce27 | |||
| ef5de91c69 | |||
| e621646099 | |||
| 42e9058901 | |||
| da6648a6fe | |||
| 9a0502b592 | |||
| aefc90462d | |||
| 3fc59dcd72 | |||
| c3f498d36a | |||
| 10fb071ebb | |||
| a09603233e | |||
| ef2cc30ada | |||
| 0b0f1fa3c7 | |||
| 7dba81dfeb | |||
| bed8af63fb | |||
| 7620ce462a | |||
| 76bafd33bb | |||
| f0dcecd4b0 | |||
| b24e52a439 | |||
| babc48573a | |||
| 9b76761618 | |||
| 87b6fe407e | |||
| 03e55fb439 | |||
| fa78b551eb | |||
| cd0fba6c38 | |||
| 85a8d78092 | |||
| 89eb154ff9 | |||
| ea796c0598 | |||
| e2738d365a | |||
| 8b7a7ae3ac | |||
| acd3dfd1bf | |||
| 4a412dfdc8 | |||
| cd1cf1b417 | |||
| 207284a6a6 | |||
| 515e728244 | |||
| cda90647e1 | |||
| 730353b17f | |||
| ca6446e3f2 | |||
| 75654fe30a | |||
| e41cd06e16 | |||
| 662567c8de | |||
| d4fe50feb7 | |||
| d9b2f2a58a | |||
| ea548cd5ce |
@@ -6,6 +6,9 @@ proto
|
||||
src
|
||||
localrc
|
||||
local.sh
|
||||
.tox
|
||||
.stackenv
|
||||
accrc
|
||||
files/*.gz
|
||||
files/*.qcow2
|
||||
files/images
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
host=review.openstack.org
|
||||
port=29418
|
||||
project=openstack-dev/devstack.git
|
||||
defaultbranch=stable/icehouse
|
||||
@@ -48,3 +48,4 @@ Vishvananda Ishaya <vishvananda@gmail.com>
|
||||
Yun Mao <yunmao@gmail.com>
|
||||
Yong Sheng Gong <gongysh@cn.ibm.com>
|
||||
Zhongyue Luo <lzyeval@gmail.com>
|
||||
Zhenguo Niu <niu.zglinux@gmail.com>
|
||||
|
||||
@@ -265,7 +265,7 @@ you'll need the following settings in your `localrc` section:
|
||||
If tempest has been successfully configured, a basic set of smoke tests can be run as follows:
|
||||
|
||||
$ cd /opt/stack/tempest
|
||||
$ nosetests tempest/scenario/test_network_basic_ops.py
|
||||
$ tox -efull tempest.scenario.test_network_basic_ops
|
||||
|
||||
# DevStack on Xenserver
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ if is_service_enabled trove; then
|
||||
cleanup_trove
|
||||
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
|
||||
echo_summary "Configuring Trove"
|
||||
configure_troveclient
|
||||
configure_trove
|
||||
|
||||
if is_service_enabled key; then
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
bridge-utils
|
||||
pylint
|
||||
python-setuptools
|
||||
screen
|
||||
unzip
|
||||
@@ -10,7 +9,6 @@ lsof # useful when debugging
|
||||
openssh-server
|
||||
openssl
|
||||
python-virtualenv
|
||||
python-unittest2
|
||||
iputils-ping
|
||||
wget
|
||||
curl
|
||||
|
||||
@@ -10,12 +10,9 @@ python-xattr
|
||||
python-sqlalchemy
|
||||
python-webob
|
||||
python-kombu
|
||||
pylint
|
||||
python-eventlet
|
||||
python-nose
|
||||
python-sphinx
|
||||
python-mox
|
||||
python-kombu
|
||||
python-coverage
|
||||
python-cherrypy3 # why?
|
||||
python-migrate
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
iptables
|
||||
libguestfs0
|
||||
libvirt-bin
|
||||
openssh-client
|
||||
|
||||
+1
-1
@@ -1,5 +1,6 @@
|
||||
dnsmasq-base
|
||||
dnsmasq-utils # for dhcp_release
|
||||
conntrack
|
||||
kpartx
|
||||
parted
|
||||
iputils-arping
|
||||
@@ -25,7 +26,6 @@ qpidd # dist:precise NOPRIME
|
||||
socat # used by ajaxterm
|
||||
python-mox
|
||||
python-paste
|
||||
python-migrate
|
||||
python-greenlet
|
||||
python-libvirt # NOPRIME
|
||||
python-libxml2
|
||||
|
||||
@@ -7,7 +7,6 @@ python-coverage
|
||||
python-eventlet
|
||||
python-greenlet
|
||||
python-netifaces
|
||||
python-nose
|
||||
python-pastedeploy
|
||||
python-simplejson
|
||||
python-webob
|
||||
|
||||
@@ -12,9 +12,7 @@ openssh
|
||||
openssl
|
||||
psmisc
|
||||
python-cmd2 # dist:opensuse-12.3
|
||||
python-pylint
|
||||
python-setuptools # instead of python-distribute; dist:sle11sp2
|
||||
python-unittest2
|
||||
screen
|
||||
tar
|
||||
tcpdump
|
||||
|
||||
@@ -14,7 +14,5 @@ python-dateutil
|
||||
python-eventlet
|
||||
python-kombu
|
||||
python-mox
|
||||
python-nose
|
||||
python-pylint
|
||||
python-sqlalchemy-migrate
|
||||
python-xattr
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
curl
|
||||
dnsmasq
|
||||
dnsmasq-utils # dist:opensuse-12.3
|
||||
conntrack-tools
|
||||
ebtables
|
||||
gawk
|
||||
genisoimage # required for config_drive
|
||||
|
||||
@@ -9,7 +9,6 @@ python-devel
|
||||
python-eventlet
|
||||
python-greenlet
|
||||
python-netifaces
|
||||
python-nose
|
||||
python-simplejson
|
||||
python-xattr
|
||||
sqlite3
|
||||
|
||||
@@ -10,10 +10,8 @@ openssl-devel # to rebuild pyOpenSSL if needed
|
||||
libxml2-devel # dist:rhel6 [2]
|
||||
libxslt-devel # dist:rhel6 [2]
|
||||
psmisc
|
||||
pylint
|
||||
python-setuptools
|
||||
python-prettytable # dist:rhel6 [1]
|
||||
python-unittest2
|
||||
python-virtualenv
|
||||
python-devel
|
||||
screen
|
||||
|
||||
@@ -2,7 +2,6 @@ Django
|
||||
gcc
|
||||
httpd # NOPRIME
|
||||
mod_wsgi # NOPRIME
|
||||
pylint
|
||||
python-anyjson
|
||||
python-BeautifulSoup
|
||||
python-boto
|
||||
@@ -14,7 +13,6 @@ python-httplib2
|
||||
python-kombu
|
||||
python-migrate
|
||||
python-mox
|
||||
python-nose
|
||||
python-paste #dist:f19,f20
|
||||
python-paste-deploy #dist:f19,f20
|
||||
python-routes
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
iptables
|
||||
libguestfs
|
||||
libvirt
|
||||
libvirt-python
|
||||
net-tools
|
||||
openssh-clients
|
||||
openvswitch
|
||||
python-libguestfs
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
MySQL-python
|
||||
curl
|
||||
dnsmasq-utils # for dhcp_release
|
||||
conntrack-tools
|
||||
ebtables
|
||||
gawk
|
||||
genisoimage # required for config_drive
|
||||
|
||||
@@ -7,7 +7,6 @@ python-coverage
|
||||
python-eventlet
|
||||
python-greenlet
|
||||
python-netifaces
|
||||
python-nose
|
||||
python-paste-deploy # dist:f19,f20,rhel7
|
||||
python-simplejson
|
||||
python-webob
|
||||
|
||||
@@ -283,6 +283,15 @@ function upload_image {
|
||||
DISK_FORMAT=iso
|
||||
CONTAINER_FORMAT=bare
|
||||
;;
|
||||
*.vhd|*.vhdx|*.vhd.gz|*.vhdx.gz)
|
||||
local extension="${IMAGE_FNAME#*.}"
|
||||
IMAGE_NAME=$(basename "$IMAGE" ".$extension")
|
||||
DISK_FORMAT=vhd
|
||||
CONTAINER_FORMAT=bare
|
||||
if [ "${IMAGE_FNAME##*.}" == "gz" ]; then
|
||||
UNPACK=zcat
|
||||
fi
|
||||
;;
|
||||
*) echo "Do not know what to do with $IMAGE_FNAME"; false;;
|
||||
esac
|
||||
|
||||
|
||||
+231
-52
@@ -36,6 +36,11 @@
|
||||
XTRACE=$(set +o | grep xtrace)
|
||||
set +o xtrace
|
||||
|
||||
# Global Config Variables
|
||||
declare -A GITREPO
|
||||
declare -A GITBRANCH
|
||||
declare -A GITDIR
|
||||
|
||||
|
||||
# Config Functions
|
||||
# ================
|
||||
@@ -577,6 +582,18 @@ function git_clone {
|
||||
cd $orig_dir
|
||||
}
|
||||
|
||||
# A variation on git clone that lets us specify a project by it's
|
||||
# actual name, like oslo.config. This is exceptionally useful in the
|
||||
# library installation case
|
||||
function git_clone_by_name {
|
||||
local name=$1
|
||||
local repo=${GITREPO[$name]}
|
||||
local dir=${GITDIR[$name]}
|
||||
local branch=${GITBRANCH[$name]}
|
||||
git_clone $repo $dir $branch
|
||||
}
|
||||
|
||||
|
||||
# git can sometimes get itself infinitely stuck with transient network
|
||||
# errors or other issues with the remote end. This wraps git in a
|
||||
# timeout/retry loop and is intended to watch over non-local git
|
||||
@@ -982,11 +999,15 @@ function zypper_install {
|
||||
# _run_process() is designed to be backgrounded by run_process() to simulate a
|
||||
# fork. It includes the dirty work of closing extra filehandles and preparing log
|
||||
# files to produce the same logs as screen_it(). The log filename is derived
|
||||
# from the service name and global-and-now-misnamed SCREEN_LOGDIR
|
||||
# _run_process service "command-line"
|
||||
# from the service name and global-and-now-misnamed ``SCREEN_LOGDIR``
|
||||
# Uses globals ``CURRENT_LOG_TIME``, ``SCREEN_LOGDIR``, ``SCREEN_NAME``, ``SERVICE_DIR``
|
||||
# If an optional group is provided sg will be used to set the group of
|
||||
# the command.
|
||||
# _run_process service "command-line" [group]
|
||||
function _run_process {
|
||||
local service=$1
|
||||
local command="$2"
|
||||
local group=$3
|
||||
|
||||
# Undo logging redirections and close the extra descriptors
|
||||
exec 1>&3
|
||||
@@ -995,15 +1016,23 @@ function _run_process {
|
||||
exec 6>&-
|
||||
|
||||
if [[ -n ${SCREEN_LOGDIR} ]]; then
|
||||
exec 1>&${SCREEN_LOGDIR}/screen-${1}.${CURRENT_LOG_TIME}.log 2>&1
|
||||
ln -sf ${SCREEN_LOGDIR}/screen-${1}.${CURRENT_LOG_TIME}.log ${SCREEN_LOGDIR}/screen-${1}.log
|
||||
exec 1>&${SCREEN_LOGDIR}/screen-${service}.${CURRENT_LOG_TIME}.log 2>&1
|
||||
ln -sf ${SCREEN_LOGDIR}/screen-${service}.${CURRENT_LOG_TIME}.log ${SCREEN_LOGDIR}/screen-${service}.log
|
||||
|
||||
# TODO(dtroyer): Hack to get stdout from the Python interpreter for the logs.
|
||||
export PYTHONUNBUFFERED=1
|
||||
fi
|
||||
|
||||
exec /bin/bash -c "$command"
|
||||
die "$service exec failure: $command"
|
||||
# Run under ``setsid`` to force the process to become a session and group leader.
|
||||
# The pid saved can be used with pkill -g to get the entire process group.
|
||||
if [[ -n "$group" ]]; then
|
||||
setsid sg $group "$command" & echo $! >$SERVICE_DIR/$SCREEN_NAME/$service.pid
|
||||
else
|
||||
setsid $command & echo $! >$SERVICE_DIR/$SCREEN_NAME/$service.pid
|
||||
fi
|
||||
|
||||
# Just silently exit this process
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Helper to remove the ``*.failure`` files under ``$SERVICE_DIR/$SCREEN_NAME``.
|
||||
@@ -1030,59 +1059,71 @@ function is_running {
|
||||
return $RC
|
||||
}
|
||||
|
||||
# run_process() launches a child process that closes all file descriptors and
|
||||
# then exec's the passed in command. This is meant to duplicate the semantics
|
||||
# of screen_it() without screen. PIDs are written to
|
||||
# $SERVICE_DIR/$SCREEN_NAME/$service.pid
|
||||
# run_process service "command-line"
|
||||
# Run a single service under screen or directly
|
||||
# If the command includes shell metachatacters (;<>*) it must be run using a shell
|
||||
# If an optional group is provided sg will be used to run the
|
||||
# command as that group.
|
||||
# run_process service "command-line" [group]
|
||||
function run_process {
|
||||
local service=$1
|
||||
local command="$2"
|
||||
local group=$3
|
||||
|
||||
# Spawn the child process
|
||||
_run_process "$service" "$command" &
|
||||
echo $!
|
||||
if is_service_enabled $service; then
|
||||
if [[ "$USE_SCREEN" = "True" ]]; then
|
||||
screen_service "$service" "$command" "$group"
|
||||
else
|
||||
# Spawn directly without screen
|
||||
_run_process "$service" "$command" "$group" &
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Helper to launch a service in a named screen
|
||||
# screen_it service "command-line"
|
||||
function screen_it {
|
||||
# Uses globals ``CURRENT_LOG_TIME``, ``SCREEN_NAME``, ``SCREEN_LOGDIR``,
|
||||
# ``SERVICE_DIR``, ``USE_SCREEN``
|
||||
# screen_service service "command-line" [group]
|
||||
# Run a command in a shell in a screen window, if an optional group
|
||||
# is provided, use sg to set the group of the command.
|
||||
function screen_service {
|
||||
local service=$1
|
||||
local command="$2"
|
||||
local group=$3
|
||||
|
||||
SCREEN_NAME=${SCREEN_NAME:-stack}
|
||||
SERVICE_DIR=${SERVICE_DIR:-${DEST}/status}
|
||||
USE_SCREEN=$(trueorfalse True $USE_SCREEN)
|
||||
|
||||
if is_service_enabled $1; then
|
||||
if is_service_enabled $service; then
|
||||
# Append the service to the screen rc file
|
||||
screen_rc "$1" "$2"
|
||||
screen_rc "$service" "$command"
|
||||
|
||||
if [[ "$USE_SCREEN" = "True" ]]; then
|
||||
screen -S $SCREEN_NAME -X screen -t $1
|
||||
screen -S $SCREEN_NAME -X screen -t $service
|
||||
|
||||
if [[ -n ${SCREEN_LOGDIR} ]]; then
|
||||
screen -S $SCREEN_NAME -p $1 -X logfile ${SCREEN_LOGDIR}/screen-${1}.${CURRENT_LOG_TIME}.log
|
||||
screen -S $SCREEN_NAME -p $1 -X log on
|
||||
ln -sf ${SCREEN_LOGDIR}/screen-${1}.${CURRENT_LOG_TIME}.log ${SCREEN_LOGDIR}/screen-${1}.log
|
||||
fi
|
||||
|
||||
# sleep to allow bash to be ready to be send the command - we are
|
||||
# creating a new window in screen and then sends characters, so if
|
||||
# bash isn't running by the time we send the command, nothing happens
|
||||
sleep 1.5
|
||||
|
||||
NL=`echo -ne '\015'`
|
||||
# This fun command does the following:
|
||||
# - the passed server command is backgrounded
|
||||
# - the pid of the background process is saved in the usual place
|
||||
# - the server process is brought back to the foreground
|
||||
# - if the server process exits prematurely the fg command errors
|
||||
# and a message is written to stdout and the service failure file
|
||||
# The pid saved can be used in screen_stop() as a process group
|
||||
# id to kill off all child processes
|
||||
screen -S $SCREEN_NAME -p $1 -X stuff "$2 & echo \$! >$SERVICE_DIR/$SCREEN_NAME/$1.pid; fg || echo \"$1 failed to start\" | tee \"$SERVICE_DIR/$SCREEN_NAME/$1.failure\"$NL"
|
||||
else
|
||||
# Spawn directly without screen
|
||||
run_process "$1" "$2" >$SERVICE_DIR/$SCREEN_NAME/$1.pid
|
||||
if [[ -n ${SCREEN_LOGDIR} ]]; then
|
||||
screen -S $SCREEN_NAME -p $service -X logfile ${SCREEN_LOGDIR}/screen-${service}.${CURRENT_LOG_TIME}.log
|
||||
screen -S $SCREEN_NAME -p $service -X log on
|
||||
ln -sf ${SCREEN_LOGDIR}/screen-${service}.${CURRENT_LOG_TIME}.log ${SCREEN_LOGDIR}/screen-${service}.log
|
||||
fi
|
||||
|
||||
# sleep to allow bash to be ready to be send the command - we are
|
||||
# creating a new window in screen and then sends characters, so if
|
||||
# bash isn't running by the time we send the command, nothing happens
|
||||
sleep 3
|
||||
|
||||
NL=`echo -ne '\015'`
|
||||
# This fun command does the following:
|
||||
# - the passed server command is backgrounded
|
||||
# - the pid of the background process is saved in the usual place
|
||||
# - the server process is brought back to the foreground
|
||||
# - if the server process exits prematurely the fg command errors
|
||||
# and a message is written to stdout and the service failure file
|
||||
# The pid saved can be used in stop_process() as a process group
|
||||
# id to kill off all child processes
|
||||
if [[ -n "$group" ]]; then
|
||||
command="sg $group '$command'"
|
||||
fi
|
||||
screen -S $SCREEN_NAME -p $service -X stuff "$command & echo \$! >$SERVICE_DIR/$SCREEN_NAME/${service}.pid; fg || echo \"$service failed to start\" | tee \"$SERVICE_DIR/$SCREEN_NAME/${service}.failure\"$NL"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -1117,21 +1158,42 @@ function screen_rc {
|
||||
# If a PID is available use it, kill the whole process group via TERM
|
||||
# If screen is being used kill the screen window; this will catch processes
|
||||
# that did not leave a PID behind
|
||||
# screen_stop service
|
||||
function screen_stop {
|
||||
# Uses globals ``SCREEN_NAME``, ``SERVICE_DIR``, ``USE_SCREEN``
|
||||
# screen_stop_service service
|
||||
function screen_stop_service {
|
||||
local service=$1
|
||||
|
||||
SCREEN_NAME=${SCREEN_NAME:-stack}
|
||||
SERVICE_DIR=${SERVICE_DIR:-${DEST}/status}
|
||||
USE_SCREEN=$(trueorfalse True $USE_SCREEN)
|
||||
|
||||
if is_service_enabled $1; then
|
||||
if is_service_enabled $service; then
|
||||
# Clean up the screen window
|
||||
screen -S $SCREEN_NAME -p $service -X kill
|
||||
fi
|
||||
}
|
||||
|
||||
# Stop a service process
|
||||
# If a PID is available use it, kill the whole process group via TERM
|
||||
# If screen is being used kill the screen window; this will catch processes
|
||||
# that did not leave a PID behind
|
||||
# Uses globals ``SERVICE_DIR``, ``USE_SCREEN``
|
||||
# stop_process service
|
||||
function stop_process {
|
||||
local service=$1
|
||||
|
||||
SERVICE_DIR=${SERVICE_DIR:-${DEST}/status}
|
||||
USE_SCREEN=$(trueorfalse True $USE_SCREEN)
|
||||
|
||||
if is_service_enabled $service; then
|
||||
# Kill via pid if we have one available
|
||||
if [[ -r $SERVICE_DIR/$SCREEN_NAME/$1.pid ]]; then
|
||||
pkill -TERM -P -$(cat $SERVICE_DIR/$SCREEN_NAME/$1.pid)
|
||||
rm $SERVICE_DIR/$SCREEN_NAME/$1.pid
|
||||
if [[ -r $SERVICE_DIR/$SCREEN_NAME/$service.pid ]]; then
|
||||
pkill -g $(cat $SERVICE_DIR/$SCREEN_NAME/$service.pid)
|
||||
rm $SERVICE_DIR/$SCREEN_NAME/$service.pid
|
||||
fi
|
||||
if [[ "$USE_SCREEN" = "True" ]]; then
|
||||
# Clean up the screen window
|
||||
screen -S $SCREEN_NAME -p $1 -X kill
|
||||
screen_stop_service $service
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@@ -1165,6 +1227,91 @@ function service_check {
|
||||
fi
|
||||
}
|
||||
|
||||
# Tail a log file in a screen if USE_SCREEN is true.
|
||||
function tail_log {
|
||||
local service=$1
|
||||
local logfile=$2
|
||||
|
||||
USE_SCREEN=$(trueorfalse True $USE_SCREEN)
|
||||
if [[ "$USE_SCREEN" = "True" ]]; then
|
||||
screen_service "$service" "sudo tail -f $logfile"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Deprecated Functions
|
||||
# --------------------
|
||||
|
||||
# _old_run_process() is designed to be backgrounded by old_run_process() to simulate a
|
||||
# fork. It includes the dirty work of closing extra filehandles and preparing log
|
||||
# files to produce the same logs as screen_it(). The log filename is derived
|
||||
# from the service name and global-and-now-misnamed ``SCREEN_LOGDIR``
|
||||
# Uses globals ``CURRENT_LOG_TIME``, ``SCREEN_LOGDIR``, ``SCREEN_NAME``, ``SERVICE_DIR``
|
||||
# _old_run_process service "command-line"
|
||||
function _old_run_process {
|
||||
local service=$1
|
||||
local command="$2"
|
||||
|
||||
# Undo logging redirections and close the extra descriptors
|
||||
exec 1>&3
|
||||
exec 2>&3
|
||||
exec 3>&-
|
||||
exec 6>&-
|
||||
|
||||
if [[ -n ${SCREEN_LOGDIR} ]]; then
|
||||
exec 1>&${SCREEN_LOGDIR}/screen-${1}.${CURRENT_LOG_TIME}.log 2>&1
|
||||
ln -sf ${SCREEN_LOGDIR}/screen-${1}.${CURRENT_LOG_TIME}.log ${SCREEN_LOGDIR}/screen-${1}.log
|
||||
|
||||
# TODO(dtroyer): Hack to get stdout from the Python interpreter for the logs.
|
||||
export PYTHONUNBUFFERED=1
|
||||
fi
|
||||
|
||||
exec /bin/bash -c "$command"
|
||||
die "$service exec failure: $command"
|
||||
}
|
||||
|
||||
# old_run_process() launches a child process that closes all file descriptors and
|
||||
# then exec's the passed in command. This is meant to duplicate the semantics
|
||||
# of screen_it() without screen. PIDs are written to
|
||||
# ``$SERVICE_DIR/$SCREEN_NAME/$service.pid`` by the spawned child process.
|
||||
# old_run_process service "command-line"
|
||||
function old_run_process {
|
||||
local service=$1
|
||||
local command="$2"
|
||||
|
||||
# Spawn the child process
|
||||
_old_run_process "$service" "$command" &
|
||||
echo $!
|
||||
}
|
||||
|
||||
# Compatibility for existing start_XXXX() functions
|
||||
# Uses global ``USE_SCREEN``
|
||||
# screen_it service "command-line"
|
||||
function screen_it {
|
||||
if is_service_enabled $1; then
|
||||
# Append the service to the screen rc file
|
||||
screen_rc "$1" "$2"
|
||||
|
||||
if [[ "$USE_SCREEN" = "True" ]]; then
|
||||
screen_service "$1" "$2"
|
||||
else
|
||||
# Spawn directly without screen
|
||||
old_run_process "$1" "$2" >$SERVICE_DIR/$SCREEN_NAME/$1.pid
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Compatibility for existing stop_XXXX() functions
|
||||
# Stop a service in screen
|
||||
# If a PID is available use it, kill the whole process group via TERM
|
||||
# If screen is being used kill the screen window; this will catch processes
|
||||
# that did not leave a PID behind
|
||||
# screen_stop service
|
||||
function screen_stop {
|
||||
# Clean up the screen window
|
||||
stop_process $1
|
||||
}
|
||||
|
||||
|
||||
# Python Functions
|
||||
# ================
|
||||
@@ -1209,7 +1356,7 @@ function pip_install {
|
||||
CMD_PIP=$DEST/.venv/bin/pip
|
||||
SUDO_PIP="env"
|
||||
else
|
||||
SUDO_PIP="sudo"
|
||||
SUDO_PIP="sudo -H"
|
||||
CMD_PIP=$(get_pip_command)
|
||||
fi
|
||||
|
||||
@@ -1239,6 +1386,37 @@ function pip_install {
|
||||
&& $SUDO_PIP rm -rf ${pip_build_tmp}
|
||||
}
|
||||
|
||||
# should we use this library from their git repo, or should we let it
|
||||
# get pulled in via pip dependencies.
|
||||
function use_library_from_git {
|
||||
local name=$1
|
||||
local enabled=1
|
||||
[[ ,${LIBS_FROM_GIT}, =~ ,${name}, ]] && enabled=0
|
||||
return $enabled
|
||||
}
|
||||
|
||||
# setup a library by name. If we are trying to use the library from
|
||||
# git, we'll do a git based install, otherwise we'll punt and the
|
||||
# library should be installed by a requirements pull from another
|
||||
# project.
|
||||
function setup_lib {
|
||||
local name=$1
|
||||
local dir=${GITDIR[$name]}
|
||||
setup_install $dir
|
||||
}
|
||||
|
||||
# setup a library by name in editiable mode. If we are trying to use
|
||||
# the library from git, we'll do a git based install, otherwise we'll
|
||||
# punt and the library should be installed by a requirements pull from
|
||||
# another project.
|
||||
#
|
||||
# use this for non namespaced libraries
|
||||
function setup_dev_lib {
|
||||
local name=$1
|
||||
local dir=${GITDIR[$name]}
|
||||
setup_develop $dir
|
||||
}
|
||||
|
||||
# this should be used if you want to install globally, all libraries should
|
||||
# use this, especially *oslo* ones
|
||||
function setup_install {
|
||||
@@ -1429,6 +1607,7 @@ function is_service_enabled {
|
||||
# are implemented
|
||||
|
||||
[[ ${service} == n-cell-* && ${ENABLED_SERVICES} =~ "n-cell" ]] && enabled=0
|
||||
[[ ${service} == n-cpu-* && ${ENABLED_SERVICES} =~ "n-cpu" ]] && enabled=0
|
||||
[[ ${service} == "nova" && ${ENABLED_SERVICES} =~ "n-" ]] && enabled=0
|
||||
[[ ${service} == "cinder" && ${ENABLED_SERVICES} =~ "c-" ]] && enabled=0
|
||||
[[ ${service} == "ceilometer" && ${ENABLED_SERVICES} =~ "ceilometer-" ]] && enabled=0
|
||||
|
||||
+19
-17
@@ -35,8 +35,9 @@ set +o xtrace
|
||||
# --------
|
||||
|
||||
# Set up default directories
|
||||
GITDIR["python-ceilometerclient"]=$DEST/python-ceilometerclient
|
||||
|
||||
CEILOMETER_DIR=$DEST/ceilometer
|
||||
CEILOMETERCLIENT_DIR=$DEST/python-ceilometerclient
|
||||
CEILOMETER_CONF_DIR=/etc/ceilometer
|
||||
CEILOMETER_CONF=$CEILOMETER_CONF_DIR/ceilometer.conf
|
||||
CEILOMETER_API_LOG_DIR=/var/log/ceilometer-api
|
||||
@@ -123,12 +124,6 @@ function cleanup_ceilometer {
|
||||
fi
|
||||
}
|
||||
|
||||
# configure_ceilometerclient() - Set config files, create data dirs, etc
|
||||
function configure_ceilometerclient {
|
||||
setup_develop $CEILOMETERCLIENT_DIR
|
||||
sudo install -D -m 0644 -o $STACK_USER {$CEILOMETERCLIENT_DIR/tools/,/etc/bash_completion.d/}ceilometer.bash_completion
|
||||
}
|
||||
|
||||
# configure_ceilometer() - Set config files, create data dirs, etc
|
||||
function configure_ceilometer {
|
||||
setup_develop $CEILOMETER_DIR
|
||||
@@ -230,21 +225,28 @@ function install_ceilometer {
|
||||
|
||||
# install_ceilometerclient() - Collect source and prepare
|
||||
function install_ceilometerclient {
|
||||
git_clone $CEILOMETERCLIENT_REPO $CEILOMETERCLIENT_DIR $CEILOMETERCLIENT_BRANCH
|
||||
if use_library_from_git "python-ceilometerclient"; then
|
||||
git_clone_by_name "python-ceilometerclient"
|
||||
setup_dev_lib "python-ceilometerclient"
|
||||
sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-ceilometerclient"]}/tools/,/etc/bash_completion.d/}ceilometer.bash_completion
|
||||
fi
|
||||
}
|
||||
|
||||
# start_ceilometer() - Start running processes, including screen
|
||||
function start_ceilometer {
|
||||
run_process ceilometer-acentral "ceilometer-agent-central --config-file $CEILOMETER_CONF"
|
||||
run_process ceilometer-anotification "ceilometer-agent-notification --config-file $CEILOMETER_CONF"
|
||||
run_process ceilometer-collector "ceilometer-collector --config-file $CEILOMETER_CONF"
|
||||
run_process ceilometer-api "ceilometer-api -d -v --log-dir=$CEILOMETER_API_LOG_DIR --config-file $CEILOMETER_CONF"
|
||||
|
||||
# Start the compute agent last to allow time for the collector to
|
||||
# fully wake up and connect to the message bus. See bug #1355809
|
||||
if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
|
||||
screen_it ceilometer-acompute "cd ; sg $LIBVIRT_GROUP \"ceilometer-agent-compute --config-file $CEILOMETER_CONF\""
|
||||
run_process ceilometer-acompute "ceilometer-agent-compute --config-file $CEILOMETER_CONF" $LIBVIRT_GROUP
|
||||
fi
|
||||
if [[ "$VIRT_DRIVER" = 'vsphere' ]]; then
|
||||
screen_it ceilometer-acompute "cd ; ceilometer-agent-compute --config-file $CEILOMETER_CONF"
|
||||
run_process ceilometer-acompute "ceilometer-agent-compute --config-file $CEILOMETER_CONF"
|
||||
fi
|
||||
screen_it ceilometer-acentral "cd ; ceilometer-agent-central --config-file $CEILOMETER_CONF"
|
||||
screen_it ceilometer-anotification "cd ; ceilometer-agent-notification --config-file $CEILOMETER_CONF"
|
||||
screen_it ceilometer-collector "cd ; ceilometer-collector --config-file $CEILOMETER_CONF"
|
||||
screen_it ceilometer-api "cd ; ceilometer-api -d -v --log-dir=$CEILOMETER_API_LOG_DIR --config-file $CEILOMETER_CONF"
|
||||
|
||||
# only die on API if it was actually intended to be turned on
|
||||
if is_service_enabled ceilometer-api; then
|
||||
@@ -254,15 +256,15 @@ function start_ceilometer {
|
||||
fi
|
||||
fi
|
||||
|
||||
screen_it ceilometer-alarm-notifier "cd ; ceilometer-alarm-notifier --config-file $CEILOMETER_CONF"
|
||||
screen_it ceilometer-alarm-evaluator "cd ; ceilometer-alarm-evaluator --config-file $CEILOMETER_CONF"
|
||||
run_process ceilometer-alarm-notifier "ceilometer-alarm-notifier --config-file $CEILOMETER_CONF"
|
||||
run_process ceilometer-alarm-evaluator "ceilometer-alarm-evaluator --config-file $CEILOMETER_CONF"
|
||||
}
|
||||
|
||||
# stop_ceilometer() - Stop running processes
|
||||
function stop_ceilometer {
|
||||
# Kill the ceilometer screen windows
|
||||
for serv in ceilometer-acompute ceilometer-acentral ceilometer-anotification ceilometer-collector ceilometer-api ceilometer-alarm-notifier ceilometer-alarm-evaluator; do
|
||||
screen_stop $serv
|
||||
stop_process $serv
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
+17
-9
@@ -35,8 +35,9 @@ if [[ -r $CINDER_PLUGINS/$CINDER_DRIVER ]]; then
|
||||
fi
|
||||
|
||||
# set up default directories
|
||||
GITDIR["python-cinderclient"]=$DEST/python-cinderclient
|
||||
|
||||
CINDER_DIR=$DEST/cinder
|
||||
CINDERCLIENT_DIR=$DEST/python-cinderclient
|
||||
CINDER_STATE_PATH=${CINDER_STATE_PATH:=$DATA_DIR/cinder}
|
||||
CINDER_AUTH_CACHE_DIR=${CINDER_AUTH_CACHE_DIR:-/var/cache/cinder}
|
||||
|
||||
@@ -475,9 +476,11 @@ function install_cinder {
|
||||
|
||||
# install_cinderclient() - Collect source and prepare
|
||||
function install_cinderclient {
|
||||
git_clone $CINDERCLIENT_REPO $CINDERCLIENT_DIR $CINDERCLIENT_BRANCH
|
||||
setup_develop $CINDERCLIENT_DIR
|
||||
sudo install -D -m 0644 -o $STACK_USER {$CINDERCLIENT_DIR/tools/,/etc/bash_completion.d/}cinder.bash_completion
|
||||
if use_library_from_git "python-cinderclient"; then
|
||||
git_clone_by_name "python-cinderclient"
|
||||
setup_dev_lib "python-cinderclient"
|
||||
sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-cinderclient"]}/tools/,/etc/bash_completion.d/}cinder.bash_completion
|
||||
fi
|
||||
}
|
||||
|
||||
# apply config.d approach for cinder volumes directory
|
||||
@@ -514,10 +517,15 @@ function start_cinder {
|
||||
sudo tgtadm --mode system --op update --name debug --value on
|
||||
fi
|
||||
|
||||
screen_it c-api "cd $CINDER_DIR && $CINDER_BIN_DIR/cinder-api --config-file $CINDER_CONF"
|
||||
screen_it c-sch "cd $CINDER_DIR && $CINDER_BIN_DIR/cinder-scheduler --config-file $CINDER_CONF"
|
||||
screen_it c-bak "cd $CINDER_DIR && $CINDER_BIN_DIR/cinder-backup --config-file $CINDER_CONF"
|
||||
screen_it c-vol "cd $CINDER_DIR && $CINDER_BIN_DIR/cinder-volume --config-file $CINDER_CONF"
|
||||
run_process c-api "$CINDER_BIN_DIR/cinder-api --config-file $CINDER_CONF"
|
||||
echo "Waiting for Cinder API to start..."
|
||||
if ! wait_for_service $SERVICE_TIMEOUT $CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT; then
|
||||
die $LINENO "c-api did not start"
|
||||
fi
|
||||
|
||||
run_process c-sch "$CINDER_BIN_DIR/cinder-scheduler --config-file $CINDER_CONF"
|
||||
run_process c-bak "$CINDER_BIN_DIR/cinder-backup --config-file $CINDER_CONF"
|
||||
run_process c-vol "$CINDER_BIN_DIR/cinder-volume --config-file $CINDER_CONF"
|
||||
|
||||
# NOTE(jdg): For cinder, startup order matters. To ensure that repor_capabilities is received
|
||||
# by the scheduler start the cinder-volume service last (or restart it) after the scheduler
|
||||
@@ -533,7 +541,7 @@ function start_cinder {
|
||||
function stop_cinder {
|
||||
# Kill the cinder screen windows
|
||||
for serv in c-api c-bak c-sch c-vol; do
|
||||
screen_stop $serv
|
||||
stop_process $serv
|
||||
done
|
||||
|
||||
if is_service_enabled c-vol; then
|
||||
|
||||
+1
-3
@@ -82,8 +82,6 @@ function merge_config_file {
|
||||
local matchgroup=$2
|
||||
local configfile=$3
|
||||
|
||||
[[ -r $configfile ]] || touch $configfile
|
||||
|
||||
get_meta_section $file $matchgroup $configfile | \
|
||||
$CONFIG_AWK_CMD -v configfile=$configfile '
|
||||
BEGIN { section = "" }
|
||||
@@ -114,7 +112,7 @@ function merge_config_group {
|
||||
|
||||
for group in $matchgroups; do
|
||||
for configfile in $(get_meta_section_files $localfile $group); do
|
||||
if [[ -d $(dirname $configfile) ]]; then
|
||||
if [[ -d $(dirname $(eval "echo $configfile")) ]]; then
|
||||
merge_config_file $localfile $group $configfile
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -77,14 +77,14 @@ function install_ganttclient {
|
||||
# start_gantt() - Start running processes, including screen
|
||||
function start_gantt {
|
||||
if is_service_enabled gantt; then
|
||||
screen_it gantt "cd $GANTT_DIR && $GANTT_BIN_DIR/gantt-scheduler --config-file $GANTT_CONF"
|
||||
run_process gantt "$GANTT_BIN_DIR/gantt-scheduler --config-file $GANTT_CONF"
|
||||
fi
|
||||
}
|
||||
|
||||
# stop_gantt() - Stop running processes
|
||||
function stop_gantt {
|
||||
echo "Stop Gantt"
|
||||
screen_stop gantt
|
||||
stop_process gantt
|
||||
}
|
||||
|
||||
# Restore xtrace
|
||||
|
||||
+10
-7
@@ -27,8 +27,9 @@ set +o xtrace
|
||||
# --------
|
||||
|
||||
# Set up default directories
|
||||
GITDIR["python-glanceclient"]=$DEST/python-glanceclient
|
||||
|
||||
GLANCE_DIR=$DEST/glance
|
||||
GLANCECLIENT_DIR=$DEST/python-glanceclient
|
||||
GLANCE_CACHE_DIR=${GLANCE_CACHE_DIR:=$DATA_DIR/glance/cache}
|
||||
GLANCE_IMAGE_DIR=${GLANCE_IMAGE_DIR:=$DATA_DIR/glance/images}
|
||||
GLANCE_AUTH_CACHE_DIR=${GLANCE_AUTH_CACHE_DIR:-/var/cache/glance}
|
||||
@@ -234,8 +235,10 @@ function init_glance {
|
||||
|
||||
# install_glanceclient() - Collect source and prepare
|
||||
function install_glanceclient {
|
||||
git_clone $GLANCECLIENT_REPO $GLANCECLIENT_DIR $GLANCECLIENT_BRANCH
|
||||
setup_develop $GLANCECLIENT_DIR
|
||||
if use_library_from_git "python-glanceclient"; then
|
||||
git_clone_by_name "python-glanceclient"
|
||||
setup_dev_lib "python-glanceclient"
|
||||
fi
|
||||
}
|
||||
|
||||
# install_glance() - Collect source and prepare
|
||||
@@ -246,8 +249,8 @@ function install_glance {
|
||||
|
||||
# start_glance() - Start running processes, including screen
|
||||
function start_glance {
|
||||
screen_it g-reg "cd $GLANCE_DIR; $GLANCE_BIN_DIR/glance-registry --config-file=$GLANCE_CONF_DIR/glance-registry.conf"
|
||||
screen_it g-api "cd $GLANCE_DIR; $GLANCE_BIN_DIR/glance-api --config-file=$GLANCE_CONF_DIR/glance-api.conf"
|
||||
run_process g-reg "$GLANCE_BIN_DIR/glance-registry --config-file=$GLANCE_CONF_DIR/glance-registry.conf"
|
||||
run_process g-api "$GLANCE_BIN_DIR/glance-api --config-file=$GLANCE_CONF_DIR/glance-api.conf"
|
||||
echo "Waiting for g-api ($GLANCE_HOSTPORT) to start..."
|
||||
if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget --no-proxy -q -O- http://$GLANCE_HOSTPORT; do sleep 1; done"; then
|
||||
die $LINENO "g-api did not start"
|
||||
@@ -257,8 +260,8 @@ function start_glance {
|
||||
# stop_glance() - Stop running processes
|
||||
function stop_glance {
|
||||
# Kill the Glance screen windows
|
||||
screen_stop g-api
|
||||
screen_stop g-reg
|
||||
stop_process g-api
|
||||
stop_process g-reg
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -29,8 +29,9 @@ set +o xtrace
|
||||
# --------
|
||||
|
||||
# set up default directories
|
||||
GITDIR["python-heatclient"]=$DEST/python-heatclient
|
||||
|
||||
HEAT_DIR=$DEST/heat
|
||||
HEATCLIENT_DIR=$DEST/python-heatclient
|
||||
HEAT_AUTH_CACHE_DIR=${HEAT_AUTH_CACHE_DIR:-/var/cache/heat}
|
||||
HEAT_STANDALONE=`trueorfalse False $HEAT_STANDALONE`
|
||||
HEAT_CONF_DIR=/etc/heat
|
||||
@@ -165,9 +166,11 @@ function create_heat_cache_dir {
|
||||
|
||||
# install_heatclient() - Collect source and prepare
|
||||
function install_heatclient {
|
||||
git_clone $HEATCLIENT_REPO $HEATCLIENT_DIR $HEATCLIENT_BRANCH
|
||||
setup_develop $HEATCLIENT_DIR
|
||||
sudo install -D -m 0644 -o $STACK_USER {$HEATCLIENT_DIR/tools/,/etc/bash_completion.d/}heat.bash_completion
|
||||
if use_library_from_git "python-heatclient"; then
|
||||
git_clone_by_name "python-heatclient"
|
||||
setup_dev_lib "python-heatclient"
|
||||
sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-heatclient"]}/tools/,/etc/bash_completion.d/}heat.bash_completion
|
||||
fi
|
||||
}
|
||||
|
||||
# install_heat() - Collect source and prepare
|
||||
@@ -177,17 +180,17 @@ function install_heat {
|
||||
|
||||
# start_heat() - Start running processes, including screen
|
||||
function start_heat {
|
||||
screen_it h-eng "cd $HEAT_DIR; bin/heat-engine --config-file=$HEAT_CONF"
|
||||
screen_it h-api "cd $HEAT_DIR; bin/heat-api --config-file=$HEAT_CONF"
|
||||
screen_it h-api-cfn "cd $HEAT_DIR; bin/heat-api-cfn --config-file=$HEAT_CONF"
|
||||
screen_it h-api-cw "cd $HEAT_DIR; bin/heat-api-cloudwatch --config-file=$HEAT_CONF"
|
||||
run_process h-eng "$HEAT_DIR/bin/heat-engine --config-file=$HEAT_CONF"
|
||||
run_process h-api "$HEAT_DIR/bin/heat-api --config-file=$HEAT_CONF"
|
||||
run_process h-api-cfn "$HEAT_DIR/bin/heat-api-cfn --config-file=$HEAT_CONF"
|
||||
run_process h-api-cw "$HEAT_DIR/bin/heat-api-cloudwatch --config-file=$HEAT_CONF"
|
||||
}
|
||||
|
||||
# stop_heat() - Stop running processes
|
||||
function stop_heat {
|
||||
# Kill the screen windows
|
||||
for serv in h-eng h-api h-api-cfn h-api-cw; do
|
||||
screen_stop $serv
|
||||
stop_process $serv
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
+14
-1
@@ -25,6 +25,8 @@ set +o xtrace
|
||||
# --------
|
||||
|
||||
# Set up default directories
|
||||
GITDIR["django_openstack_auth"]=$DEST/django_openstack_auth
|
||||
|
||||
HORIZON_DIR=$DEST/horizon
|
||||
|
||||
# local_settings.py is used to customize Dashboard settings.
|
||||
@@ -127,6 +129,7 @@ function init_horizon {
|
||||
|
||||
# Remove old log files that could mess with how devstack detects whether Horizon
|
||||
# has been successfully started (see start_horizon() and functions::screen_it())
|
||||
# and run_process
|
||||
sudo rm -f /var/log/$APACHE_NAME/horizon_*
|
||||
|
||||
# Configure apache to run horizon
|
||||
@@ -140,6 +143,16 @@ function init_horizon {
|
||||
\" $FILES/apache-horizon.template >$horizon_conf"
|
||||
}
|
||||
|
||||
# install_django_openstack_auth() - Collect source and prepare
|
||||
function install_django_openstack_auth {
|
||||
if use_library_from_git "django_openstack_auth"; then
|
||||
local dir=${GITDIR["django_openstack_auth"]}
|
||||
git_clone_by_name "django_openstack_auth"
|
||||
fi
|
||||
# if we aren't using this library from git, then we just let it
|
||||
# get dragged in by the horizon setup.
|
||||
}
|
||||
|
||||
# install_horizon() - Collect source and prepare
|
||||
function install_horizon {
|
||||
# Apache installation, because we mark it NOPRIME
|
||||
@@ -151,7 +164,7 @@ function install_horizon {
|
||||
# start_horizon() - Start running processes, including screen
|
||||
function start_horizon {
|
||||
restart_apache_server
|
||||
screen_it horizon "cd $HORIZON_DIR && sudo tail -f /var/log/$APACHE_NAME/horizon_error.log"
|
||||
tail_log horizon /var/log/$APACHE_NAME/horizon_error.log
|
||||
}
|
||||
|
||||
# stop_horizon() - Stop running processes (non-screen)
|
||||
|
||||
@@ -20,7 +20,7 @@ set +o xtrace
|
||||
|
||||
# Defaults
|
||||
# --------
|
||||
PBR_DIR=$DEST/pbr
|
||||
GITDIR["pbr"]=$DEST/pbr
|
||||
REQUIREMENTS_DIR=$DEST/requirements
|
||||
|
||||
# Entry Points
|
||||
@@ -31,10 +31,10 @@ function unfubar_setuptools {
|
||||
# this is a giant game of who's on first, but it does consistently work
|
||||
# there is hope that upstream python packaging fixes this in the future
|
||||
echo_summary "Unbreaking setuptools"
|
||||
pip_install -U setuptools
|
||||
pip_install -U "setuptools<8.0"
|
||||
pip_install -U pip
|
||||
uninstall_package python-setuptools
|
||||
pip_install -U setuptools
|
||||
pip_install -U "setuptools<8.0"
|
||||
pip_install -U pip
|
||||
}
|
||||
|
||||
@@ -45,8 +45,12 @@ function install_infra {
|
||||
git_clone $REQUIREMENTS_REPO $REQUIREMENTS_DIR $REQUIREMENTS_BRANCH
|
||||
|
||||
# Install pbr
|
||||
git_clone $PBR_REPO $PBR_DIR $PBR_BRANCH
|
||||
setup_install $PBR_DIR
|
||||
if use_library_from_git "pbr"; then
|
||||
git_clone_by_name "pbr"
|
||||
setup_lib "pbr"
|
||||
else
|
||||
pip_install "pbr"
|
||||
fi
|
||||
}
|
||||
|
||||
# Restore xtrace
|
||||
|
||||
+40
-35
@@ -28,10 +28,11 @@ set +o pipefail
|
||||
# --------
|
||||
|
||||
# Set up default directories
|
||||
GITDIR["python-ironicclient"]=$DEST/python-ironicclient
|
||||
|
||||
IRONIC_DIR=$DEST/ironic
|
||||
IRONIC_DATA_DIR=$DATA_DIR/ironic
|
||||
IRONIC_STATE_PATH=/var/lib/ironic
|
||||
IRONICCLIENT_DIR=$DEST/python-ironicclient
|
||||
IRONIC_AUTH_CACHE_DIR=${IRONIC_AUTH_CACHE_DIR:-/var/cache/ironic}
|
||||
IRONIC_CONF_DIR=${IRONIC_CONF_DIR:-/etc/ironic}
|
||||
IRONIC_CONF_FILE=$IRONIC_CONF_DIR/ironic.conf
|
||||
@@ -49,15 +50,16 @@ IRONIC_SSH_KEY_FILENAME=${IRONIC_SSH_KEY_FILENAME:-ironic_key}
|
||||
IRONIC_KEY_FILE=$IRONIC_SSH_KEY_DIR/$IRONIC_SSH_KEY_FILENAME
|
||||
IRONIC_SSH_VIRT_TYPE=${IRONIC_SSH_VIRT_TYPE:-virsh}
|
||||
IRONIC_TFTPBOOT_DIR=${IRONIC_TFTPBOOT_DIR:-$IRONIC_DATA_DIR/tftpboot}
|
||||
IRONIC_VM_SSH_PORT=${IRONIC_VM_SSH_PORT:-2222}
|
||||
IRONIC_VM_SSH_PORT=${IRONIC_VM_SSH_PORT:-22}
|
||||
IRONIC_VM_SSH_ADDRESS=${IRONIC_VM_SSH_ADDRESS:-$HOST_IP}
|
||||
IRONIC_VM_COUNT=${IRONIC_VM_COUNT:-1}
|
||||
IRONIC_VM_SPECS_CPU=${IRONIC_VM_SPECS_CPU:-1}
|
||||
# NOTE(agordeev): both ubuntu and fedora deploy images won't work with 256MB of RAM.
|
||||
# System halts and throws kernel panic during initramfs unpacking.
|
||||
# Ubuntu needs at least 384MB, but fedora requires 448.
|
||||
# So placing 512 here to satisfy both.
|
||||
IRONIC_VM_SPECS_RAM=${IRONIC_VM_SPECS_RAM:-512}
|
||||
# NOTE(adam_g): Kernels 3.12 and newer user tmpfs by default for initramfs.
|
||||
# DIB produced ramdisks tend to be ~250MB but tmpfs will only allow
|
||||
# use of 50% of available memory before ENOSPC. Set minimum 1GB
|
||||
# for nodes to avoid (LP: #1311987) and ensure consistency across
|
||||
# older and newer kernels.
|
||||
IRONIC_VM_SPECS_RAM=${IRONIC_VM_SPECS_RAM:-1024}
|
||||
IRONIC_VM_SPECS_DISK=${IRONIC_VM_SPECS_DISK:-10}
|
||||
IRONIC_VM_EMULATOR=${IRONIC_VM_EMULATOR:-/usr/bin/qemu-system-x86_64}
|
||||
IRONIC_VM_NETWORK_BRIDGE=${IRONIC_VM_NETWORK_BRIDGE:-brbm}
|
||||
@@ -107,8 +109,22 @@ function install_ironic {
|
||||
|
||||
# install_ironicclient() - Collect sources and prepare
|
||||
function install_ironicclient {
|
||||
git_clone $IRONICCLIENT_REPO $IRONICCLIENT_DIR $IRONICCLIENT_BRANCH
|
||||
setup_develop $IRONICCLIENT_DIR
|
||||
if use_library_from_git "python-ironicclient"; then
|
||||
git_clone_by_name "python-ironicclient"
|
||||
setup_dev_lib "python-ironicclient"
|
||||
sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-ironicclient"]}/tools/,/etc/bash_completion.d/}ironic.bash_completion
|
||||
else
|
||||
# nothing actually "requires" ironicclient, so force instally from pypi
|
||||
pip_install python-ironicclient
|
||||
fi
|
||||
}
|
||||
|
||||
# _cleanup_ironic_apache_wsgi() - Remove wsgi files, disable and remove apache vhost file
|
||||
function _cleanup_ironic_apache_wsgi {
|
||||
sudo rm -rf $IRONIC_HTTP_DIR
|
||||
disable_apache_site ironic
|
||||
sudo rm -f $(apache_site_config_for ironic)
|
||||
restart_apache_server
|
||||
}
|
||||
|
||||
# cleanup_ironic() - Remove residual data files, anything left over from previous
|
||||
@@ -265,7 +281,7 @@ function start_ironic {
|
||||
# start_ironic_api() - Used by start_ironic().
|
||||
# Starts Ironic API server.
|
||||
function start_ironic_api {
|
||||
screen_it ir-api "cd $IRONIC_DIR; $IRONIC_BIN_DIR/ironic-api --config-file=$IRONIC_CONF_FILE"
|
||||
run_process ir-api "$IRONIC_BIN_DIR/ironic-api --config-file=$IRONIC_CONF_FILE"
|
||||
echo "Waiting for ir-api ($IRONIC_HOSTPORT) to start..."
|
||||
if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget --no-proxy -q -O- http://$IRONIC_HOSTPORT; do sleep 1; done"; then
|
||||
die $LINENO "ir-api did not start"
|
||||
@@ -275,7 +291,7 @@ function start_ironic_api {
|
||||
# start_ironic_conductor() - Used by start_ironic().
|
||||
# Starts Ironic conductor.
|
||||
function start_ironic_conductor {
|
||||
screen_it ir-cond "cd $IRONIC_DIR; $IRONIC_BIN_DIR/ironic-conductor --config-file=$IRONIC_CONF_FILE"
|
||||
run_process ir-cond "$IRONIC_BIN_DIR/ironic-conductor --config-file=$IRONIC_CONF_FILE"
|
||||
# TODO(romcheg): Find a way to check whether the conductor has started.
|
||||
}
|
||||
|
||||
@@ -379,11 +395,16 @@ function enroll_vms {
|
||||
neutron port-delete $PORT_ID
|
||||
}
|
||||
|
||||
function configure_tftpd {
|
||||
# enable tftp natting for allowing connections to SERVICE_HOST's tftp server
|
||||
function configure_iptables {
|
||||
# enable tftp natting for allowing connections to HOST_IP's tftp server
|
||||
sudo modprobe nf_conntrack_tftp
|
||||
sudo modprobe nf_nat_tftp
|
||||
# nodes boot from TFTP and callback to the API server listening on $HOST_IP
|
||||
sudo iptables -I INPUT -d $HOST_IP -p udp --dport 69 -j ACCEPT || true
|
||||
sudo iptables -I INPUT -d $HOST_IP -p tcp --dport 6385 -j ACCEPT || true
|
||||
}
|
||||
|
||||
function configure_tftpd {
|
||||
if is_ubuntu; then
|
||||
PXEBIN=/usr/lib/syslinux/pxelinux.0
|
||||
elif is_fedora; then
|
||||
@@ -432,31 +453,10 @@ function ironic_ssh_check {
|
||||
fi
|
||||
}
|
||||
|
||||
function configure_ironic_sshd {
|
||||
# Ensure sshd server accepts connections from localhost only
|
||||
|
||||
SSH_CONFIG=/etc/ssh/sshd_config
|
||||
HOST_PORT=$IRONIC_VM_SSH_ADDRESS:$IRONIC_VM_SSH_PORT
|
||||
if ! sudo grep ListenAddress $SSH_CONFIG | grep $HOST_PORT; then
|
||||
echo "ListenAddress $HOST_PORT" | sudo tee -a $SSH_CONFIG
|
||||
fi
|
||||
|
||||
SSH_SERVICE_NAME=sshd
|
||||
if is_ubuntu; then
|
||||
SSH_SERVICE_NAME=ssh
|
||||
fi
|
||||
|
||||
restart_service $SSH_SERVICE_NAME
|
||||
# to ensure ssh service is up and running
|
||||
sleep 3
|
||||
ironic_ssh_check $IRONIC_SSH_KEY_DIR/$IRONIC_SSH_KEY_FILENAME $IRONIC_VM_SSH_ADDRESS $IRONIC_VM_SSH_PORT $IRONIC_SSH_USERNAME 10
|
||||
|
||||
}
|
||||
|
||||
function configure_ironic_auxiliary {
|
||||
configure_ironic_dirs
|
||||
configure_ironic_ssh_keypair
|
||||
configure_ironic_sshd
|
||||
ironic_ssh_check $IRONIC_SSH_KEY_DIR/$IRONIC_SSH_KEY_FILENAME $IRONIC_VM_SSH_ADDRESS $IRONIC_VM_SSH_PORT $IRONIC_SSH_USERNAME 10
|
||||
}
|
||||
|
||||
# build deploy kernel+ramdisk, then upload them to glance
|
||||
@@ -527,6 +527,7 @@ function prepare_baremetal_basic_ops {
|
||||
create_bridge_and_vms
|
||||
enroll_vms
|
||||
configure_tftpd
|
||||
configure_iptables
|
||||
|
||||
# restart nova-compute to ensure its resource tracking is up to
|
||||
# date with newly enrolled nodes
|
||||
@@ -546,6 +547,10 @@ function cleanup_baremetal_basic_ops {
|
||||
sudo su $STACK_USER -c "$IRONIC_SCRIPTS_DIR/cleanup-nodes $IRONIC_VM_COUNT $IRONIC_VM_NETWORK_BRIDGE"
|
||||
sudo rm -rf /etc/xinetd.d/tftp /etc/init/tftpd-hpa.override
|
||||
restart_service xinetd
|
||||
sudo iptables -D INPUT -d $HOST_IP -p udp --dport 69 -j ACCEPT || true
|
||||
sudo iptables -D INPUT -d $HOST_IP -p tcp --dport 6385 -j ACCEPT || true
|
||||
sudo rmmod nf_conntrack_tftp || true
|
||||
sudo rmmod nf_nat_tftp || true
|
||||
}
|
||||
|
||||
# Restore xtrace + pipefail
|
||||
|
||||
+31
-8
@@ -32,6 +32,9 @@ set +o xtrace
|
||||
# --------
|
||||
|
||||
# Set up default directories
|
||||
GITDIR["python-keystoneclient"]=$DEST/python-keystoneclient
|
||||
GITDIR["keystonemiddleware"]=$DEST/keystonemiddleware
|
||||
|
||||
KEYSTONE_DIR=$DEST/keystone
|
||||
KEYSTONE_CONF_DIR=${KEYSTONE_CONF_DIR:-/etc/keystone}
|
||||
KEYSTONE_CONF=$KEYSTONE_CONF_DIR/keystone.conf
|
||||
@@ -39,8 +42,6 @@ KEYSTONE_PASTE_INI=${KEYSTONE_PASTE_INI:-$KEYSTONE_CONF_DIR/keystone-paste.ini}
|
||||
KEYSTONE_AUTH_CACHE_DIR=${KEYSTONE_AUTH_CACHE_DIR:-/var/cache/keystone}
|
||||
KEYSTONE_WSGI_DIR=${KEYSTONE_WSGI_DIR:-/var/www/keystone}
|
||||
|
||||
KEYSTONECLIENT_DIR=$DEST/python-keystoneclient
|
||||
|
||||
# Select the backend for Keystone's service catalog
|
||||
KEYSTONE_CATALOG_BACKEND=${KEYSTONE_CATALOG_BACKEND:-sql}
|
||||
KEYSTONE_CATALOG=$KEYSTONE_CONF_DIR/default_catalog.templates
|
||||
@@ -177,6 +178,13 @@ function configure_keystone {
|
||||
iniset $KEYSTONE_CONF assignment driver "keystone.assignment.backends.$KEYSTONE_ASSIGNMENT_BACKEND.Assignment"
|
||||
fi
|
||||
|
||||
# Configure rabbitmq credentials
|
||||
if is_service_enabled rabbit; then
|
||||
iniset $KEYSTONE_CONF DEFAULT rabbit_userid $RABBIT_USERID
|
||||
iniset $KEYSTONE_CONF DEFAULT rabbit_password $RABBIT_PASSWORD
|
||||
iniset $KEYSTONE_CONF DEFAULT rabbit_host $RABBIT_HOST
|
||||
fi
|
||||
|
||||
# Set the URL advertised in the ``versions`` structure returned by the '/' route
|
||||
iniset $KEYSTONE_CONF DEFAULT public_endpoint "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:%(public_port)s/"
|
||||
iniset $KEYSTONE_CONF DEFAULT admin_endpoint "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:%(admin_port)s/"
|
||||
@@ -389,9 +397,19 @@ function init_keystone {
|
||||
|
||||
# install_keystoneclient() - Collect source and prepare
|
||||
function install_keystoneclient {
|
||||
git_clone $KEYSTONECLIENT_REPO $KEYSTONECLIENT_DIR $KEYSTONECLIENT_BRANCH
|
||||
setup_develop $KEYSTONECLIENT_DIR
|
||||
sudo install -D -m 0644 -o $STACK_USER {$KEYSTONECLIENT_DIR/tools/,/etc/bash_completion.d/}keystone.bash_completion
|
||||
if use_library_from_git "python-keystoneclient"; then
|
||||
git_clone_by_name "python-keystoneclient"
|
||||
setup_dev_lib "python-keystoneclient"
|
||||
sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-keystoneclient"]}/tools/,/etc/bash_completion.d/}keystone.bash_completion
|
||||
fi
|
||||
}
|
||||
|
||||
# install_keystonemiddleware() - Collect source and prepare
|
||||
function install_keystonemiddleware {
|
||||
if use_library_from_git "keystonemiddleware"; then
|
||||
git_clone_by_name "keystonemiddleware"
|
||||
setup_dev_lib "keystonemiddleware"
|
||||
fi
|
||||
}
|
||||
|
||||
# install_keystone() - Collect source and prepare
|
||||
@@ -428,10 +446,10 @@ function start_keystone {
|
||||
|
||||
if is_apache_enabled_service key; then
|
||||
restart_apache_server
|
||||
screen_it key "cd $KEYSTONE_DIR && sudo tail -f /var/log/$APACHE_NAME/keystone"
|
||||
tail_log key /var/log/$APACHE_NAME/keystone
|
||||
else
|
||||
# Start Keystone in a screen window
|
||||
screen_it key "cd $KEYSTONE_DIR && $KEYSTONE_DIR/bin/keystone-all --config-file $KEYSTONE_CONF --debug"
|
||||
run_process key "$KEYSTONE_DIR/bin/keystone-all --config-file $KEYSTONE_CONF --debug"
|
||||
fi
|
||||
|
||||
echo "Waiting for keystone to start..."
|
||||
@@ -449,9 +467,14 @@ function start_keystone {
|
||||
# stop_keystone() - Stop running processes
|
||||
function stop_keystone {
|
||||
# Kill the Keystone screen window
|
||||
screen_stop key
|
||||
stop_process key
|
||||
# Cleanup the WSGI files and VHOST
|
||||
_cleanup_keystone_apache_wsgi
|
||||
}
|
||||
|
||||
function is_keystone_enabled {
|
||||
return is_service_enabled key
|
||||
}
|
||||
|
||||
# Restore xtrace
|
||||
$XTRACE
|
||||
|
||||
+17
-13
@@ -70,8 +70,10 @@ PRIVATE_SUBNET_NAME=${PRIVATE_SUBNET_NAME:-"private-subnet"}
|
||||
PUBLIC_SUBNET_NAME=${PUBLIC_SUBNET_NAME:-"public-subnet"}
|
||||
|
||||
# Set up default directories
|
||||
GITDIR["python-neutronclient"]=$DEST/python-neutronclient
|
||||
|
||||
|
||||
NEUTRON_DIR=$DEST/neutron
|
||||
NEUTRONCLIENT_DIR=$DEST/python-neutronclient
|
||||
NEUTRON_AUTH_CACHE_DIR=${NEUTRON_AUTH_CACHE_DIR:-/var/cache/neutron}
|
||||
|
||||
# Support entry points installation of console scripts
|
||||
@@ -450,9 +452,11 @@ function install_neutron {
|
||||
|
||||
# install_neutronclient() - Collect source and prepare
|
||||
function install_neutronclient {
|
||||
git_clone $NEUTRONCLIENT_REPO $NEUTRONCLIENT_DIR $NEUTRONCLIENT_BRANCH
|
||||
setup_develop $NEUTRONCLIENT_DIR
|
||||
sudo install -D -m 0644 -o $STACK_USER {$NEUTRONCLIENT_DIR/tools/,/etc/bash_completion.d/}neutron.bash_completion
|
||||
if use_library_from_git "python-neutronclient"; then
|
||||
git_clone_by_name "python-neutronclient"
|
||||
setup_dev_lib "python-neutronclient"
|
||||
sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-neutronclient"]}/tools/,/etc/bash_completion.d/}neutron.bash_completion
|
||||
fi
|
||||
}
|
||||
|
||||
# install_neutron_agent_packages() - Collect source and prepare
|
||||
@@ -476,7 +480,7 @@ function start_neutron_service_and_check {
|
||||
CFG_FILE_OPTIONS+=" --config-file /$cfg_file"
|
||||
done
|
||||
# Start the Neutron service
|
||||
screen_it q-svc "cd $NEUTRON_DIR && python $NEUTRON_BIN_DIR/neutron-server $CFG_FILE_OPTIONS"
|
||||
run_process q-svc "python $NEUTRON_BIN_DIR/neutron-server $CFG_FILE_OPTIONS"
|
||||
echo "Waiting for Neutron to start..."
|
||||
if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget --no-proxy -q -O- http://$Q_HOST:$Q_PORT; do sleep 1; done"; then
|
||||
die $LINENO "Neutron did not start"
|
||||
@@ -486,8 +490,8 @@ function start_neutron_service_and_check {
|
||||
# Start running processes, including screen
|
||||
function start_neutron_agents {
|
||||
# Start up the neutron agents if enabled
|
||||
screen_it q-agt "cd $NEUTRON_DIR && python $AGENT_BINARY --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE"
|
||||
screen_it q-dhcp "cd $NEUTRON_DIR && python $AGENT_DHCP_BINARY --config-file $NEUTRON_CONF --config-file=$Q_DHCP_CONF_FILE"
|
||||
run_process q-agt "python $AGENT_BINARY --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE"
|
||||
run_process q-dhcp "python $AGENT_DHCP_BINARY --config-file $NEUTRON_CONF --config-file=$Q_DHCP_CONF_FILE"
|
||||
|
||||
L3_CONF_FILES="--config-file $NEUTRON_CONF --config-file=$Q_L3_CONF_FILE"
|
||||
|
||||
@@ -495,24 +499,24 @@ function start_neutron_agents {
|
||||
L3_CONF_FILES="$L3_CONF_FILES --config-file $Q_FWAAS_CONF_FILE"
|
||||
fi
|
||||
if is_service_enabled q-vpn; then
|
||||
screen_it q-vpn "cd $NEUTRON_DIR && $AGENT_VPN_BINARY $L3_CONF_FILES"
|
||||
run_process q-vpn "$AGENT_VPN_BINARY $L3_CONF_FILES"
|
||||
else
|
||||
screen_it q-l3 "cd $NEUTRON_DIR && python $AGENT_L3_BINARY $L3_CONF_FILES"
|
||||
run_process q-l3 "python $AGENT_L3_BINARY $L3_CONF_FILES"
|
||||
fi
|
||||
|
||||
screen_it q-meta "cd $NEUTRON_DIR && python $AGENT_META_BINARY --config-file $NEUTRON_CONF --config-file=$Q_META_CONF_FILE"
|
||||
run_process q-meta "python $AGENT_META_BINARY --config-file $NEUTRON_CONF --config-file=$Q_META_CONF_FILE"
|
||||
|
||||
if [ "$VIRT_DRIVER" = 'xenserver' ]; then
|
||||
# For XenServer, start an agent for the domU openvswitch
|
||||
screen_it q-domua "cd $NEUTRON_DIR && python $AGENT_BINARY --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE.domU"
|
||||
run_process q-domua "python $AGENT_BINARY --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE.domU"
|
||||
fi
|
||||
|
||||
if is_service_enabled q-lbaas; then
|
||||
screen_it q-lbaas "cd $NEUTRON_DIR && python $AGENT_LBAAS_BINARY --config-file $NEUTRON_CONF --config-file=$LBAAS_AGENT_CONF_FILENAME"
|
||||
run_process q-lbaas "python $AGENT_LBAAS_BINARY --config-file $NEUTRON_CONF --config-file=$LBAAS_AGENT_CONF_FILENAME"
|
||||
fi
|
||||
|
||||
if is_service_enabled q-metering; then
|
||||
screen_it q-metering "cd $NEUTRON_DIR && python $AGENT_METERING_BINARY --config-file $NEUTRON_CONF --config-file $METERING_AGENT_CONF_FILENAME"
|
||||
run_process q-metering "python $AGENT_METERING_BINARY --config-file $NEUTRON_CONF --config-file $METERING_AGENT_CONF_FILENAME"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ set +o xtrace
|
||||
# Select either 'gre', 'vxlan', or '(gre vxlan)'
|
||||
Q_ML2_TENANT_NETWORK_TYPE=${Q_ML2_TENANT_NETWORK_TYPE:-}
|
||||
# This has to be set here since the agent will set this in the config file
|
||||
if [[ "$Q_ML2_TENANT_NETWORK_TYPE" != "" ]]; then
|
||||
if [[ "$Q_ML2_TENANT_NETWORK_TYPE" == "gre" || "$Q_ML2_TENANT_NETWORK_TYPE" == "vxlan" ]]; then
|
||||
Q_AGENT_EXTRA_AGENT_OPTS+=(tunnel_types=$Q_ML2_TENANT_NETWORK_TYPE)
|
||||
elif [[ "$ENABLE_TENANT_TUNNELS" = "True" ]]; then
|
||||
Q_AGENT_EXTRA_AGENT_OPTS+=(tunnel_types=gre)
|
||||
|
||||
@@ -38,7 +38,14 @@ function _neutron_ovs_base_install_agent_packages {
|
||||
# FIXME add to ``files/apts/neutron``, but don't install if not needed!
|
||||
if is_ubuntu; then
|
||||
kernel_version=`cat /proc/version | cut -d " " -f3`
|
||||
install_package make fakeroot dkms openvswitch-switch openvswitch-datapath-dkms linux-headers-$kernel_version
|
||||
ovs_packages="make fakeroot dkms openvswitch-switch"
|
||||
# From kernel 3.13 on, openvswitch-datapath-dkms is not needed
|
||||
kernel_major_minor=`echo $kernel_version | cut -d. -f1-2`
|
||||
if [ `vercmp_numbers "$kernel_major_minor" "3.13"` -lt "0" ]; then
|
||||
ovs_packages="$ovs_packages openvswitch-datapath-dkms"
|
||||
fi
|
||||
ovs_packages="$ovs_packages linux-headers-$kernel_version"
|
||||
install_package $ovs_packages
|
||||
elif is_fedora; then
|
||||
install_package openvswitch
|
||||
# Ensure that the service is started
|
||||
|
||||
Vendored
+4
-2
@@ -28,12 +28,14 @@ functions to be implemented
|
||||
git clone xxx
|
||||
|
||||
* ``start_<third_party>``:
|
||||
start running processes, including screen
|
||||
start running processes, including screen if USE_SCREEN=True
|
||||
e.g.
|
||||
screen_it XXXX "cd $XXXXY_DIR && $XXXX_DIR/bin/XXXX-bin"
|
||||
run_process XXXX "$XXXX_DIR/bin/XXXX-bin"
|
||||
|
||||
* ``stop_<third_party>``:
|
||||
stop running processes (non-screen)
|
||||
e.g.
|
||||
stop_process XXXX
|
||||
|
||||
* ``check_<third_party>``:
|
||||
verify that the integration between neutron server and third-party components is sane
|
||||
|
||||
Vendored
+1
-1
@@ -63,7 +63,7 @@ function install_ryu {
|
||||
}
|
||||
|
||||
function start_ryu {
|
||||
screen_it ryu "cd $RYU_DIR && $RYU_DIR/bin/ryu-manager --config-file $RYU_CONF"
|
||||
run_process ryu "$RYU_DIR/bin/ryu-manager --config-file $RYU_CONF"
|
||||
}
|
||||
|
||||
function stop_ryu {
|
||||
|
||||
@@ -29,8 +29,10 @@ set +o xtrace
|
||||
# --------
|
||||
|
||||
# Set up default directories
|
||||
GITDIR["python-novaclient"]=$DEST/python-novaclient
|
||||
|
||||
|
||||
NOVA_DIR=$DEST/nova
|
||||
NOVACLIENT_DIR=$DEST/python-novaclient
|
||||
NOVA_STATE_PATH=${NOVA_STATE_PATH:=$DATA_DIR/nova}
|
||||
# INSTANCES_PATH is the previous name for this
|
||||
NOVA_INSTANCES_PATH=${NOVA_INSTANCES_PATH:=${INSTANCES_PATH:=$NOVA_STATE_PATH/instances}}
|
||||
@@ -39,6 +41,7 @@ NOVA_AUTH_CACHE_DIR=${NOVA_AUTH_CACHE_DIR:-/var/cache/nova}
|
||||
NOVA_CONF_DIR=/etc/nova
|
||||
NOVA_CONF=$NOVA_CONF_DIR/nova.conf
|
||||
NOVA_CELLS_CONF=$NOVA_CONF_DIR/nova-cells.conf
|
||||
NOVA_FAKE_CONF=$NOVA_CONF_DIR/nova-fake.conf
|
||||
NOVA_CELLS_DB=${NOVA_CELLS_DB:-nova_cell}
|
||||
|
||||
NOVA_API_PASTE_INI=${NOVA_API_PASTE_INI:-$NOVA_CONF_DIR/api-paste.ini}
|
||||
@@ -75,8 +78,18 @@ QEMU_CONF=/etc/libvirt/qemu.conf
|
||||
|
||||
# Set default defaults here as some hypervisor drivers override these
|
||||
PUBLIC_INTERFACE_DEFAULT=br100
|
||||
GUEST_INTERFACE_DEFAULT=eth0
|
||||
FLAT_NETWORK_BRIDGE_DEFAULT=br100
|
||||
# set the GUEST_INTERFACE_DEFAULT to some interface on the box so that
|
||||
# the default isn't completely crazy. This will match eth*, em*, or
|
||||
# the new p* interfaces, then basically picks the first
|
||||
# alphabetically. It's probably wrong, however it's less wrong than
|
||||
# always using 'eth0' which doesn't exist on new Linux distros at all.
|
||||
GUEST_INTERFACE_DEFAULT=$(ip link \
|
||||
| grep 'state UP' \
|
||||
| awk '{print $2}' \
|
||||
| sed 's/://' \
|
||||
| grep ^[ep] \
|
||||
| head -1)
|
||||
|
||||
# Get hypervisor configuration
|
||||
# ----------------------------
|
||||
@@ -578,8 +591,8 @@ function init_nova_cells {
|
||||
fi
|
||||
|
||||
$NOVA_BIN_DIR/nova-manage --config-file $NOVA_CELLS_CONF db sync
|
||||
$NOVA_BIN_DIR/nova-manage --config-file $NOVA_CELLS_CONF cell create --name=region --cell_type=parent --username=guest --hostname=$RABBIT_HOST --port=5672 --password=$RABBIT_PASSWORD --virtual_host=/ --woffset=0 --wscale=1
|
||||
$NOVA_BIN_DIR/nova-manage cell create --name=child --cell_type=child --username=guest --hostname=$RABBIT_HOST --port=5672 --password=$RABBIT_PASSWORD --virtual_host=child_cell --woffset=0 --wscale=1
|
||||
$NOVA_BIN_DIR/nova-manage --config-file $NOVA_CELLS_CONF cell create --name=region --cell_type=parent --username=$RABBIT_USERID --hostname=$RABBIT_HOST --port=5672 --password=$RABBIT_PASSWORD --virtual_host=/ --woffset=0 --wscale=1
|
||||
$NOVA_BIN_DIR/nova-manage cell create --name=child --cell_type=child --username=$RABBIT_USERID --hostname=$RABBIT_HOST --port=5672 --password=$RABBIT_PASSWORD --virtual_host=child_cell --woffset=0 --wscale=1
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -639,9 +652,11 @@ function init_nova {
|
||||
|
||||
# install_novaclient() - Collect source and prepare
|
||||
function install_novaclient {
|
||||
git_clone $NOVACLIENT_REPO $NOVACLIENT_DIR $NOVACLIENT_BRANCH
|
||||
setup_develop $NOVACLIENT_DIR
|
||||
sudo install -D -m 0644 -o $STACK_USER {$NOVACLIENT_DIR/tools/,/etc/bash_completion.d/}nova.bash_completion
|
||||
if use_library_from_git "python-novaclient"; then
|
||||
git_clone_by_name "python-novaclient"
|
||||
setup_dev_lib "python-novaclient"
|
||||
sudo install -D -m 0644 -o $STACK_USER {${GITDIR["python-novaclient"]}/tools/,/etc/bash_completion.d/}nova.bash_completion
|
||||
fi
|
||||
}
|
||||
|
||||
# install_nova() - Collect source and prepare
|
||||
@@ -687,7 +702,7 @@ function start_nova_api {
|
||||
service_port=$NOVA_SERVICE_PORT_INT
|
||||
fi
|
||||
|
||||
screen_it n-api "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-api"
|
||||
run_process n-api "$NOVA_BIN_DIR/nova-api"
|
||||
echo "Waiting for nova-api to start..."
|
||||
if ! wait_for_service $SERVICE_TIMEOUT http://$SERVICE_HOST:$service_port; then
|
||||
die $LINENO "nova-api did not start"
|
||||
@@ -709,17 +724,23 @@ function start_nova_compute {
|
||||
|
||||
if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
|
||||
# The group **$LIBVIRT_GROUP** is added to the current user in this script.
|
||||
# Use 'sg' to execute nova-compute as a member of the **$LIBVIRT_GROUP** group.
|
||||
screen_it n-cpu "cd $NOVA_DIR && sg $LIBVIRT_GROUP '$NOVA_BIN_DIR/nova-compute --config-file $compute_cell_conf'"
|
||||
# sg' will be used in run_process to execute nova-compute as a member of the
|
||||
# **$LIBVIRT_GROUP** group.
|
||||
run_process n-cpu "$NOVA_BIN_DIR/nova-compute --config-file $compute_cell_conf" $LIBVIRT_GROUP
|
||||
elif [[ "$VIRT_DRIVER" = 'fake' ]]; then
|
||||
for i in `seq 1 $NUMBER_FAKE_NOVA_COMPUTE`; do
|
||||
screen_it n-cpu "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-compute --config-file $compute_cell_conf --config-file <(echo -e '[DEFAULT]\nhost=${HOSTNAME}${i}')"
|
||||
# Avoid process redirection of fake host configurations by
|
||||
# creating or modifying real configurations. Each fake
|
||||
# gets its own configuration and own log file.
|
||||
local fake_conf="${NOVA_FAKE_CONF}-${i}"
|
||||
iniset $fake_conf DEFAULT nhost "${HOSTNAME}${i}"
|
||||
run_process "n-cpu-${i}" "$NOVA_BIN_DIR/nova-compute --config-file $compute_cell_conf --config-file $fake_conf"
|
||||
done
|
||||
else
|
||||
if is_service_enabled n-cpu && [[ -r $NOVA_PLUGINS/hypervisor-$VIRT_DRIVER ]]; then
|
||||
start_nova_hypervisor
|
||||
fi
|
||||
screen_it n-cpu "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-compute --config-file $compute_cell_conf"
|
||||
run_process n-cpu "$NOVA_BIN_DIR/nova-compute --config-file $compute_cell_conf"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -732,25 +753,25 @@ function start_nova_rest {
|
||||
local compute_cell_conf=$NOVA_CONF
|
||||
fi
|
||||
|
||||
# ``screen_it`` checks ``is_service_enabled``, it is not needed here
|
||||
screen_it n-cond "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-conductor --config-file $compute_cell_conf"
|
||||
screen_it n-cell-region "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-cells --config-file $api_cell_conf"
|
||||
screen_it n-cell-child "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-cells --config-file $compute_cell_conf"
|
||||
# ``run_process`` checks ``is_service_enabled``, it is not needed here
|
||||
run_process n-cond "$NOVA_BIN_DIR/nova-conductor --config-file $compute_cell_conf"
|
||||
run_process n-cell-region "$NOVA_BIN_DIR/nova-cells --config-file $api_cell_conf"
|
||||
run_process n-cell-child "$NOVA_BIN_DIR/nova-cells --config-file $compute_cell_conf"
|
||||
|
||||
screen_it n-crt "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-cert --config-file $api_cell_conf"
|
||||
screen_it n-net "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-network --config-file $compute_cell_conf"
|
||||
screen_it n-sch "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-scheduler --config-file $compute_cell_conf"
|
||||
screen_it n-api-meta "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-api-metadata --config-file $compute_cell_conf"
|
||||
run_process n-crt "$NOVA_BIN_DIR/nova-cert --config-file $api_cell_conf"
|
||||
run_process n-net "$NOVA_BIN_DIR/nova-network --config-file $compute_cell_conf"
|
||||
run_process n-sch "$NOVA_BIN_DIR/nova-scheduler --config-file $compute_cell_conf"
|
||||
run_process n-api-meta "$NOVA_BIN_DIR/nova-api-metadata --config-file $compute_cell_conf"
|
||||
|
||||
screen_it n-novnc "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-novncproxy --config-file $api_cell_conf --web $NOVNC_WEB_DIR"
|
||||
screen_it n-xvnc "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-xvpvncproxy --config-file $api_cell_conf"
|
||||
screen_it n-spice "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-spicehtml5proxy --config-file $api_cell_conf --web $SPICE_WEB_DIR"
|
||||
screen_it n-cauth "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-consoleauth --config-file $api_cell_conf"
|
||||
run_process n-novnc "$NOVA_BIN_DIR/nova-novncproxy --config-file $api_cell_conf --web $NOVNC_WEB_DIR"
|
||||
run_process n-xvnc "$NOVA_BIN_DIR/nova-xvpvncproxy --config-file $api_cell_conf"
|
||||
run_process n-spice "$NOVA_BIN_DIR/nova-spicehtml5proxy --config-file $api_cell_conf --web $SPICE_WEB_DIR"
|
||||
run_process n-cauth "$NOVA_BIN_DIR/nova-consoleauth --config-file $api_cell_conf"
|
||||
|
||||
# Starting the nova-objectstore only if swift3 service is not enabled.
|
||||
# Swift will act as s3 objectstore.
|
||||
is_service_enabled swift3 || \
|
||||
screen_it n-obj "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-objectstore --config-file $api_cell_conf"
|
||||
run_process n-obj "$NOVA_BIN_DIR/nova-objectstore --config-file $api_cell_conf"
|
||||
}
|
||||
|
||||
function start_nova {
|
||||
@@ -759,7 +780,7 @@ function start_nova {
|
||||
}
|
||||
|
||||
function stop_nova_compute {
|
||||
screen_stop n-cpu
|
||||
stop_process n-cpu
|
||||
if is_service_enabled n-cpu && [[ -r $NOVA_PLUGINS/hypervisor-$VIRT_DRIVER ]]; then
|
||||
stop_nova_hypervisor
|
||||
fi
|
||||
@@ -770,7 +791,7 @@ function stop_nova_rest {
|
||||
# Some services are listed here twice since more than one instance
|
||||
# of a service may be running in certain configs.
|
||||
for serv in n-api n-crt n-net n-sch n-novnc n-xvnc n-cauth n-spice n-cond n-cell n-cell n-api-meta n-obj; do
|
||||
screen_stop $serv
|
||||
stop_process $serv
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
@@ -39,8 +39,8 @@ function cleanup_nova_hypervisor {
|
||||
# configure_nova_hypervisor - Set config files, create data dirs, etc
|
||||
function configure_nova_hypervisor {
|
||||
configure_libvirt
|
||||
iniset $NOVA_CONF DEFAULT libvirt_type "$LIBVIRT_TYPE"
|
||||
iniset $NOVA_CONF DEFAULT libvirt_cpu_mode "none"
|
||||
iniset $NOVA_CONF libvirt virt_type "$LIBVIRT_TYPE"
|
||||
iniset $NOVA_CONF libvirt cpu_mode "none"
|
||||
iniset $NOVA_CONF DEFAULT use_usb_tablet "False"
|
||||
iniset $NOVA_CONF DEFAULT default_ephemeral_format "ext4"
|
||||
iniset $NOVA_CONF DEFAULT compute_driver "libvirt.LibvirtDriver"
|
||||
|
||||
+3
-1
@@ -148,6 +148,8 @@ function start_opendaylight {
|
||||
# The flags to ODL have the following meaning:
|
||||
# -of13: runs ODL using OpenFlow 1.3 protocol support.
|
||||
# -virt ovsdb: Runs ODL in "virtualization" mode with OVSDB support
|
||||
# NOTE(chdent): Leaving this as screen_it instead of run_process until
|
||||
# the right thing for this service is determined.
|
||||
screen_it odl-server "cd $ODL_DIR/opendaylight && JAVA_HOME=$JHOME ./run.sh $ODL_ARGS -of13 -virt ovsdb"
|
||||
|
||||
# Sleep a bit to let OpenDaylight finish starting up
|
||||
@@ -156,7 +158,7 @@ function start_opendaylight {
|
||||
|
||||
# stop_opendaylight() - Stop running processes (non-screen)
|
||||
function stop_opendaylight {
|
||||
screen_stop odl-server
|
||||
stop_process odl-server
|
||||
}
|
||||
|
||||
# stop_opendaylight-compute() - Remove OVS bridges
|
||||
|
||||
@@ -20,60 +20,39 @@ set +o xtrace
|
||||
|
||||
# Defaults
|
||||
# --------
|
||||
CLIFF_DIR=$DEST/cliff
|
||||
OSLOCFG_DIR=$DEST/oslo.config
|
||||
OSLOMSG_DIR=$DEST/oslo.messaging
|
||||
OSLORWRAP_DIR=$DEST/oslo.rootwrap
|
||||
OSLOVMWARE_DIR=$DEST/oslo.vmware
|
||||
PYCADF_DIR=$DEST/pycadf
|
||||
STEVEDORE_DIR=$DEST/stevedore
|
||||
TASKFLOW_DIR=$DEST/taskflow
|
||||
GITDIR["cliff"]=$DEST/cliff
|
||||
GITDIR["oslo.config"]=$DEST/oslo.config
|
||||
GITDIR["oslo.messaging"]=$DEST/oslo.messaging
|
||||
GITDIR["oslo.rootwrap"]=$DEST/oslo.rootwrap
|
||||
GITDIR["oslo.vmware"]=$DEST/oslo.vmware
|
||||
GITDIR["pycadf"]=$DEST/pycadf
|
||||
GITDIR["stevedore"]=$DEST/stevedore
|
||||
GITDIR["taskflow"]=$DEST/taskflow
|
||||
|
||||
# Entry Points
|
||||
# ------------
|
||||
|
||||
# install_oslo() - Collect source and prepare
|
||||
function install_oslo {
|
||||
# TODO(sdague): remove this once we get to Icehouse, this just makes
|
||||
# for a smoother transition of existing users.
|
||||
cleanup_oslo
|
||||
|
||||
git_clone $CLIFF_REPO $CLIFF_DIR $CLIFF_BRANCH
|
||||
setup_install $CLIFF_DIR
|
||||
|
||||
git_clone $OSLOCFG_REPO $OSLOCFG_DIR $OSLOCFG_BRANCH
|
||||
setup_install $OSLOCFG_DIR
|
||||
|
||||
git_clone $OSLOMSG_REPO $OSLOMSG_DIR $OSLOMSG_BRANCH
|
||||
setup_install $OSLOMSG_DIR
|
||||
|
||||
git_clone $OSLORWRAP_REPO $OSLORWRAP_DIR $OSLORWRAP_BRANCH
|
||||
setup_install $OSLORWRAP_DIR
|
||||
|
||||
git_clone $OSLOVMWARE_REPO $OSLOVMWARE_DIR $OSLOVMWARE_BRANCH
|
||||
setup_install $OSLOVMWARE_DIR
|
||||
|
||||
git_clone $PYCADF_REPO $PYCADF_DIR $PYCADF_BRANCH
|
||||
setup_install $PYCADF_DIR
|
||||
|
||||
git_clone $STEVEDORE_REPO $STEVEDORE_DIR $STEVEDORE_BRANCH
|
||||
setup_install $STEVEDORE_DIR
|
||||
|
||||
git_clone $TASKFLOW_REPO $TASKFLOW_DIR $TASKFLOW_BRANCH
|
||||
setup_install $TASKFLOW_DIR
|
||||
}
|
||||
|
||||
# cleanup_oslo() - purge possibly old versions of oslo
|
||||
function cleanup_oslo {
|
||||
# this means we've got an old oslo installed, lets get rid of it
|
||||
if ! python -c 'import oslo.config' 2>/dev/null; then
|
||||
echo "Found old oslo.config... removing to ensure consistency"
|
||||
local PIP_CMD=$(get_pip_command)
|
||||
pip_install oslo.config
|
||||
sudo $PIP_CMD uninstall -y oslo.config
|
||||
function _do_install_oslo_lib {
|
||||
local name=$1
|
||||
if use_library_from_git "$name"; then
|
||||
git_clone_by_name "$name"
|
||||
setup_lib "$name"
|
||||
fi
|
||||
}
|
||||
|
||||
# install_oslo() - Collect source and prepare
|
||||
function install_oslo {
|
||||
_do_install_oslo_lib "cliff"
|
||||
_do_install_oslo_lib "oslo.config"
|
||||
_do_install_oslo_lib "oslo.messaging"
|
||||
_do_install_oslo_lib "oslo.rootwrap"
|
||||
_do_install_oslo_lib "oslo.vmware"
|
||||
_do_install_oslo_lib "pycadf"
|
||||
_do_install_oslo_lib "stevedore"
|
||||
_do_install_oslo_lib "taskflow"
|
||||
}
|
||||
|
||||
|
||||
# Restore xtrace
|
||||
$XTRACE
|
||||
|
||||
|
||||
+23
-3
@@ -5,7 +5,7 @@
|
||||
# Dependencies:
|
||||
#
|
||||
# - ``functions`` file
|
||||
# - ``RABBIT_{HOST|PASSWORD}`` must be defined when RabbitMQ is used
|
||||
# - ``RABBIT_{HOST|PASSWORD|USERID}`` must be defined when RabbitMQ is used
|
||||
|
||||
# ``stack.sh`` calls the entry points in this order:
|
||||
#
|
||||
@@ -63,6 +63,9 @@ function check_rpc_backend {
|
||||
function cleanup_rpc_backend {
|
||||
if is_service_enabled rabbit; then
|
||||
# Obliterate rabbitmq-server
|
||||
if [ -n "$RABBIT_USERID" ]; then
|
||||
sudo rabbitmqctl delete_user "$RABBIT_USERID"
|
||||
fi
|
||||
uninstall_package rabbitmq-server
|
||||
sudo killall epmd || sudo killall -9 epmd
|
||||
if is_ubuntu; then
|
||||
@@ -147,15 +150,16 @@ function restart_rpc_backend {
|
||||
# service is not started by default
|
||||
restart_service rabbitmq-server
|
||||
fi
|
||||
rabbit_setuser "$RABBIT_USERID" "$RABBIT_PASSWORD"
|
||||
# change the rabbit password since the default is "guest"
|
||||
sudo rabbitmqctl change_password guest $RABBIT_PASSWORD && break
|
||||
sudo rabbitmqctl change_password $RABBIT_USERID $RABBIT_PASSWORD && break
|
||||
[[ $i -eq "10" ]] && die $LINENO "Failed to set rabbitmq password"
|
||||
done
|
||||
if is_service_enabled n-cell; then
|
||||
# Add partitioned access for the child cell
|
||||
if [ -z `sudo rabbitmqctl list_vhosts | grep child_cell` ]; then
|
||||
sudo rabbitmqctl add_vhost child_cell
|
||||
sudo rabbitmqctl set_permissions -p child_cell guest ".*" ".*" ".*"
|
||||
sudo rabbitmqctl set_permissions -p child_cell $RABBIT_USERID ".*" ".*" ".*"
|
||||
fi
|
||||
fi
|
||||
elif is_service_enabled qpid; then
|
||||
@@ -188,6 +192,7 @@ function iniset_rpc_backend {
|
||||
iniset $file $section rpc_backend ${package}.openstack.common.rpc.impl_kombu
|
||||
iniset $file $section rabbit_hosts $RABBIT_HOST
|
||||
iniset $file $section rabbit_password $RABBIT_PASSWORD
|
||||
iniset $file $section rabbit_userid $RABBIT_USERID
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -202,6 +207,21 @@ function qpid_is_supported {
|
||||
( ! is_suse )
|
||||
}
|
||||
|
||||
function rabbit_setuser {
|
||||
local user="$1" pass="$2" found="" out=""
|
||||
out=$(sudo rabbitmqctl list_users) ||
|
||||
{ echo "failed to list users" 1>&2; return 1; }
|
||||
found=$(echo "$out" | awk '$1 == user { print $1 }' "user=$user")
|
||||
if [ "$found" = "$user" ]; then
|
||||
sudo rabbitmqctl change_password "$user" "$pass" ||
|
||||
{ echo "failed changing pass for '$user'" 1>&2; return 1; }
|
||||
else
|
||||
sudo rabbitmqctl add_user "$user" "$pass" ||
|
||||
{ echo "failed changing pass for $user"; return 1; }
|
||||
fi
|
||||
sudo rabbitmqctl set_permissions "$user" ".*" ".*" ".*"
|
||||
}
|
||||
|
||||
|
||||
# Restore xtrace
|
||||
$XTRACE
|
||||
|
||||
+11
-5
@@ -20,12 +20,10 @@ set +o xtrace
|
||||
# Defaults
|
||||
# --------
|
||||
|
||||
# Set up default repos
|
||||
SAHARA_REPO=${SAHARA_REPO:-${GIT_BASE}/openstack/sahara.git}
|
||||
SAHARA_BRANCH=${SAHARA_BRANCH:-master}
|
||||
|
||||
# Set up default directories
|
||||
GITDIR["python-saharaclient"]=$DEST/python-saharaclient
|
||||
SAHARA_DIR=$DEST/sahara
|
||||
|
||||
SAHARA_CONF_DIR=${SAHARA_CONF_DIR:-/etc/sahara}
|
||||
SAHARA_CONF_FILE=${SAHARA_CONF_DIR}/sahara.conf
|
||||
|
||||
@@ -157,9 +155,17 @@ function install_sahara {
|
||||
setup_develop $SAHARA_DIR
|
||||
}
|
||||
|
||||
# install_python_saharaclient() - Collect source and prepare
|
||||
function install_python_saharaclient {
|
||||
if use_library_from_git "python-saharaclient"; then
|
||||
git_clone_by_name "python-saharaclient"
|
||||
setup_dev_lib "python-saharaclient"
|
||||
fi
|
||||
}
|
||||
|
||||
# start_sahara() - Start running processes, including screen
|
||||
function start_sahara {
|
||||
screen_it sahara "cd $SAHARA_DIR && $SAHARA_BIN_DIR/sahara-api --config-file $SAHARA_CONF_FILE"
|
||||
run_process sahara "$SAHARA_BIN_DIR/sahara-api --config-file $SAHARA_CONF_FILE"
|
||||
}
|
||||
|
||||
# stop_sahara() - Stop running processes
|
||||
|
||||
@@ -30,8 +30,10 @@ set +o xtrace
|
||||
# --------
|
||||
|
||||
# Set up default directories
|
||||
GITDIR["python-swiftclient"]=$DEST/python-swiftclient
|
||||
|
||||
|
||||
SWIFT_DIR=$DEST/swift
|
||||
SWIFTCLIENT_DIR=$DEST/python-swiftclient
|
||||
SWIFT_AUTH_CACHE_DIR=${SWIFT_AUTH_CACHE_DIR:-/var/cache/swift}
|
||||
SWIFT_APACHE_WSGI_DIR=${SWIFT_APACHE_WSGI_DIR:-/var/www/swift}
|
||||
SWIFT3_DIR=$DEST/swift3
|
||||
@@ -308,7 +310,12 @@ function configure_swift {
|
||||
SWIFT_CONFIG_PROXY_SERVER=${SWIFT_CONF_DIR}/proxy-server.conf
|
||||
cp ${SWIFT_DIR}/etc/proxy-server.conf-sample ${SWIFT_CONFIG_PROXY_SERVER}
|
||||
|
||||
cp ${SWIFT_DIR}/etc/container-sync-realms.conf-sample ${SWIFT_CONF_DIR}/container-sync-realms.conf
|
||||
# To run container sync feature introduced in Swift ver 1.12.0,
|
||||
# container sync "realm" is added in container-sync-realms.conf
|
||||
local csyncfile=${SWIFT_CONF_DIR}/container-sync-realms.conf
|
||||
cp ${SWIFT_DIR}/etc/container-sync-realms.conf-sample ${csyncfile}
|
||||
iniset ${csyncfile} realm1 key realm1key
|
||||
iniset ${csyncfile} realm1 cluster_name1 "http://$SERVICE_HOST:8080/v1/"
|
||||
|
||||
iniuncomment ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT user
|
||||
iniset ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT user ${STACK_USER}
|
||||
@@ -334,12 +341,12 @@ function configure_swift {
|
||||
iniset ${SWIFT_CONFIG_PROXY_SERVER} app:proxy-server node_timeout 120
|
||||
iniset ${SWIFT_CONFIG_PROXY_SERVER} app:proxy-server conn_timeout 20
|
||||
|
||||
# Skipped due to bug 1294789
|
||||
## Configure Ceilometer
|
||||
#if is_service_enabled ceilometer; then
|
||||
# iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:ceilometer use "egg:ceilometer#swift"
|
||||
# SWIFT_EXTRAS_MIDDLEWARE_LAST="${SWIFT_EXTRAS_MIDDLEWARE_LAST} ceilometer"
|
||||
#fi
|
||||
# Configure Ceilometer
|
||||
if is_service_enabled ceilometer; then
|
||||
iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:ceilometer "set log_level" "WARN"
|
||||
iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:ceilometer use "egg:ceilometer#swift"
|
||||
SWIFT_EXTRAS_MIDDLEWARE_LAST="${SWIFT_EXTRAS_MIDDLEWARE_LAST} ceilometer"
|
||||
fi
|
||||
|
||||
# Restrict the length of auth tokens in the swift proxy-server logs.
|
||||
iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:proxy-logging reveal_sensitive_prefix ${SWIFT_LOG_TOKEN_LENGTH}
|
||||
@@ -453,10 +460,13 @@ EOF
|
||||
rm -rf ${swift_log_dir}
|
||||
mkdir -p ${swift_log_dir}/hourly
|
||||
sudo chown -R ${STACK_USER}:adm ${swift_log_dir}
|
||||
sed "s,%SWIFT_LOGDIR%,${swift_log_dir}," $FILES/swift/rsyslog.conf | sudo \
|
||||
tee /etc/rsyslog.d/10-swift.conf
|
||||
# restart syslog to take the changes
|
||||
sudo killall -HUP rsyslogd
|
||||
|
||||
if [[ $SYSLOG != "False" ]]; then
|
||||
sed "s,%SWIFT_LOGDIR%,${swift_log_dir}," $FILES/swift/rsyslog.conf | sudo \
|
||||
tee /etc/rsyslog.d/10-swift.conf
|
||||
# restart syslog to take the changes
|
||||
sudo killall -HUP rsyslogd
|
||||
fi
|
||||
|
||||
if is_apache_enabled_service swift; then
|
||||
_config_swift_apache_wsgi
|
||||
@@ -625,8 +635,10 @@ function install_swift {
|
||||
}
|
||||
|
||||
function install_swiftclient {
|
||||
git_clone $SWIFTCLIENT_REPO $SWIFTCLIENT_DIR $SWIFTCLIENT_BRANCH
|
||||
setup_develop $SWIFTCLIENT_DIR
|
||||
if use_library_from_git "python-swiftclient"; then
|
||||
git_clone_by_name "python-swiftclient"
|
||||
setup_dev_lib "python-swiftclient"
|
||||
fi
|
||||
}
|
||||
|
||||
# start_swift() - Start running processes, including screen
|
||||
@@ -646,10 +658,10 @@ function start_swift {
|
||||
if is_apache_enabled_service swift; then
|
||||
restart_apache_server
|
||||
swift-init --run-dir=${SWIFT_DATA_DIR}/run rest start
|
||||
screen_it s-proxy "cd $SWIFT_DIR && sudo tail -f /var/log/$APACHE_NAME/proxy-server"
|
||||
tail_log s-proxy /var/log/$APACHE_NAME/proxy-server
|
||||
if [[ ${SWIFT_REPLICAS} == 1 ]]; then
|
||||
for type in object container account; do
|
||||
screen_it s-${type} "cd $SWIFT_DIR && sudo tail -f /var/log/$APACHE_NAME/${type}-server-1"
|
||||
tail_log s-${type} /var/log/$APACHE_NAME/${type}-server-1
|
||||
done
|
||||
fi
|
||||
return 0
|
||||
@@ -669,10 +681,10 @@ function start_swift {
|
||||
for type in proxy ${todo}; do
|
||||
swift-init --run-dir=${SWIFT_DATA_DIR}/run ${type} stop || true
|
||||
done
|
||||
screen_it s-proxy "cd $SWIFT_DIR && $SWIFT_DIR/bin/swift-proxy-server ${SWIFT_CONF_DIR}/proxy-server.conf -v"
|
||||
run_process s-proxy "$SWIFT_DIR/bin/swift-proxy-server ${SWIFT_CONF_DIR}/proxy-server.conf -v"
|
||||
if [[ ${SWIFT_REPLICAS} == 1 ]]; then
|
||||
for type in object container account; do
|
||||
screen_it s-${type} "cd $SWIFT_DIR && $SWIFT_DIR/bin/swift-${type}-server ${SWIFT_CONF_DIR}/${type}-server/1.conf -v"
|
||||
run_process s-${type} "$SWIFT_DIR/bin/swift-${type}-server ${SWIFT_CONF_DIR}/${type}-server/1.conf -v"
|
||||
done
|
||||
fi
|
||||
}
|
||||
@@ -689,9 +701,9 @@ function stop_swift {
|
||||
swift-init --run-dir=${SWIFT_DATA_DIR}/run all stop || true
|
||||
fi
|
||||
# Dump all of the servers
|
||||
# Maintain the iteration as screen_stop() has some desirable side-effects
|
||||
# Maintain the iteration as stop_process() has some desirable side-effects
|
||||
for type in proxy object container account; do
|
||||
screen_stop s-${type}
|
||||
stop_process s-${type}
|
||||
done
|
||||
# Blast out any stragglers
|
||||
pkill -f swift-
|
||||
|
||||
+75
-14
@@ -45,6 +45,8 @@ set +o xtrace
|
||||
# --------
|
||||
|
||||
# Set up default directories
|
||||
GITDIR["tempest-lib"]=$DEST/tempest-lib
|
||||
|
||||
TEMPEST_DIR=$DEST/tempest
|
||||
TEMPEST_CONFIG_DIR=${TEMPEST_CONFIG_DIR:-$TEMPEST_DIR/etc}
|
||||
TEMPEST_CONFIG=$TEMPEST_CONFIG_DIR/tempest.conf
|
||||
@@ -71,7 +73,8 @@ IPV6_ENABLED=$(trueorfalse True $IPV6_ENABLED)
|
||||
|
||||
# configure_tempest() - Set config files, create data dirs, etc
|
||||
function configure_tempest {
|
||||
setup_develop $TEMPEST_DIR
|
||||
# install testr since its used to process tempest logs
|
||||
pip_install `grep -h testrepository $REQUIREMENTS_DIR/global-requirements.txt | cut -d\# -f1`
|
||||
local image_lines
|
||||
local images
|
||||
local num_images
|
||||
@@ -271,6 +274,9 @@ function configure_tempest {
|
||||
iniset $TEMPEST_CONFIG identity admin_domain_name $ADMIN_DOMAIN_NAME
|
||||
iniset $TEMPEST_CONFIG identity auth_version ${TEMPEST_AUTH_VERSION:-v2}
|
||||
|
||||
# Identity Features
|
||||
iniset $TEMPEST_CONFIG identity-feature-enabled xml_api True
|
||||
|
||||
# Image
|
||||
# for the gate we want to be able to override this variable so we aren't
|
||||
# doing an HTTP fetch over the wide internet for this test
|
||||
@@ -280,6 +286,7 @@ function configure_tempest {
|
||||
|
||||
# Compute
|
||||
iniset $TEMPEST_CONFIG compute allow_tenant_isolation ${TEMPEST_ALLOW_TENANT_ISOLATION:-True}
|
||||
iniset $TEMPEST_CONFIG auth tempest_roles "Member"
|
||||
iniset $TEMPEST_CONFIG compute ssh_user ${DEFAULT_INSTANCE_USER:-cirros} # DEPRECATED
|
||||
iniset $TEMPEST_CONFIG compute network_for_ssh $PRIVATE_NETWORK_NAME
|
||||
iniset $TEMPEST_CONFIG compute ip_version_for_ssh 4
|
||||
@@ -297,6 +304,25 @@ function configure_tempest {
|
||||
iniset $TEMPEST_CONFIG compute-feature-enabled live_migration ${LIVE_MIGRATION_AVAILABLE:-False}
|
||||
iniset $TEMPEST_CONFIG compute-feature-enabled change_password False
|
||||
iniset $TEMPEST_CONFIG compute-feature-enabled block_migration_for_live_migration ${USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION:-False}
|
||||
iniset $TEMPEST_CONFIG compute-feature-enabled xml_api_v2 ${COMPUTE_XML_API_V2:-True}
|
||||
|
||||
DEFAULT_COMPUTE_EXT="NMN, OS-DCF, OS-EXT-AZ, OS-EXT-IMG-SIZE, OS-EXT-IPS, OS-EXT-IPS-MAC, OS-EXT-SRV-ATTR, OS-EXT-STS, OS-EXT-VIF-NET, "
|
||||
DEFAULT_COMPUTE_EXT+="OS-FLV-DISABLED, OS-FLV-EXT-DATA, OS-SCH-HNT, OS-SRV-USG, os-admin-actions, os-agents, os-aggregates, "
|
||||
DEFAULT_COMPUTE_EXT+="os-assisted-volume-snapshots, os-attach-interfaces, os-availability-zone, os-baremetal-ext-status, "
|
||||
DEFAULT_COMPUTE_EXT+="os-baremetal-nodes, os-block-device-mapping-v2-boot, os-cell-capacities, os-cells, os-certificates, os-cloudpipe, "
|
||||
DEFAULT_COMPUTE_EXT+="os-cloudpipe-update, os-config-drive, os-console-auth-tokens, os-console-output, os-consoles, os-create-server-ext, "
|
||||
DEFAULT_COMPUTE_EXT+="os-deferred-delete, os-evacuate, os-extended-floating-ips, os-extended-hypervisors, os-extended-quotas, "
|
||||
DEFAULT_COMPUTE_EXT+="os-extended-services, os-extended-services-delete, os-extended-volumes, os-fixed-ips, os-flavor-access, "
|
||||
DEFAULT_COMPUTE_EXT+="os-flavor-extra-specs, os-flavor-manage, os-flavor-rxtx, os-flavor-swap, os-floating-ip-dns, os-floating-ip-pools, "
|
||||
DEFAULT_COMPUTE_EXT+="os-floating-ips, os-floating-ips-bulk, os-fping, os-hide-server-addresses, os-hosts, os-hypervisors, "
|
||||
DEFAULT_COMPUTE_EXT+="os-instance-actions, os-instance_usage_audit_log, os-keypairs, os-migrations, os-multiple-create, os-networks, "
|
||||
DEFAULT_COMPUTE_EXT+="os-networks-associate, os-preserve-ephemeral-rebuild, os-quota-class-sets, os-quota-sets, os-rescue, "
|
||||
DEFAULT_COMPUTE_EXT+="os-security-group-default-rules, os-security-groups, os-server-diagnostics, os-server-external-events, "
|
||||
DEFAULT_COMPUTE_EXT+="os-server-groups, os-server-password, os-server-start-stop, os-services, os-shelve, os-simple-tenant-usage, "
|
||||
DEFAULT_COMPUTE_EXT+="os-tenant-networks, os-used-limits, os-used-limits-for-admin, os-user-data, os-user-quotas, os-virtual-interfaces, "
|
||||
DEFAULT_COMPUTE_EXT+="os-volume-attachment-update, os-volumes"
|
||||
|
||||
iniset $TEMPEST_CONFIG compute-feature-enabled api_extensions "${COMPUTE_API_EXTENSIONS:-$DEFAULT_COMPUTE_EXT}"
|
||||
|
||||
# Compute admin
|
||||
iniset $TEMPEST_CONFIG "compute-admin" username $ADMIN_USERNAME
|
||||
@@ -310,27 +336,35 @@ function configure_tempest {
|
||||
iniset $TEMPEST_CONFIG network public_router_id "$public_router_id"
|
||||
iniset $TEMPEST_CONFIG network default_network "$FIXED_RANGE"
|
||||
iniset $TEMPEST_CONFIG network-feature-enabled ipv6 "$IPV6_ENABLED"
|
||||
iniset $TEMPEST_CONFIG network-feature-enabled xml_api True
|
||||
|
||||
# boto
|
||||
iniset $TEMPEST_CONFIG boto ec2_url "http://$SERVICE_HOST:8773/services/Cloud"
|
||||
iniset $TEMPEST_CONFIG boto s3_url "http://$SERVICE_HOST:${S3_SERVICE_PORT:-3333}"
|
||||
iniset $TEMPEST_CONFIG boto s3_materials_path "$BOTO_MATERIALS_PATH"
|
||||
iniset $TEMPEST_CONFIG boto ari_manifest cirros-0.3.1-x86_64-initrd.manifest.xml
|
||||
iniset $TEMPEST_CONFIG boto ami_manifest cirros-0.3.1-x86_64-blank.img.manifest.xml
|
||||
iniset $TEMPEST_CONFIG boto aki_manifest cirros-0.3.1-x86_64-vmlinuz.manifest.xml
|
||||
iniset $TEMPEST_CONFIG boto instance_type "$boto_instance_type"
|
||||
iniset $TEMPEST_CONFIG boto http_socket_timeout 30
|
||||
iniset $TEMPEST_CONFIG boto ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
|
||||
# boto - disabled
|
||||
#
|
||||
# because of compat issues boto in icehouse is not testable
|
||||
# against tempest. Set FORCE_BOTO=1 in local.conf to enable.
|
||||
iniset $TEMPEST_CONFIG compute-feature-enabled ec2_api False
|
||||
if [[ -n "$FORCE_BOTO" ]]; then
|
||||
iniset $TEMPEST_CONFIG boto ec2_url "http://$SERVICE_HOST:8773/services/Cloud"
|
||||
iniset $TEMPEST_CONFIG boto s3_url "http://$SERVICE_HOST:${S3_SERVICE_PORT:-3333}"
|
||||
iniset $TEMPEST_CONFIG boto s3_materials_path "$BOTO_MATERIALS_PATH"
|
||||
iniset $TEMPEST_CONFIG boto ari_manifest cirros-0.3.1-x86_64-initrd.manifest.xml
|
||||
iniset $TEMPEST_CONFIG boto ami_manifest cirros-0.3.1-x86_64-blank.img.manifest.xml
|
||||
iniset $TEMPEST_CONFIG boto aki_manifest cirros-0.3.1-x86_64-vmlinuz.manifest.xml
|
||||
iniset $TEMPEST_CONFIG boto instance_type "$boto_instance_type"
|
||||
iniset $TEMPEST_CONFIG boto http_socket_timeout 30
|
||||
iniset $TEMPEST_CONFIG boto ssh_user ${DEFAULT_INSTANCE_USER:-cirros}
|
||||
iniset $TEMPEST_CONFIG compute-feature-enabled ec2_api True
|
||||
fi
|
||||
|
||||
# Orchestration Tests
|
||||
if is_service_enabled heat; then
|
||||
if [[ ! -z "$HEAT_CFN_IMAGE_URL" ]]; then
|
||||
iniset $TEMPEST_CONFIG orchestration image_ref $(basename "$HEAT_CFN_IMAGE_URL" ".qcow2")
|
||||
fi
|
||||
# build a specialized heat flavor that is likely to be fast
|
||||
# build a specialized heat flavor
|
||||
available_flavors=$(nova flavor-list)
|
||||
if [[ ! ( $available_flavors =~ 'm1.heat' ) ]]; then
|
||||
nova flavor-create m1.heat 451 1024 0 2
|
||||
nova flavor-create m1.heat 451 512 0 1
|
||||
fi
|
||||
iniset $TEMPEST_CONFIG orchestration instance_type "m1.heat"
|
||||
iniset $TEMPEST_CONFIG orchestration build_timeout 900
|
||||
@@ -358,6 +392,16 @@ function configure_tempest {
|
||||
iniset $TEMPEST_CONFIG volume storage_protocol $TEMPEST_STORAGE_PROTOCOL
|
||||
fi
|
||||
|
||||
DEFAULT_VOLUME_EXT="OS-SCH-HNT, backups, encryption, os-admin-actions, os-availability-zone, "
|
||||
DEFAULT_VOLUME_EXT+="os-extended-services, os-extended-snapshot-attributes, os-hosts, os-image-create, "
|
||||
DEFAULT_VOLUME_EXT+="os-quota-class-sets, os-quota-sets, os-services, os-snapshot-actions, "
|
||||
DEFAULT_VOLUME_EXT+="os-types-extra-specs, os-types-manage, os-used-limits, os-vol-host-attr, "
|
||||
DEFAULT_VOLUME_EXT+="os-vol-image-meta, os-vol-mig-status-attr, os-vol-tenant-attr, os-volume-actions, "
|
||||
DEFAULT_VOLUME_EXT+="os-volume-encryption-metadata, os-volume-manage, os-volume-transfer, "
|
||||
DEFAULT_VOLUME_EXT+="os-volume-unmanage, qos-specs"
|
||||
|
||||
iniset $TEMPEST_CONFIG volume-feature-enabled api_extensions "${VOLUME_API_EXTENSIONS:-$DEFAULT_VOLUME_EXT}"
|
||||
|
||||
# Dashboard
|
||||
iniset $TEMPEST_CONFIG dashboard dashboard_url "http://$SERVICE_HOST/"
|
||||
iniset $TEMPEST_CONFIG dashboard login_url "http://$SERVICE_HOST/auth/login/"
|
||||
@@ -365,14 +409,22 @@ function configure_tempest {
|
||||
# cli
|
||||
iniset $TEMPEST_CONFIG cli cli_dir $NOVA_BIN_DIR
|
||||
|
||||
DEFAULT_NET_EXT="agent, allowed-address-pairs, binding, dhcp_agent_scheduler, ext-gw-mode, external-net"
|
||||
DEFAULT_NET_EXT+=", extra_dhcp_opt, extraroute, fwaas, l3_agent_scheduler, lbaas"
|
||||
DEFAULT_NET_EXT+=", lbaas_agent_scheduler, metering, multi-provider, provider, quotas"
|
||||
DEFAULT_NET_EXT+=", router, security-group, service-type, vpnaas"
|
||||
# Networking
|
||||
iniset $TEMPEST_CONFIG network-feature-enabled api_extensions "${NETWORK_API_EXTENSIONS:-all}"
|
||||
iniset $TEMPEST_CONFIG network-feature-enabled api_extensions "${NETWORK_API_EXTENSIONS:-$DEFAULT_NET_EXT}"
|
||||
|
||||
# Baremetal
|
||||
if [ "$VIRT_DRIVER" = "ironic" ] ; then
|
||||
iniset $TEMPEST_CONFIG baremetal driver_enabled True
|
||||
fi
|
||||
|
||||
DEFAULT_SWIFT_EXT="account_quotas, bulk_delete, bulk_upload, container_quotas, container_sync, crossdomain"
|
||||
DEFAULT_SWIFT_EXT+=", formpost, keystoneauth, ratelimit, slo, staticweb, tempauth, tempurl"
|
||||
# Object Storage
|
||||
iniset $TEMPEST_CONFIG object-storage-feature-enabled discoverable_apis "${OBJECT_STORAGE_API_EXTENSIONS:-$DEFAULT_SWIFT_EXT}"
|
||||
# service_available
|
||||
for service in ${TEMPEST_SERVICES//,/ }; do
|
||||
if is_service_enabled $service ; then
|
||||
@@ -412,9 +464,18 @@ function create_tempest_accounts {
|
||||
fi
|
||||
}
|
||||
|
||||
# install_tempest_lib() - Collect source, prepare, and install tempest-lib
|
||||
function install_tempest_lib {
|
||||
if use_library_from_git "tempest-lib"; then
|
||||
git_clone_by_name "tempest-lib"
|
||||
setup_dev_lib "tempest-lib"
|
||||
fi
|
||||
}
|
||||
|
||||
# install_tempest() - Collect source and prepare
|
||||
function install_tempest {
|
||||
git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH
|
||||
pip_install "tox<1.7"
|
||||
}
|
||||
|
||||
# init_tempest() - Initialize ec2 images
|
||||
|
||||
+6
-2
@@ -75,13 +75,17 @@ function install_XXXX {
|
||||
|
||||
# start_XXXX() - Start running processes, including screen
|
||||
function start_XXXX {
|
||||
# screen_it XXXX "cd $XXXX_DIR && $XXXX_DIR/bin/XXXX-bin"
|
||||
# The quoted command must be a single command and not include an
|
||||
# shell metacharacters, redirections or shell builtins.
|
||||
# run_process XXXX "$XXXX_DIR/bin/XXXX-bin"
|
||||
:
|
||||
}
|
||||
|
||||
# stop_XXXX() - Stop running processes (non-screen)
|
||||
function stop_XXXX {
|
||||
# FIXME(dtroyer): stop only our screen screen window?
|
||||
# for serv in serv-a serv-b; do
|
||||
# stop_process $serv
|
||||
# done
|
||||
:
|
||||
}
|
||||
|
||||
|
||||
@@ -320,7 +320,8 @@ function make_root_CA {
|
||||
#
|
||||
# Uses global ``SSL_ENABLED_SERVICES``
|
||||
function is_ssl_enabled_service {
|
||||
services=$@
|
||||
local services=$@
|
||||
local service=""
|
||||
for service in ${services}; do
|
||||
[[ ,${SSL_ENABLED_SERVICES}, =~ ,${service}, ]] && return 0
|
||||
done
|
||||
|
||||
@@ -25,8 +25,9 @@ set +o xtrace
|
||||
NETWORK_GATEWAY=${NETWORK_GATEWAY:-10.0.0.1}
|
||||
|
||||
# Set up default configuration
|
||||
GITDIR["python-troveclient"]=$DEST/python-troveclient
|
||||
|
||||
TROVE_DIR=$DEST/trove
|
||||
TROVECLIENT_DIR=$DEST/python-troveclient
|
||||
TROVE_CONF_DIR=/etc/trove
|
||||
TROVE_LOCAL_CONF_DIR=$TROVE_DIR/etc/trove
|
||||
TROVE_AUTH_CACHE_DIR=${TROVE_AUTH_CACHE_DIR:-/var/cache/trove}
|
||||
@@ -112,10 +113,6 @@ function cleanup_trove {
|
||||
rm -fr $TROVE_CONF_DIR/*
|
||||
}
|
||||
|
||||
# configure_troveclient() - Set config files, create data dirs, etc
|
||||
function configure_troveclient {
|
||||
setup_develop $TROVECLIENT_DIR
|
||||
}
|
||||
|
||||
# configure_trove() - Set config files, create data dirs, etc
|
||||
function configure_trove {
|
||||
@@ -144,6 +141,7 @@ function configure_trove {
|
||||
rm -f $TROVE_CONF_DIR/trove-taskmanager.conf
|
||||
rm -f $TROVE_CONF_DIR/trove-conductor.conf
|
||||
|
||||
iniset $TROVE_CONF_DIR/trove.conf DEFAULT rabbit_userid $RABBIT_USERID
|
||||
iniset $TROVE_CONF_DIR/trove.conf DEFAULT rabbit_password $RABBIT_PASSWORD
|
||||
iniset $TROVE_CONF_DIR/trove.conf DEFAULT sql_connection `database_connection_url trove`
|
||||
iniset $TROVE_CONF_DIR/trove.conf DEFAULT add_addresses True
|
||||
@@ -151,6 +149,7 @@ function configure_trove {
|
||||
iniset $TROVE_CONF_DIR/trove.conf DEFAULT cinder_url $CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1
|
||||
iniset $TROVE_CONF_DIR/trove.conf DEFAULT swift_url http://$SERVICE_HOST:8080/v1/AUTH_
|
||||
|
||||
iniset $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample DEFAULT rabbit_userid $RABBIT_USERID
|
||||
iniset $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample DEFAULT rabbit_password $RABBIT_PASSWORD
|
||||
sed -i "s/localhost/$NETWORK_GATEWAY/g" $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample
|
||||
|
||||
@@ -161,6 +160,7 @@ function configure_trove {
|
||||
if is_service_enabled tr-tmgr; then
|
||||
TROVE_AUTH_ENDPOINT=$KEYSTONE_AUTH_PROTOCOL://$KEYSTONE_AUTH_HOST:$KEYSTONE_AUTH_PORT//v$IDENTITY_API_VERSION
|
||||
|
||||
iniset $TROVE_CONF_DIR/trove-taskmanager.conf DEFAULT rabbit_userid $RABBIT_USERID
|
||||
iniset $TROVE_CONF_DIR/trove-taskmanager.conf DEFAULT rabbit_password $RABBIT_PASSWORD
|
||||
iniset $TROVE_CONF_DIR/trove-taskmanager.conf DEFAULT sql_connection `database_connection_url trove`
|
||||
iniset $TROVE_CONF_DIR/trove-taskmanager.conf DEFAULT taskmanager_manager trove.taskmanager.manager.Manager
|
||||
@@ -176,6 +176,7 @@ function configure_trove {
|
||||
|
||||
# (Re)create trove conductor conf file if needed
|
||||
if is_service_enabled tr-cond; then
|
||||
iniset $TROVE_CONF_DIR/trove-conductor.conf DEFAULT rabbit_userid $RABBIT_USERID
|
||||
iniset $TROVE_CONF_DIR/trove-conductor.conf DEFAULT rabbit_password $RABBIT_PASSWORD
|
||||
iniset $TROVE_CONF_DIR/trove-conductor.conf DEFAULT sql_connection `database_connection_url trove`
|
||||
iniset $TROVE_CONF_DIR/trove-conductor.conf DEFAULT nova_proxy_admin_user radmin
|
||||
@@ -189,7 +190,10 @@ function configure_trove {
|
||||
|
||||
# install_troveclient() - Collect source and prepare
|
||||
function install_troveclient {
|
||||
git_clone $TROVECLIENT_REPO $TROVECLIENT_DIR $TROVECLIENT_BRANCH
|
||||
if use_library_from_git "python-troveclient"; then
|
||||
git_clone_by_name "python-troveclient"
|
||||
setup_dev_lib "python-troveclient"
|
||||
fi
|
||||
}
|
||||
|
||||
# install_trove() - Collect source and prepare
|
||||
@@ -208,16 +212,16 @@ function init_trove {
|
||||
|
||||
# start_trove() - Start running processes, including screen
|
||||
function start_trove {
|
||||
screen_it tr-api "cd $TROVE_DIR; $TROVE_BIN_DIR/trove-api --config-file=$TROVE_CONF_DIR/trove.conf --debug 2>&1"
|
||||
screen_it tr-tmgr "cd $TROVE_DIR; $TROVE_BIN_DIR/trove-taskmanager --config-file=$TROVE_CONF_DIR/trove-taskmanager.conf --debug 2>&1"
|
||||
screen_it tr-cond "cd $TROVE_DIR; $TROVE_BIN_DIR/trove-conductor --config-file=$TROVE_CONF_DIR/trove-conductor.conf --debug 2>&1"
|
||||
run_process tr-api "$TROVE_BIN_DIR/trove-api --config-file=$TROVE_CONF_DIR/trove.conf --debug"
|
||||
run_process tr-tmgr "$TROVE_BIN_DIR/trove-taskmanager --config-file=$TROVE_CONF_DIR/trove-taskmanager.conf --debug"
|
||||
run_process tr-cond "$TROVE_BIN_DIR/trove-conductor --config-file=$TROVE_CONF_DIR/trove-conductor.conf --debug"
|
||||
}
|
||||
|
||||
# stop_trove() - Stop running processes
|
||||
function stop_trove {
|
||||
# Kill the trove screen windows
|
||||
for serv in tr-api tr-tmgr tr-cond; do
|
||||
screen_stop $serv
|
||||
stop_process $serv
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
+9
-38
@@ -18,47 +18,18 @@
|
||||
PASSES=""
|
||||
FAILURES=""
|
||||
|
||||
# Check the return code and add the test to PASSES or FAILURES as appropriate
|
||||
# pass_fail <result> <expected> <name>
|
||||
function pass_fail {
|
||||
local result=$1
|
||||
local expected=$2
|
||||
local test_name=$3
|
||||
|
||||
if [[ $result -ne $expected ]]; then
|
||||
FAILURES="$FAILURES $test_name"
|
||||
else
|
||||
PASSES="$PASSES $test_name"
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ -n $@ ]]; then
|
||||
FILES=$@
|
||||
else
|
||||
LIBS=`find lib -type f | grep -v \.md`
|
||||
SCRIPTS=`find . -type f -name \*\.sh`
|
||||
EXTRA="functions functions-common stackrc openrc exerciserc eucarc"
|
||||
FILES="$SCRIPTS $LIBS $EXTRA"
|
||||
fi
|
||||
|
||||
echo "Running bash8..."
|
||||
|
||||
./tools/bash8.py -v $FILES
|
||||
pass_fail $? 0 bash8
|
||||
|
||||
|
||||
# Test that no one is trying to land crazy refs as branches
|
||||
|
||||
echo "Ensuring we don't have crazy refs"
|
||||
|
||||
REFS=`grep BRANCH stackrc | grep -v -- '-master'`
|
||||
rc=$?
|
||||
pass_fail $rc 1 crazy-refs
|
||||
if [[ $rc -eq 0 ]]; then
|
||||
echo "Branch defaults must be master. Found:"
|
||||
echo $REFS
|
||||
fi
|
||||
for testfile in tests/test_*.sh; do
|
||||
$testfile
|
||||
if [[ $? -eq 0 ]]; then
|
||||
PASSES="$PASSES $testfile"
|
||||
else
|
||||
FAILURES="$FAILURES $testfile"
|
||||
fi
|
||||
done
|
||||
|
||||
# Summary display now that all is said and done
|
||||
echo "====================================================================="
|
||||
for script in $PASSES; do
|
||||
echo PASS $script
|
||||
|
||||
@@ -211,18 +211,14 @@ sudo mv $TEMPFILE /etc/sudoers.d/50_stack_sh
|
||||
# Additional repos
|
||||
# ----------------
|
||||
|
||||
# For debian/ubuntu make apt attempt to retry network ops on it's own
|
||||
if is_ubuntu; then
|
||||
echo 'APT::Acquire::Retries "20";' | sudo tee /etc/apt/apt.conf.d/80retry
|
||||
fi
|
||||
|
||||
# Some distros need to add repos beyond the defaults provided by the vendor
|
||||
# to pick up required packages.
|
||||
|
||||
# The Debian Wheezy official repositories do not contain all required packages,
|
||||
# add gplhost repository.
|
||||
if [[ "$os_VENDOR" =~ (Debian) ]]; then
|
||||
echo 'deb http://archive.gplhost.com/debian grizzly main' | sudo tee /etc/apt/sources.list.d/gplhost_wheezy-backports.list
|
||||
echo 'deb http://archive.gplhost.com/debian grizzly-backports main' | sudo tee -a /etc/apt/sources.list.d/gplhost_wheezy-backports.list
|
||||
apt_get update
|
||||
apt_get install --force-yes gplhost-archive-keyring
|
||||
fi
|
||||
|
||||
if [[ is_fedora && $DISTRO =~ (rhel) ]]; then
|
||||
# Installing Open vSwitch on RHEL requires enabling the RDO repo.
|
||||
RHEL6_RDO_REPO_RPM=${RHEL6_RDO_REPO_RPM:-"http://rdo.fedorapeople.org/openstack-icehouse/rdo-release-icehouse.rpm"}
|
||||
@@ -234,9 +230,9 @@ if [[ is_fedora && $DISTRO =~ (rhel) ]]; then
|
||||
fi
|
||||
# RHEL requires EPEL for many Open Stack dependencies
|
||||
if [[ $DISTRO =~ (rhel7) ]]; then
|
||||
EPEL_RPM=${RHEL7_EPEL_RPM:-"http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.1.noarch.rpm"}
|
||||
EPEL_RPM=${RHEL7_EPEL_RPM:-"http://download.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.1.noarch.rpm"}
|
||||
else
|
||||
EPEL_RPM=${RHEL6_EPEL_RPM:-"http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm"}
|
||||
EPEL_RPM=${RHEL6_EPEL_RPM:-"http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm"}
|
||||
fi
|
||||
if ! sudo yum repolist enabled epel | grep -q 'epel'; then
|
||||
echo "EPEL not detected; installing"
|
||||
@@ -364,9 +360,6 @@ if [[ -d $TOP_DIR/extras.d ]]; then
|
||||
done
|
||||
fi
|
||||
|
||||
# Set the destination directories for other OpenStack projects
|
||||
OPENSTACKCLIENT_DIR=$DEST/python-openstackclient
|
||||
|
||||
# Interactive Configuration
|
||||
# -------------------------
|
||||
|
||||
@@ -436,6 +429,7 @@ initialize_database_backends && echo "Using $DATABASE_TYPE database backend" ||
|
||||
|
||||
# Rabbit connection info
|
||||
if is_service_enabled rabbit; then
|
||||
RABBIT_USERID=${RABBIT_USERID:-stackrabbit}
|
||||
RABBIT_HOST=${RABBIT_HOST:-$SERVICE_HOST}
|
||||
read_password RABBIT_PASSWORD "ENTER A PASSWORD TO USE FOR RABBIT."
|
||||
fi
|
||||
@@ -542,26 +536,15 @@ if [[ -n "$LOGFILE" ]]; then
|
||||
# Copy stdout to fd 3
|
||||
exec 3>&1
|
||||
if [[ "$VERBOSE" == "True" ]]; then
|
||||
# Redirect stdout/stderr to tee to write the log file
|
||||
exec 1> >( awk -v logfile=${LOGFILE} '
|
||||
/((set \+o$)|xtrace)/ { next }
|
||||
{
|
||||
cmd ="date +\"%Y-%m-%d %H:%M:%S.%3N | \""
|
||||
cmd | getline now
|
||||
close("date +\"%Y-%m-%d %H:%M:%S.%3N | \"")
|
||||
sub(/^/, now)
|
||||
print > logfile
|
||||
fflush(logfile)
|
||||
print
|
||||
fflush("")
|
||||
}' ) 2>&1
|
||||
# Set up a second fd for output
|
||||
exec 6> >( tee "${SUMFILE}" )
|
||||
# Set fd 1 and 2 to write the log file
|
||||
exec 1> >( $TOP_DIR/tools/outfilter.py -v -o "${LOGFILE}" ) 2>&1
|
||||
# Set fd 6 to summary log file
|
||||
exec 6> >( $TOP_DIR/tools/outfilter.py -o "${SUMFILE}" )
|
||||
else
|
||||
# Set fd 1 and 2 to primary logfile
|
||||
exec 1> "${LOGFILE}" 2>&1
|
||||
exec 1> >( $TOP_DIR/tools/outfilter.py -o "${LOGFILE}" ) 2>&1
|
||||
# Set fd 6 to summary logfile and stdout
|
||||
exec 6> >( tee "${SUMFILE}" >&3 )
|
||||
exec 6> >( $TOP_DIR/tools/outfilter.py -v -o "${SUMFILE}" >&3 )
|
||||
fi
|
||||
|
||||
echo_summary "stack.sh log $LOGFILE"
|
||||
@@ -577,7 +560,7 @@ else
|
||||
exec 1>/dev/null 2>&1
|
||||
fi
|
||||
# Always send summary fd to original stdout
|
||||
exec 6>&3
|
||||
exec 6> >( $TOP_DIR/tools/outfilter.py -v >&3 )
|
||||
fi
|
||||
|
||||
# Set up logging of screen windows
|
||||
@@ -708,9 +691,6 @@ if is_service_enabled heat horizon; then
|
||||
install_heatclient
|
||||
fi
|
||||
|
||||
git_clone $OPENSTACKCLIENT_REPO $OPENSTACKCLIENT_DIR $OPENSTACKCLIENT_BRANCH
|
||||
setup_develop $OPENSTACKCLIENT_DIR
|
||||
|
||||
if is_service_enabled key; then
|
||||
install_keystone
|
||||
configure_keystone
|
||||
@@ -753,6 +733,8 @@ if is_service_enabled nova; then
|
||||
fi
|
||||
|
||||
if is_service_enabled horizon; then
|
||||
# django openstack_auth
|
||||
install_django_openstack_auth
|
||||
# dashboard
|
||||
install_horizon
|
||||
configure_horizon
|
||||
@@ -763,7 +745,6 @@ if is_service_enabled ceilometer; then
|
||||
install_ceilometer
|
||||
echo_summary "Configuring Ceilometer"
|
||||
configure_ceilometer
|
||||
configure_ceilometerclient
|
||||
fi
|
||||
|
||||
if is_service_enabled heat; then
|
||||
@@ -780,7 +761,6 @@ if is_service_enabled tls-proxy; then
|
||||
# don't be naive and add to existing line!
|
||||
fi
|
||||
|
||||
|
||||
# Extras Install
|
||||
# --------------
|
||||
|
||||
@@ -791,6 +771,24 @@ if [[ -d $TOP_DIR/extras.d ]]; then
|
||||
done
|
||||
fi
|
||||
|
||||
# install the OpenStack client, needed for most setup commands
|
||||
if use_library_from_git "python-openstackclient"; then
|
||||
git_clone_by_name "python-openstackclient"
|
||||
setup_dev_lib "python-openstackclient"
|
||||
else
|
||||
# FIXME(adam)g: Work around a gate wedge by installing a capped novaclient
|
||||
# here, so that the following OSC installation does not pull in a newer one
|
||||
# via its uncapped requirement. This can be removed once OSC ends up in a
|
||||
# venv.
|
||||
pip_install "python-novaclient>=2.17.0,<2.21"
|
||||
|
||||
# Also install the capped neutronclient as per blocked
|
||||
# https://review.openstack.org/#/c/157606/
|
||||
pip_install "python-neutronclient>=2.3.4,<2.3.11"
|
||||
|
||||
pip_install "python-openstackclient<=0.4.1"
|
||||
fi
|
||||
|
||||
if [[ $TRACK_DEPENDS = True ]]; then
|
||||
$DEST/.venv/bin/pip freeze > $DEST/requires-post-pip
|
||||
if ! diff -Nru $DEST/requires-pre-pip $DEST/requires-post-pip > $DEST/requires.diff; then
|
||||
@@ -1163,7 +1161,7 @@ fi
|
||||
|
||||
if is_service_enabled zeromq; then
|
||||
echo_summary "Starting zermomq receiver"
|
||||
screen_it zeromq "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-rpc-zmq-receiver"
|
||||
run_process zeromq "$OSLO_BIN_DIR/oslo-messaging-zmq-receiver"
|
||||
fi
|
||||
|
||||
# Launch the nova-api and wait for it to answer before continuing
|
||||
@@ -1266,7 +1264,7 @@ if is_service_enabled nova && is_baremetal; then
|
||||
fi
|
||||
# ensure callback daemon is running
|
||||
sudo pkill nova-baremetal-deploy-helper || true
|
||||
screen_it baremetal "cd ; nova-baremetal-deploy-helper"
|
||||
run_process baremetal "nova-baremetal-deploy-helper"
|
||||
fi
|
||||
|
||||
# Save some values we generated for later use
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
# Find the other rc files
|
||||
RC_DIR=$(cd $(dirname "${BASH_SOURCE:-$0}") && pwd)
|
||||
|
||||
# Source required devstack functions and globals
|
||||
source $RC_DIR/functions
|
||||
|
||||
# Destination path for installation
|
||||
DEST=/opt/stack
|
||||
|
||||
@@ -97,137 +100,257 @@ GIT_TIMEOUT=${GIT_TIMEOUT:-0}
|
||||
# Another option is http://review.openstack.org/p
|
||||
GIT_BASE=${GIT_BASE:-git://git.openstack.org}
|
||||
|
||||
##############
|
||||
#
|
||||
# OpenStack Server Components
|
||||
#
|
||||
##############
|
||||
|
||||
# metering service
|
||||
CEILOMETER_REPO=${CEILOMETER_REPO:-${GIT_BASE}/openstack/ceilometer.git}
|
||||
CEILOMETER_BRANCH=${CEILOMETER_BRANCH:-master}
|
||||
CEILOMETER_BRANCH=${CEILOMETER_BRANCH:-stable/icehouse}
|
||||
|
||||
# ceilometer client library
|
||||
CEILOMETERCLIENT_REPO=${CEILOMETERCLIENT_REPO:-${GIT_BASE}/openstack/python-ceilometerclient.git}
|
||||
CEILOMETERCLIENT_BRANCH=${CEILOMETERCLIENT_BRANCH:-master}
|
||||
|
||||
# volume service
|
||||
# block storage service
|
||||
CINDER_REPO=${CINDER_REPO:-${GIT_BASE}/openstack/cinder.git}
|
||||
CINDER_BRANCH=${CINDER_BRANCH:-master}
|
||||
|
||||
# volume client
|
||||
CINDERCLIENT_REPO=${CINDERCLIENT_REPO:-${GIT_BASE}/openstack/python-cinderclient.git}
|
||||
CINDERCLIENT_BRANCH=${CINDERCLIENT_BRANCH:-master}
|
||||
CINDER_BRANCH=${CINDER_BRANCH:-stable/icehouse}
|
||||
|
||||
# image catalog service
|
||||
GLANCE_REPO=${GLANCE_REPO:-${GIT_BASE}/openstack/glance.git}
|
||||
GLANCE_BRANCH=${GLANCE_BRANCH:-master}
|
||||
|
||||
# python glance client library
|
||||
GLANCECLIENT_REPO=${GLANCECLIENT_REPO:-${GIT_BASE}/openstack/python-glanceclient.git}
|
||||
GLANCECLIENT_BRANCH=${GLANCECLIENT_BRANCH:-master}
|
||||
GLANCE_BRANCH=${GLANCE_BRANCH:-stable/icehouse}
|
||||
|
||||
# heat service
|
||||
HEAT_REPO=${HEAT_REPO:-${GIT_BASE}/openstack/heat.git}
|
||||
HEAT_BRANCH=${HEAT_BRANCH:-master}
|
||||
|
||||
# python heat client library
|
||||
HEATCLIENT_REPO=${HEATCLIENT_REPO:-${GIT_BASE}/openstack/python-heatclient.git}
|
||||
HEATCLIENT_BRANCH=${HEATCLIENT_BRANCH:-master}
|
||||
HEAT_BRANCH=${HEAT_BRANCH:-stable/icehouse}
|
||||
|
||||
# django powered web control panel for openstack
|
||||
HORIZON_REPO=${HORIZON_REPO:-${GIT_BASE}/openstack/horizon.git}
|
||||
HORIZON_BRANCH=${HORIZON_BRANCH:-master}
|
||||
HORIZON_BRANCH=${HORIZON_BRANCH:-stable/icehouse}
|
||||
|
||||
# baremetal provisionint service
|
||||
IRONIC_REPO=${IRONIC_REPO:-${GIT_BASE}/openstack/ironic.git}
|
||||
IRONIC_BRANCH=${IRONIC_BRANCH:-master}
|
||||
|
||||
# ironic client
|
||||
IRONICCLIENT_REPO=${IRONICCLIENT_REPO:-${GIT_BASE}/openstack/python-ironicclient.git}
|
||||
IRONICCLIENT_BRANCH=${IRONICCLIENT_BRANCH:-master}
|
||||
IRONIC_BRANCH=${IRONIC_BRANCH:-stable/icehouse}
|
||||
|
||||
# unified auth system (manages accounts/tokens)
|
||||
KEYSTONE_REPO=${KEYSTONE_REPO:-${GIT_BASE}/openstack/keystone.git}
|
||||
KEYSTONE_BRANCH=${KEYSTONE_BRANCH:-master}
|
||||
|
||||
# python keystone client library to nova that horizon uses
|
||||
KEYSTONECLIENT_REPO=${KEYSTONECLIENT_REPO:-${GIT_BASE}/openstack/python-keystoneclient.git}
|
||||
KEYSTONECLIENT_BRANCH=${KEYSTONECLIENT_BRANCH:-master}
|
||||
|
||||
# compute service
|
||||
NOVA_REPO=${NOVA_REPO:-${GIT_BASE}/openstack/nova.git}
|
||||
NOVA_BRANCH=${NOVA_BRANCH:-master}
|
||||
|
||||
# python client library to nova that horizon (and others) use
|
||||
NOVACLIENT_REPO=${NOVACLIENT_REPO:-${GIT_BASE}/openstack/python-novaclient.git}
|
||||
NOVACLIENT_BRANCH=${NOVACLIENT_BRANCH:-master}
|
||||
|
||||
# consolidated openstack python client
|
||||
OPENSTACKCLIENT_REPO=${OPENSTACKCLIENT_REPO:-${GIT_BASE}/openstack/python-openstackclient.git}
|
||||
OPENSTACKCLIENT_BRANCH=${OPENSTACKCLIENT_BRANCH:-master}
|
||||
|
||||
# cliff command line framework
|
||||
CLIFF_REPO=${CLIFF_REPO:-${GIT_BASE}/openstack/cliff.git}
|
||||
CLIFF_BRANCH=${CLIFF_BRANCH:-master}
|
||||
|
||||
# oslo.config
|
||||
OSLOCFG_REPO=${OSLOCFG_REPO:-${GIT_BASE}/openstack/oslo.config.git}
|
||||
OSLOCFG_BRANCH=${OSLOCFG_BRANCH:-master}
|
||||
|
||||
# oslo.messaging
|
||||
OSLOMSG_REPO=${OSLOMSG_REPO:-${GIT_BASE}/openstack/oslo.messaging.git}
|
||||
OSLOMSG_BRANCH=${OSLOMSG_BRANCH:-master}
|
||||
|
||||
# oslo.rootwrap
|
||||
OSLORWRAP_REPO=${OSLORWRAP_REPO:-${GIT_BASE}/openstack/oslo.rootwrap.git}
|
||||
OSLORWRAP_BRANCH=${OSLORWRAP_BRANCH:-master}
|
||||
|
||||
# oslo.vmware
|
||||
OSLOVMWARE_REPO=${OSLOVMWARE_REPO:-${GIT_BASE}/openstack/oslo.vmware.git}
|
||||
OSLOVMWARE_BRANCH=${OSLOVMWARE_BRANCH:-master}
|
||||
|
||||
# pycadf auditing library
|
||||
PYCADF_REPO=${PYCADF_REPO:-${GIT_BASE}/openstack/pycadf.git}
|
||||
PYCADF_BRANCH=${PYCADF_BRANCH:-master}
|
||||
|
||||
# stevedore plugin manager
|
||||
STEVEDORE_REPO=${STEVEDORE_REPO:-${GIT_BASE}/openstack/stevedore.git}
|
||||
STEVEDORE_BRANCH=${STEVEDORE_BRANCH:-master}
|
||||
|
||||
# taskflow plugin manager
|
||||
TASKFLOW_REPO=${TASKFLOW_REPO:-${GIT_BASE}/openstack/taskflow.git}
|
||||
TASKFLOW_BRANCH=${TASKFLOW_BRANCH:-master}
|
||||
|
||||
# pbr drives the setuptools configs
|
||||
PBR_REPO=${PBR_REPO:-${GIT_BASE}/openstack-dev/pbr.git}
|
||||
PBR_BRANCH=${PBR_BRANCH:-master}
|
||||
KEYSTONE_BRANCH=${KEYSTONE_BRANCH:-stable/icehouse}
|
||||
|
||||
# neutron service
|
||||
NEUTRON_REPO=${NEUTRON_REPO:-${GIT_BASE}/openstack/neutron.git}
|
||||
NEUTRON_BRANCH=${NEUTRON_BRANCH:-master}
|
||||
NEUTRON_BRANCH=${NEUTRON_BRANCH:-stable/icehouse}
|
||||
|
||||
# neutron client
|
||||
NEUTRONCLIENT_REPO=${NEUTRONCLIENT_REPO:-${GIT_BASE}/openstack/python-neutronclient.git}
|
||||
NEUTRONCLIENT_BRANCH=${NEUTRONCLIENT_BRANCH:-master}
|
||||
# compute service
|
||||
NOVA_REPO=${NOVA_REPO:-${GIT_BASE}/openstack/nova.git}
|
||||
NOVA_BRANCH=${NOVA_BRANCH:-stable/icehouse}
|
||||
|
||||
# data processing service
|
||||
SAHARA_REPO=${SAHARA_REPO:-${GIT_BASE}/openstack/sahara.git}
|
||||
SAHARA_BRANCH=${SAHARA_BRANCH:-master}
|
||||
|
||||
# object storage service
|
||||
SWIFT_REPO=${SWIFT_REPO:-${GIT_BASE}/openstack/swift.git}
|
||||
SWIFT_BRANCH=${SWIFT_BRANCH:-stable/icehouse}
|
||||
|
||||
# trove service
|
||||
TROVE_REPO=${TROVE_REPO:-${GIT_BASE}/openstack/trove.git}
|
||||
TROVE_BRANCH=${TROVE_BRANCH:-stable/icehouse}
|
||||
|
||||
##############
|
||||
#
|
||||
# Testing Components
|
||||
#
|
||||
##############
|
||||
|
||||
# consolidated openstack requirements
|
||||
REQUIREMENTS_REPO=${REQUIREMENTS_REPO:-${GIT_BASE}/openstack/requirements.git}
|
||||
REQUIREMENTS_BRANCH=${REQUIREMENTS_BRANCH:-master}
|
||||
|
||||
# storage service
|
||||
SWIFT_REPO=${SWIFT_REPO:-${GIT_BASE}/openstack/swift.git}
|
||||
SWIFT_BRANCH=${SWIFT_BRANCH:-master}
|
||||
SWIFT3_REPO=${SWIFT3_REPO:-${GIT_BASE}/stackforge/swift3.git}
|
||||
SWIFT3_BRANCH=${SWIFT3_BRANCH:-master}
|
||||
|
||||
# python swift client library
|
||||
SWIFTCLIENT_REPO=${SWIFTCLIENT_REPO:-${GIT_BASE}/openstack/python-swiftclient.git}
|
||||
SWIFTCLIENT_BRANCH=${SWIFTCLIENT_BRANCH:-master}
|
||||
REQUIREMENTS_BRANCH=${REQUIREMENTS_BRANCH:-stable/icehouse}
|
||||
|
||||
# Tempest test suite
|
||||
TEMPEST_REPO=${TEMPEST_REPO:-${GIT_BASE}/openstack/tempest.git}
|
||||
TEMPEST_BRANCH=${TEMPEST_BRANCH:-master}
|
||||
|
||||
# TODO(sdague): this should end up as a library component like below
|
||||
GITREPO["tempest-lib"]=${TEMPEST_LIB_REPO:-${GIT_BASE}/openstack/tempest-lib.git}
|
||||
GITBRANCH["tempest-lib"]=${TEMPEST_LIB_BRANCH:-master}
|
||||
|
||||
|
||||
##############
|
||||
#
|
||||
# OpenStack Client Library Componets
|
||||
#
|
||||
##############
|
||||
|
||||
# ceilometer client library
|
||||
GITREPO["python-ceilometerclient"]=${CEILOMETERCLIENT_REPO:-${GIT_BASE}/openstack/python-ceilometerclient.git}
|
||||
GITBRANCH["python-ceilometerclient"]=${CEILOMETERCLIENT_BRANCH:-master}
|
||||
|
||||
# volume client
|
||||
GITREPO["python-cinderclient"]=${CINDERCLIENT_REPO:-${GIT_BASE}/openstack/python-cinderclient.git}
|
||||
GITBRANCH["python-cinderclient"]=${CINDERCLIENT_BRANCH:-master}
|
||||
|
||||
# python glance client library
|
||||
GITREPO["python-glanceclient"]=${GLANCECLIENT_REPO:-${GIT_BASE}/openstack/python-glanceclient.git}
|
||||
GITBRANCH["python-glanceclient"]=${GLANCECLIENT_BRANCH:-master}
|
||||
|
||||
# python heat client library
|
||||
GITREPO["python-heatclient"]=${HEATCLIENT_REPO:-${GIT_BASE}/openstack/python-heatclient.git}
|
||||
GITBRANCH["python-heatclient"]=${HEATCLIENT_BRANCH:-master}
|
||||
|
||||
# ironic client
|
||||
GITREPO["python-ironicclient"]=${IRONICCLIENT_REPO:-${GIT_BASE}/openstack/python-ironicclient.git}
|
||||
GITBRANCH["python-ironicclient"]=${IRONICCLIENT_BRANCH:-master}
|
||||
|
||||
# python keystone client library to nova that horizon uses
|
||||
GITREPO["python-keystoneclient"]=${KEYSTONECLIENT_REPO:-${GIT_BASE}/openstack/python-keystoneclient.git}
|
||||
GITBRANCH["python-keystoneclient"]=${KEYSTONECLIENT_BRANCH:-master}
|
||||
|
||||
# neutron client
|
||||
GITREPO["python-neutronclient"]=${NEUTRONCLIENT_REPO:-${GIT_BASE}/openstack/python-neutronclient.git}
|
||||
GITBRANCH["python-neutronclient"]=${NEUTRONCLIENT_BRANCH:-master}
|
||||
|
||||
# python client library to nova that horizon (and others) use
|
||||
GITREPO["python-novaclient"]=${NOVACLIENT_REPO:-${GIT_BASE}/openstack/python-novaclient.git}
|
||||
GITBRANCH["python-novaclient"]=${NOVACLIENT_BRANCH:-master}
|
||||
|
||||
# python saharaclient
|
||||
GITREPO["python-saharaclient"]=${SAHARACLIENT_REPO:-${GIT_BASE}/openstack/python-saharaclient.git}
|
||||
GITBRANCH["python-saharaclient"]=${SAHARACLIENT_BRANCH:-master}
|
||||
|
||||
# python swift client library
|
||||
GITREPO["python-swiftclient"]=${SWIFTCLIENT_REPO:-${GIT_BASE}/openstack/python-swiftclient.git}
|
||||
GITBRANCH["python-swiftclient"]=${SWIFTCLIENT_BRANCH:-master}
|
||||
|
||||
# trove client library test
|
||||
GITREPO["python-troveclient"]=${TROVECLIENT_REPO:-${GIT_BASE}/openstack/python-troveclient.git}
|
||||
GITBRANCH["python-troveclient"]=${TROVECLIENT_BRANCH:-master}
|
||||
|
||||
# consolidated openstack python client
|
||||
GITREPO["python-openstackclient"]=${OPENSTACKCLIENT_REPO:-${GIT_BASE}/openstack/python-openstackclient.git}
|
||||
GITBRANCH["python-openstackclient"]=${OPENSTACKCLIENT_BRANCH:-master}
|
||||
# this doesn't exist in a lib file, so set it here
|
||||
GITDIR["python-openstackclient"]=$DEST/python-openstackclient
|
||||
|
||||
###################
|
||||
#
|
||||
# Oslo Libraries
|
||||
#
|
||||
###################
|
||||
|
||||
# cliff command line framework
|
||||
GITREPO["cliff"]=${CLIFF_REPO:-${GIT_BASE}/openstack/cliff.git}
|
||||
GITBRANCH["cliff"]=${CLIFF_BRANCH:-master}
|
||||
|
||||
# oslo.config
|
||||
GITREPO["oslo.config"]=${OSLOCFG_REPO:-${GIT_BASE}/openstack/oslo.config.git}
|
||||
GITBRANCH["oslo.config"]=${OSLOCFG_BRANCH:-master}
|
||||
|
||||
# oslo.messaging
|
||||
GITREPO["oslo.messaging"]=${OSLOMSG_REPO:-${GIT_BASE}/openstack/oslo.messaging.git}
|
||||
GITBRANCH["oslo.messaging"]=${OSLOMSG_BRANCH:-master}
|
||||
|
||||
# oslo.rootwrap
|
||||
GITREPO["oslo.rootwrap"]=${OSLORWRAP_REPO:-${GIT_BASE}/openstack/oslo.rootwrap.git}
|
||||
GITBRANCH["oslo.rootwrap"]=${OSLORWRAP_BRANCH:-master}
|
||||
|
||||
# oslo.vmware
|
||||
GITREPO["oslo.vmware"]=${OSLOVMWARE_REPO:-${GIT_BASE}/openstack/oslo.vmware.git}
|
||||
GITBRANCH["oslo.vmware"]=${OSLOVMWARE_BRANCH:-master}
|
||||
|
||||
# pycadf auditing library
|
||||
GITREPO["pycadf"]=${PYCADF_REPO:-${GIT_BASE}/openstack/pycadf.git}
|
||||
GITBRANCH["pycadf"]=${PYCADF_BRANCH:-master}
|
||||
|
||||
# stevedore plugin manager
|
||||
GITREPO["stevedore"]=${STEVEDORE_REPO:-${GIT_BASE}/openstack/stevedore.git}
|
||||
GITBRANCH["stevedore"]=${STEVEDORE_BRANCH:-master}
|
||||
|
||||
# taskflow plugin manager
|
||||
GITREPO["taskflow"]=${TASKFLOW_REPO:-${GIT_BASE}/openstack/taskflow.git}
|
||||
GITBRANCH["taskflow"]=${TASKFLOW_BRANCH:-master}
|
||||
|
||||
# pbr drives the setuptools configs
|
||||
GITREPO["pbr"]=${PBR_REPO:-${GIT_BASE}/openstack-dev/pbr.git}
|
||||
GITBRANCH["pbr"]=${PBR_BRANCH:-master}
|
||||
|
||||
##################
|
||||
#
|
||||
# Libraries managed by OpenStack programs (non oslo)
|
||||
#
|
||||
##################
|
||||
|
||||
# heat-cfntools server agent
|
||||
HEAT_CFNTOOLS_REPO=${HEAT_CFNTOOLS_REPO:-${GIT_BASE}/openstack/heat-cfntools.git}
|
||||
HEAT_CFNTOOLS_BRANCH=${HEAT_CFNTOOLS_BRANCH:-master}
|
||||
|
||||
# heat example templates and elements
|
||||
HEAT_TEMPLATES_REPO=${HEAT_TEMPLATES_REPO:-${GIT_BASE}/openstack/heat-templates.git}
|
||||
HEAT_TEMPLATES_BRANCH=${HEAT_TEMPLATES_BRANCH:-master}
|
||||
|
||||
# django openstack_auth library
|
||||
GITREPO["django_openstack_auth"]=${HORIZONAUTH_REPO:-${GIT_BASE}/openstack/django_openstack_auth.git}
|
||||
GITBRANCH["django_openstack_auth"]=${HORIZONAUTH_BRANCH:-master}
|
||||
|
||||
# keystone middleware
|
||||
GITREPO["keystonemiddleware"]=${KEYSTONEMIDDLEWARE_REPO:-${GIT_BASE}/openstack/keystonemiddleware.git}
|
||||
GITBRANCH["keystonemiddleware"]=${KEYSTONEMIDDLEWARE_BRANCH:-master}
|
||||
|
||||
# s3 support for swift
|
||||
SWIFT3_REPO=${SWIFT3_REPO:-${GIT_BASE}/stackforge/swift3.git}
|
||||
SWIFT3_BRANCH=${SWIFT3_BRANCH:-master}
|
||||
|
||||
##################
|
||||
#
|
||||
# TripleO Components
|
||||
#
|
||||
##################
|
||||
|
||||
# diskimage-builder
|
||||
DIB_REPO=${DIB_REPO:-${GIT_BASE}/openstack/diskimage-builder.git}
|
||||
DIB_BRANCH=${DIB_BRANCH:-master}
|
||||
|
||||
# os-apply-config configuration template tool
|
||||
OAC_REPO=${OAC_REPO:-${GIT_BASE}/openstack/os-apply-config.git}
|
||||
OAC_BRANCH=${OAC_BRANCH:-master}
|
||||
|
||||
# os-collect-config configuration agent
|
||||
OCC_REPO=${OCC_REPO:-${GIT_BASE}/openstack/os-collect-config.git}
|
||||
OCC_BRANCH=${OCC_BRANCH:-master}
|
||||
|
||||
# os-refresh-config configuration run-parts tool
|
||||
ORC_REPO=${ORC_REPO:-${GIT_BASE}/openstack/os-refresh-config.git}
|
||||
ORC_BRANCH=${ORC_BRANCH:-master}
|
||||
|
||||
# Tripleo elements for diskimage-builder images
|
||||
TIE_REPO=${TIE_REPO:-${GIT_BASE}/openstack/tripleo-image-elements.git}
|
||||
TIE_BRANCH=${TIE_BRANCH:-master}
|
||||
|
||||
#################
|
||||
#
|
||||
# Additional Libraries
|
||||
#
|
||||
#################
|
||||
|
||||
# stackforge libraries that are used by OpenStack core services
|
||||
# wsme
|
||||
WSME_REPO=${WSME_REPO:-${GIT_BASE}/stackforge/wsme.git}
|
||||
WSME_BRANCH=${WSME_BRANCH:-master}
|
||||
|
||||
# pecan
|
||||
PECAN_REPO=${PECAN_REPO:-${GIT_BASE}/stackforge/pecan.git}
|
||||
PECAN_BRANCH=${PECAN_BRANCH:-master}
|
||||
|
||||
|
||||
#################
|
||||
#
|
||||
# 3rd Party Components (non pip installable)
|
||||
#
|
||||
# NOTE(sdague): these should be converted to release version installs or removed
|
||||
#
|
||||
#################
|
||||
|
||||
# ironic python agent
|
||||
IRONIC_PYTHON_AGENT_REPO=${IRONIC_PYTHON_AGENT_REPO:-${GIT_BASE}/openstack/ironic-python-agent.git}
|
||||
IRONIC_PYTHON_AGENT_BRANCH=${IRONIC_PYTHON_AGENT_BRANCH:-master}
|
||||
|
||||
# a websockets/html5 or flash powered VNC console for vm instances
|
||||
NOVNC_REPO=${NOVNC_REPO:-https://github.com/kanaka/noVNC.git}
|
||||
NOVNC_BRANCH=${NOVNC_BRANCH:-master}
|
||||
@@ -240,22 +363,6 @@ RYU_BRANCH=${RYU_BRANCH:-master}
|
||||
SPICE_REPO=${SPICE_REPO:-http://anongit.freedesktop.org/git/spice/spice-html5.git}
|
||||
SPICE_BRANCH=${SPICE_BRANCH:-master}
|
||||
|
||||
# trove service
|
||||
TROVE_REPO=${TROVE_REPO:-${GIT_BASE}/openstack/trove.git}
|
||||
TROVE_BRANCH=${TROVE_BRANCH:-master}
|
||||
|
||||
# trove client library test
|
||||
TROVECLIENT_REPO=${TROVECLIENT_REPO:-${GIT_BASE}/openstack/python-troveclient.git}
|
||||
TROVECLIENT_BRANCH=${TROVECLIENT_BRANCH:-master}
|
||||
|
||||
# stackforge libraries that are used by OpenStack core services
|
||||
# wsme
|
||||
WSME_REPO=${WSME_REPO:-${GIT_BASE}/stackforge/wsme.git}
|
||||
WSME_BRANCH=${WSME_BRANCH:-master}
|
||||
|
||||
# pecan
|
||||
PECAN_REPO=${PECAN_REPO:-${GIT_BASE}/stackforge/pecan.git}
|
||||
PECAN_BRANCH=${PECAN_BRANCH:-master}
|
||||
|
||||
|
||||
# Nova hypervisor configuration. We default to libvirt with **kvm** but will
|
||||
@@ -322,11 +429,11 @@ case "$VIRT_DRIVER" in
|
||||
libvirt)
|
||||
case "$LIBVIRT_TYPE" in
|
||||
lxc) # the cirros root disk in the uec tarball is empty, so it will not work for lxc
|
||||
DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-cirros-0.3.1-x86_64-rootfs}
|
||||
IMAGE_URLS=${IMAGE_URLS:-"http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-rootfs.img.gz"};;
|
||||
DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-cirros-0.3.2-x86_64-rootfs}
|
||||
IMAGE_URLS=${IMAGE_URLS:-"http://download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-rootfs.img.gz"};;
|
||||
*) # otherwise, use the uec style image (with kernel, ramdisk, disk)
|
||||
DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-cirros-0.3.1-x86_64-uec}
|
||||
IMAGE_URLS=${IMAGE_URLS:-"http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz"};;
|
||||
DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-cirros-0.3.2-x86_64-uec}
|
||||
IMAGE_URLS=${IMAGE_URLS:-"http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz,http://download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-uec.tar.gz"};;
|
||||
esac
|
||||
;;
|
||||
vsphere)
|
||||
@@ -334,18 +441,19 @@ case "$VIRT_DRIVER" in
|
||||
IMAGE_URLS=${IMAGE_URLS:-"http://partnerweb.vmware.com/programs/vmdkimage/cirros-0.3.0-i386-disk.vmdk"};;
|
||||
xenserver)
|
||||
DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-cirros-0.3.0-x86_64-disk}
|
||||
IMAGE_URLS=${IMAGE_URLS:-"https://github.com/downloads/citrix-openstack/warehouse/cirros-0.3.0-x86_64-disk.vhd.tgz"};;
|
||||
IMAGE_URLS=${IMAGE_URLS:-"https://github.com/downloads/citrix-openstack/warehouse/cirros-0.3.0-x86_64-disk.vhd.tgz"}
|
||||
IMAGE_URLS+=",http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz,http://download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-uec.tar.gz";;
|
||||
*) # Default to Cirros with kernel, ramdisk and disk image
|
||||
DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-cirros-0.3.1-x86_64-uec}
|
||||
IMAGE_URLS=${IMAGE_URLS:-"http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz"};;
|
||||
DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-cirros-0.3.2-x86_64-uec}
|
||||
IMAGE_URLS=${IMAGE_URLS:-"http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz,http://download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-uec.tar.gz"};;
|
||||
esac
|
||||
|
||||
# if heat is enabled, bring in a linux image with cfn enabled
|
||||
# TODO(sdague) this next block can be removed after nodepool has the 64bit image in it's cache
|
||||
HEAT_FETCHED_TEST_IMAGE=${HEAT_FETCHED_TEST_IMAGE:-""}
|
||||
if [[ "$HEAT_FETCHED_TEST_IMAGE" == "Fedora-i386-20-20131211.1-sda" ]]; then
|
||||
HEAT_CFN_IMAGE_URL="https://dl.fedoraproject.org/pub/fedora/linux/releases/20/Images/i386/$HEAT_FETCHED_TEST_IMAGE.qcow2"
|
||||
IMAGE_URLS+=",https://dl.fedoraproject.org/pub/fedora/linux/releases/20/Images/i386/$HEAT_FETCHED_TEST_IMAGE.qcow2"
|
||||
HEAT_CFN_IMAGE_URL="https://download.fedoraproject.org/pub/fedora/linux/releases/20/Images/i386/$HEAT_FETCHED_TEST_IMAGE.qcow2"
|
||||
IMAGE_URLS+=",https://download.fedoraproject.org/pub/fedora/linux/releases/20/Images/i386/$HEAT_FETCHED_TEST_IMAGE.qcow2"
|
||||
elif [[ "$HEAT_FETCHED_TEST_IMAGE" == "Fedora-x86_64-20-20131211.1-sda" ]]; then
|
||||
HEAT_CFN_IMAGE_URL="https://download.fedoraproject.org/pub/fedora/linux/releases/20/Images/x86_64/Fedora-x86_64-20-20131211.1-sda.qcow2"
|
||||
IMAGE_URLS+=",https://download.fedoraproject.org/pub/fedora/linux/releases/20/Images/x86_64/Fedora-x86_64-20-20131211.1-sda.qcow2"
|
||||
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
# fake-service.sh - a fake service for start/stop testing
|
||||
# $1 - sleep time
|
||||
|
||||
SLEEP_TIME=${1:-3}
|
||||
|
||||
LOG=/tmp/fake-service.log
|
||||
TIMESTAMP_FORMAT=${TIMESTAMP_FORMAT:-"%F-%H%M%S"}
|
||||
|
||||
# duplicate output
|
||||
exec 1> >(tee -a ${LOG})
|
||||
|
||||
echo ""
|
||||
echo "Starting fake-service for ${SLEEP_TIME}"
|
||||
while true; do
|
||||
echo "$(date +${TIMESTAMP_FORMAT}) [$$]"
|
||||
sleep ${SLEEP_TIME}
|
||||
done
|
||||
|
||||
Executable
+109
@@ -0,0 +1,109 @@
|
||||
#!/bin/bash
|
||||
# tests/exec.sh - Test DevStack run_process() and stop_process()
|
||||
#
|
||||
# exec.sh start|stop|status
|
||||
#
|
||||
# Set USE_SCREEN True|False to change use of screen.
|
||||
#
|
||||
# This script emulates the basic exec envirnment in ``stack.sh`` to test
|
||||
# the process spawn and kill operations.
|
||||
|
||||
if [[ -z $1 ]]; then
|
||||
echo "$0 start|stop"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TOP_DIR=$(cd $(dirname "$0")/.. && pwd)
|
||||
source $TOP_DIR/functions
|
||||
|
||||
USE_SCREEN=${USE_SCREEN:-False}
|
||||
|
||||
ENABLED_SERVICES=fake-service
|
||||
|
||||
SERVICE_DIR=/tmp
|
||||
SCREEN_NAME=test
|
||||
SCREEN_LOGDIR=${SERVICE_DIR}/${SCREEN_NAME}
|
||||
|
||||
|
||||
# Kill background processes on exit
|
||||
trap clean EXIT
|
||||
clean() {
|
||||
local r=$?
|
||||
jobs -p
|
||||
kill >/dev/null 2>&1 $(jobs -p)
|
||||
exit $r
|
||||
}
|
||||
|
||||
|
||||
# Exit on any errors so that errors don't compound
|
||||
trap failed ERR
|
||||
failed() {
|
||||
local r=$?
|
||||
jobs -p
|
||||
kill >/dev/null 2>&1 $(jobs -p)
|
||||
set +o xtrace
|
||||
[ -n "$LOGFILE" ] && echo "${0##*/} failed: full log in $LOGFILE"
|
||||
exit $r
|
||||
}
|
||||
|
||||
function status {
|
||||
if [[ -r $SERVICE_DIR/$SCREEN_NAME/fake-service.pid ]]; then
|
||||
pstree -pg $(cat $SERVICE_DIR/$SCREEN_NAME/fake-service.pid)
|
||||
fi
|
||||
ps -ef | grep fake
|
||||
}
|
||||
|
||||
function setup_screen {
|
||||
if [[ ! -d $SERVICE_DIR/$SCREEN_NAME ]]; then
|
||||
rm -rf $SERVICE_DIR/$SCREEN_NAME
|
||||
mkdir -p $SERVICE_DIR/$SCREEN_NAME
|
||||
fi
|
||||
|
||||
if [[ "$USE_SCREEN" == "True" ]]; then
|
||||
# Create a new named screen to run processes in
|
||||
screen -d -m -S $SCREEN_NAME -t shell -s /bin/bash
|
||||
sleep 1
|
||||
|
||||
# Set a reasonable status bar
|
||||
if [ -z "$SCREEN_HARDSTATUS" ]; then
|
||||
SCREEN_HARDSTATUS='%{= .} %-Lw%{= .}%> %n%f %t*%{= .}%+Lw%< %-=%{g}(%{d}%H/%l%{g})'
|
||||
fi
|
||||
screen -r $SCREEN_NAME -X hardstatus alwayslastline "$SCREEN_HARDSTATUS"
|
||||
fi
|
||||
|
||||
# Clear screen rc file
|
||||
SCREENRC=$TOP_DIR/tests/$SCREEN_NAME-screenrc
|
||||
if [[ -e $SCREENRC ]]; then
|
||||
echo -n > $SCREENRC
|
||||
fi
|
||||
}
|
||||
|
||||
# Mimic logging
|
||||
# Set up output redirection without log files
|
||||
# Copy stdout to fd 3
|
||||
exec 3>&1
|
||||
if [[ "$VERBOSE" != "True" ]]; then
|
||||
# Throw away stdout and stderr
|
||||
#exec 1>/dev/null 2>&1
|
||||
:
|
||||
fi
|
||||
# Always send summary fd to original stdout
|
||||
exec 6>&3
|
||||
|
||||
|
||||
if [[ "$1" == "start" ]]; then
|
||||
echo "Start service"
|
||||
setup_screen
|
||||
run_process fake-service "$TOP_DIR/tests/fake-service.sh"
|
||||
sleep 1
|
||||
status
|
||||
elif [[ "$1" == "stop" ]]; then
|
||||
echo "Stop service"
|
||||
stop_process fake-service
|
||||
status
|
||||
elif [[ "$1" == "status" ]]; then
|
||||
status
|
||||
else
|
||||
echo "Unknown command"
|
||||
exit 1
|
||||
fi
|
||||
+35
-1
@@ -42,6 +42,17 @@ type=original
|
||||
EOF
|
||||
}
|
||||
|
||||
function setup_test4 {
|
||||
mkdir -p test-etc
|
||||
cat >test-etc/test4.conf <<EOF
|
||||
[fff]
|
||||
# original comment
|
||||
type=original
|
||||
EOF
|
||||
TEST4_DIR="test-etc"
|
||||
TEST4_FILE="test4.conf"
|
||||
}
|
||||
|
||||
cat >test.conf <<EOF
|
||||
[[test1|test1a.conf]]
|
||||
[default]
|
||||
@@ -76,8 +87,11 @@ $TEST_1C_ADD
|
||||
attribute=value
|
||||
|
||||
# the above line has a single space
|
||||
EOF
|
||||
|
||||
[[test4|\$TEST4_DIR/\$TEST4_FILE]]
|
||||
[fff]
|
||||
type=new
|
||||
EOF
|
||||
|
||||
echo -n "get_meta_section_files: test0 doesn't exist: "
|
||||
VAL=$(get_meta_section_files test.conf test0)
|
||||
@@ -192,4 +206,24 @@ EXPECT_VAL="
|
||||
attribute = value"
|
||||
check_result "$VAL" "$EXPECT_VAL"
|
||||
|
||||
echo -n "merge_config_group test4 variable filename: "
|
||||
setup_test4
|
||||
merge_config_group test.conf test4
|
||||
VAL=$(cat test-etc/test4.conf)
|
||||
EXPECT_VAL="[fff]
|
||||
# original comment
|
||||
type=new"
|
||||
check_result "$VAL" "$EXPECT_VAL"
|
||||
|
||||
echo -n "merge_config_group test4 variable filename (not exist): "
|
||||
setup_test4
|
||||
rm test-etc/test4.conf
|
||||
merge_config_group test.conf test4
|
||||
VAL=$(cat test-etc/test4.conf)
|
||||
EXPECT_VAL="
|
||||
[fff]
|
||||
type = new"
|
||||
check_result "$VAL" "$EXPECT_VAL"
|
||||
|
||||
rm -f test.conf test1c.conf test2a.conf test-space.conf
|
||||
rm -rf test-etc
|
||||
|
||||
Executable
+97
@@ -0,0 +1,97 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
|
||||
TOP=$(cd $(dirname "$0")/.. && pwd)
|
||||
|
||||
export TOP_DIR=$TOP
|
||||
|
||||
# Import common functions
|
||||
source $TOP/functions
|
||||
source $TOP/stackrc
|
||||
source $TOP/lib/tls
|
||||
for i in $TOP/lib/*; do
|
||||
if [[ -f $i ]]; then
|
||||
source $i
|
||||
fi
|
||||
done
|
||||
|
||||
ALL_LIBS="python-novaclient oslo.config pbr python-troveclient python-keystoneclient taskflow pycadf python-glanceclient python-ironicclient tempest-lib oslo.messaging cliff python-heatclient stevedore python-cinderclient oslo.vmware keystonemiddleware python-saharaclient django_openstack_auth python-openstackclient oslo.rootwrap python-ceilometerclient python-swiftclient python-neutronclient"
|
||||
|
||||
# Generate the above list with
|
||||
# echo ${!GITREPO[@]}
|
||||
# exit 1
|
||||
|
||||
function check_exists {
|
||||
local thing=$1
|
||||
local hash=$2
|
||||
local key=$3
|
||||
if [[ ! -z "$VERBOSE" ]]; then
|
||||
echo "Checking for $hash[$key]"
|
||||
fi
|
||||
if [[ -z $thing ]]; then
|
||||
echo "$hash[$key] does not exit!"
|
||||
exit 1
|
||||
else
|
||||
if [[ ! -z "$VERBOSE" ]]; then
|
||||
echo "$hash[$key] => $thing"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function test_all_libs_upto_date {
|
||||
# this is all the magics
|
||||
local found_libs=${!GITREPO[@]}
|
||||
declare -A all_libs
|
||||
for lib in $ALL_LIBS; do
|
||||
all_libs[$lib]=1
|
||||
done
|
||||
|
||||
for lib in $found_libs; do
|
||||
if [[ -z ${all_libs[$lib]} ]]; then
|
||||
echo "Library '$lib' not listed in unit tests, please add to ALL_LIBS"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
done
|
||||
echo "test_all_libs_upto_date PASSED"
|
||||
}
|
||||
|
||||
function test_libs_exist {
|
||||
local lib=""
|
||||
for lib in $ALL_LIBS; do
|
||||
check_exists "${GITREPO[$lib]}" "GITREPO" "$lib"
|
||||
check_exists "${GITBRANCH[$lib]}" "GITBRANCH" "$lib"
|
||||
check_exists "${GITDIR[$lib]}" "GITDIR" "$lib"
|
||||
done
|
||||
|
||||
echo "test_libs_exist PASSED"
|
||||
}
|
||||
|
||||
function test_branch_master {
|
||||
for lib in $ALL_LIBS; do
|
||||
if [[ ${GITBRANCH[$lib]} != "master" ]]; then
|
||||
echo "GITBRANCH for $lib not master (${GITBRANCH[$lib]})"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "test_branch_master PASSED"
|
||||
}
|
||||
|
||||
set -o errexit
|
||||
|
||||
test_libs_exist
|
||||
test_branch_master
|
||||
test_all_libs_upto_date
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
|
||||
echo "Ensuring we don't have crazy refs"
|
||||
|
||||
REFS=`grep BRANCH stackrc | grep -v -- '-master' | grep -v -- '-stable/'`
|
||||
rc=$?
|
||||
if [[ $rc -eq 0 ]]; then
|
||||
echo "Branch defaults must be master. Found:"
|
||||
echo $REFS
|
||||
exit 1
|
||||
fi
|
||||
+25
-10
@@ -18,7 +18,6 @@
|
||||
# - (re)start messagebus daemon
|
||||
# - remove distro packages python-crypto and python-lxml
|
||||
# - pre-install hgtools to work around a bug in RHEL6 distribute
|
||||
# - install nose 1.1 from EPEL
|
||||
|
||||
set -o errexit
|
||||
set -o xtrace
|
||||
@@ -35,6 +34,30 @@ source $TOP_DIR/functions
|
||||
|
||||
FILES=$TOP_DIR/files
|
||||
|
||||
# Keystone Port Reservation
|
||||
# -------------------------
|
||||
# Reserve and prevent $KEYSTONE_AUTH_PORT and $KEYSTONE_AUTH_PORT_INT from
|
||||
# being used as ephemeral ports by the system. The default(s) are 35357 and
|
||||
# 35358 which are in the Linux defined ephemeral port range (in disagreement
|
||||
# with the IANA ephemeral port range). This is a workaround for bug #1253482
|
||||
# where Keystone will try and bind to the port and the port will already be
|
||||
# in use as an ephemeral port by another process. This places an explicit
|
||||
# exception into the Kernel for the Keystone AUTH ports.
|
||||
keystone_ports=${KEYSTONE_AUTH_PORT:-35357},${KEYSTONE_AUTH_PORT_INT:-35358}
|
||||
|
||||
# Get any currently reserved ports, strip off leading whitespace
|
||||
reserved_ports=$(sysctl net.ipv4.ip_local_reserved_ports | awk -F'=' '{print $2;}' | sed 's/^ //')
|
||||
|
||||
if [[ -z "${reserved_ports}" ]]; then
|
||||
# If there are no currently reserved ports, reserve the keystone ports
|
||||
sudo sysctl -w net.ipv4.ip_local_reserved_ports=${keystone_ports}
|
||||
else
|
||||
# If there are currently reserved ports, keep those and also reserve the
|
||||
# keystone specific ports. Duplicate reservations are merged into a single
|
||||
# reservation (or range) automatically by the kernel.
|
||||
sudo sysctl -w net.ipv4.ip_local_reserved_ports=${keystone_ports},${reserved_ports}
|
||||
fi
|
||||
|
||||
|
||||
# Python Packages
|
||||
# ---------------
|
||||
@@ -51,7 +74,7 @@ function get_package_path {
|
||||
|
||||
# Fix prettytable 0.7.2 permissions
|
||||
# Don't specify --upgrade so we use the existing package if present
|
||||
pip_install 'prettytable>0.7'
|
||||
pip_install 'prettytable>=0.7'
|
||||
PACKAGE_DIR=$(get_package_path prettytable)
|
||||
# Only fix version 0.7.2
|
||||
dir=$(echo $PACKAGE_DIR/prettytable-0.7.2*)
|
||||
@@ -137,12 +160,4 @@ if [[ $DISTRO =~ (rhel6) ]]; then
|
||||
# Note we do this before the track-depends in ``stack.sh``.
|
||||
pip_install hgtools
|
||||
|
||||
|
||||
# RHEL6's version of ``python-nose`` is incompatible with Tempest.
|
||||
# Install nose 1.1 (Tempest-compatible) from EPEL
|
||||
install_package python-nose1.1
|
||||
# Add a symlink for the new nosetests to allow tox for Tempest to
|
||||
# work unmolested.
|
||||
sudo ln -sf /usr/bin/nosetests1.1 /usr/local/bin/nosetests
|
||||
|
||||
fi
|
||||
|
||||
+36
-38
@@ -24,28 +24,8 @@ source $TOP_DIR/functions
|
||||
|
||||
FILES=$TOP_DIR/files
|
||||
|
||||
# Handle arguments
|
||||
|
||||
USE_GET_PIP=${USE_GET_PIP:-0}
|
||||
INSTALL_PIP_VERSION=${INSTALL_PIP_VERSION:-"1.4.1"}
|
||||
while [[ -n "$1" ]]; do
|
||||
case $1 in
|
||||
--force)
|
||||
FORCE=1
|
||||
;;
|
||||
--pip-version)
|
||||
INSTALL_PIP_VERSION="$2"
|
||||
shift
|
||||
;;
|
||||
--use-get-pip)
|
||||
USE_GET_PIP=1;
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
PIP_GET_PIP_URL=https://raw.github.com/pypa/pip/master/contrib/get-pip.py
|
||||
PIP_TAR_URL=https://pypi.python.org/packages/source/p/pip/pip-$INSTALL_PIP_VERSION.tar.gz
|
||||
PIP_GET_PIP_URL=https://bootstrap.pypa.io/get-pip.py
|
||||
LOCAL_PIP="$FILES/$(basename $PIP_GET_PIP_URL)"
|
||||
|
||||
GetDistro
|
||||
echo "Distro: $DISTRO"
|
||||
@@ -62,24 +42,40 @@ function get_versions {
|
||||
|
||||
|
||||
function install_get_pip {
|
||||
if [[ ! -r $FILES/get-pip.py ]]; then
|
||||
(cd $FILES; \
|
||||
curl -O $PIP_GET_PIP_URL; \
|
||||
)
|
||||
if [[ ! -r $LOCAL_PIP ]]; then
|
||||
curl -o $LOCAL_PIP $PIP_GET_PIP_URL || \
|
||||
die $LINENO "Download of get-pip.py failed"
|
||||
fi
|
||||
sudo -E python $FILES/get-pip.py
|
||||
sudo -H -E python $LOCAL_PIP
|
||||
}
|
||||
|
||||
function install_pip_tarball {
|
||||
if [[ ! -r $FILES/pip-$INSTALL_PIP_VERSION.tar.gz ]]; then
|
||||
(cd $FILES; \
|
||||
curl -O $PIP_TAR_URL; \
|
||||
tar xvfz pip-$INSTALL_PIP_VERSION.tar.gz 1>/dev/null)
|
||||
|
||||
function configure_pypi_alternative_url {
|
||||
PIP_ROOT_FOLDER="$HOME/.pip"
|
||||
PIP_CONFIG_FILE="$PIP_ROOT_FOLDER/pip.conf"
|
||||
if [[ ! -d $PIP_ROOT_FOLDER ]]; then
|
||||
echo "Creating $PIP_ROOT_FOLDER"
|
||||
mkdir $PIP_ROOT_FOLDER
|
||||
fi
|
||||
(cd $FILES/pip-$INSTALL_PIP_VERSION; \
|
||||
sudo -E python setup.py install 1>/dev/null)
|
||||
if [[ ! -f $PIP_CONFIG_FILE ]]; then
|
||||
echo "Creating $PIP_CONFIG_FILE"
|
||||
touch $PIP_CONFIG_FILE
|
||||
fi
|
||||
if ! ini_has_option "$PIP_CONFIG_FILE" "global" "index-url"; then
|
||||
#it means that the index-url does not exist
|
||||
iniset "$PIP_CONFIG_FILE" "global" "index-url" "$PYPI_OVERRIDE"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
# Setuptools 8 implements PEP 440, and 8.0.4 adds a warning triggered any time
|
||||
# pkg_resources inspects the list of installed Python packages if there are
|
||||
# non-compliant version numbers in the egg-info (for example, from distro
|
||||
# system packaged Python libraries). This is off by default after 8.2 but can
|
||||
# be enabled by uncommenting the lines below.
|
||||
#PYTHONWARNINGS=$PYTHONWARNINGS,always::RuntimeWarning:pkg_resources
|
||||
#export PYTHONWARNINGS
|
||||
|
||||
# Show starting versions
|
||||
get_versions
|
||||
|
||||
@@ -88,10 +84,12 @@ get_versions
|
||||
# Eradicate any and all system packages
|
||||
uninstall_package python-pip
|
||||
|
||||
if [[ "$USE_GET_PIP" == "1" ]]; then
|
||||
install_get_pip
|
||||
else
|
||||
install_pip_tarball
|
||||
install_get_pip
|
||||
|
||||
if [[ -n $PYPI_ALTERNATIVE_URL ]]; then
|
||||
configure_pypi_alternative_url
|
||||
fi
|
||||
|
||||
pip_install -U setuptools
|
||||
|
||||
get_versions
|
||||
|
||||
Executable
+87
@@ -0,0 +1,87 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Copyright 2014 Hewlett-Packard Development Company, L.P.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
# This is an output filter to filter and timestamp the logs from grenade and
|
||||
# devstack. Largely our awk filters got beyond the complexity level which were
|
||||
# sustainable, so this provides us much more control in a single place.
|
||||
#
|
||||
# The overhead of running python should be less than execing `date` a million
|
||||
# times during a run.
|
||||
|
||||
import argparse
|
||||
import datetime
|
||||
import re
|
||||
import sys
|
||||
|
||||
IGNORE_LINES = re.compile('(set \+o|xtrace)')
|
||||
HAS_DATE = re.compile('^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3} \|')
|
||||
|
||||
|
||||
def get_options():
|
||||
parser = argparse.ArgumentParser(
|
||||
description='Filter output by devstack and friends')
|
||||
parser.add_argument('-o', '--outfile',
|
||||
help='Output file for content',
|
||||
default=None)
|
||||
parser.add_argument('-v', '--verbose', action='store_true',
|
||||
default=False)
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def skip_line(line):
|
||||
"""Should we skip this line."""
|
||||
return IGNORE_LINES.search(line) is not None
|
||||
|
||||
|
||||
def main():
|
||||
opts = get_options()
|
||||
outfile = None
|
||||
if opts.outfile:
|
||||
outfile = open(opts.outfile, 'a', 0)
|
||||
|
||||
# otherwise fileinput reprocess args as files
|
||||
sys.argv = []
|
||||
while True:
|
||||
line = sys.stdin.readline()
|
||||
if not line:
|
||||
return 0
|
||||
|
||||
# put skip lines here
|
||||
if skip_line(line):
|
||||
continue
|
||||
|
||||
# this prevents us from nesting date lines, because
|
||||
# we'd like to pull this in directly in grenade and not double
|
||||
# up on devstack lines
|
||||
if HAS_DATE.search(line) is None:
|
||||
now = datetime.datetime.utcnow()
|
||||
line = ("%s | %s" % (
|
||||
now.strftime("%Y-%m-%d %H:%M:%S.%f")[:-3],
|
||||
line))
|
||||
|
||||
if opts.verbose:
|
||||
sys.stdout.write(line)
|
||||
sys.stdout.flush()
|
||||
if outfile:
|
||||
outfile.write(line)
|
||||
outfile.flush()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
sys.exit(main())
|
||||
except KeyboardInterrupt:
|
||||
sys.exit(1)
|
||||
@@ -21,19 +21,12 @@ set -o xtrace
|
||||
# This directory
|
||||
TOP_DIR=$(cd $(dirname "$0") && pwd)
|
||||
|
||||
# Source lower level functions
|
||||
. $TOP_DIR/../../functions
|
||||
|
||||
# Include onexit commands
|
||||
. $TOP_DIR/scripts/on_exit.sh
|
||||
|
||||
# xapi functions
|
||||
. $TOP_DIR/functions
|
||||
|
||||
# Determine what system we are running on.
|
||||
# Might not be XenServer if we're using xenserver-core
|
||||
GetDistro
|
||||
|
||||
# Source params - override xenrc params in your localrc to suite your taste
|
||||
source xenrc
|
||||
|
||||
|
||||
+20
-22
@@ -93,7 +93,7 @@ function get_local_sr_path {
|
||||
echo $pbd_path
|
||||
}
|
||||
|
||||
function find_ip_by_name() {
|
||||
function find_ip_by_name {
|
||||
local guest_name="$1"
|
||||
local interface="$2"
|
||||
|
||||
@@ -121,7 +121,7 @@ function find_ip_by_name() {
|
||||
done
|
||||
}
|
||||
|
||||
function _vm_uuid() {
|
||||
function _vm_uuid {
|
||||
local vm_name_label
|
||||
|
||||
vm_name_label="$1"
|
||||
@@ -129,14 +129,14 @@ function _vm_uuid() {
|
||||
xe vm-list name-label="$vm_name_label" --minimal
|
||||
}
|
||||
|
||||
function _create_new_network() {
|
||||
function _create_new_network {
|
||||
local name_label
|
||||
name_label=$1
|
||||
|
||||
xe network-create name-label="$name_label"
|
||||
}
|
||||
|
||||
function _multiple_networks_with_name() {
|
||||
function _multiple_networks_with_name {
|
||||
local name_label
|
||||
name_label=$1
|
||||
|
||||
@@ -144,21 +144,21 @@ function _multiple_networks_with_name() {
|
||||
xe network-list name-label="$name_label" --minimal | grep -q ","
|
||||
}
|
||||
|
||||
function _network_exists() {
|
||||
function _network_exists {
|
||||
local name_label
|
||||
name_label=$1
|
||||
|
||||
! [ -z "$(xe network-list name-label="$name_label" --minimal)" ]
|
||||
}
|
||||
|
||||
function _bridge_exists() {
|
||||
function _bridge_exists {
|
||||
local bridge
|
||||
bridge=$1
|
||||
|
||||
! [ -z "$(xe network-list bridge="$bridge" --minimal)" ]
|
||||
}
|
||||
|
||||
function _network_uuid() {
|
||||
function _network_uuid {
|
||||
local bridge_or_net_name
|
||||
bridge_or_net_name=$1
|
||||
|
||||
@@ -169,7 +169,7 @@ function _network_uuid() {
|
||||
fi
|
||||
}
|
||||
|
||||
function add_interface() {
|
||||
function add_interface {
|
||||
local vm_name_label
|
||||
local bridge_or_network_name
|
||||
|
||||
@@ -185,7 +185,7 @@ function add_interface() {
|
||||
xe vif-create network-uuid=$net vm-uuid=$vm device=$device_number
|
||||
}
|
||||
|
||||
function setup_network() {
|
||||
function setup_network {
|
||||
local bridge_or_net_name
|
||||
bridge_or_net_name=$1
|
||||
|
||||
@@ -204,7 +204,7 @@ EOF
|
||||
fi
|
||||
}
|
||||
|
||||
function bridge_for() {
|
||||
function bridge_for {
|
||||
local bridge_or_net_name
|
||||
bridge_or_net_name=$1
|
||||
|
||||
@@ -215,29 +215,28 @@ function bridge_for() {
|
||||
fi
|
||||
}
|
||||
|
||||
function xenapi_ip_on() {
|
||||
function xenapi_ip_on {
|
||||
local bridge_or_net_name
|
||||
bridge_or_net_name=$1
|
||||
|
||||
ifconfig $(bridge_for "$bridge_or_net_name") | grep "inet addr" | cut -d ":" -f2 | sed "s/ .*//"
|
||||
}
|
||||
|
||||
function xenapi_is_listening_on() {
|
||||
function xenapi_is_listening_on {
|
||||
local bridge_or_net_name
|
||||
bridge_or_net_name=$1
|
||||
|
||||
! [ -z $(xenapi_ip_on "$bridge_or_net_name") ]
|
||||
}
|
||||
|
||||
function parameter_is_specified() {
|
||||
function parameter_is_specified {
|
||||
local parameter_name
|
||||
parameter_name=$1
|
||||
|
||||
compgen -v | grep "$parameter_name"
|
||||
}
|
||||
|
||||
function append_kernel_cmdline()
|
||||
{
|
||||
function append_kernel_cmdline {
|
||||
local vm_name_label
|
||||
local kernel_args
|
||||
|
||||
@@ -252,8 +251,7 @@ function append_kernel_cmdline()
|
||||
xe vm-param-set PV-args="$pv_args $kernel_args" uuid=$vm
|
||||
}
|
||||
|
||||
function destroy_all_vifs_of()
|
||||
{
|
||||
function destroy_all_vifs_of {
|
||||
local vm_name_label
|
||||
|
||||
vm_name_label="$1"
|
||||
@@ -268,11 +266,11 @@ function destroy_all_vifs_of()
|
||||
unset IFS
|
||||
}
|
||||
|
||||
function have_multiple_hosts() {
|
||||
function have_multiple_hosts {
|
||||
xe host-list --minimal | grep -q ","
|
||||
}
|
||||
|
||||
function attach_network() {
|
||||
function attach_network {
|
||||
local bridge_or_net_name
|
||||
|
||||
bridge_or_net_name="$1"
|
||||
@@ -286,7 +284,7 @@ function attach_network() {
|
||||
xe network-attach uuid=$net host-uuid=$host
|
||||
}
|
||||
|
||||
function set_vm_memory() {
|
||||
function set_vm_memory {
|
||||
local vm_name_label
|
||||
local memory
|
||||
|
||||
@@ -305,7 +303,7 @@ function set_vm_memory() {
|
||||
uuid=$vm
|
||||
}
|
||||
|
||||
function max_vcpus() {
|
||||
function max_vcpus {
|
||||
local vm_name_label
|
||||
|
||||
vm_name_label="$1"
|
||||
@@ -337,7 +335,7 @@ function max_vcpus() {
|
||||
xe vm-param-set uuid=$vm VCPUs-at-startup=$cpu_count
|
||||
}
|
||||
|
||||
function get_domid() {
|
||||
function get_domid {
|
||||
local vm_name_label
|
||||
|
||||
vm_name_label="$1"
|
||||
|
||||
@@ -22,19 +22,12 @@ fi
|
||||
# This directory
|
||||
THIS_DIR=$(cd $(dirname "$0") && pwd)
|
||||
|
||||
# Source lower level functions
|
||||
. $THIS_DIR/../../functions
|
||||
|
||||
# Include onexit commands
|
||||
. $THIS_DIR/scripts/on_exit.sh
|
||||
|
||||
# xapi functions
|
||||
. $THIS_DIR/functions
|
||||
|
||||
# Determine what system we are running on.
|
||||
# Might not be XenServer if we're using xenserver-core
|
||||
GetDistro
|
||||
|
||||
#
|
||||
# Get Settings
|
||||
#
|
||||
|
||||
@@ -22,19 +22,12 @@ set -o xtrace
|
||||
# This directory
|
||||
TOP_DIR=$(cd $(dirname "$0") && pwd)
|
||||
|
||||
# Source lower level functions
|
||||
. $TOP_DIR/../../functions
|
||||
|
||||
# Include onexit commands
|
||||
. $TOP_DIR/scripts/on_exit.sh
|
||||
|
||||
# xapi functions
|
||||
. $TOP_DIR/functions
|
||||
|
||||
# Determine what system we are running on.
|
||||
# Might not be XenServer if we're using xenserver-core
|
||||
GetDistro
|
||||
|
||||
# Source params - override xenrc params in your localrc to suite your taste
|
||||
source xenrc
|
||||
|
||||
|
||||
+19
-2
@@ -91,7 +91,24 @@ UBUNTU_INST_GATEWAY=""
|
||||
# Set the size to 0 to avoid creation of additional disk.
|
||||
XEN_XVDB_SIZE_GB=0
|
||||
|
||||
restore_nounset=`set +o | grep nounset`
|
||||
STACK_USER=stack
|
||||
DOMZERO_USER=domzero
|
||||
|
||||
RC_DIR="../.."
|
||||
|
||||
restore_nounset=$(set +o | grep nounset)
|
||||
set +u
|
||||
source ../../stackrc
|
||||
|
||||
## Note that the lines below are coming from stackrc to support
|
||||
## new-style config files
|
||||
|
||||
# allow local overrides of env variables, including repo config
|
||||
if [[ -f $RC_DIR/localrc ]]; then
|
||||
# Old-style user-supplied config
|
||||
source $RC_DIR/localrc
|
||||
elif [[ -f $RC_DIR/.localrc.auto ]]; then
|
||||
# New-style user-supplied config extracted from local.conf
|
||||
source $RC_DIR/.localrc.auto
|
||||
fi
|
||||
|
||||
$restore_nounset
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
[tox]
|
||||
minversion = 1.6
|
||||
skipsdist = True
|
||||
envlist = bashate
|
||||
|
||||
[testenv]
|
||||
usedevelop = False
|
||||
install_command = pip install {opts} {packages}
|
||||
|
||||
[testenv:bashate]
|
||||
deps = bashate
|
||||
whitelist_externals = bash
|
||||
commands = bash -c "find {toxinidir} -not -wholename \*.tox/\* -and \( -name \*.sh -or -name \*rc -or -name functions\* -or \( -wholename lib/\* -and -not -name \*.md \) \) -print0 | xargs -0 bashate -v"
|
||||
|
||||
[testenv:docs]
|
||||
commands = python setup.py build_sphinx
|
||||
Reference in New Issue
Block a user