3 # NOTE: This file takes two jobs from the OpenStack infra and
4 # puts them here. See here:
6 # https://github.com/openstack-infra/project-config/blob/master/jenkins/jobs/networking-odl.yaml
8 export PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin
10 # *SIGH*. This is required to get lsb_release
11 sudo yum -y install redhat-lsb-core indent python-testrepository
13 echo "Making /opt/stack/new jenkins:jenkins"
14 sudo /usr/sbin/groupadd jenkins
15 sudo mkdir -p /opt/stack/new
16 sudo chown -R jenkins:jenkins /opt/stack/new
17 sudo bash -c 'echo "stack ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers'
19 # Save existing WORKSPACE
20 SAVED_WORKSPACE=$WORKSPACE
21 export WORKSPACE=~/workspace
25 # This is the job which checks out devstack-gate
26 if [[ ! -e devstack-gate ]]; then
27 echo "Cloning devstack-gate"
28 git clone https://git.openstack.org/openstack-infra/devstack-gate
30 echo "Fixing devstack-gate git remotes"
32 git remote set-url origin https://git.openstack.org/openstack-infra/devstack-gate
35 if ! git clean -x -f ; then
40 git reset --hard remotes/origin/master
41 if ! git clean -x -f ; then
48 # Set the pieces we want to test
49 if [ "$GERRIT_PROJECT" == "openstack/neutron" ]; then
50 ZUUL_PROJECT=$GERRIT_PROJECT
51 ZUUL_BRANCH=$GERRIT_REFSPEC
52 elif [ "$GERRIT_PROJECT" == "openstack-dev/devstack" ]; then
53 ZUUL_PROJECT=$GERRIT_PROJECT
54 ZUUL_BRANCH=$GERRIT_REFSPEC
57 echo "Setting environment variables"
58 # And this runs devstack-gate
59 export PYTHONUNBUFFERED=true
60 export DEVSTACK_GATE_TIMEOUT=120
61 export DEVSTACK_GATE_NEUTRON=1
62 export DEVSTACK_GATE_TEMPEST=1
63 export BRANCH_OVERRIDE=master
64 if [ "$BRANCH_OVERRIDE" != "default" ] ; then
65 export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
67 # Because we are testing a non standard project, add
68 # our project repository. This makes zuul do the right
69 # reference magic for testing changes.
70 export PROJECTS="stackforge/networking-odl $PROJECTS"
71 # Note the actual url here is somewhat irrelevant because it
72 # caches in nodepool, however make it a valid url for
73 # documentation purposes.
74 if [ "$GERRIT_PROJECT" == "stackforge/networking-odl" ]; then
75 export DEVSTACK_LOCAL_CONFIG="enable_plugin networking-odl https://$GERRIT_HOST/$GERRIT_PROJECT $GERRIT_REFSPEC"
77 export DEVSTACK_LOCAL_CONFIG="enable_plugin networking-odl https://git.openstack.org/stackforge/networking-odl"
81 # Keep localrc to be able to set some vars in pre_test_hook
84 # Unset this because it's set by the underlying Jenkins node ...
87 # Only run certain tempest tests
88 export DEVSTACK_GATE_TEMPEST_REGEX="tempest.api.network.test_networks \
89 tempest.api.network.test_networks_negative"
91 # Specifically set the services we want
92 #OVERRIDE_ENABLED_SERVICES=q-svc,q-dhcp,q-l3,q-meta,quantum,key,g-api,g-reg,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch,n-xvnc,n-cauth,h-eng,h-api,h-api-cfn,h-api-cw,rabbit,tempest,mysql
94 # Enable ODL debug logs and set memory parameters
95 export ODL_NETVIRT_DEBUG_LOGS=True
96 export ODL_JAVA_MIN_MEM=512m
97 export ODL_JAVA_MAX_MEM=784m
98 export ODL_JAVA_MAX_PERM_MEM=784m
100 # Trim down the boot wait time
101 export ODL_BOOT_WAIT=30
103 echo "Copying devstack-vm-gate-wrap.sh"
104 cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh
105 echo "Running safe-devstack-vm-gate-wrap.sh"
106 ./safe-devstack-vm-gate-wrap.sh
107 # Save the return value so we can exit with this
111 OS_WORKSPACE=$WORKSPACE
112 export WORKSPACE=$SAVED_WORKSPACE
115 cp -r $OS_WORKSPACE/logs $WORKSPACE
116 cp -a /opt/stack/new/logs/q-odl-karaf* $WORKSPACE/logs
117 mkdir -p $WORKSPACE/logs/opendaylight
118 cp -a /opt/stack/new/opendaylight/distribution*/etc $WORKSPACE/logs/opendaylight
119 # Unzip the logs to make them easier to view
120 gunzip $WORKSPACE/logs/*.gz