d92247b853cddc6788d138208630464ac47ea517
[openstack-build/neutron-build.git] / neutron / tests / contrib / gate_hook.sh
1 #!/usr/bin/env bash
2
3 set -ex
4
5 VENV=${1:-"dsvm-functional"}
6
7 GATE_DEST=$BASE/new
8 DEVSTACK_PATH=$GATE_DEST/devstack
9
10 if [ "$VENV" == "dsvm-functional" ] || [ "$VENV" == "dsvm-fullstack" ]
11 then
12     # The following need to be set before sourcing
13     # configure_for_func_testing.
14     GATE_STACK_USER=stack
15     NEUTRON_PATH=$GATE_DEST/neutron
16     PROJECT_NAME=neutron
17     IS_GATE=True
18
19     source $NEUTRON_PATH/tools/configure_for_func_testing.sh
20
21     # Make the workspace owned by the stack user
22     sudo chown -R $STACK_USER:$STACK_USER $BASE
23
24     configure_host_for_func_testing
25 elif [ "$VENV" == "api" ]
26 then
27     cat > $DEVSTACK_PATH/local.conf <<EOF
28 [[post-config|/etc/neutron/neutron_vpnaas.conf]]
29
30 [service_providers]
31 service_provider=VPN:openswan:neutron_vpnaas.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default
32
33 EOF
34
35     export DEVSTACK_LOCAL_CONFIG+="
36 enable_plugin neutron-vpnaas git://git.openstack.org/openstack/neutron-vpnaas
37 enable_plugin neutron git://git.openstack.org/openstack/neutron
38 enable_service q-qos
39 "
40
41     $BASE/new/devstack-gate/devstack-vm-gate.sh
42 fi