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"
59 # Enable ODL debug logs and set memory parameters
60 DEVSTACK_LOCAL_CONFIG=""
61 DEVSTACK_LOCAL_CONFIG+="ODL_NETVIRT_DEBUG_LOGS=True;"
62 DEVSTACK_LOCAL_CONFIG+="ODL_JAVA_MIN_MEM=512m;"
63 DEVSTACK_LOCAL_CONFIG+="ODL_JAVA_MAX_MEM=784m;"
64 DEVSTACK_LOCAL_CONFIG+="ODL_JAVA_MAX_PERM_MEM=784m;"
66 # Set ODL_URL_PREFIX if "nexus proxy" is provided
67 if [ -n "$ODLNEXUSPROXY" ] ; then
68 DEVSTACK_LOCAL_CONFIG+="ODL_URL_PREFIX=$ODLNEXUSPROXY;"
71 ## # Trim down the boot wait time
72 ## export ODL_BOOT_WAIT=30
74 # And this runs devstack-gate
75 export PYTHONUNBUFFERED=true
76 export DEVSTACK_GATE_TIMEOUT=120
77 export DEVSTACK_GATE_NEUTRON=1
78 export DEVSTACK_GATE_TEMPEST=1
79 export BRANCH_OVERRIDE=master
80 if [ "$BRANCH_OVERRIDE" != "default" ] ; then
81 export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
83 # Because we are testing a non standard project, add
84 # our project repository. This makes zuul do the right
85 # reference magic for testing changes.
86 export PROJECTS="stackforge/networking-odl $PROJECTS"
87 # Note the actual url here is somewhat irrelevant because it
88 # caches in nodepool, however make it a valid url for
89 # documentation purposes.
90 if [ "$GERRIT_PROJECT" == "stackforge/networking-odl" ]; then
91 export DEVSTACK_LOCAL_CONFIG+="enable_plugin networking-odl https://$GERRIT_HOST/$GERRIT_PROJECT $GERRIT_REFSPEC"
93 export DEVSTACK_LOCAL_CONFIG+="enable_plugin networking-odl https://git.openstack.org/stackforge/networking-odl"
97 # Keep localrc to be able to set some vars in pre_test_hook
100 # Unset this because it's set by the underlying Jenkins node ...
103 # Only run certain tempest tests
104 export DEVSTACK_GATE_TEMPEST_REGEX="tempest.api.network.test_networks_negative tempest.api.network.test_networks.NetworksTestJSON"
106 # Specifically set the services we want
107 #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
109 echo "Copying devstack-vm-gate-wrap.sh"
110 cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh
111 echo "Running safe-devstack-vm-gate-wrap.sh"
112 ./safe-devstack-vm-gate-wrap.sh
113 # Save the return value so we can exit with this
117 OS_WORKSPACE=$WORKSPACE
118 export WORKSPACE=$SAVED_WORKSPACE
121 cp -r $OS_WORKSPACE/logs $WORKSPACE
122 cp -a /opt/stack/new/logs/q-odl-karaf* $WORKSPACE/logs
123 mkdir -p $WORKSPACE/logs/opendaylight
124 cp -a /opt/stack/new/opendaylight/distribution*/etc $WORKSPACE/logs/opendaylight
125 # Unzip the logs to make them easier to view
126 gunzip $WORKSPACE/logs/*.gz