Files
group-based-policy/gbpservice/tests/contrib/gate_hook.sh
Sumit Naiksatam 84939e8228 Adding GBP integration and functional gate
This patch implements the hooks so that functional and integration
tests can be run in the group-based-policy repo.

Currently, the configured devstack for this job is enabled to run GBP
exercise scripts, which result in complete end-to-end integration
testing of the GBP service and client components along with integration
with Neutron and Nova.

A placeholder functional test case is also added. A functional test suite
will be added in a separate commit.

Change-Id: Id705e5755b9662f6e297f29836d6983d66f845a8
2015-03-28 12:36:53 -07:00

50 lines
1.6 KiB
Bash

#!/bin/bash
set -ex
TOP_DIR=$BASE/new/devstack
cd $TOP_DIR
sudo git remote add group-policy http://github.com/group-policy/devstack
sudo git fetch group-policy
sudo git checkout -t group-policy/kilo-gate
#sudo cp devstack-vm-gate.sh $BASE/new/devstack-gate/devstack-vm-gate.sh
CONTRIB_DIR="$BASE/new/group-based-policy/gbpservice/tests/contrib"
#$BASE/new/devstack-gate/devstack-vm-gate.sh
source $TOP_DIR/functions
source $TOP_DIR/functions-common
sudo pip install httplib2
install_package openvswitch-switch
pip_install -e /opt/stack/new/group-based-policy
$TOP_DIR/stack.sh
# Add a rootwrap filter to support test-only
# configuration (e.g. a KillFilter for processes that
# use the python installed in a tox env).
FUNC_FILTER=$CONTRIB_DIR/filters.template
sed -e "s+\$BASE_PATH+$BASE/new/group-based-policy/.tox/dsvm-functional+" \
$FUNC_FILTER | sudo tee /etc/neutron/rootwrap.d/functional.filters > /dev/null
# Use devstack functions to install mysql and psql servers
source $TOP_DIR/lib/config
source $TOP_DIR/stackrc
source $TOP_DIR/lib/database
disable_service postgresql
enable_service mysql
initialize_database_backends
install_database
# Set up the 'openstack_citest' user and database in each backend
tmp_dir=`mktemp -d`
cat << EOF > $tmp_dir/mysql.sql
CREATE DATABASE openstack_citest;
CREATE USER 'openstack_citest'@'localhost' IDENTIFIED BY 'openstack_citest';
CREATE USER 'openstack_citest' IDENTIFIED BY 'openstack_citest';
GRANT ALL PRIVILEGES ON *.* TO 'openstack_citest'@'localhost';
GRANT ALL PRIVILEGES ON *.* TO 'openstack_citest';
FLUSH PRIVILEGES;
EOF
/usr/bin/mysql -u root < $tmp_dir/mysql.sql