3 export PATH=$PATH:/bin:/sbin:/usr/sbin
4 export DEVSTACKDIR=$WORKSPACE/$BUILD_TAG
8 cat <<EOL > firewall.sh
9 sudo iptables -I INPUT -p tcp --dport 5672 -j ACCEPT
10 sudo iptables -I INPUT -p tcp --dport 80 -j ACCEPT
11 sudo iptables -I INPUT -p tcp --dport 9292 -j ACCEPT
12 sudo iptables -I INPUT -p tcp --dport 9696 -j ACCEPT
13 sudo iptables -I INPUT -p tcp --dport 35357 -j ACCEPT
14 sudo iptables -I INPUT -p tcp --dport 6080 -j ACCEPT
15 sudo iptables -I INPUT -p tcp --dport 8773 -j ACCEPT
16 sudo iptables -I INPUT -p udp --dport 8472 -j ACCEPT
17 sudo iptables -I INPUT -p udp --dport 4789 -j ACCEPT
20 sudo iptables -I INPUT -p tcp --dport 5000 -j ACCEPT
21 sudo iptables -I INPUT -p tcp --dport 8774 -j ACCEPT
24 sudo iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
29 cat $DEVSTACKDIR/firewall.sh
30 $DEVSTACKDIR/firewall.sh
32 # FIXME: update version of pip being used here
33 curl -O https://pypi.python.org/packages/source/p/pip/pip-6.0.8.tar.gz
34 tar xvfz pip-6.0.8.tar.gz
36 sudo -E python setup.py install
37 sudo pip install testtools
39 sudo mkdir -p /opt/stack
40 sudo chown $(whoami) /opt/stack
41 sudo chmod 755 /opt/stack
45 # https://bugs.launchpad.net/devstack/+bug/1276297
46 sudo rm -rf /usr/lib/python2.7/site-packages/oslo*
48 # Workaround for "keystone not found" issues
49 sudo rm -rf /usr/lib/python2.7/site-packages/*client*
51 # Make sure keystonemiddleware is up to date
52 sudo pip install --upgrade keystonemiddleware
54 # Workaround: Pull neutron first
56 git clone -q git://git.openstack.org/openstack/neutron.git
58 sudo python ./setup.py -q install
62 sudo yum -y install qemu libvirt-daemon
63 git clone https://github.com/openstack-dev/devstack.git
67 # Specify changeset being worked on if it's networking-odl
69 if [ "$GERRIT_PROJECT" == "stackforge/networking-odl" ]; then
70 cat <<EOLLC > local.conf
72 enable_plugin networking-odl https://$GERRIT_HOST/$GERRIT_PROJECT $GERRIT_REFSPEC
75 cat <<EOLLC > local.conf
77 enable_plugin networking-odl https://github.com/stackforge/networking-odl
81 cat <<EOLLC >> local.conf
83 SCREEN_LOGDIR=/opt/stack/data/log
88 GIT_BASE=https://git.openstack.org
90 # Only uncomment the below two lines if you are running on Fedora
92 disable_service rabbit
100 enable_service q-meta
101 enable_service quantum
102 enable_service tempest
107 Q_ML2_PLUGIN_MECHANISM_DRIVERS=logger,opendaylight
108 ENABLE_TENANT_TUNNELS=True
111 ODL_NETVIRT_DEBUG_LOGS=True
112 ODL_MGR_IP=$(ip addr | grep inet | grep eth0 | awk -F" " '{print $2}'| sed -e 's/\/.*$//')
113 ODL_ARGS="-Xmx1024m -XX:MaxPermSize=512m"
116 VNCSERVER_LISTEN=0.0.0.0
118 HOST_NAME=$(hostname)
119 SERVICE_HOST_NAME=$(hostname)
120 HOST_IP=$(ip addr | grep inet | grep eth0 | awk -F" " '{print $2}'| sed -e 's/\/.*$//')
121 SERVICE_HOST=$(hostname)
123 MYSQL_HOST=$(hostname)
124 RABBIT_HOST=$(hostname)
125 GLANCE_HOSTPORT=$(hostname):9292
126 KEYSTONE_AUTH_HOST=$(hostname)
127 KEYSTONE_SERVICE_HOST=$(hostname)
130 RABBIT_PASSWORD=rabbit
132 SERVICE_TOKEN=service
133 SERVICE_PASSWORD=admin
137 # Add Neutron specific config if required
138 if [ "$GERRIT_PROJECT" == "openstack/neutron" ]; then
139 cat <<EOLLC >> local.conf
140 NEUTRON_REPO=https://$GERRIT_HOST/$GERRIT_PROJECT
141 NEUTRON_BRANCH=$GERRIT_REFSPEC
148 # Clone the changeset being worked on if it's devstack
150 if [ "$GERRIT_PROJECT" == "openstack-dev/devstack" ]; then
151 git fetch https://$GERRIT_HOST/$GERRIT_PROJECT $GERRIT_REFSPEC && git checkout FETCH_HEAD
157 if [ "$?" != "0" ]; then
158 echo "stack.sh failed"
160 mkdir -p $WORKSPACE/logs/devstack
161 mkdir -p $WORKSPACE/logs/opendaylight
162 cp -r /opt/stack/data/log/* $WORKSPACE/logs/devstack
163 cp -r $DEVSTACKDIR/devstack/stack.sh.log* $WORKSPACE/logs
164 cp -r $DEVSTACKDIR/devstack/local.conf $WORKSPACE/logs
165 cp -r /opt/stack/opendaylight/*/logs $WORKSPACE/logs/opendaylight
166 cp -r /opt/stack/opendaylight/*/data/log $WORKSPACE/logs/opendaylight
167 cp -r /opt/stack/opendaylight/*/etc $WORKSPACE/logs/opendaylight
168 tar cvzf $WORKSPACE/opendaylight-full-logs.tgz $WORKSPACE/logs
173 if [[ -n ${BUILD_ID} ]]; then
174 cd /opt/stack/tempest
176 # put all the info in the following file for processing later
177 log_for_review=odl_tempest_test_list.txt
179 echo "Running tempest tests:" > /tmp/${log_for_review}
180 echo "" >> /tmp/${log_for_review}
181 testr init > /dev/null 2>&1 || true
182 cmd="testr run tempest.api.network.test_networks"
183 echo "opendaylight-test:$ "${cmd} >> /tmp/${log_for_review}
184 ${cmd} >> /tmp/${log_for_review}
185 echo "" >> /tmp/${log_for_review}
186 echo "" >> /tmp/${log_for_review}
188 x=$(grep "id=" /tmp/${log_for_review})
190 z=$(echo ${y} | awk '{print $3}' | sed 's/\,//g')
192 #echo "x ($x) y ($y) z ($z)"
194 echo "List of tempest tests ran (id="${z}"):" >> /tmp/${log_for_review}
195 echo "" >> /tmp/${log_for_review}
197 grep -ri successful .testrepository/${z} | awk '{ gsub(/\[/, "\ "); print $1 " " $2}' >> /tmp/${log_for_review}
202 mkdir -p $WORKSPACE/logs/devstack
203 mkdir -p $WORKSPACE/logs/tempest
204 mkdir -p $WORKSPACE/logs/opendaylight
205 cp -r /opt/stack/tempest/tempest.log* $WORKSPACE/logs/tempest
206 cp -r /opt/stack/data/log/* $WORKSPACE/logs/devstack
207 cp -r /opt/stack/opendaylight/*/logs $WORKSPACE/logs/opendaylight
208 cp -r /opt/stack/opendaylight/*/data/log $WORKSPACE/logs/opendaylight
209 cp -r /opt/stack/opendaylight/*/etc $WORKSPACE/logs/opendaylight
210 cp -r /tmp/${log_for_review} $WORKSPACE/logs
211 cp -r /tmp/${log_for_review} $WORKSPACE
212 cp -r $DEVSTACKDIR/devstack/stack.sh.log* $WORKSPACE/logs
213 cp -r $DEVSTACKDIR/devstack/local.conf $WORKSPACE/logs
214 tar cvzf $WORKSPACE/opendaylight-full-logs.tgz $WORKSPACE/logs