Compare commits
89 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bcc7e1a4f4 | |||
| dcffea9184 | |||
| 71afb5674d | |||
| 3deab5cd91 | |||
| 5cdb66d752 | |||
| 984f6bb676 | |||
| 9edb50760a | |||
| 7c4d678b3b | |||
| e8aa5d57d3 | |||
| 0591b1a6a3 | |||
| d870047bb9 | |||
| b4233fbc4e | |||
| 4c15ae7bd2 | |||
| 39385cf471 | |||
| bbeae070ef | |||
| e4e088e566 | |||
| 2a866dd2bd | |||
| f8119e5813 | |||
| a943831c8d | |||
| d5cb356d13 | |||
| fee3d18f1a | |||
| d5b4ac741c | |||
| 38c31ca025 | |||
| e8928e93bd | |||
| 3a64be8d76 | |||
| 73e16ae464 | |||
| 8c432d935c | |||
| 525bc5cfe4 | |||
| 71af1ee707 | |||
| 86b0f80488 | |||
| 2af47f99fd | |||
| a83b5385e8 | |||
| ec39f18e39 | |||
| e776ec5b02 | |||
| ebb848a108 | |||
| bf7eb80b64 | |||
| 4d39e07119 | |||
| 40024ea262 | |||
| 49b97f733d | |||
| 501bb07462 | |||
| b9ee0e8b42 | |||
| 4b80bc25e8 | |||
| 019bd53f08 | |||
| bcc239f30f | |||
| 380c6a4573 | |||
| ab6da55578 | |||
| 704d547242 | |||
| 48c8a41dd0 | |||
| 526f8f6542 | |||
| bf8735ced4 | |||
| 5762816346 | |||
| bbcc74abcc | |||
| 9a4130bae1 | |||
| 58bcbce0e4 | |||
| bf3c7e5442 | |||
| 640bf5d2ec | |||
| 5bd1fb6fcd | |||
| ac9f5d9ab1 | |||
| c21d6ae145 | |||
| 5acb98ae49 | |||
| 3bf121591a | |||
| 385508edfd | |||
| c3faf14326 | |||
| 6b757821fb | |||
| 539d1898eb | |||
| 91eba8eb20 | |||
| 042e687b64 | |||
| 0387d1f951 | |||
| 46a272b31a | |||
| d9422b838a | |||
| e401ae4b9c | |||
| e0c8d4835c | |||
| 00f43e5b26 | |||
| 6313bf8452 | |||
| cad121ea62 | |||
| d3a9cab22d | |||
| 0355ecc4d3 | |||
| aca08dedc7 | |||
| 6ff54a3936 | |||
| 65f4f129cb | |||
| 1816012e83 | |||
| e19494f81e | |||
| b30dca9a30 | |||
| d095b3287a | |||
| cbcce857c8 | |||
| 06796ede82 | |||
| d680e9b140 | |||
| 92005efdfc | |||
| 8dac66f087 |
@@ -2,3 +2,4 @@
|
||||
host=review.openstack.org
|
||||
port=29418
|
||||
project=openstack-dev/devstack.git
|
||||
defaultbranch=stable/liberty
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
# Duplicated from stackrc for now
|
||||
DEST=/opt/stack
|
||||
WHEELHOUSE=$(DEST)/.wheelhouse
|
||||
|
||||
all:
|
||||
echo "This just saved you from a terrible mistake!"
|
||||
@@ -25,9 +24,6 @@ stack:
|
||||
unstack:
|
||||
./unstack.sh
|
||||
|
||||
wheels:
|
||||
WHEELHOUSE=$(WHEELHOUSE) tools/build-wheels.sh
|
||||
|
||||
docs:
|
||||
tox -edocs
|
||||
|
||||
@@ -57,7 +53,7 @@ clean:
|
||||
|
||||
# Clean out the cache too
|
||||
realclean: clean
|
||||
rm -rf files/cirros*.tar.gz files/Fedora*.qcow2 $(WHEELHOUSE)
|
||||
rm -rf files/cirros*.tar.gz files/Fedora*.qcow2
|
||||
|
||||
# Repo stuffs
|
||||
|
||||
|
||||
@@ -588,13 +588,6 @@ with ``VOLUME_BACKING_FILE_SIZE``.
|
||||
VOLUME_BACKING_FILE_SIZE=10250M
|
||||
|
||||
|
||||
Cinder v1 API is depricated and disabled by default. You can enable v1 API by
|
||||
setting ``CINDER_ENABLE_V1_API`` to ``True``.
|
||||
|
||||
::
|
||||
CINDER_ENABLE_V1_API=True
|
||||
|
||||
|
||||
Keystone
|
||||
~~~~~~~~
|
||||
|
||||
|
||||
@@ -206,7 +206,6 @@ Tools
|
||||
|
||||
* `tools/build\_docs.sh <tools/build_docs.sh.html>`__
|
||||
* `tools/build\_venv.sh <tools/build_venv.sh.html>`__
|
||||
* `tools/build\_wheels.sh <tools/build_wheels.sh.html>`__
|
||||
* `tools/create-stack-user.sh <tools/create-stack-user.sh.html>`__
|
||||
* `tools/create\_userrc.sh <tools/create_userrc.sh.html>`__
|
||||
* `tools/fixup\_stuff.sh <tools/fixup_stuff.sh.html>`__
|
||||
|
||||
@@ -14,6 +14,8 @@ if is_service_enabled tempest; then
|
||||
echo_summary "Initializing Tempest"
|
||||
configure_tempest
|
||||
init_tempest
|
||||
echo_summary "Installing Tempest Plugins"
|
||||
install_tempest_plugins
|
||||
elif [[ "$1" == "stack" && "$2" == "post-extra" ]]; then
|
||||
# local.conf Tempest option overrides
|
||||
:
|
||||
|
||||
+5
-1
@@ -3,6 +3,7 @@ screen
|
||||
unzip
|
||||
wget
|
||||
psmisc
|
||||
bsdmainutils
|
||||
gcc
|
||||
g++
|
||||
git
|
||||
@@ -20,8 +21,11 @@ python2.7
|
||||
python-gdbm # needed for testr
|
||||
bc
|
||||
libyaml-dev
|
||||
libffi-dev
|
||||
libffi-dev # for pyOpenSSL
|
||||
libssl-dev # for pyOpenSSL
|
||||
libxml2-dev # lxml
|
||||
libxslt1-dev # lxml
|
||||
gettext # used for compiling message catalogs
|
||||
openjdk-7-jre-headless # NOPRIME
|
||||
pkg-config
|
||||
uuid-runtime
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# apparmor is an undeclared dependency for docker on ubuntu: https://github.com/docker/docker/issues/9745
|
||||
apparmor
|
||||
docker.io
|
||||
ipmitool
|
||||
iptables
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
python-lxml
|
||||
sqlite3
|
||||
python-mysqldb
|
||||
python-mysql.connector
|
||||
libldap2-dev
|
||||
libsasl2-dev
|
||||
libkrb5-dev
|
||||
memcached
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
python-numpy
|
||||
@@ -15,4 +15,3 @@ rabbitmq-server # NOPRIME
|
||||
sqlite3
|
||||
vlan
|
||||
radvd # NOPRIME
|
||||
uuid-runtime
|
||||
|
||||
+2
-5
@@ -8,7 +8,8 @@ libmysqlclient-dev
|
||||
mysql-server # NOPRIME
|
||||
python-mysqldb
|
||||
python-mysql.connector
|
||||
python-lxml # needed for glance which is needed for nova --- this shouldn't be here
|
||||
libxml2-dev # needed for building lxml
|
||||
libxslt1-dev
|
||||
gawk
|
||||
iptables
|
||||
ebtables
|
||||
@@ -25,7 +26,3 @@ curl
|
||||
genisoimage # required for config_drive
|
||||
rabbitmq-server # NOPRIME
|
||||
socat # used by ajaxterm
|
||||
python-libvirt # NOPRIME
|
||||
python-libxml2
|
||||
python-numpy # used by websockify for spice console
|
||||
python-m2crypto
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2015 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 a terrible, terrible, truly terrible work around for
|
||||
# environments that have libvirt < 1.2.11. ebtables requires that you
|
||||
# specifically tell it you would like to not race and get punched in
|
||||
# the face when 2 run at the same time with a --concurrent flag.
|
||||
|
||||
flock -w 300 /var/lock/ebtables.nova /sbin/ebtables.real $@
|
||||
@@ -19,5 +19,6 @@ screen
|
||||
tar
|
||||
tcpdump
|
||||
unzip
|
||||
util-linux
|
||||
wget
|
||||
net-tools
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
cyrus-sasl-devel
|
||||
memcached
|
||||
openldap2-devel
|
||||
python-devel
|
||||
sqlite3
|
||||
|
||||
@@ -19,6 +19,7 @@ screen
|
||||
tar
|
||||
tcpdump
|
||||
unzip
|
||||
util-linux
|
||||
wget
|
||||
which
|
||||
bc
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
MySQL-python
|
||||
libxslt-devel
|
||||
sqlite
|
||||
memcached
|
||||
mod_ssl
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
# Once we can prebuild wheels before a devstack run, uncomment the skipped libraries
|
||||
cryptography
|
||||
# lxml # still install from from packages
|
||||
# netifaces # still install from packages
|
||||
#numpy # slowest wheel by far, stop building until we are actually using the output
|
||||
posix-ipc
|
||||
# psycopg # still install from packages
|
||||
pycrypto
|
||||
pyOpenSSL
|
||||
PyYAML
|
||||
xattr
|
||||
@@ -300,8 +300,8 @@ function upload_image {
|
||||
*) echo "Do not know what to do with $image_fname"; false;;
|
||||
esac
|
||||
|
||||
if is_arch "ppc64"; then
|
||||
img_property="--property hw_cdrom_bus=scsi"
|
||||
if is_arch "ppc64le" || is_arch "ppc64" || is_arch "ppc"; then
|
||||
img_property="--property hw_disk_bus=scsi --property hw_scsi_model=virtio-scsi --property hw_cdrom_bus=scsi --property os_command_line=console=hvc0"
|
||||
fi
|
||||
|
||||
if is_arch "aarch64"; then
|
||||
@@ -524,12 +524,58 @@ function vercmp_numbers {
|
||||
typeset v1=$1 v2=$2 sep
|
||||
typeset -a ver1 ver2
|
||||
|
||||
deprecated "vercmp_numbers is deprecated for more generic vercmp"
|
||||
|
||||
IFS=. read -ra ver1 <<< "$v1"
|
||||
IFS=. read -ra ver2 <<< "$v2"
|
||||
|
||||
_vercmp_r "${#ver1[@]}" "${ver1[@]}" "${ver2[@]}"
|
||||
}
|
||||
|
||||
# vercmp ver1 op ver2
|
||||
# Compare VER1 to VER2
|
||||
# - op is one of < <= == >= >
|
||||
# - returns true if satisified
|
||||
# e.g.
|
||||
# if vercmp 1.0 "<" 2.0; then
|
||||
# ...
|
||||
# fi
|
||||
function vercmp {
|
||||
local v1=$1
|
||||
local op=$2
|
||||
local v2=$3
|
||||
local result
|
||||
|
||||
# sort the two numbers with sort's "-V" argument. Based on if v2
|
||||
# swapped places with v1, we can determine ordering.
|
||||
result=$(echo -e "$v1\n$v2" | sort -V | head -1)
|
||||
|
||||
case $op in
|
||||
"==")
|
||||
[ "$v1" = "$v2" ]
|
||||
return
|
||||
;;
|
||||
">")
|
||||
[ "$v1" != "$v2" ] && [ "$result" = "$v2" ]
|
||||
return
|
||||
;;
|
||||
"<")
|
||||
[ "$v1" != "$v2" ] && [ "$result" = "$v1" ]
|
||||
return
|
||||
;;
|
||||
">=")
|
||||
[ "$result" = "$v2" ]
|
||||
return
|
||||
;;
|
||||
"<=")
|
||||
[ "$result" = "$v1" ]
|
||||
return
|
||||
;;
|
||||
*)
|
||||
die $LINENO "unrecognised op: $op"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# This function sets log formatting options for colorizing log
|
||||
# output to stdout. It is meant to be called by lib modules.
|
||||
@@ -599,6 +645,15 @@ function create_disk {
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# set_mtu - Set MTU on a device
|
||||
function set_mtu {
|
||||
local dev=$1
|
||||
local mtu=$2
|
||||
sudo ip link set mtu $mtu dev $dev
|
||||
}
|
||||
|
||||
|
||||
# Restore xtrace
|
||||
$XTRACE
|
||||
|
||||
|
||||
+95
-20
@@ -76,9 +76,11 @@ function write_clouds_yaml {
|
||||
# The location is a variable to allow for easier refactoring later to make it
|
||||
# overridable. There is currently no usecase where doing so makes sense, so
|
||||
# it's not currently configurable.
|
||||
CLOUDS_YAML=~/.config/openstack/clouds.yaml
|
||||
|
||||
mkdir -p $(dirname $CLOUDS_YAML)
|
||||
CLOUDS_YAML=/etc/openstack/clouds.yaml
|
||||
|
||||
sudo mkdir -p $(dirname $CLOUDS_YAML)
|
||||
sudo chown -R $STACK_USER /etc/openstack
|
||||
|
||||
CA_CERT_ARG=''
|
||||
if [ -f "$SSL_BUNDLE_FILE" ]; then
|
||||
@@ -385,6 +387,8 @@ function GetDistro {
|
||||
DISTRO="rhel${os_RELEASE::1}"
|
||||
elif [[ "$os_VENDOR" =~ (XenServer) ]]; then
|
||||
DISTRO="xs$os_RELEASE"
|
||||
elif [[ "$os_VENDOR" =~ (kvmibm) ]]; then
|
||||
DISTRO="${os_VENDOR}${os_RELEASE::1}"
|
||||
else
|
||||
# Catch-all for now is Vendor + Release + Update
|
||||
DISTRO="$os_VENDOR-$os_RELEASE.$os_UPDATE"
|
||||
@@ -419,7 +423,7 @@ function is_fedora {
|
||||
|
||||
[ "$os_VENDOR" = "Fedora" ] || [ "$os_VENDOR" = "Red Hat" ] || \
|
||||
[ "$os_VENDOR" = "CentOS" ] || [ "$os_VENDOR" = "OracleLinux" ] || \
|
||||
[ "$os_VENDOR" = "CloudLinux" ]
|
||||
[ "$os_VENDOR" = "CloudLinux" ] || [ "$os_VENDOR" = "kvmibm" ]
|
||||
}
|
||||
|
||||
|
||||
@@ -854,6 +858,38 @@ function get_or_add_user_project_role {
|
||||
echo $user_role_id
|
||||
}
|
||||
|
||||
# Gets or adds user role to domain
|
||||
# Usage: get_or_add_user_domain_role <role> <user> <domain>
|
||||
function get_or_add_user_domain_role {
|
||||
local user_role_id
|
||||
# Gets user role id
|
||||
user_role_id=$(openstack role list \
|
||||
--user $2 \
|
||||
--os-url=$KEYSTONE_SERVICE_URI_V3 \
|
||||
--os-identity-api-version=3 \
|
||||
--column "ID" \
|
||||
--domain $3 \
|
||||
--column "Name" \
|
||||
| grep " $1 " | get_field 1)
|
||||
if [[ -z "$user_role_id" ]]; then
|
||||
# Adds role to user and get it
|
||||
openstack role add $1 \
|
||||
--user $2 \
|
||||
--domain $3 \
|
||||
--os-url=$KEYSTONE_SERVICE_URI_V3 \
|
||||
--os-identity-api-version=3
|
||||
user_role_id=$(openstack role list \
|
||||
--user $2 \
|
||||
--os-url=$KEYSTONE_SERVICE_URI_V3 \
|
||||
--os-identity-api-version=3 \
|
||||
--column "ID" \
|
||||
--domain $3 \
|
||||
--column "Name" \
|
||||
| grep " $1 " | get_field 1)
|
||||
fi
|
||||
echo $user_role_id
|
||||
}
|
||||
|
||||
# Gets or adds group role to project
|
||||
# Usage: get_or_add_group_project_role <role> <group> <project>
|
||||
function get_or_add_group_project_role {
|
||||
@@ -982,6 +1018,29 @@ function _get_package_dir {
|
||||
echo "$pkg_dir"
|
||||
}
|
||||
|
||||
# Wrapper for ``apt-get update`` to try multiple times on the update
|
||||
# to address bad package mirrors (which happen all the time).
|
||||
function apt_get_update {
|
||||
# only do this once per run
|
||||
if [[ "$REPOS_UPDATED" == "True" && "$RETRY_UPDATE" != "True" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
# bail if we are offline
|
||||
[[ "$OFFLINE" = "True" ]] && return
|
||||
|
||||
local sudo="sudo"
|
||||
[[ "$(id -u)" = "0" ]] && sudo="env"
|
||||
|
||||
local proxies="http_proxy=${http_proxy:-} https_proxy=${https_proxy:-} no_proxy=${no_proxy:-} "
|
||||
local update_cmd="$sudo $proxies apt-get update"
|
||||
if ! timeout 300 sh -c "while ! $update_cmd; do sleep 30; done"; then
|
||||
die $LINENO "Failed to update apt repos, we're dead now"
|
||||
fi
|
||||
|
||||
REPOS_UPDATED=True
|
||||
}
|
||||
|
||||
# Wrapper for ``apt-get`` to set cache and proxy environment variables
|
||||
# Uses globals ``OFFLINE``, ``*_proxy``
|
||||
# apt_get operation package [package ...]
|
||||
@@ -1148,15 +1207,7 @@ function update_package_repo {
|
||||
fi
|
||||
|
||||
if is_ubuntu; then
|
||||
local xtrace=$(set +o | grep xtrace)
|
||||
set +o xtrace
|
||||
if [[ "$REPOS_UPDATED" != "True" || "$RETRY_UPDATE" = "True" ]]; then
|
||||
# if there are transient errors pulling the updates, that's fine.
|
||||
# It may be secondary repositories that we don't really care about.
|
||||
apt_get update || /bin/true
|
||||
REPOS_UPDATED=True
|
||||
fi
|
||||
$xtrace
|
||||
apt_get_update
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -1476,6 +1527,12 @@ function stop_process {
|
||||
# Kill via pid if we have one available
|
||||
if [[ -r $SERVICE_DIR/$SCREEN_NAME/$service.pid ]]; then
|
||||
pkill -g $(cat $SERVICE_DIR/$SCREEN_NAME/$service.pid)
|
||||
# TODO(danms): Remove this double-kill when we have
|
||||
# this fixed in all services:
|
||||
# https://bugs.launchpad.net/oslo-incubator/+bug/1446583
|
||||
sleep 1
|
||||
# /bin/true becakse pkill on a non existant process returns an error
|
||||
pkill -g $(cat $SERVICE_DIR/$SCREEN_NAME/$service.pid) || /bin/true
|
||||
rm $SERVICE_DIR/$SCREEN_NAME/$service.pid
|
||||
fi
|
||||
if [[ "$USE_SCREEN" = "True" ]]; then
|
||||
@@ -1717,6 +1774,7 @@ function run_phase {
|
||||
# the source phase corresponds to settings loading in plugins
|
||||
if [[ "$mode" == "source" ]]; then
|
||||
load_plugin_settings
|
||||
verify_disabled_services
|
||||
elif [[ "$mode" == "override_defaults" ]]; then
|
||||
plugin_override_defaults
|
||||
else
|
||||
@@ -1772,25 +1830,26 @@ function disable_negated_services {
|
||||
ENABLED_SERVICES=$(remove_disabled_services "$remaining" "$to_remove")
|
||||
}
|
||||
|
||||
# disable_service() removes the services passed as argument to the
|
||||
# ``ENABLED_SERVICES`` list, if they are present.
|
||||
# disable_service() prepares the services passed as argument to be
|
||||
# removed from the ``ENABLED_SERVICES`` list, if they are present.
|
||||
#
|
||||
# For example:
|
||||
# disable_service rabbit
|
||||
#
|
||||
# This function does not know about the special cases
|
||||
# for nova, glance, and neutron built into is_service_enabled().
|
||||
# Uses global ``ENABLED_SERVICES``
|
||||
# Uses global ``DISABLED_SERVICES``
|
||||
# disable_service service [service ...]
|
||||
function disable_service {
|
||||
local tmpsvcs=",${ENABLED_SERVICES},"
|
||||
local disabled_svcs="${DISABLED_SERVICES}"
|
||||
local enabled_svcs=",${ENABLED_SERVICES},"
|
||||
local service
|
||||
for service in $@; do
|
||||
disabled_svcs+=",$service"
|
||||
if is_service_enabled $service; then
|
||||
tmpsvcs=${tmpsvcs//,$service,/,}
|
||||
enabled_svcs=${enabled_svcs//,$service,/,}
|
||||
fi
|
||||
done
|
||||
ENABLED_SERVICES=$(_cleanup_service_list "$tmpsvcs")
|
||||
DISABLED_SERVICES=$(_cleanup_service_list "$disabled_svcs")
|
||||
ENABLED_SERVICES=$(_cleanup_service_list "$enabled_svcs")
|
||||
}
|
||||
|
||||
# enable_service() adds the services passed as argument to the
|
||||
@@ -1807,6 +1866,10 @@ function enable_service {
|
||||
local tmpsvcs="${ENABLED_SERVICES}"
|
||||
local service
|
||||
for service in $@; do
|
||||
if [[ ,${DISABLED_SERVICES}, =~ ,${service}, ]]; then
|
||||
warn $LINENO "Attempt to enable_service ${service} when it has been disabled"
|
||||
continue
|
||||
fi
|
||||
if ! is_service_enabled $service; then
|
||||
tmpsvcs+=",$service"
|
||||
fi
|
||||
@@ -1910,6 +1973,18 @@ function use_exclusive_service {
|
||||
return 0
|
||||
}
|
||||
|
||||
# Make sure that nothing has manipulated ENABLED_SERVICES in a way
|
||||
# that conflicts with prior calls to disable_service.
|
||||
# Uses global ``ENABLED_SERVICES``
|
||||
function verify_disabled_services {
|
||||
local service
|
||||
for service in ${ENABLED_SERVICES//,/ }; do
|
||||
if [[ ,${DISABLED_SERVICES}, =~ ,${service}, ]]; then
|
||||
die $LINENO "ENABLED_SERVICES directly modified to overcome 'disable_service ${service}'"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
# System Functions
|
||||
# ================
|
||||
|
||||
+164
@@ -250,6 +250,170 @@ function iniuncomment {
|
||||
$xtrace
|
||||
}
|
||||
|
||||
# Set a localrc var
|
||||
function localrc_set {
|
||||
local file=$1
|
||||
local group="local"
|
||||
local conf="localrc"
|
||||
local section=""
|
||||
local option=$2
|
||||
local value=$3
|
||||
localconf_set "$file" "$group" "$conf" "$section" "$option" "$value"
|
||||
}
|
||||
|
||||
# Check if local.conf has section.
|
||||
function localconf_has_section {
|
||||
local file=$1
|
||||
local group=$2
|
||||
local conf=$3
|
||||
local section=$4
|
||||
local sep
|
||||
sep=$(echo -ne "\x01")
|
||||
local line
|
||||
line=$(sed -ne "\\${sep}^\[\[${group}|${conf}\]\]${sep},\\${sep}\[\[.*\]\]${sep}{
|
||||
/\[${section}\]/p
|
||||
}" "$file")
|
||||
[ -n "$line" ]
|
||||
}
|
||||
|
||||
# Check if local.conf has option.
|
||||
function localconf_has_option {
|
||||
local file=$1
|
||||
local group=$2
|
||||
local conf=$3
|
||||
local section=$4
|
||||
local option=$5
|
||||
local sep
|
||||
sep=$(echo -ne "\x01")
|
||||
local line
|
||||
if [[ -z "$section" ]]; then
|
||||
line=$(sed -ne "\\${sep}^\[\[${group}|${conf}\]\]${sep},\\${sep}\[\[.*\]\]${sep}{
|
||||
/${option}[ \t]*=.*$/p
|
||||
}" "$file")
|
||||
else
|
||||
line=$(sed -ne "\\${sep}^\[\[${group}|${conf}\]\]${sep},\\${sep}\[\[.*\]\]${sep}{
|
||||
/\[${section}\]/,/\[\[.*\]\]\|\[.*\]/{
|
||||
/${option}[ \t]*=.*$/p}
|
||||
}" "$file")
|
||||
fi
|
||||
[ -n "$line" ]
|
||||
}
|
||||
|
||||
# Update option in local.conf.
|
||||
function localconf_update_option {
|
||||
local sudo=$1
|
||||
local file=$2
|
||||
local group=$3
|
||||
local conf=$4
|
||||
local section=$5
|
||||
local option=$6
|
||||
local value=$7
|
||||
local sep
|
||||
sep=$(echo -ne "\x01")
|
||||
if [[ -z "$section" ]]; then
|
||||
$sudo sed -i -e "\\${sep}^\[\[${group}|${conf}\]\]${sep},\\${sep}\[\[.*\]\]${sep}{
|
||||
s${sep}^\(${option}[ \t]*=[ \t]*\).*\$${sep}\1${value}${sep}
|
||||
}" "$file"
|
||||
else
|
||||
$sudo sed -i -e "\\${sep}^\[\[${group}|${conf}\]\]${sep},\\${sep}\[\[.*\]\]${sep}{
|
||||
/\[${section}\]/,/\[\[.*\]\]\|\[.*\]/s${sep}^\(${option}[ \t]*=[ \t]*\).*\$${sep}\1${value}${sep}
|
||||
}" "$file"
|
||||
fi
|
||||
}
|
||||
|
||||
# Add option in local.conf.
|
||||
function localconf_add_option {
|
||||
local sudo=$1
|
||||
local file=$2
|
||||
local group=$3
|
||||
local conf=$4
|
||||
local section=$5
|
||||
local option=$6
|
||||
local value=$7
|
||||
local sep
|
||||
sep=$(echo -ne "\x01")
|
||||
if [[ -z "$section" ]]; then
|
||||
$sudo sed -i -e "\\${sep}^\[\[${group}|${conf}\]\]${sep} a $option=$value" "$file"
|
||||
else
|
||||
$sudo sed -i -e "\\${sep}^\[\[${group}|${conf}\]\]${sep},\\${sep}\[\[.*\]\]${sep}{
|
||||
/\[${section}\]/ a $option=$value
|
||||
}" "$file"
|
||||
fi
|
||||
}
|
||||
|
||||
# Add section and option in local.conf.
|
||||
function localconf_add_section_and_option {
|
||||
local sudo=$1
|
||||
local file=$2
|
||||
local group=$3
|
||||
local conf=$4
|
||||
local section=$5
|
||||
local option=$6
|
||||
local value=$7
|
||||
local sep
|
||||
sep=$(echo -ne "\x01")
|
||||
$sudo sed -i -e "\\${sep}^\[\[${group}|${conf}\]\]${sep} {
|
||||
a [$section]
|
||||
a $option=$value
|
||||
}" "$file"
|
||||
}
|
||||
|
||||
# Set an option in a local.conf file.
|
||||
# localconf_set [-sudo] config-file group conf-name section option value
|
||||
# - if the file does not exist, it is created
|
||||
function localconf_set {
|
||||
local xtrace
|
||||
xtrace=$(set +o | grep xtrace)
|
||||
set +o xtrace
|
||||
local sep
|
||||
sep=$(echo -ne "\x01")
|
||||
local sudo=""
|
||||
if [ $1 == "-sudo" ]; then
|
||||
sudo="sudo "
|
||||
shift
|
||||
fi
|
||||
local file=$1
|
||||
local group=$2
|
||||
local conf=$3
|
||||
local section=$4
|
||||
local option=$5
|
||||
local value=$6
|
||||
|
||||
if [[ -z $group || -z $conf || -z $option || -z $value ]]; then
|
||||
$xtrace
|
||||
return
|
||||
fi
|
||||
|
||||
if ! grep -q "^\[\[${group}|${conf}\]\]" "$file" 2>/dev/null; then
|
||||
# Add meta section at the end if it does not exist
|
||||
echo -e "\n[[${group}|${conf}]]" | $sudo tee --append "$file" > /dev/null
|
||||
# Add section at the end
|
||||
if [[ -n "$section" ]]; then
|
||||
echo -e "[$section]" | $sudo tee --append "$file" > /dev/null
|
||||
fi
|
||||
# Add option at the end
|
||||
echo -e "$option=$value" | $sudo tee --append "$file" > /dev/null
|
||||
elif [[ -z "$section" ]]; then
|
||||
if ! localconf_has_option "$file" "$group" "$conf" "$section" "$option"; then
|
||||
# Add option
|
||||
localconf_add_option "$sudo" "$file" "$group" "$conf" "$section" "$option" "$value"
|
||||
else
|
||||
# Replace it
|
||||
localconf_update_option "$sudo" "$file" "$group" "$conf" "$section" "$option" "$value"
|
||||
fi
|
||||
elif ! localconf_has_section "$file" "$group" "$conf" "$section"; then
|
||||
# Add section and option in specified meta section
|
||||
localconf_add_section_and_option "$sudo" "$file" "$group" "$conf" "$section" "$option" "$value"
|
||||
elif ! localconf_has_option "$file" "$group" "$conf" "$section" "$option"; then
|
||||
# Add option
|
||||
localconf_add_option "$sudo" "$file" "$group" "$conf" "$section" "$option" "$value"
|
||||
else
|
||||
# Replace it
|
||||
localconf_update_option "$sudo" "$file" "$group" "$conf" "$section" "$option" "$value"
|
||||
fi
|
||||
$xtrace
|
||||
}
|
||||
|
||||
# Restore xtrace
|
||||
$INC_CONF_TRACE
|
||||
|
||||
|
||||
@@ -115,11 +115,15 @@ function pip_install {
|
||||
fi
|
||||
|
||||
$xtrace
|
||||
# adding SETUPTOOLS_SYS_PATH_TECHNIQUE is a workaround to keep
|
||||
# the same behaviour of setuptools before version 25.0.0.
|
||||
# related issue: https://github.com/pypa/pip/issues/3874
|
||||
$sudo_pip \
|
||||
http_proxy="${http_proxy:-}" \
|
||||
https_proxy="${https_proxy:-}" \
|
||||
no_proxy="${no_proxy:-}" \
|
||||
PIP_FIND_LINKS=$PIP_FIND_LINKS \
|
||||
SETUPTOOLS_SYS_PATH_TECHNIQUE=rewrite \
|
||||
$cmd_pip $upgrade \
|
||||
$@
|
||||
|
||||
|
||||
+12
-17
@@ -27,9 +27,6 @@ set +o xtrace
|
||||
# Defaults
|
||||
# --------
|
||||
|
||||
# NOTE (e0ne): Cinder API v1 is deprecated and will be disabled by default.
|
||||
CINDER_ENABLE_V1_API=$(trueorfalse False CINDER_ENABLE_V1_API)
|
||||
|
||||
# set up default driver
|
||||
CINDER_DRIVER=${CINDER_DRIVER:-default}
|
||||
CINDER_PLUGINS=$TOP_DIR/lib/cinder_plugins
|
||||
@@ -228,12 +225,9 @@ function configure_cinder {
|
||||
iniset $CINDER_CONF oslo_concurrency lock_path $CINDER_STATE_PATH
|
||||
iniset $CINDER_CONF DEFAULT periodic_interval $CINDER_PERIODIC_INTERVAL
|
||||
# NOTE(thingee): Cinder V1 API is deprecated and defaults to off as of
|
||||
# Juno.
|
||||
if [[ ${CINDER_ENABLE_V1_API} = True ]]; then
|
||||
iniset $CINDER_CONF DEFAULT enable_v1_api true
|
||||
else
|
||||
iniset $CINDER_CONF DEFAULT enable_v1_api false
|
||||
fi
|
||||
# Juno. Keep it enabled so we can continue testing while it's still
|
||||
# supported.
|
||||
iniset $CINDER_CONF DEFAULT enable_v1_api true
|
||||
|
||||
iniset $CINDER_CONF DEFAULT os_region_name "$REGION_NAME"
|
||||
|
||||
@@ -332,13 +326,12 @@ function create_cinder_accounts {
|
||||
|
||||
if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
|
||||
|
||||
if [[ ${CINDER_ENABLE_V1_API} = True ]]; then
|
||||
get_or_create_service "cinder" "volume" "Cinder Volume Service"
|
||||
get_or_create_endpoint "volume" "$REGION_NAME" \
|
||||
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \
|
||||
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \
|
||||
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s"
|
||||
fi
|
||||
get_or_create_service "cinder" "volume" "Cinder Volume Service"
|
||||
get_or_create_endpoint "volume" "$REGION_NAME" \
|
||||
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \
|
||||
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s" \
|
||||
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v1/\$(tenant_id)s"
|
||||
|
||||
get_or_create_service "cinderv2" "volumev2" "Cinder Volume Service V2"
|
||||
get_or_create_endpoint "volumev2" "$REGION_NAME" \
|
||||
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v2/\$(tenant_id)s" \
|
||||
@@ -489,7 +482,9 @@ function create_volume_types {
|
||||
local be be_name
|
||||
for be in ${CINDER_ENABLED_BACKENDS//,/ }; do
|
||||
be_name=${be##*:}
|
||||
openstack volume type create --os-volume-api-version 2 --property volume_backend_name="${be_name}" ${be_name}
|
||||
# FIXME(jamielennox): Remove --os-volume-api-version pinning when
|
||||
# osc supports volume type create on v2 api. bug #1475060
|
||||
openstack volume type create --os-volume-api-version 1 --property volume_backend_name="${be_name}" ${be_name}
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ function recreate_database_postgresql {
|
||||
}
|
||||
|
||||
function configure_database_postgresql {
|
||||
local pg_conf pg_dir pg_hba root_roles
|
||||
local pg_conf pg_dir pg_hba root_roles version
|
||||
echo_summary "Configuring and starting PostgreSQL"
|
||||
if is_fedora; then
|
||||
pg_hba=/var/lib/pgsql/data/pg_hba.conf
|
||||
@@ -56,6 +56,13 @@ function configure_database_postgresql {
|
||||
sudo postgresql-setup initdb
|
||||
fi
|
||||
elif is_ubuntu; then
|
||||
version=`psql --version | cut -d ' ' -f3 | cut -d. -f1-2`
|
||||
if vercmp $version '>=' 9.3; then
|
||||
if [ -z "`pg_lsclusters -h`" ]; then
|
||||
echo 'No PostgreSQL clusters exist; will create one'
|
||||
sudo pg_createcluster $version main --start
|
||||
fi
|
||||
fi
|
||||
pg_dir=`find /etc/postgresql -name pg_hba.conf|xargs dirname`
|
||||
pg_hba=$pg_dir/pg_hba.conf
|
||||
pg_conf=$pg_dir/postgresql.conf
|
||||
|
||||
@@ -36,7 +36,6 @@ HEAT_DIR=$DEST/heat
|
||||
HEAT_CFNTOOLS_DIR=$DEST/heat-cfntools
|
||||
HEAT_TEMPLATES_REPO_DIR=$DEST/heat-templates
|
||||
OCC_DIR=$DEST/os-collect-config
|
||||
DIB_UTILS_DIR=$DEST/dib-utils
|
||||
ORC_DIR=$DEST/os-refresh-config
|
||||
OAC_DIR=$DEST/os-apply-config
|
||||
|
||||
@@ -220,7 +219,6 @@ function install_heat_other {
|
||||
git_clone $OAC_REPO $OAC_DIR $OAC_BRANCH
|
||||
git_clone $OCC_REPO $OCC_DIR $OCC_BRANCH
|
||||
git_clone $ORC_REPO $ORC_DIR $ORC_BRANCH
|
||||
git_clone $DIB_UTILS_REPO $DIB_UTILS_DIR $DIB_UTILS_BRANCH
|
||||
}
|
||||
|
||||
# start_heat() - Start running processes, including screen
|
||||
@@ -295,7 +293,7 @@ function create_heat_accounts {
|
||||
|
||||
# build_heat_pip_mirror() - Build a pip mirror containing heat agent projects
|
||||
function build_heat_pip_mirror {
|
||||
local project_dirs="$OCC_DIR $OAC_DIR $ORC_DIR $HEAT_CFNTOOLS_DIR $DIB_UTILS_DIR"
|
||||
local project_dirs="$OCC_DIR $OAC_DIR $ORC_DIR $HEAT_CFNTOOLS_DIR"
|
||||
local projpath proj package
|
||||
|
||||
rm -rf $HEAT_PIP_REPO
|
||||
|
||||
+15
-12
@@ -59,7 +59,6 @@ IRONIC_HW_EPHEMERAL_DISK=${IRONIC_HW_EPHEMERAL_DISK:-0}
|
||||
IRONIC_IPMIINFO_FILE=${IRONIC_IPMIINFO_FILE:-$IRONIC_DATA_DIR/hardware_info}
|
||||
|
||||
# Set up defaults for functional / integration testing
|
||||
IRONIC_NODE_UUID=${IRONIC_NODE_UUID:-`uuidgen`}
|
||||
IRONIC_SCRIPTS_DIR=${IRONIC_SCRIPTS_DIR:-$TOP_DIR/tools/ironic/scripts}
|
||||
IRONIC_TEMPLATES_DIR=${IRONIC_TEMPLATES_DIR:-$TOP_DIR/tools/ironic/templates}
|
||||
IRONIC_BAREMETAL_BASIC_OPS=$(trueorfalse False IRONIC_BAREMETAL_BASIC_OPS)
|
||||
@@ -97,8 +96,11 @@ IRONIC_DEPLOY_RAMDISK=${IRONIC_DEPLOY_RAMDISK:-}
|
||||
IRONIC_DEPLOY_KERNEL=${IRONIC_DEPLOY_KERNEL:-}
|
||||
IRONIC_DEPLOY_ELEMENT=${IRONIC_DEPLOY_ELEMENT:-deploy-ironic}
|
||||
|
||||
IRONIC_AGENT_KERNEL_URL=${IRONIC_AGENT_KERNEL_URL:-http://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe.vmlinuz}
|
||||
IRONIC_AGENT_RAMDISK_URL=${IRONIC_AGENT_RAMDISK_URL:-http://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe_image-oem.cpio.gz}
|
||||
# NOTE(jroll) this needs to be updated when stable branches are cut
|
||||
IPA_DOWNLOAD_BRANCH=${IPA_DOWNLOAD_BRANCH:-stable/liberty}
|
||||
IPA_DOWNLOAD_BRANCH=$(echo $IPA_DOWNLOAD_BRANCH | tr / -)
|
||||
IRONIC_AGENT_KERNEL_URL=${IRONIC_AGENT_KERNEL_URL:-http://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe-${IPA_DOWNLOAD_BRANCH}.vmlinuz}
|
||||
IRONIC_AGENT_RAMDISK_URL=${IRONIC_AGENT_RAMDISK_URL:-http://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe_image-oem-${IPA_DOWNLOAD_BRANCH}.cpio.gz}
|
||||
|
||||
# Which deploy driver to use - valid choices right now
|
||||
# are ``pxe_ssh``, ``pxe_ipmitool``, ``agent_ssh`` and ``agent_ipmitool``.
|
||||
@@ -119,7 +121,7 @@ IRONIC_HOSTPORT=${IRONIC_HOSTPORT:-$SERVICE_HOST:$IRONIC_SERVICE_PORT}
|
||||
IRONIC_IPXE_ENABLED=$(trueorfalse False IRONIC_IPXE_ENABLED)
|
||||
IRONIC_HTTP_DIR=${IRONIC_HTTP_DIR:-$IRONIC_DATA_DIR/httpboot}
|
||||
IRONIC_HTTP_SERVER=${IRONIC_HTTP_SERVER:-$HOST_IP}
|
||||
IRONIC_HTTP_PORT=${IRONIC_HTTP_PORT:-8088}
|
||||
IRONIC_HTTP_PORT=${IRONIC_HTTP_PORT:-3928}
|
||||
|
||||
# NOTE(lucasagomes): This flag is used to differentiate the nodes that
|
||||
# uses IPA as their deploy ramdisk from nodes that uses the agent_* drivers
|
||||
@@ -349,7 +351,7 @@ function configure_ironic_conductor {
|
||||
if [[ "$IRONIC_VM_LOG_CONSOLE" == "True" ]] ; then
|
||||
pxe_params+="nofb nomodeset vga=normal console=ttyS0"
|
||||
if is_deployed_with_ipa_ramdisk; then
|
||||
pxe_params+=" systemd.journald.forward_to_console=yes"
|
||||
pxe_params+=" systemd.journald.forward_to_console=yes ipa-debug=1"
|
||||
fi
|
||||
fi
|
||||
# When booting with less than 1GB, we need to switch from default tmpfs
|
||||
@@ -499,11 +501,13 @@ function stop_ironic {
|
||||
|
||||
function create_ovs_taps {
|
||||
local ironic_net_id=$(neutron net-list | grep private | get_field 1)
|
||||
die_if_not_set $LINENO ironic_net_id "Failed to get ironic network id"
|
||||
|
||||
# Work around: No netns exists on host until a Neutron port is created. We
|
||||
# need to create one in Neutron to know what netns to tap into prior to the
|
||||
# first node booting.
|
||||
local port_id=$(neutron port-create private | grep " id " | get_field 2)
|
||||
die_if_not_set $LINENO port_id "Failed to create neutron port"
|
||||
|
||||
# intentional sleep to make sure the tag has been set to port
|
||||
sleep 10
|
||||
@@ -513,7 +517,9 @@ function create_ovs_taps {
|
||||
else
|
||||
local tapdev=$(sudo ip link list | grep " tap" | cut -d':' -f2 | cut -d'@' -f1 | cut -b2-)
|
||||
fi
|
||||
die_if_not_set $LINENO tapdev "Failed to get tap device id"
|
||||
local tag_id=$(sudo ovs-vsctl show |grep ${tapdev} -A1 -m1 | grep tag | cut -d':' -f2 | cut -b2-)
|
||||
die_if_not_set $LINENO tag_id "Failed to get tag id"
|
||||
|
||||
# make sure veth pair is not existing, otherwise delete its links
|
||||
sudo ip link show ovs-tap1 && sudo ip link delete ovs-tap1
|
||||
@@ -617,6 +623,7 @@ function enroll_nodes {
|
||||
|
||||
# First node created will be used for testing in ironic w/o glance
|
||||
# scenario, so we need to know its UUID.
|
||||
IRONIC_NODE_UUID=${IRONIC_NODE_UUID:-`uuidgen`}
|
||||
local standalone_node_uuid=$([ $total_nodes -eq 0 ] && echo "--uuid $IRONIC_NODE_UUID")
|
||||
|
||||
local node_id=$(ironic node-create $standalone_node_uuid\
|
||||
@@ -771,26 +778,22 @@ function upload_baremetal_ironic_deploy {
|
||||
fi
|
||||
fi
|
||||
|
||||
local token=$(openstack token issue -c id -f value)
|
||||
die_if_not_set $LINENO token "Keystone fail to get token"
|
||||
|
||||
# load them into glance
|
||||
IRONIC_DEPLOY_KERNEL_ID=$(openstack \
|
||||
--os-token $token \
|
||||
--os-url http://$GLANCE_HOSTPORT \
|
||||
image create \
|
||||
$(basename $IRONIC_DEPLOY_KERNEL_PATH) \
|
||||
--public --disk-format=aki \
|
||||
--container-format=aki \
|
||||
< $IRONIC_DEPLOY_KERNEL_PATH | grep ' id ' | get_field 2)
|
||||
die_if_not_set $LINENO IRONIC_DEPLOY_KERNEL_ID "Failed to load kernel image into glance"
|
||||
|
||||
IRONIC_DEPLOY_RAMDISK_ID=$(openstack \
|
||||
--os-token $token \
|
||||
--os-url http://$GLANCE_HOSTPORT \
|
||||
image create \
|
||||
$(basename $IRONIC_DEPLOY_RAMDISK_PATH) \
|
||||
--public --disk-format=ari \
|
||||
--container-format=ari \
|
||||
< $IRONIC_DEPLOY_RAMDISK_PATH | grep ' id ' | get_field 2)
|
||||
die_if_not_set $LINENO IRONIC_DEPLOY_RAMDISK_ID "Failed to load ramdisk image into glance"
|
||||
}
|
||||
|
||||
function prepare_baremetal_basic_ops {
|
||||
|
||||
+10
-11
@@ -351,6 +351,7 @@ function create_keystone_accounts {
|
||||
local admin_user=$(get_or_create_user "admin" "$ADMIN_PASSWORD" default)
|
||||
local admin_role=$(get_or_create_role "admin")
|
||||
get_or_add_user_project_role $admin_role $admin_user $admin_tenant
|
||||
get_or_add_user_domain_role $admin_role $admin_user default
|
||||
|
||||
# Create service project/role
|
||||
get_or_create_project "$SERVICE_TENANT_NAME" default
|
||||
@@ -443,6 +444,7 @@ function configure_auth_token_middleware {
|
||||
iniset $conf_file $section auth_uri $KEYSTONE_SERVICE_URI
|
||||
iniset $conf_file $section cafile $SSL_BUNDLE_FILE
|
||||
iniset $conf_file $section signing_dir $signing_dir
|
||||
iniset $conf_file $section memcache_servers 127.0.0.1:11211
|
||||
}
|
||||
|
||||
# init_keystone() - Initialize databases, etc.
|
||||
@@ -512,17 +514,11 @@ function install_keystone {
|
||||
if is_service_enabled ldap; then
|
||||
install_ldap
|
||||
fi
|
||||
if [[ "$KEYSTONE_TOKEN_BACKEND" = "memcache" ]]; then
|
||||
# Install memcached and the memcache Python library that keystone uses.
|
||||
# Unfortunately the Python library goes by different names in the .deb
|
||||
# and .rpm circles.
|
||||
install_package memcached
|
||||
if is_ubuntu; then
|
||||
install_package python-memcache
|
||||
else
|
||||
install_package python-memcached
|
||||
fi
|
||||
fi
|
||||
|
||||
# Install the memcache library so keystonemiddleware can cache tokens in a
|
||||
# shared location.
|
||||
pip_install python-memcached
|
||||
|
||||
git_clone $KEYSTONE_REPO $KEYSTONE_DIR $KEYSTONE_BRANCH
|
||||
setup_develop $KEYSTONE_DIR
|
||||
if [ "$KEYSTONE_USE_MOD_WSGI" == "True" ]; then
|
||||
@@ -566,6 +562,9 @@ function start_keystone {
|
||||
start_tls_proxy '*' $KEYSTONE_SERVICE_PORT $KEYSTONE_SERVICE_HOST $KEYSTONE_SERVICE_PORT_INT &
|
||||
start_tls_proxy '*' $KEYSTONE_AUTH_PORT $KEYSTONE_AUTH_HOST $KEYSTONE_AUTH_PORT_INT &
|
||||
fi
|
||||
|
||||
# (re)start memcached to make sure we have a clean memcache.
|
||||
restart_service memcached
|
||||
}
|
||||
|
||||
# stop_keystone() - Stop running processes
|
||||
|
||||
+24
-15
@@ -171,6 +171,7 @@ PROVIDER_SUBNET_NAME=${PROVIDER_SUBNET_NAME:-"provider_net"}
|
||||
# Define the public bridge that will transmit traffic from VMs to the
|
||||
# physical network - used by both the OVS and Linux Bridge drivers.
|
||||
PUBLIC_BRIDGE=${PUBLIC_BRIDGE:-br-ex}
|
||||
PUBLIC_BRIDGE_MTU=${PUBLIC_BRIDGE_MTU:-1500}
|
||||
|
||||
# Use flat providernet for public network
|
||||
#
|
||||
@@ -358,6 +359,9 @@ else
|
||||
Q_USE_SECGROUP=False
|
||||
fi
|
||||
|
||||
default_route_dev=$(ip route | grep ^default | awk '{print $5}')
|
||||
die_if_not_set $LINENO default_route_dev "Failure retrieving default route device"
|
||||
|
||||
# Save trace setting
|
||||
XTRACE=$(set +o | grep xtrace)
|
||||
set +o xtrace
|
||||
@@ -468,19 +472,13 @@ function configure_neutron {
|
||||
function create_nova_conf_neutron {
|
||||
iniset $NOVA_CONF DEFAULT network_api_class "nova.network.neutronv2.api.API"
|
||||
|
||||
|
||||
if [ "$ENABLE_IDENTITY_V2" == "False" ]; then
|
||||
iniset $NOVA_CONF neutron auth_plugin "v3password"
|
||||
iniset $NOVA_CONF neutron auth_url "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_AUTH_PORT/v3"
|
||||
iniset $NOVA_CONF neutron username "$Q_ADMIN_USERNAME"
|
||||
iniset $NOVA_CONF neutron password "$SERVICE_PASSWORD"
|
||||
iniset $NOVA_CONF neutron user_domain_name "default"
|
||||
else
|
||||
iniset $NOVA_CONF neutron admin_username "$Q_ADMIN_USERNAME"
|
||||
iniset $NOVA_CONF neutron admin_password "$SERVICE_PASSWORD"
|
||||
iniset $NOVA_CONF neutron admin_auth_url "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_AUTH_PORT/v2.0"
|
||||
iniset $NOVA_CONF neutron admin_tenant_name "$SERVICE_TENANT_NAME"
|
||||
fi
|
||||
iniset $NOVA_CONF neutron auth_plugin "v3password"
|
||||
iniset $NOVA_CONF neutron auth_url "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_AUTH_PORT/v3"
|
||||
iniset $NOVA_CONF neutron username "$Q_ADMIN_USERNAME"
|
||||
iniset $NOVA_CONF neutron password "$SERVICE_PASSWORD"
|
||||
iniset $NOVA_CONF neutron user_domain_name "Default"
|
||||
iniset $NOVA_CONF neutron project_name "$SERVICE_TENANT_NAME"
|
||||
iniset $NOVA_CONF neutron project_domain_name "Default"
|
||||
iniset $NOVA_CONF neutron auth_strategy "$Q_AUTH_STRATEGY"
|
||||
iniset $NOVA_CONF neutron region_name "$REGION_NAME"
|
||||
iniset $NOVA_CONF neutron url "${Q_PROTOCOL}://$Q_HOST:$Q_PORT"
|
||||
@@ -806,7 +804,9 @@ function _move_neutron_addresses_route {
|
||||
|
||||
local IP_ADD=""
|
||||
local IP_DEL=""
|
||||
local DEFAULT_ROUTE_GW=$(ip r | awk "/default.+$from_intf/ { print \$3; exit }")
|
||||
local IP_UP=""
|
||||
local DEFAULT_ROUTE_GW
|
||||
DEFAULT_ROUTE_GW=$(ip r | awk "/default.+$from_intf/ { print \$3; exit }")
|
||||
local ADD_OVS_PORT=""
|
||||
|
||||
if [[ $af == "inet" ]]; then
|
||||
@@ -828,9 +828,10 @@ function _move_neutron_addresses_route {
|
||||
if [[ "$IP_BRD" != "" ]]; then
|
||||
IP_DEL="sudo ip addr del $IP_BRD dev $from_intf"
|
||||
IP_ADD="sudo ip addr add $IP_BRD dev $to_intf"
|
||||
IP_UP="sudo ip link set $to_intf up"
|
||||
fi
|
||||
|
||||
$IP_DEL; $IP_ADD; $ADD_OVS_PORT; $ADD_DEFAULT_ROUTE
|
||||
$IP_DEL; $IP_ADD; $IP_UP; $ADD_OVS_PORT; $ADD_DEFAULT_ROUTE
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -960,6 +961,9 @@ function _configure_neutron_common {
|
||||
fi
|
||||
|
||||
_neutron_setup_rootwrap
|
||||
|
||||
# push mtu into instances to avoid packet drops when tunnelling is used
|
||||
iniset $NEUTRON_CONF DEFAULT advertise_mtu "True"
|
||||
}
|
||||
|
||||
function _configure_neutron_debug_command {
|
||||
@@ -1343,6 +1347,11 @@ function _neutron_configure_router_v6 {
|
||||
|
||||
# This logic is specific to using the l3-agent for layer 3
|
||||
if is_service_enabled q-l3; then
|
||||
# Ensure IPv6 RAs are accepted on the interface with the default route.
|
||||
# This is needed for neutron-based devstack clouds to work in
|
||||
# IPv6-only clouds in the gate. Please do not remove this without
|
||||
# talking to folks in Infra.
|
||||
sudo sysctl -w net.ipv6.conf.$default_route_dev.accept_ra=2
|
||||
# Ensure IPv6 forwarding is enabled on the host
|
||||
sudo sysctl -w net.ipv6.conf.all.forwarding=1
|
||||
# Configure and enable public bridge
|
||||
|
||||
@@ -48,6 +48,7 @@ function neutron_plugin_configure_dhcp_agent {
|
||||
|
||||
function neutron_plugin_configure_l3_agent {
|
||||
sudo brctl addbr $PUBLIC_BRIDGE
|
||||
set_mtu $PUBLIC_BRIDGE $PUBLIC_BRIDGE_MTU
|
||||
iniset $Q_L3_CONF_FILE DEFAULT external_network_bridge
|
||||
iniset $Q_L3_CONF_FILE DEFAULT l3_agent_manager neutron.agent.l3_agent.L3NATAgentWithStateReport
|
||||
}
|
||||
@@ -69,6 +70,18 @@ function neutron_plugin_configure_plugin_agent {
|
||||
fi
|
||||
AGENT_BINARY="$NEUTRON_BIN_DIR/neutron-linuxbridge-agent"
|
||||
iniset /$Q_PLUGIN_CONF_FILE agent tunnel_types $Q_TUNNEL_TYPES
|
||||
|
||||
# Configure vxlan tunneling
|
||||
if [[ "$ENABLE_TENANT_TUNNELS" == "True" ]]; then
|
||||
if [[ "$Q_ML2_TENANT_NETWORK_TYPE" == "vxlan" ]]; then
|
||||
iniset /$Q_PLUGIN_CONF_FILE vxlan enable_vxlan "True"
|
||||
iniset /$Q_PLUGIN_CONF_FILE vxlan local_ip $TUNNEL_ENDPOINT_IP
|
||||
else
|
||||
iniset /$Q_PLUGIN_CONF_FILE vxlan enable_vxlan "False"
|
||||
fi
|
||||
else
|
||||
iniset /$Q_PLUGIN_CONF_FILE vxlan enable_vxlan "False"
|
||||
fi
|
||||
}
|
||||
|
||||
function neutron_plugin_setup_interface_driver {
|
||||
|
||||
@@ -40,6 +40,12 @@ Q_ML2_PLUGIN_EXT_DRIVERS=${Q_ML2_PLUGIN_EXT_DRIVERS-port_security}
|
||||
# L3 Plugin to load for ML2
|
||||
ML2_L3_PLUGIN=${ML2_L3_PLUGIN:-neutron.services.l3_router.l3_router_plugin.L3RouterPlugin}
|
||||
|
||||
# Underlying path MTU for physical network managing br-tun; use '-' instead of
|
||||
# ':-' to allow people to explicitly override this to blank, to disable
|
||||
# automatic MTU calculation for tunnelled tenant networks
|
||||
Q_ML2_PLUGIN_PATH_MTU=${Q_ML2_PLUGIN_PATH_MTU-1500}
|
||||
|
||||
|
||||
function populate_ml2_config {
|
||||
CONF=$1
|
||||
SECTION=$2
|
||||
@@ -77,6 +83,12 @@ function neutron_plugin_configure_service {
|
||||
echo "WARNING - The ml2 plugin is using local tenant networks, with no connectivity between hosts."
|
||||
fi
|
||||
|
||||
# Enable ml2 mtu calculation mechanism for networks by providing path mtu
|
||||
# value for physical devices that are used for br-tun traffic
|
||||
if [[ "$ENABLE_TENANT_TUNNELS" == "True" ]] && [[ "$Q_ML2_PLUGIN_PATH_MTU" != "" ]]; then
|
||||
iniset /$Q_PLUGIN_CONF_FILE ml2 path_mtu "$Q_ML2_PLUGIN_PATH_MTU"
|
||||
fi
|
||||
|
||||
# Allow for overrding VLAN configuration (for example, to configure provider
|
||||
# VLANs) by first checking if Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS is set.
|
||||
if [ "$Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS" == "" ]; then
|
||||
|
||||
@@ -102,11 +102,16 @@ function _neutron_ovs_base_configure_l3_agent {
|
||||
sudo ip link set $Q_PUBLIC_VETH_EX up
|
||||
sudo ip addr flush dev $Q_PUBLIC_VETH_EX
|
||||
else
|
||||
_neutron_ovs_base_add_bridge $PUBLIC_BRIDGE
|
||||
_neutron_ovs_base_add_public_bridge
|
||||
sudo ovs-vsctl br-set-external-id $PUBLIC_BRIDGE bridge-id $PUBLIC_BRIDGE
|
||||
fi
|
||||
}
|
||||
|
||||
function _neutron_ovs_base_add_public_bridge {
|
||||
_neutron_ovs_base_add_bridge $PUBLIC_BRIDGE
|
||||
set_mtu $PUBLIC_BRIDGE $PUBLIC_BRIDGE_MTU
|
||||
}
|
||||
|
||||
function _neutron_ovs_base_configure_nova_vif_driver {
|
||||
:
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
FW_XTRACE=$(set +o | grep xtrace)
|
||||
set +o xtrace
|
||||
|
||||
FWAAS_PLUGIN=neutron_fwaas.services.firewall.fwaas_plugin.FirewallPlugin
|
||||
FWAAS_PLUGIN=${FWAAS_PLUGIN:-neutron_fwaas.services.firewall.fwaas_plugin.FirewallPlugin}
|
||||
FWAAS_DRIVER=${FWAAS_DRIVER:-neutron_fwaas.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver}
|
||||
|
||||
function neutron_fwaas_configure_common {
|
||||
_neutron_service_plugin_class_add $FWAAS_PLUGIN
|
||||
@@ -16,7 +17,7 @@ function neutron_fwaas_configure_driver {
|
||||
cp $NEUTRON_FWAAS_DIR/etc/fwaas_driver.ini $FWAAS_DRIVER_CONF_FILENAME
|
||||
|
||||
iniset_multiline $FWAAS_DRIVER_CONF_FILENAME fwaas enabled True
|
||||
iniset_multiline $FWAAS_DRIVER_CONF_FILENAME fwaas driver "neutron_fwaas.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver"
|
||||
iniset_multiline $FWAAS_DRIVER_CONF_FILENAME fwaas driver "$FWAAS_DRIVER"
|
||||
}
|
||||
|
||||
function neutron_fwaas_stop {
|
||||
|
||||
@@ -652,6 +652,23 @@ function create_nova_conf {
|
||||
iniset $NOVA_CONF serial_console serialproxy_host "$NOVA_SERVICE_LISTEN_ADDRESS"
|
||||
iniset $NOVA_CONF serial_console enabled True
|
||||
fi
|
||||
|
||||
# Setup logging for nova-dhcpbridge command line
|
||||
sudo cp "$NOVA_CONF" "$NOVA_CONF_DIR/nova-dhcpbridge.conf"
|
||||
|
||||
local service="n-dhcp"
|
||||
local logfile="${service}.log.${CURRENT_LOG_TIME}"
|
||||
local real_logfile="${LOGDIR}/${logfile}"
|
||||
if [[ -n ${LOGDIR} ]]; then
|
||||
bash -c "cd '$LOGDIR' && ln -sf '$logfile' ${service}.log"
|
||||
iniset "$NOVA_CONF_DIR/nova-dhcpbridge.conf" DEFAULT log_file "$real_logfile"
|
||||
if [[ -n ${SCREEN_LOGDIR} ]]; then
|
||||
# Drop the backward-compat symlink
|
||||
ln -sf "$real_logfile" ${SCREEN_LOGDIR}/screen-${service}.log
|
||||
fi
|
||||
fi
|
||||
|
||||
iniset $NOVA_CONF DEFAULT dhcpbridge_flagfile "$NOVA_CONF_DIR/nova-dhcpbridge.conf"
|
||||
}
|
||||
|
||||
function init_nova_cells {
|
||||
@@ -692,6 +709,8 @@ function create_nova_conf_nova_network {
|
||||
iniset $NOVA_CONF DEFAULT public_interface "$PUBLIC_INTERFACE"
|
||||
iniset $NOVA_CONF DEFAULT vlan_interface "$VLAN_INTERFACE"
|
||||
iniset $NOVA_CONF DEFAULT flat_network_bridge "$FLAT_NETWORK_BRIDGE"
|
||||
# force down dhcp leases to 5 minutes, which lets us expire faster
|
||||
iniset $NOVA_CONF DEFAULT dhcp_lease_time 300
|
||||
if [ -n "$FLAT_INTERFACE" ]; then
|
||||
iniset $NOVA_CONF DEFAULT flat_interface "$FLAT_INTERFACE"
|
||||
fi
|
||||
|
||||
@@ -31,9 +31,17 @@ function install_libvirt {
|
||||
fi
|
||||
install_package libvirt-bin libvirt-dev
|
||||
pip_install_gr libvirt-python
|
||||
if [[ "$EBTABLES_RACE_FIX" == "True" ]]; then
|
||||
# Work around for bug #1501558. We can remove this once we
|
||||
# get to a version of Ubuntu that has new enough libvirt.
|
||||
TOP_DIR=$TOP_DIR $TOP_DIR/tools/install_ebtables_workaround.sh
|
||||
fi
|
||||
#pip_install_gr <there-si-no-guestfs-in-pypi>
|
||||
elif is_fedora || is_suse; then
|
||||
install_package kvm
|
||||
# On "KVM for IBM z Systems", kvm does not have its own package
|
||||
if [[ ! ${DISTRO} =~ "kvmibm1" ]]; then
|
||||
install_package kvm
|
||||
fi
|
||||
# there is a dependency issue with kvm (which is really just a
|
||||
# wrapper to qemu-system-x86) that leaves some bios files out,
|
||||
# so install qemu-kvm (which shouldn't strictly be needed, as
|
||||
|
||||
+63
-21
@@ -66,11 +66,15 @@ BUILD_TIMEOUT=${BUILD_TIMEOUT:-196}
|
||||
# This must be False on stable branches, as master tempest
|
||||
# deps do not match stable branch deps. Set this to True to
|
||||
# have tempest installed in DevStack by default.
|
||||
INSTALL_TEMPEST=${INSTALL_TEMPEST:-"True"}
|
||||
INSTALL_TEMPEST=${INSTALL_TEMPEST:-"False"}
|
||||
|
||||
BOTO_MATERIALS_PATH="$FILES/images/s3-materials/cirros-${CIRROS_VERSION}"
|
||||
BOTO_CONF=/etc/boto.cfg
|
||||
|
||||
# This variable is passed directly to pip install inside the common tox venv
|
||||
# that is created
|
||||
TEMPEST_PLUGINS=${TEMPEST_PLUGINS:-0}
|
||||
|
||||
# Cinder/Volume variables
|
||||
TEMPEST_VOLUME_DRIVER=${TEMPEST_VOLUME_DRIVER:-default}
|
||||
TEMPEST_DEFAULT_VOLUME_VENDOR="Open Source"
|
||||
@@ -138,7 +142,7 @@ function configure_tempest {
|
||||
local public_router_id
|
||||
local tenant_networks_reachable
|
||||
local boto_instance_type="m1.tiny"
|
||||
local ssh_connect_method="fixed"
|
||||
local ssh_connect_method="floating"
|
||||
|
||||
# Save IFS
|
||||
ifs=$IFS
|
||||
@@ -261,9 +265,6 @@ function configure_tempest {
|
||||
|
||||
if [ "$Q_USE_NAMESPACE" != "False" ]; then
|
||||
tenant_networks_reachable=false
|
||||
if ! is_service_enabled n-net; then
|
||||
ssh_connect_method="floating"
|
||||
fi
|
||||
else
|
||||
tenant_networks_reachable=true
|
||||
fi
|
||||
@@ -333,6 +334,7 @@ function configure_tempest {
|
||||
if is_ssl_enabled_service "key" || is_service_enabled tls-proxy; then
|
||||
iniset $TEMPEST_CONFIG identity ca_certificates_file $SSL_BUNDLE_FILE
|
||||
fi
|
||||
iniset $TEMPEST_CONFIG identity-feature-enabled api_extensions OS-EC2
|
||||
|
||||
# Image
|
||||
# We want to be able to override this variable in the gate to avoid
|
||||
@@ -340,7 +342,10 @@ function configure_tempest {
|
||||
if [[ ! -z "$TEMPEST_HTTP_IMAGE" ]]; then
|
||||
iniset $TEMPEST_CONFIG image http_image $TEMPEST_HTTP_IMAGE
|
||||
fi
|
||||
iniset $TEMPEST_CONFIG image-feature-enabled deactivate_image true
|
||||
if [ "$VIRT_DRIVER" = "xenserver" ]; then
|
||||
iniset $TEMPEST_CONFIG image disk_formats "ami,ari,aki,vhd,raw,iso"
|
||||
iniset $TEMPEST_CONFIG scenario img_disk_format vhd
|
||||
fi
|
||||
|
||||
# Image Features
|
||||
iniset $TEMPEST_CONFIG image-feature-enabled deactivate_image True
|
||||
@@ -374,7 +379,7 @@ function configure_tempest {
|
||||
# NOTE(mtreinish): This must be done after auth settings are added to the tempest config
|
||||
local tmp_cfg_file=$(mktemp)
|
||||
cd $TEMPEST_DIR
|
||||
tox -revenv -- verify-tempest-config -uro $tmp_cfg_file
|
||||
tox -revenv-tempest -- verify-tempest-config -u -r -o $tmp_cfg_file
|
||||
|
||||
local compute_api_extensions=${COMPUTE_API_EXTENSIONS:-"all"}
|
||||
if [[ ! -z "$DISABLE_COMPUTE_API_EXTENSIONS" ]]; then
|
||||
@@ -401,6 +406,17 @@ function configure_tempest {
|
||||
if is_service_enabled n-cell; then
|
||||
# Cells doesn't support shelving/unshelving
|
||||
iniset $TEMPEST_CONFIG compute-feature-enabled shelve False
|
||||
# Cells doesn't support hot-plugging virtual interfaces.
|
||||
iniset $TEMPEST_CONFIG compute-feature-enabled interface_attach False
|
||||
|
||||
if [[ -z "$DEFAULT_INSTANCE_TYPE" ]]; then
|
||||
# Cells supports resize but does not currently work with devstack
|
||||
# because of the custom flavors created for Tempest runs which are
|
||||
# not in the cells database.
|
||||
# TODO(mriedem): work on adding a nova-manage command to sync
|
||||
# flavors into the cells database.
|
||||
iniset $TEMPEST_CONFIG compute-feature-enabled resize False
|
||||
fi
|
||||
fi
|
||||
|
||||
# Network
|
||||
@@ -412,7 +428,15 @@ function configure_tempest {
|
||||
iniset $TEMPEST_CONFIG network-feature-enabled ipv6 "$IPV6_ENABLED"
|
||||
iniset $TEMPEST_CONFIG network-feature-enabled ipv6_subnet_attributes "$IPV6_SUBNET_ATTRIBUTES_ENABLED"
|
||||
|
||||
local network_api_extensions=${NETWORK_API_EXTENSIONS:-"all"}
|
||||
DEFAULT_NET_EXT="agent,allowed-address-pairs,binding"
|
||||
DEFAULT_NET_EXT+=",dhcp_agent_scheduler,dns-integration"
|
||||
DEFAULT_NET_EXT+=",dvr,ext-gw-mode,external-net"
|
||||
DEFAULT_NET_EXT+=",extra_dhcp_opt,extraroute,flavors,fwaas"
|
||||
DEFAULT_NET_EXT+=",fwaasrouterinsertion,l3-ha,l3_agent_scheduler,lbaas"
|
||||
DEFAULT_NET_EXT+=",lbaas_agent_scheduler,metering,multi-provider,net-mtu,port-security"
|
||||
DEFAULT_NET_EXT+=",provider,quotas,rbac-policies,router,security-group,service-type"
|
||||
DEFAULT_NET_EXT+=",subnet_allocation,vpnaas"
|
||||
local network_api_extensions="${NETWORK_API_EXTENSIONS:-$DEFAULT_NET_EXT}"
|
||||
if [[ ! -z "$DISABLE_NETWORK_API_EXTENSIONS" ]]; then
|
||||
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
|
||||
network_api_extensions=${NETWORK_API_EXTENSIONS:-$(iniget $tmp_cfg_file network-feature-enabled api_extensions | tr -d " ")}
|
||||
@@ -461,7 +485,11 @@ function configure_tempest {
|
||||
iniset $TEMPEST_CONFIG telemetry-feature-enabled events "True"
|
||||
|
||||
# Object Store
|
||||
local object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-"all"}
|
||||
DEFAULT_SWIFT_OPT="account_quotas,bulk,bulk_delete,bulk_upload,container_quotas"
|
||||
DEFAULT_SWIFT_OPT+=",container_sync,crossdomain,formpost,ratelimit,slo"
|
||||
DEFAULT_SWIFT_OPT+=",staticweb,tempauth,tempurl"
|
||||
|
||||
local object_storage_api_extensions="${OBJECT_STORAGE_API_EXTENSIONS:-$DEFAULT_SWIFT_OPT}"
|
||||
if [[ ! -z "$DISABLE_OBJECT_STORAGE_API_EXTENSIONS" ]]; then
|
||||
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
|
||||
object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-$(iniget $tmp_cfg_file object-storage-feature-enabled discoverable_apis | tr -d " ")}
|
||||
@@ -478,8 +506,21 @@ function configure_tempest {
|
||||
iniset $TEMPEST_CONFIG volume-feature-enabled bootable True
|
||||
# TODO(jordanP): Remove the extend_with_snapshot flag when Juno is end of life.
|
||||
iniset $TEMPEST_CONFIG volume-feature-enabled extend_with_snapshot True
|
||||
# TODO(obutenko): Remove the incremental_backup_force flag when Kilo and Juno is end of life.
|
||||
iniset $TEMPEST_CONFIG volume-feature-enabled incremental_backup_force True
|
||||
|
||||
local volume_api_extensions=${VOLUME_API_EXTENSIONS:-"all"}
|
||||
DEFAULT_VOL_EXT="OS-SCH-HNT,backups,capabilities,cgsnapshots,consistencygroups"
|
||||
DEFAULT_VOL_EXT+=",encryption,os-admin-actions,os-availability-zone"
|
||||
DEFAULT_VOL_EXT+=",os-extended-services,os-extended-snapshot-attributes"
|
||||
DEFAULT_VOL_EXT+=",os-hosts,os-image-create,os-quota-class-sets,os-quota-sets"
|
||||
DEFAULT_VOL_EXT+=",os-services,os-snapshot-actions,os-snapshot-manage,os-snapshot-unmanage"
|
||||
DEFAULT_VOL_EXT+=",os-types-extra-specs"
|
||||
DEFAULT_VOL_EXT+=",os-types-manage,os-used-limits,os-vol-host-attr,os-vol-image-meta"
|
||||
DEFAULT_VOL_EXT+=",os-vol-mig-status-attr,os-vol-tenant-attr,os-volume-actions"
|
||||
DEFAULT_VOL_EXT+=",os-volume-encryption-metadata,os-volume-manage"
|
||||
DEFAULT_VOL_EXT+=",os-volume-replication,os-volume-transfer,os-volume-type-access"
|
||||
DEFAULT_VOL_EXT+=",os-volume-unmanage,qos-specs,scheduler-stats"
|
||||
local volume_api_extensions="${VOLUME_API_EXTENSIONS:-$DEFAULT_VOL_EXT}"
|
||||
if [[ ! -z "$DISABLE_VOLUME_API_EXTENSIONS" ]]; then
|
||||
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
|
||||
volume_api_extensions=${VOLUME_API_EXTENSIONS:-$(iniget $tmp_cfg_file volume-feature-enabled api_extensions | tr -d " ")}
|
||||
@@ -492,15 +533,6 @@ function configure_tempest {
|
||||
iniset $TEMPEST_CONFIG volume-feature-enabled backup False
|
||||
fi
|
||||
|
||||
# Use only Cinder API v2
|
||||
if [[ ${CINDER_ENABLE_V1_API} = True ]]; then
|
||||
iniset $TEMPEST_CONFIG volume-feature-enabled api_v1 True
|
||||
iniset $TEMPEST_CONFIG volume catalog_type volume
|
||||
else
|
||||
iniset $TEMPEST_CONFIG volume-feature-enabled api_v1 False
|
||||
iniset $TEMPEST_CONFIG volume catalog_type volumev2
|
||||
fi
|
||||
|
||||
# Using ``CINDER_ENABLED_BACKENDS``
|
||||
if [[ -n "$CINDER_ENABLED_BACKENDS" ]] && [[ $CINDER_ENABLED_BACKENDS =~ .*,.* ]]; then
|
||||
iniset $TEMPEST_CONFIG volume-feature-enabled multi_backend "True"
|
||||
@@ -532,7 +564,8 @@ function configure_tempest {
|
||||
# Baremetal
|
||||
if [ "$VIRT_DRIVER" = "ironic" ] ; then
|
||||
iniset $TEMPEST_CONFIG baremetal driver_enabled True
|
||||
iniset $TEMPEST_CONFIG baremetal unprovision_timeout 300
|
||||
iniset $TEMPEST_CONFIG baremetal unprovision_timeout $BUILD_TIMEOUT
|
||||
iniset $TEMPEST_CONFIG baremetal active_timeout $BUILD_TIMEOUT
|
||||
iniset $TEMPEST_CONFIG baremetal deploy_img_dir $FILES
|
||||
iniset $TEMPEST_CONFIG baremetal node_uuid $IRONIC_NODE_UUID
|
||||
iniset $TEMPEST_CONFIG compute-feature-enabled change_password False
|
||||
@@ -626,7 +659,16 @@ function install_tempest {
|
||||
pip_install tox
|
||||
pushd $TEMPEST_DIR
|
||||
tox --notest -efull
|
||||
PROJECT_VENV["tempest"]=${TEMPEST_DIR}/.tox/full
|
||||
PROJECT_VENV["tempest"]=${TEMPEST_DIR}/.tox/tempest
|
||||
popd
|
||||
}
|
||||
|
||||
# install_tempest_plugins() - Install any specified plugins into the tempest venv
|
||||
function install_tempest_plugins {
|
||||
pushd $TEMPEST_DIR
|
||||
if [[ $TEMPEST_PLUGINS != 0 ]] ; then
|
||||
tox -evenv-tempest -- pip install $TEMPEST_PLUGINS
|
||||
fi
|
||||
install_tempest_lib
|
||||
popd
|
||||
}
|
||||
|
||||
@@ -42,6 +42,8 @@ if [[ -n "$NOUNSET" ]]; then
|
||||
set -o nounset
|
||||
fi
|
||||
|
||||
# Set start of devstack timestamp
|
||||
DEVSTACK_START_TIME=$(date +%s)
|
||||
|
||||
# Configuration
|
||||
# =============
|
||||
@@ -169,7 +171,7 @@ source $TOP_DIR/stackrc
|
||||
|
||||
# Warn users who aren't on an explicitly supported distro, but allow them to
|
||||
# override check and attempt installation with ``FORCE=yes ./stack``
|
||||
if [[ ! ${DISTRO} =~ (precise|trusty|utopic|vivid|7.0|wheezy|sid|testing|jessie|f21|f22|rhel7) ]]; then
|
||||
if [[ ! ${DISTRO} =~ (precise|trusty|utopic|vivid|7.0|wheezy|sid|testing|jessie|f21|f22|rhel7|kvmibm1) ]]; then
|
||||
echo "WARNING: this script has not been tested on $DISTRO"
|
||||
if [[ "$FORCE" != "yes" ]]; then
|
||||
die $LINENO "If you wish to run this script anyway run with FORCE=yes"
|
||||
@@ -278,14 +280,7 @@ EOF
|
||||
# ... and also optional to be enabled
|
||||
sudo yum-config-manager --enable rhel-7-server-optional-rpms
|
||||
|
||||
RHEL_RDO_REPO_RPM=${RHEL7_RDO_REPO_RPM:-"https://repos.fedorapeople.org/repos/openstack/openstack-kilo/rdo-release-kilo-1.noarch.rpm"}
|
||||
RHEL_RDO_REPO_ID=${RHEL7_RDO_REPO_ID:-"openstack-kilo"}
|
||||
|
||||
if ! sudo yum repolist enabled $RHEL_RDO_REPO_ID | grep -q $RHEL_RDO_REPO_ID; then
|
||||
echo "RDO repo not detected; installing"
|
||||
yum_install $RHEL_RDO_REPO_RPM || \
|
||||
die $LINENO "Error installing RDO repo, cannot continue"
|
||||
fi
|
||||
sudo yum install -y https://rdoproject.org/repos/rdo-release.rpm
|
||||
|
||||
if is_oraclelinux; then
|
||||
sudo yum-config-manager --enable ol7_optional_latest ol7_addons ol7_MySQL56
|
||||
@@ -464,11 +459,14 @@ function exit_trap {
|
||||
|
||||
if [[ $r -ne 0 ]]; then
|
||||
echo "Error on exit"
|
||||
generate-subunit $DEVSTACK_START_TIME $SECONDS 'fail' >> ${SUBUNIT_OUTPUT}
|
||||
if [[ -z $LOGDIR ]]; then
|
||||
$TOP_DIR/tools/worlddump.py
|
||||
else
|
||||
$TOP_DIR/tools/worlddump.py -d $LOGDIR
|
||||
fi
|
||||
else
|
||||
generate-subunit $DEVSTACK_START_TIME $SECONDS >> ${SUBUNIT_OUTPUT}
|
||||
fi
|
||||
|
||||
exit $r
|
||||
@@ -545,6 +543,7 @@ source $TOP_DIR/lib/dstat
|
||||
# Phase: source
|
||||
run_phase source
|
||||
|
||||
|
||||
# Interactive Configuration
|
||||
# -------------------------
|
||||
|
||||
@@ -689,6 +688,9 @@ if [[ "$OFFLINE" != "True" ]]; then
|
||||
PYPI_ALTERNATIVE_URL=${PYPI_ALTERNATIVE_URL:-""} $TOP_DIR/tools/install_pip.sh
|
||||
fi
|
||||
|
||||
# Install subunit for the subunit output stream
|
||||
pip_install -U os-testr
|
||||
|
||||
TRACK_DEPENDS=${TRACK_DEPENDS:-False}
|
||||
|
||||
# Install Python packages into a virtualenv so that we can track them
|
||||
@@ -712,12 +714,6 @@ source $TOP_DIR/tools/fixup_stuff.sh
|
||||
# Install required infra support libraries
|
||||
install_infra
|
||||
|
||||
# Pre-build some problematic wheels
|
||||
if [[ -n ${WHEELHOUSE:-} && ! -d ${WHEELHOUSE:-} ]]; then
|
||||
source $TOP_DIR/tools/build_wheels.sh
|
||||
fi
|
||||
|
||||
|
||||
# Extras Pre-install
|
||||
# ------------------
|
||||
# Phase: pre-install
|
||||
|
||||
@@ -29,6 +29,9 @@ DATA_DIR=${DEST}/data
|
||||
# Destination for status files
|
||||
SERVICE_DIR=${DEST}/status
|
||||
|
||||
# Path for subunit output file
|
||||
SUBUNIT_OUTPUT=${DEST}/devstack.subunit
|
||||
|
||||
# Determine stack user
|
||||
if [[ $EUID -eq 0 ]]; then
|
||||
STACK_USER=stack
|
||||
@@ -138,11 +141,6 @@ USE_VENV=$(trueorfalse False USE_VENV)
|
||||
# requirmenets files here, in a comma-separated list
|
||||
ADDITIONAL_VENV_PACKAGES=${ADITIONAL_VENV_PACKAGES:-""}
|
||||
|
||||
# Configure wheel cache location
|
||||
export WHEELHOUSE=${WHEELHOUSE:-$DEST/.wheelhouse}
|
||||
export PIP_WHEEL_DIR=${PIP_WHEEL_DIR:-$WHEELHOUSE}
|
||||
export PIP_FIND_LINKS=${PIP_FIND_LINKS:-file://$WHEELHOUSE}
|
||||
|
||||
# This can be used to turn database query logging on and off
|
||||
# (currently only implemented for MySQL backend)
|
||||
DATABASE_QUERY_LOGGING=$(trueorfalse False DATABASE_QUERY_LOGGING)
|
||||
@@ -190,51 +188,51 @@ REQUIREMENTS_DIR=$DEST/requirements
|
||||
|
||||
# block storage service
|
||||
CINDER_REPO=${CINDER_REPO:-${GIT_BASE}/openstack/cinder.git}
|
||||
CINDER_BRANCH=${CINDER_BRANCH:-master}
|
||||
CINDER_BRANCH=${CINDER_BRANCH:-stable/liberty}
|
||||
|
||||
# image catalog service
|
||||
GLANCE_REPO=${GLANCE_REPO:-${GIT_BASE}/openstack/glance.git}
|
||||
GLANCE_BRANCH=${GLANCE_BRANCH:-master}
|
||||
GLANCE_BRANCH=${GLANCE_BRANCH:-stable/liberty}
|
||||
|
||||
# heat service
|
||||
HEAT_REPO=${HEAT_REPO:-${GIT_BASE}/openstack/heat.git}
|
||||
HEAT_BRANCH=${HEAT_BRANCH:-master}
|
||||
HEAT_BRANCH=${HEAT_BRANCH:-stable/liberty}
|
||||
|
||||
# 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/liberty}
|
||||
|
||||
# baremetal provisioning service
|
||||
IRONIC_REPO=${IRONIC_REPO:-${GIT_BASE}/openstack/ironic.git}
|
||||
IRONIC_BRANCH=${IRONIC_BRANCH:-master}
|
||||
IRONIC_BRANCH=${IRONIC_BRANCH:-stable/liberty}
|
||||
|
||||
# unified auth system (manages accounts/tokens)
|
||||
KEYSTONE_REPO=${KEYSTONE_REPO:-${GIT_BASE}/openstack/keystone.git}
|
||||
KEYSTONE_BRANCH=${KEYSTONE_BRANCH:-master}
|
||||
KEYSTONE_BRANCH=${KEYSTONE_BRANCH:-stable/liberty}
|
||||
|
||||
# neutron service
|
||||
NEUTRON_REPO=${NEUTRON_REPO:-${GIT_BASE}/openstack/neutron.git}
|
||||
NEUTRON_BRANCH=${NEUTRON_BRANCH:-master}
|
||||
NEUTRON_BRANCH=${NEUTRON_BRANCH:-stable/liberty}
|
||||
|
||||
# neutron fwaas service
|
||||
NEUTRON_FWAAS_REPO=${NEUTRON_FWAAS_REPO:-${GIT_BASE}/openstack/neutron-fwaas.git}
|
||||
NEUTRON_FWAAS_BRANCH=${NEUTRON_FWAAS_BRANCH:-master}
|
||||
NEUTRON_FWAAS_BRANCH=${NEUTRON_FWAAS_BRANCH:-stable/liberty}
|
||||
|
||||
# neutron lbaas service
|
||||
NEUTRON_LBAAS_REPO=${NEUTRON_LBAAS_REPO:-${GIT_BASE}/openstack/neutron-lbaas.git}
|
||||
NEUTRON_LBAAS_BRANCH=${NEUTRON_LBAAS_BRANCH:-master}
|
||||
NEUTRON_LBAAS_BRANCH=${NEUTRON_LBAAS_BRANCH:-stable/liberty}
|
||||
|
||||
# neutron vpnaas service
|
||||
NEUTRON_VPNAAS_REPO=${NEUTRON_VPNAAS_REPO:-${GIT_BASE}/openstack/neutron-vpnaas.git}
|
||||
NEUTRON_VPNAAS_BRANCH=${NEUTRON_VPNAAS_BRANCH:-master}
|
||||
NEUTRON_VPNAAS_BRANCH=${NEUTRON_VPNAAS_BRANCH:-stable/liberty}
|
||||
|
||||
# compute service
|
||||
NOVA_REPO=${NOVA_REPO:-${GIT_BASE}/openstack/nova.git}
|
||||
NOVA_BRANCH=${NOVA_BRANCH:-master}
|
||||
NOVA_BRANCH=${NOVA_BRANCH:-stable/liberty}
|
||||
|
||||
# object storage service
|
||||
SWIFT_REPO=${SWIFT_REPO:-${GIT_BASE}/openstack/swift.git}
|
||||
SWIFT_BRANCH=${SWIFT_BRANCH:-master}
|
||||
SWIFT_BRANCH=${SWIFT_BRANCH:-stable/liberty}
|
||||
|
||||
##############
|
||||
#
|
||||
@@ -244,7 +242,7 @@ SWIFT_BRANCH=${SWIFT_BRANCH:-master}
|
||||
|
||||
# consolidated openstack requirements
|
||||
REQUIREMENTS_REPO=${REQUIREMENTS_REPO:-${GIT_BASE}/openstack/requirements.git}
|
||||
REQUIREMENTS_BRANCH=${REQUIREMENTS_BRANCH:-master}
|
||||
REQUIREMENTS_BRANCH=${REQUIREMENTS_BRANCH:-stable/liberty}
|
||||
|
||||
# Tempest test suite
|
||||
TEMPEST_REPO=${TEMPEST_REPO:-${GIT_BASE}/openstack/tempest.git}
|
||||
@@ -442,7 +440,7 @@ GITREPO["keystonemiddleware"]=${KEYSTONEMIDDLEWARE_REPO:-${GIT_BASE}/openstack/k
|
||||
GITBRANCH["keystonemiddleware"]=${KEYSTONEMIDDLEWARE_BRANCH:-master}
|
||||
|
||||
# s3 support for swift
|
||||
SWIFT3_REPO=${SWIFT3_REPO:-${GIT_BASE}/stackforge/swift3.git}
|
||||
SWIFT3_REPO=${SWIFT3_REPO:-${GIT_BASE}/openstack/swift3.git}
|
||||
SWIFT3_BRANCH=${SWIFT3_BRANCH:-master}
|
||||
|
||||
# ceilometer middleware
|
||||
@@ -750,6 +748,16 @@ GIT_DEPTH=${GIT_DEPTH:-0}
|
||||
# Use native SSL for servers in ``SSL_ENABLED_SERVICES``
|
||||
USE_SSL=$(trueorfalse False USE_SSL)
|
||||
|
||||
# ebtables is inherently racey. If you run it by two or more processes
|
||||
# simultaneously it will collide, badly, in the kernel and produce
|
||||
# failures or corruption of ebtables. The only way around it is for
|
||||
# all tools running ebtables to only ever do so with the --concurrent
|
||||
# flag. This requires libvirt >= 1.2.11.
|
||||
#
|
||||
# If you don't have this then the following work around will replace
|
||||
# ebtables with a wrapper script so that it is safe to run without
|
||||
# that flag.
|
||||
EBTABLES_RACE_FIX=$(trueorfalse False EBTABLES_RACE_FIX)
|
||||
|
||||
# Following entries need to be last items in file
|
||||
|
||||
|
||||
@@ -9,6 +9,22 @@ source $TOP/functions
|
||||
|
||||
source $TOP/tests/unittest.sh
|
||||
|
||||
echo "Testing generate_hex_string()"
|
||||
|
||||
VAL=$(generate_hex_string 16)
|
||||
if [[ ${#VAL} -eq 32 ]]; then
|
||||
passed "OK"
|
||||
else
|
||||
failed "generate_hex_string 16 failed ${#VAL}"
|
||||
fi
|
||||
|
||||
VAL=$(generate_hex_string 32)
|
||||
if [[ ${#VAL} -eq 64 ]]; then
|
||||
passed "OK"
|
||||
else
|
||||
failed "generate_hex_string 32 failed ${#VAL}"
|
||||
fi
|
||||
|
||||
echo "Testing die_if_not_set()"
|
||||
|
||||
bash -c "source $TOP/functions; X=`echo Y && true`; die_if_not_set $LINENO X 'not OK'"
|
||||
|
||||
Executable
+475
@@ -0,0 +1,475 @@
|
||||
#!/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.
|
||||
|
||||
# Tests for DevStack INI functions
|
||||
|
||||
TOP=$(cd $(dirname "$0")/.. && pwd)
|
||||
|
||||
# Import config functions
|
||||
source $TOP/inc/ini-config
|
||||
|
||||
source $TOP/tests/unittest.sh
|
||||
|
||||
echo "Testing INI local.conf functions"
|
||||
|
||||
# test that can determine if file has section in specified meta-section
|
||||
|
||||
function test_localconf_has_section {
|
||||
local file_localconf
|
||||
local file_conf1
|
||||
local file_conf2
|
||||
file_localconf=`mktemp`
|
||||
file_conf1=`mktemp`
|
||||
file_conf2=`mktemp`
|
||||
|
||||
cat <<- EOF > $file_localconf
|
||||
[[local|localrc]]
|
||||
LOCALRC_VAR1=localrc_val1
|
||||
LOCALRC_VAR2=localrc_val2
|
||||
LOCALRC_VAR3=localrc_val3
|
||||
|
||||
[[post-config|$file_conf1]]
|
||||
[conf1_t1]
|
||||
conf1_t1_opt1=conf1_t1_val1
|
||||
conf1_t1_opt2=conf1_t1_val2
|
||||
conf1_t1_opt3=conf1_t1_val3
|
||||
[conf1_t2]
|
||||
conf1_t2_opt1=conf1_t2_val1
|
||||
conf1_t2_opt2=conf1_t2_val2
|
||||
conf1_t2_opt3=conf1_t2_val3
|
||||
[conf1_t3]
|
||||
conf1_t3_opt1=conf1_t3_val1
|
||||
conf1_t3_opt2=conf1_t3_val2
|
||||
conf1_t3_opt3=conf1_t3_val3
|
||||
|
||||
[[post-extra|$file_conf2]]
|
||||
[conf2_t1]
|
||||
conf2_t1_opt1=conf2_t1_val1
|
||||
conf2_t1_opt2=conf2_t1_val2
|
||||
conf2_t1_opt3=conf2_t1_val3
|
||||
EOF
|
||||
|
||||
localconf_has_section $file_localconf post-config $file_conf1 conf1_t1
|
||||
assert_equal $? 0
|
||||
localconf_has_section $file_localconf post-config $file_conf1 conf1_t2
|
||||
assert_equal $? 0
|
||||
localconf_has_section $file_localconf post-config $file_conf1 conf1_t3
|
||||
assert_equal $? 0
|
||||
localconf_has_section $file_localconf post-extra $file_conf2 conf2_t1
|
||||
assert_equal $? 0
|
||||
localconf_has_section $file_localconf post-config $file_conf1 conf1_t4
|
||||
assert_equal $? 1
|
||||
localconf_has_section $file_localconf post-install $file_conf1 conf1_t1
|
||||
assert_equal $? 1
|
||||
localconf_has_section $file_localconf local localrc conf1_t2
|
||||
assert_equal $? 1
|
||||
rm -f $file_localconf $file_conf1 $file_conf2
|
||||
}
|
||||
|
||||
# test that can determine if file has option in specified meta-section and section
|
||||
function test_localconf_has_option {
|
||||
local file_localconf
|
||||
local file_conf1
|
||||
local file_conf2
|
||||
file_localconf=`mktemp`
|
||||
file_conf1=`mktemp`
|
||||
file_conf2=`mktemp`
|
||||
cat <<- EOF > $file_localconf
|
||||
[[post-config|$file_conf1]]
|
||||
[conf1_t1]
|
||||
conf1_t1_opt1 = conf1_t1_val1
|
||||
conf1_t1_opt2 = conf1_t1_val2
|
||||
conf1_t1_opt3 = conf1_t1_val3
|
||||
[conf1_t2]
|
||||
conf1_t2_opt1=conf1_t2_val1
|
||||
conf1_t2_opt2=conf1_t2_val2
|
||||
conf1_t2_opt3=conf1_t2_val3
|
||||
[conf1_t3]
|
||||
conf1_t3_opt1=conf1_t3_val1
|
||||
conf1_t3_opt2=conf1_t3_val2
|
||||
conf1_t3_opt3=conf1_t3_val3
|
||||
|
||||
[[local|localrc]]
|
||||
LOCALRC_VAR1=localrc_val1
|
||||
LOCALRC_VAR2=localrc_val2
|
||||
LOCALRC_VAR3=localrc_val3
|
||||
|
||||
[[post-extra|$file_conf2]]
|
||||
[conf2_t1]
|
||||
conf2_t1_opt1=conf2_t1_val1
|
||||
conf2_t1_opt2=conf2_t1_val2
|
||||
conf2_t1_opt3=conf2_t1_val3
|
||||
EOF
|
||||
|
||||
localconf_has_option $file_localconf local localrc "" LOCALRC_VAR1
|
||||
assert_equal $? 0
|
||||
localconf_has_option $file_localconf local localrc "" LOCALRC_VAR2
|
||||
assert_equal $? 0
|
||||
localconf_has_option $file_localconf local localrc "" LOCALRC_VAR3
|
||||
assert_equal $? 0
|
||||
localconf_has_option $file_localconf post-config $file_conf1 conf1_t1 conf1_t1_opt1
|
||||
assert_equal $? 0
|
||||
localconf_has_option $file_localconf post-config $file_conf1 conf1_t2 conf1_t2_opt2
|
||||
assert_equal $? 0
|
||||
localconf_has_option $file_localconf post-config $file_conf1 conf1_t3 conf1_t3_opt3
|
||||
assert_equal $? 0
|
||||
localconf_has_option $file_localconf post-extra $file_conf2 conf2_t1 conf2_t1_opt2
|
||||
assert_equal $? 0
|
||||
localconf_has_option $file_localconf post-config $file_conf1 conf1_t1_opt4
|
||||
assert_equal $? 1
|
||||
localconf_has_option $file_localconf post-install $file_conf1 conf1_t1_opt1
|
||||
assert_equal $? 1
|
||||
localconf_has_option $file_localconf local localrc conf1_t2 conf1_t2_opt1
|
||||
assert_equal $? 1
|
||||
rm -f $file_localconf $file_conf1 $file_conf2
|
||||
}
|
||||
|
||||
# test that update option in specified meta-section and section
|
||||
function test_localconf_update_option {
|
||||
local file_localconf
|
||||
local file_localconf_expected
|
||||
local file_conf1
|
||||
local file_conf2
|
||||
file_localconf=`mktemp`
|
||||
file_localconf_expected=`mktemp`
|
||||
file_conf1=`mktemp`
|
||||
file_conf2=`mktemp`
|
||||
cat <<- EOF > $file_localconf
|
||||
[[local|localrc]]
|
||||
LOCALRC_VAR1 = localrc_val1
|
||||
LOCALRC_VAR2 = localrc_val2
|
||||
LOCALRC_VAR3 = localrc_val3
|
||||
|
||||
[[post-config|$file_conf1]]
|
||||
[conf1_t1]
|
||||
conf1_t1_opt1=conf1_t1_val1
|
||||
conf1_t1_opt2=conf1_t1_val2
|
||||
conf1_t1_opt3=conf1_t1_val3
|
||||
[conf1_t2]
|
||||
conf1_t2_opt1=conf1_t2_val1
|
||||
conf1_t2_opt2=conf1_t2_val2
|
||||
conf1_t2_opt3=conf1_t2_val3
|
||||
[conf1_t3]
|
||||
conf1_t3_opt1=conf1_t3_val1
|
||||
conf1_t3_opt2=conf1_t3_val2
|
||||
conf1_t3_opt3=conf1_t3_val3
|
||||
|
||||
[[post-extra|$file_conf2]]
|
||||
[conf2_t1]
|
||||
conf2_t1_opt1=conf2_t1_val1
|
||||
conf2_t1_opt2=conf2_t1_val2
|
||||
conf2_t1_opt3=conf2_t1_val3
|
||||
EOF
|
||||
cat <<- EOF > $file_localconf_expected
|
||||
[[local|localrc]]
|
||||
LOCALRC_VAR1 = localrc_val1
|
||||
LOCALRC_VAR2 = localrc_val2_update
|
||||
LOCALRC_VAR3 = localrc_val3
|
||||
|
||||
[[post-config|$file_conf1]]
|
||||
[conf1_t1]
|
||||
conf1_t1_opt1=conf1_t1_val1_update
|
||||
conf1_t1_opt2=conf1_t1_val2
|
||||
conf1_t1_opt3=conf1_t1_val3
|
||||
[conf1_t2]
|
||||
conf1_t2_opt1=conf1_t2_val1
|
||||
conf1_t2_opt2=conf1_t2_val2_update
|
||||
conf1_t2_opt3=conf1_t2_val3
|
||||
[conf1_t3]
|
||||
conf1_t3_opt1=conf1_t3_val1
|
||||
conf1_t3_opt2=conf1_t3_val2
|
||||
conf1_t3_opt3=conf1_t3_val3_update
|
||||
|
||||
[[post-extra|$file_conf2]]
|
||||
[conf2_t1]
|
||||
conf2_t1_opt1=conf2_t1_val1
|
||||
conf2_t1_opt2=conf2_t1_val2
|
||||
conf2_t1_opt3=conf2_t1_val3_update
|
||||
EOF
|
||||
|
||||
localconf_update_option "$SUDO" $file_localconf local localrc "" LOCALRC_VAR2 localrc_val2_update
|
||||
localconf_update_option "$SUDO" $file_localconf post-config $file_conf1 conf1_t1 conf1_t1_opt1 conf1_t1_val1_update
|
||||
localconf_update_option "$SUDO" $file_localconf post-config $file_conf1 conf1_t2 conf1_t2_opt2 conf1_t2_val2_update
|
||||
localconf_update_option "$SUDO" $file_localconf post-config $file_conf1 conf1_t3 conf1_t3_opt3 conf1_t3_val3_update
|
||||
localconf_update_option "$SUDO" $file_localconf post-extra $file_conf2 conf2_t1 conf2_t1_opt3 conf2_t1_val3_update
|
||||
result=`cat $file_localconf`
|
||||
result_expected=`cat $file_localconf_expected`
|
||||
assert_equal "$result" "$result_expected"
|
||||
localconf_update_option "$SUDO" $file_localconf post-config $file_conf1 conf1_t2 conf1_t3_opt1 conf1_t3_val1_update
|
||||
localconf_update_option "$SUDO" $file_localconf post-extra $file_conf2 conf2_t1 conf2_t1_opt4 conf2_t1_val4_update
|
||||
localconf_update_option "$SUDO" $file_localconf post-install $file_conf2 conf2_t1 conf2_t1_opt1 conf2_t1_val1_update
|
||||
localconf_update_option "$SUDO" $file_localconf local localrc "" LOCALRC_VAR4 localrc_val4_update
|
||||
result=`cat $file_localconf`
|
||||
result_expected=`cat $file_localconf_expected`
|
||||
assert_equal "$result" "$result_expected"
|
||||
rm -f $file_localconf $file_localconf_expected $file_conf1 $file_conf2
|
||||
}
|
||||
|
||||
# test that add option in specified meta-section and section
|
||||
function test_localconf_add_option {
|
||||
local file_localconf
|
||||
local file_localconf_expected
|
||||
local file_conf1
|
||||
local file_conf2
|
||||
file_localconf=`mktemp`
|
||||
file_localconf_expected=`mktemp`
|
||||
file_conf1=`mktemp`
|
||||
file_conf2=`mktemp`
|
||||
cat <<- EOF > $file_localconf
|
||||
[[post-config|$file_conf1]]
|
||||
[conf1_t1]
|
||||
conf1_t1_opt1=conf1_t1_val1
|
||||
conf1_t1_opt2=conf1_t1_val2
|
||||
conf1_t1_opt3=conf1_t1_val3
|
||||
[conf1_t2]
|
||||
conf1_t2_opt1=conf1_t2_val1
|
||||
conf1_t2_opt2=conf1_t2_val2
|
||||
conf1_t2_opt3=conf1_t2_val3
|
||||
[conf1_t3]
|
||||
conf1_t3_opt1=conf1_t3_val1
|
||||
conf1_t3_opt2=conf1_t3_val2
|
||||
conf1_t3_opt3=conf1_t3_val3
|
||||
|
||||
[[local|localrc]]
|
||||
LOCALRC_VAR1=localrc_val1
|
||||
LOCALRC_VAR2=localrc_val2
|
||||
LOCALRC_VAR3=localrc_val3
|
||||
|
||||
[[post-extra|$file_conf2]]
|
||||
[conf2_t1]
|
||||
conf2_t1_opt1 = conf2_t1_val1
|
||||
conf2_t1_opt2 = conf2_t1_val2
|
||||
conf2_t1_opt3 = conf2_t1_val3
|
||||
EOF
|
||||
cat <<- EOF > $file_localconf_expected
|
||||
[[post-config|$file_conf1]]
|
||||
[conf1_t1]
|
||||
conf1_t1_opt4 = conf1_t1_val4
|
||||
conf1_t1_opt1=conf1_t1_val1
|
||||
conf1_t1_opt2=conf1_t1_val2
|
||||
conf1_t1_opt3=conf1_t1_val3
|
||||
[conf1_t2]
|
||||
conf1_t2_opt4 = conf1_t2_val4
|
||||
conf1_t2_opt1=conf1_t2_val1
|
||||
conf1_t2_opt2=conf1_t2_val2
|
||||
conf1_t2_opt3=conf1_t2_val3
|
||||
[conf1_t3]
|
||||
conf1_t3_opt4 = conf1_t3_val4
|
||||
conf1_t3_opt1=conf1_t3_val1
|
||||
conf1_t3_opt2=conf1_t3_val2
|
||||
conf1_t3_opt3=conf1_t3_val3
|
||||
|
||||
[[local|localrc]]
|
||||
LOCALRC_VAR4 = localrc_val4
|
||||
LOCALRC_VAR1=localrc_val1
|
||||
LOCALRC_VAR2=localrc_val2
|
||||
LOCALRC_VAR3=localrc_val3
|
||||
|
||||
[[post-extra|$file_conf2]]
|
||||
[conf2_t1]
|
||||
conf2_t1_opt4 = conf2_t1_val4
|
||||
conf2_t1_opt1 = conf2_t1_val1
|
||||
conf2_t1_opt2 = conf2_t1_val2
|
||||
conf2_t1_opt3 = conf2_t1_val3
|
||||
EOF
|
||||
|
||||
localconf_add_option "$SUDO" $file_localconf local localrc "" LOCALRC_VAR4 localrc_val4
|
||||
localconf_add_option "$SUDO" $file_localconf post-config $file_conf1 conf1_t1 conf1_t1_opt4 conf1_t1_val4
|
||||
localconf_add_option "$SUDO" $file_localconf post-config $file_conf1 conf1_t2 conf1_t2_opt4 conf1_t2_val4
|
||||
localconf_add_option "$SUDO" $file_localconf post-config $file_conf1 conf1_t3 conf1_t3_opt4 conf1_t3_val4
|
||||
localconf_add_option "$SUDO" $file_localconf post-extra $file_conf2 conf2_t1 conf2_t1_opt4 conf2_t1_val4
|
||||
result=`cat $file_localconf`
|
||||
result_expected=`cat $file_localconf_expected`
|
||||
assert_equal "$result" "$result_expected"
|
||||
localconf_add_option "$SUDO" $file_localconf local localrc.conf "" LOCALRC_VAR4 localrc_val4_update
|
||||
localconf_add_option "$SUDO" $file_localconf post-config $file_conf1 conf1_t4 conf1_t4_opt1 conf1_t4_val1
|
||||
localconf_add_option "$SUDO" $file_localconf post-extra $file_conf2 conf2_t2 conf2_t2_opt4 conf2_t2_val4
|
||||
localconf_add_option "$SUDO" $file_localconf post-install $file_conf2 conf2_t1 conf2_t1_opt4 conf2_t2_val4
|
||||
result=`cat $file_localconf`
|
||||
result_expected=`cat $file_localconf_expected`
|
||||
assert_equal "$result" "$result_expected"
|
||||
rm -f $file_localconf $file_localconf_expected $file_conf1 $file_conf2
|
||||
}
|
||||
|
||||
# test that add section and option in specified meta-section
|
||||
function test_localconf_add_section_and_option {
|
||||
local file_localconf
|
||||
local file_localconf_expected
|
||||
local file_conf1
|
||||
local file_conf2
|
||||
file_localconf=`mktemp`
|
||||
file_localconf_expected=`mktemp`
|
||||
file_conf1=`mktemp`
|
||||
file_conf2=`mktemp`
|
||||
cat <<- EOF > $file_localconf
|
||||
[[post-config|$file_conf1]]
|
||||
[conf1_t1]
|
||||
conf1_t1_opt1=conf1_t1_val1
|
||||
conf1_t1_opt2=conf1_t1_val2
|
||||
conf1_t1_opt3=conf1_t1_val3
|
||||
[conf1_t2]
|
||||
conf1_t2_opt1=conf1_t2_val1
|
||||
conf1_t2_opt2=conf1_t2_val2
|
||||
conf1_t2_opt3=conf1_t2_val3
|
||||
[conf1_t3]
|
||||
conf1_t3_opt1=conf1_t3_val1
|
||||
conf1_t3_opt2=conf1_t3_val2
|
||||
conf1_t3_opt3=conf1_t3_val3
|
||||
|
||||
[[local|localrc]]
|
||||
LOCALRC_VAR1=localrc_val1
|
||||
LOCALRC_VAR2=localrc_val2
|
||||
LOCALRC_VAR3=localrc_val3
|
||||
|
||||
[[post-extra|$file_conf2]]
|
||||
[conf2_t1]
|
||||
conf2_t1_opt1=conf2_t1_val1
|
||||
conf2_t1_opt2=conf2_t1_val2
|
||||
conf2_t1_opt3=conf2_t1_val3
|
||||
EOF
|
||||
cat <<- EOF > $file_localconf_expected
|
||||
[[post-config|$file_conf1]]
|
||||
[conf1_t4]
|
||||
conf1_t4_opt1 = conf1_t4_val1
|
||||
[conf1_t1]
|
||||
conf1_t1_opt1=conf1_t1_val1
|
||||
conf1_t1_opt2=conf1_t1_val2
|
||||
conf1_t1_opt3=conf1_t1_val3
|
||||
[conf1_t2]
|
||||
conf1_t2_opt1=conf1_t2_val1
|
||||
conf1_t2_opt2=conf1_t2_val2
|
||||
conf1_t2_opt3=conf1_t2_val3
|
||||
[conf1_t3]
|
||||
conf1_t3_opt1=conf1_t3_val1
|
||||
conf1_t3_opt2=conf1_t3_val2
|
||||
conf1_t3_opt3=conf1_t3_val3
|
||||
|
||||
[[local|localrc]]
|
||||
LOCALRC_VAR1=localrc_val1
|
||||
LOCALRC_VAR2=localrc_val2
|
||||
LOCALRC_VAR3=localrc_val3
|
||||
|
||||
[[post-extra|$file_conf2]]
|
||||
[conf2_t2]
|
||||
conf2_t2_opt1 = conf2_t2_val1
|
||||
[conf2_t1]
|
||||
conf2_t1_opt1=conf2_t1_val1
|
||||
conf2_t1_opt2=conf2_t1_val2
|
||||
conf2_t1_opt3=conf2_t1_val3
|
||||
EOF
|
||||
|
||||
localconf_add_section_and_option "$SUDO" $file_localconf post-config $file_conf1 conf1_t4 conf1_t4_opt1 conf1_t4_val1
|
||||
localconf_add_section_and_option "$SUDO" $file_localconf post-extra $file_conf2 conf2_t2 conf2_t2_opt1 conf2_t2_val1
|
||||
result=`cat $file_localconf`
|
||||
result_expected=`cat $file_localconf_expected`
|
||||
assert_equal "$result" "$result_expected"
|
||||
localconf_add_section_and_option "$SUDO" $file_localconf post-install $file_conf2 conf2_t2 conf2_t2_opt1 conf2_t2_val1
|
||||
result=`cat $file_localconf`
|
||||
result_expected=`cat $file_localconf_expected`
|
||||
assert_equal "$result" "$result_expected"
|
||||
rm -f $file_localconf $file_localconf_expected $file_conf1 $file_conf2
|
||||
}
|
||||
|
||||
# test that add section and option in specified meta-section
|
||||
function test_localconf_set {
|
||||
local file_localconf
|
||||
local file_localconf_expected
|
||||
local file_conf1
|
||||
local file_conf2
|
||||
file_localconf=`mktemp`
|
||||
file_localconf_expected=`mktemp`
|
||||
file_conf1=`mktemp`
|
||||
file_conf2=`mktemp`
|
||||
cat <<- EOF > $file_localconf
|
||||
[[local|localrc]]
|
||||
LOCALRC_VAR1=localrc_val1
|
||||
LOCALRC_VAR2=localrc_val2
|
||||
LOCALRC_VAR3=localrc_val3
|
||||
|
||||
[[post-config|$file_conf1]]
|
||||
[conf1_t1]
|
||||
conf1_t1_opt1=conf1_t1_val1
|
||||
conf1_t1_opt2=conf1_t1_val2
|
||||
conf1_t1_opt3=conf1_t1_val3
|
||||
[conf1_t2]
|
||||
conf1_t2_opt1=conf1_t2_val1
|
||||
conf1_t2_opt2=conf1_t2_val2
|
||||
conf1_t2_opt3=conf1_t2_val3
|
||||
[conf1_t3]
|
||||
conf1_t3_opt1=conf1_t3_val1
|
||||
conf1_t3_opt2=conf1_t3_val2
|
||||
conf1_t3_opt3=conf1_t3_val3
|
||||
|
||||
[[post-extra|$file_conf2]]
|
||||
[conf2_t1]
|
||||
conf2_t1_opt1=conf2_t1_val1
|
||||
conf2_t1_opt2=conf2_t1_val2
|
||||
conf2_t1_opt3=conf2_t1_val3
|
||||
EOF
|
||||
cat <<- EOF > $file_localconf_expected
|
||||
[[local|localrc]]
|
||||
LOCALRC_VAR1=localrc_val1
|
||||
LOCALRC_VAR2=localrc_val2_update
|
||||
LOCALRC_VAR3=localrc_val3
|
||||
|
||||
[[post-config|$file_conf1]]
|
||||
[conf1_t4]
|
||||
conf1_t4_opt1 = conf1_t4_val1
|
||||
[conf1_t1]
|
||||
conf1_t1_opt1=conf1_t1_val1
|
||||
conf1_t1_opt2=conf1_t1_val2
|
||||
conf1_t1_opt3=conf1_t1_val3
|
||||
[conf1_t2]
|
||||
conf1_t2_opt1=conf1_t2_val1
|
||||
conf1_t2_opt2=conf1_t2_val2
|
||||
conf1_t2_opt3=conf1_t2_val3
|
||||
[conf1_t3]
|
||||
conf1_t3_opt1=conf1_t3_val1
|
||||
conf1_t3_opt2=conf1_t3_val2
|
||||
conf1_t3_opt3=conf1_t3_val3
|
||||
|
||||
[[post-extra|$file_conf2]]
|
||||
[conf2_t1]
|
||||
conf2_t1_opt4 = conf2_t1_val4
|
||||
conf2_t1_opt1=conf2_t1_val1
|
||||
conf2_t1_opt2=conf2_t1_val2
|
||||
conf2_t1_opt3=conf2_t1_val3
|
||||
|
||||
[[post-install|/etc/neutron/plugin/ml2/ml2_conf.ini]]
|
||||
[ml2]
|
||||
ml2_opt1 = ml2_val1
|
||||
EOF
|
||||
|
||||
if [[ -n "$SUDO" ]]; then
|
||||
SUDO_ARG="-sudo"
|
||||
else
|
||||
SUDO_ARG=""
|
||||
fi
|
||||
localconf_set $SUDO_ARG $file_localconf post-install /etc/neutron/plugin/ml2/ml2_conf.ini ml2 ml2_opt1 ml2_val1
|
||||
localconf_set $SUDO_ARG $file_localconf local localrc "" LOCALRC_VAR2 localrc_val2_update
|
||||
localconf_set $SUDO_ARG $file_localconf post-config $file_conf1 conf1_t4 conf1_t4_opt1 conf1_t4_val1
|
||||
localconf_set $SUDO_ARG $file_localconf post-extra $file_conf2 conf2_t1 conf2_t1_opt4 conf2_t1_val4
|
||||
result=`cat $file_localconf`
|
||||
result_expected=`cat $file_localconf_expected`
|
||||
assert_equal "$result" "$result_expected"
|
||||
rm -f $file_localconf $file_localconf_expected $file_conf1 $file_conf2
|
||||
}
|
||||
|
||||
|
||||
test_localconf_has_section
|
||||
test_localconf_has_option
|
||||
test_localconf_update_option
|
||||
test_localconf_add_option
|
||||
test_localconf_add_section_and_option
|
||||
test_localconf_set
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
|
||||
echo "Ensuring we don't have crazy refs"
|
||||
|
||||
REFS=`grep BRANCH stackrc | grep -v -- '-master'`
|
||||
REFS=`grep BRANCH stackrc | grep -v -- '-master' | grep -v -- '-stable/liberty'`
|
||||
rc=$?
|
||||
if [[ $rc -eq 0 ]]; then
|
||||
echo "Branch defaults must be master. Found:"
|
||||
|
||||
Executable
+47
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Tests for DevStack vercmp functionality
|
||||
|
||||
TOP=$(cd $(dirname "$0")/.. && pwd)
|
||||
|
||||
# Import common functions
|
||||
source $TOP/functions
|
||||
source $TOP/tests/unittest.sh
|
||||
|
||||
assert_true "numeric gt" vercmp 2.0 ">" 1.0
|
||||
assert_true "numeric gte" vercmp 2.0 ">=" 1.0
|
||||
assert_true "numeric gt" vercmp 1.0.1 ">" 1.0
|
||||
assert_true "numeric gte" vercmp 1.0.1 ">=" 1.0
|
||||
assert_true "alpha gt" vercmp 1.0.1b ">" 1.0.1a
|
||||
assert_true "alpha gte" vercmp 1.0.1b ">=" 1.0.1a
|
||||
assert_true "alpha gt" vercmp b ">" a
|
||||
assert_true "alpha gte" vercmp b ">=" a
|
||||
assert_true "alpha gt" vercmp 2.0-rc3 ">" 2.0-rc1
|
||||
assert_true "alpha gte" vercmp 2.0-rc3 ">=" 2.0-rc1
|
||||
|
||||
assert_false "numeric gt fail" vercmp 1.0 ">" 1.0
|
||||
assert_true "numeric gte" vercmp 1.0 ">=" 1.0
|
||||
assert_false "numeric gt fail" vercmp 0.9 ">" 1.0
|
||||
assert_false "numeric gte fail" vercmp 0.9 ">=" 1.0
|
||||
assert_false "numeric gt fail" vercmp 0.9.9 ">" 1.0
|
||||
assert_false "numeric gte fail" vercmp 0.9.9 ">=" 1.0
|
||||
assert_false "numeric gt fail" vercmp 0.9a.9 ">" 1.0.1
|
||||
assert_false "numeric gte fail" vercmp 0.9a.9 ">=" 1.0.1
|
||||
|
||||
assert_false "numeric lt" vercmp 1.0 "<" 1.0
|
||||
assert_true "numeric lte" vercmp 1.0 "<=" 1.0
|
||||
assert_true "numeric lt" vercmp 1.0 "<" 1.0.1
|
||||
assert_true "numeric lte" vercmp 1.0 "<=" 1.0.1
|
||||
assert_true "alpha lt" vercmp 1.0.1a "<" 1.0.1b
|
||||
assert_true "alpha lte" vercmp 1.0.1a "<=" 1.0.1b
|
||||
assert_true "alpha lt" vercmp a "<" b
|
||||
assert_true "alpha lte" vercmp a "<=" b
|
||||
assert_true "alpha lt" vercmp 2.0-rc1 "<" 2.0-rc3
|
||||
assert_true "alpha lte" vercmp 2.0-rc1 "<=" 2.0-rc3
|
||||
|
||||
assert_true "eq" vercmp 1.0 "==" 1.0
|
||||
assert_true "eq" vercmp 1.0.1 "==" 1.0.1
|
||||
assert_false "eq fail" vercmp 1.0.1 "==" 1.0.2
|
||||
assert_false "eq fail" vercmp 2.0-rc1 "==" 2.0-rc2
|
||||
|
||||
report_results
|
||||
@@ -84,6 +84,51 @@ function assert_empty {
|
||||
fi
|
||||
}
|
||||
|
||||
# assert the arguments evaluate to true
|
||||
# assert_true "message" arg1 arg2
|
||||
function assert_true {
|
||||
local lineno
|
||||
lineno=`caller 0 | awk '{print $1}'`
|
||||
local function
|
||||
function=`caller 0 | awk '{print $2}'`
|
||||
local msg=$1
|
||||
shift
|
||||
|
||||
$@
|
||||
if [ $? -eq 0 ]; then
|
||||
PASS=$((PASS+1))
|
||||
echo "PASS: $function:L$lineno - $msg"
|
||||
else
|
||||
FAILED_FUNCS+="$function:L$lineno\n"
|
||||
echo "ERROR: test failed in $function:L$lineno!"
|
||||
echo " $msg"
|
||||
ERROR=$((ERROR+1))
|
||||
fi
|
||||
}
|
||||
|
||||
# assert the arguments evaluate to false
|
||||
# assert_false "message" arg1 arg2
|
||||
function assert_false {
|
||||
local lineno
|
||||
lineno=`caller 0 | awk '{print $1}'`
|
||||
local function
|
||||
function=`caller 0 | awk '{print $2}'`
|
||||
local msg=$1
|
||||
shift
|
||||
|
||||
$@
|
||||
if [ $? -eq 0 ]; then
|
||||
FAILED_FUNCS+="$function:L$lineno\n"
|
||||
echo "ERROR: test failed in $function:L$lineno!"
|
||||
echo " $msg"
|
||||
ERROR=$((ERROR+1))
|
||||
else
|
||||
PASS=$((PASS+1))
|
||||
echo "PASS: $function:L$lineno - $msg"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# print a summary of passing and failing tests, exiting
|
||||
# with an error if we have failed tests
|
||||
# usage: report_results
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# **tools/build_wheels.sh** - Build a cache of Python wheels
|
||||
#
|
||||
# build_wheels.sh [package [...]]
|
||||
#
|
||||
# System package prerequisites listed in ``files/*/devlibs`` will be installed
|
||||
#
|
||||
# Builds wheels for all virtual env requirements listed in
|
||||
# ``venv-requirements.txt`` plus any supplied on the command line.
|
||||
#
|
||||
# Assumes:
|
||||
# - ``tools/install_pip.sh`` has been run and a suitable ``pip/setuptools`` is available.
|
||||
|
||||
# If ``TOP_DIR`` is set we're being sourced rather than running stand-alone
|
||||
# or in a sub-shell
|
||||
if [[ -z "$TOP_DIR" ]]; then
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
|
||||
# Keep track of the DevStack directory
|
||||
TOP_DIR=$(cd $(dirname "$0")/.. && pwd)
|
||||
FILES=$TOP_DIR/files
|
||||
|
||||
# Import common functions
|
||||
source $TOP_DIR/functions
|
||||
|
||||
GetDistro
|
||||
|
||||
source $TOP_DIR/stackrc
|
||||
|
||||
trap err_trap ERR
|
||||
|
||||
fi
|
||||
|
||||
# Get additional packages to build
|
||||
MORE_PACKAGES="$@"
|
||||
|
||||
# Exit on any errors so that errors don't compound
|
||||
function err_trap {
|
||||
local r=$?
|
||||
set +o xtrace
|
||||
|
||||
rm -rf $TMP_VENV_PATH
|
||||
|
||||
exit $r
|
||||
}
|
||||
|
||||
# Get system prereqs
|
||||
install_package $(get_packages devlibs)
|
||||
|
||||
# Get a modern ``virtualenv``
|
||||
pip_install virtualenv
|
||||
|
||||
# Prepare the workspace
|
||||
TMP_VENV_PATH=$(mktemp -d tmp-venv-XXXX)
|
||||
virtualenv $TMP_VENV_PATH
|
||||
|
||||
# Install modern pip and wheel
|
||||
PIP_VIRTUAL_ENV=$TMP_VENV_PATH pip_install -U pip wheel
|
||||
|
||||
# BUG: cffi has a lot of issues. It has no stable ABI, if installed
|
||||
# code is built with a different ABI than the one that's detected at
|
||||
# load time, it tries to compile on the fly for the new ABI in the
|
||||
# install location (which will probably be /usr and not
|
||||
# writable). Also cffi is often included via setup_requires by
|
||||
# packages, which have different install rules (allowing betas) than
|
||||
# pip has.
|
||||
#
|
||||
# Because of this we must pip install cffi into the venv to build
|
||||
# wheels.
|
||||
PIP_VIRTUAL_ENV=$TMP_VENV_PATH pip_install_gr cffi
|
||||
|
||||
# ``VENV_PACKAGES`` is a list of packages we want to pre-install
|
||||
VENV_PACKAGE_FILE=$FILES/venv-requirements.txt
|
||||
if [[ -r $VENV_PACKAGE_FILE ]]; then
|
||||
VENV_PACKAGES=$(grep -v '^#' $VENV_PACKAGE_FILE)
|
||||
fi
|
||||
|
||||
for pkg in ${VENV_PACKAGES,/ } ${MORE_PACKAGES}; do
|
||||
$TMP_VENV_PATH/bin/pip wheel $pkg
|
||||
done
|
||||
|
||||
# Clean up wheel workspace
|
||||
rm -rf $TMP_VENV_PATH
|
||||
@@ -0,0 +1 @@
|
||||
pip<8
|
||||
@@ -30,7 +30,8 @@ def update_cpu_map(tree):
|
||||
x86 = arch
|
||||
break
|
||||
if x86 is not None:
|
||||
# Create a gate64 cpu model that is core2duo less monitor and pse36
|
||||
# Create a gate64 cpu model that is core2duo less monitor, pse36,
|
||||
# vme, and ssse3.
|
||||
gate64 = ET.SubElement(x86, "model")
|
||||
gate64.set("name", "gate64")
|
||||
ET.SubElement(gate64, "vendor").set("name", "Intel")
|
||||
@@ -51,13 +52,11 @@ def update_cpu_map(tree):
|
||||
ET.SubElement(gate64, "feature").set("name", "fxsr")
|
||||
ET.SubElement(gate64, "feature").set("name", "sse")
|
||||
ET.SubElement(gate64, "feature").set("name", "sse2")
|
||||
ET.SubElement(gate64, "feature").set("name", "vme")
|
||||
ET.SubElement(gate64, "feature").set("name", "mtrr")
|
||||
ET.SubElement(gate64, "feature").set("name", "mca")
|
||||
ET.SubElement(gate64, "feature").set("name", "clflush")
|
||||
ET.SubElement(gate64, "feature").set("name", "pni")
|
||||
ET.SubElement(gate64, "feature").set("name", "nx")
|
||||
ET.SubElement(gate64, "feature").set("name", "ssse3")
|
||||
ET.SubElement(gate64, "feature").set("name", "syscall")
|
||||
ET.SubElement(gate64, "feature").set("name", "lm")
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ if is_fedora; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$os_RELEASE" -ge "21" ]]; then
|
||||
if [[ "$os_VENDOR" == "Fedora" ]] && [[ "$os_RELEASE" -ge "21" ]]; then
|
||||
# requests ships vendored version of chardet/urllib3, but on
|
||||
# fedora these are symlinked back to the primary versions to
|
||||
# avoid duplication of code on disk. This is fine when
|
||||
@@ -152,9 +152,9 @@ if is_fedora; then
|
||||
# https://bugs.launchpad.net/glance/+bug/1476770
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1253823
|
||||
|
||||
base_path=/usr/lib/python2.7/site-packages/requests/packages
|
||||
base_path=$(get_package_path requests)/packages
|
||||
if [ -L $base_path/chardet -o -L $base_path/urllib3 ]; then
|
||||
sudo rm -f /usr/lib/python2.7/site-packages/requests/packages/{chardet,urllib3}
|
||||
sudo rm -f $base_path/{chardet,urllib3}
|
||||
# install requests with the bundled urllib3 to avoid conflicts
|
||||
pip_install --upgrade --force-reinstall requests
|
||||
fi
|
||||
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash -eu
|
||||
#
|
||||
# Copyright 2015 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 replaces the ebtables on your system with a wrapper script that
|
||||
# does implicit locking. This is needed if libvirt < 1.2.11 on your platform.
|
||||
|
||||
EBTABLES=/sbin/ebtables
|
||||
EBTABLESREAL=/sbin/ebtables.real
|
||||
FILES=$TOP_DIR/files
|
||||
|
||||
if [[ -f "$EBTABLES" ]]; then
|
||||
if file $EBTABLES | grep ELF; then
|
||||
sudo mv $EBTABLES $EBTABLESREAL
|
||||
sudo install -m 0755 $FILES/ebtables.workaround $EBTABLES
|
||||
echo "Replaced ebtables with locking workaround"
|
||||
fi
|
||||
fi
|
||||
@@ -58,7 +58,7 @@ function install_get_pip {
|
||||
die $LINENO "Download of get-pip.py failed"
|
||||
touch $LOCAL_PIP.downloaded
|
||||
fi
|
||||
sudo -H -E python $LOCAL_PIP
|
||||
sudo -H -E python $LOCAL_PIP -c $TOOLS_DIR/cap-pip.txt
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ export_proxy_variables
|
||||
# ================
|
||||
|
||||
# Install package requirements
|
||||
PACKAGES=$(get_packages general $ENABLED_SERVICES)
|
||||
PACKAGES=$(get_packages general,$ENABLED_SERVICES)
|
||||
PACKAGES="$PACKAGES $(get_plugin_packages)"
|
||||
|
||||
if is_ubuntu && echo $PACKAGES | grep -q dkms ; then
|
||||
|
||||
@@ -8,23 +8,25 @@ usedevelop = False
|
||||
install_command = pip install {opts} {packages}
|
||||
|
||||
[testenv:bashate]
|
||||
deps = bashate
|
||||
deps =
|
||||
{env:BASHATE_INSTALL_PATH:bashate==0.3.1}
|
||||
whitelist_externals = bash
|
||||
commands = bash -c "find {toxinidir} \
|
||||
-not \( -type d -name .?\* -prune \) \ # prune all 'dot' dirs
|
||||
-not \( -type d -name doc -prune \) \ # skip documentation
|
||||
-not \( -type d -name shocco -prune \) \ # skip shocco
|
||||
-type f \ # only files
|
||||
-not -name \*~ \ # skip editors, readme, etc
|
||||
-not \( -type d -name .?\* -prune \) \
|
||||
-not \( -type d -name doc -prune \) \
|
||||
-not \( -type d -name shocco -prune \) \
|
||||
-type f \
|
||||
-not -name \*~ \
|
||||
-not -name \*.md \
|
||||
\( \
|
||||
-name \*.sh -or \
|
||||
-name \*.orig -or \
|
||||
-name \*rc -or \
|
||||
-name functions\* -or \
|
||||
-wholename \*/inc/\* -or \ # /inc files and
|
||||
-wholename \*/lib/\* \ # /lib files are shell, but
|
||||
\) \ # have no extension
|
||||
-print0 | xargs -0 bashate -v"
|
||||
-wholename \*/inc/\* -or \
|
||||
-wholename \*/lib/\* \
|
||||
\) \
|
||||
-print0 | xargs -0 bashate -v -iE006"
|
||||
|
||||
[testenv:docs]
|
||||
deps =
|
||||
|
||||
Reference in New Issue
Block a user