deb-aodh/devstack/gate/gate_hook.sh
Chris Dent e57d5d2aaa Correct database functional tests
The database related functional tests would not work. Several
changes were required to fix them:

* Clean up permissions in function post_test_hook

  Without this tox can't create its .tox directories. We want to be
  running as user stack against a directory owned by user stack.

  We need to check for a directory named 'devstack' not a file in
  order to get the permissions changes to happen.

* Call pg_ctl initdb, not initdb to create the postgresql database.

* Add a DRIVER_MANAGER for mysql+pymysql (without this all mysql
  tests are skipped, even in the unit tests).

* Change get_connection so it doesn't split on + when looking up
  storage extensions, as we do want to use pymysql.

* Make sure AODH_BACKEND is set and exported in gate_hook.sh

* Mysql requires a database exist when we name it in a sql
  create_engine, replace the placeholder with '' when in mysql.

* Move keystonemiddleware config to the correct section of the paste
  file, temporarily.

Change-Id: I001e34e28353a35148e2101ab90cb3d238bd53cb
2015-08-10 17:12:52 +00:00

41 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# This script is executed inside gate_hook function in devstack gate.
ENABLED_SERVICES="key,aodi-api,aodh-notifier,aodh-evaluator"
ENABLED_SERVICES+="ceilometer-acompute,ceilometer-acentral,ceilometer-anotification,"
ENABLED_SERVICES+="ceilometer-collector,ceilometer-api,"
# The backend is passed in by the job as the first and only argument
export AODH_BACKEND="${1}"
export DEVSTACK_GATE_INSTALL_TESTONLY=1
export DEVSTACK_GATE_NO_SERVICES=1
export DEVSTACK_GATE_TEMPEST=0
export DEVSTACK_GATE_EXERCISES=0
export KEEP_LOCALRC=1
# default to mysql
case $AODH_BACKEND in
postgresql)
export DEVSTACK_GATE_POSTGRES=1
;;
esac
DEVSTACK_LOCAL_CONFIG+=$'\n'"export AODH_BACKEND=${AODH_BACKEND}"
export ENABLED_SERVICES
$BASE/new/devstack-gate/devstack-vm-gate.sh