Merge "CI: move the libvirt storage pool to /opt"

This commit is contained in:
Zuul 2020-05-29 08:20:53 +00:00 committed by Gerrit Code Review
commit 7030161d7d

View File

@ -12,7 +12,6 @@ BUILD_IMAGE="${BUILD_IMAGE:-false}"
BAREMETAL_DATA_FILE=${BAREMETAL_DATA_FILE:-'/tmp/baremetal.json'}
ENABLE_KEYSTONE="${ENABLE_KEYSTONE:-false}"
ZUUL_BRANCH=${ZUUL_BRANCH:-}
ZUUL_REF=${ZUUL_REF:-}
# Set defaults for ansible command-line options to drive the different
# tests.
@ -46,42 +45,10 @@ CLOUD_CONFIG=""
WAIT_FOR_DEPLOY=true
ENABLE_VENV=true
# This sets up the MySQL database like it's done for all OpenStack
# projects for CI testing.
mysql_setup() {
# The root password for the MySQL database; pass it in via
# MYSQL_ROOT_PW.
local DB_ROOT_PW=${MYSQL_ROOT_PW:-insecure_slave}
# This user and its password are used by the tests, if you change it,
# your tests might fail.
local DB_USER=openstack_citest
local DB_PW=openstack_citest
# Make sure MySQL is running
sudo service mysql start || sudo service mysqld start || sudo service mariadb start
sudo -H mysqladmin -u root password $DB_ROOT_PW
# It's best practice to remove anonymous users from the database. If
# an anonymous user exists, then it matches first for connections and
# other connections from that host will not work.
sudo -H mysql -u root -p$DB_ROOT_PW -h localhost -e "
DELETE FROM mysql.user WHERE User='';
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.*
TO '$DB_USER'@'%' identified by '$DB_PW' WITH GRANT OPTION;"
# Now create our database.
mysql -u $DB_USER -p$DB_PW -h 127.0.0.1 -e "
SET default_storage_engine=MYISAM;
DROP DATABASE IF EXISTS openstack_citest;
CREATE DATABASE openstack_citest CHARACTER SET utf8;"
}
# Setup openstack_ci test database if run in OpenStack CI.
if [ "$ZUUL_BRANCH" != "" -a "$ZUUL_REF" ]; then
mysql_setup
if [ "$ZUUL_BRANCH" != "" ]; then
sudo mkdir -p /opt/libvirt/images
VM_SETUP_EXTRA="-e test_vm_storage_pool_path=/opt/libvirt/images"
fi
if [ ${USE_VENV} = "true" ]; then
@ -156,7 +123,8 @@ ${ANSIBLE} -vvvv \
-e test_vm_disk_gib=${VM_DISK:-10} \
-e baremetal_json_file=${BAREMETAL_DATA_FILE} \
-e enable_venv=${ENABLE_VENV} \
-e bifrost_venv_dir=${VENV}
-e bifrost_venv_dir=${VENV} \
${VM_SETUP_EXTRA:-}
if [ ${USE_DHCP} = "true" ]; then
# reduce the number of nodes in JSON file