blob: 35415f7c7bbf6fff03a3a1ab6cb745d72e0b0d2a [file] [log] [blame]
Andy Bavier99c11d32016-09-14 17:21:20 -04001#!/usr/bin/env bash
2
Sapan Bhatia01ddea62017-02-10 11:28:48 -08003set -e -x
Andy Bavier99c11d32016-09-14 17:21:20 -04004
Zack Williams0620c932017-01-25 14:36:31 -07005CORDDIR=~/cord
Andy Bavier99c11d32016-09-14 17:21:20 -04006VMDIR=/cord/build/
7CONFIG=config/cord_in_a_box.yml
Andy Baviera69ee722016-11-17 07:26:01 -08008SSHCONFIG=~/.ssh/config
Andy Bavier99c11d32016-09-14 17:21:20 -04009
Andy Bavierd1165102017-01-13 16:38:57 -050010# For CORD version
11REPO_BRANCH="master"
12VERSION_STRING="CiaB development version"
13
Sapan Bhatiaa94c2db2017-02-27 20:18:24 +010014function finish {
Sapan Bhatia95692092017-03-01 06:48:19 +010015 EXIT=$?
Sapan Bhatiaeb7819c2017-03-01 15:26:17 +010016 python $CORDDIR/build/elk-logger/mixpanel --event FINISH --corddir $CORDDIR --finish --status $EXIT
Sapan Bhatiaa94c2db2017-02-27 20:18:24 +010017}
18
Andy Bavier0f07bb32017-01-17 10:20:26 -050019function add_box() {
20 vagrant box list | grep $1 | grep virtualbox || vagrant box add $1
21 vagrant box list | grep $1 | grep libvirt || vagrant mutate $1 libvirt --input-provider virtualbox
22}
23
Sapan Bhatia01ddea62017-02-10 11:28:48 -080024function run_stage {
Sapan Bhatiaa94c2db2017-02-27 20:18:24 +010025 cd $CORDDIR
Sapan Bhatiaeb7819c2017-03-01 15:26:17 +010026 python build/elk-logger/mixpanel --event $1-start --corddir $CORDDIR
Sapan Bhatiaa94c2db2017-02-27 20:18:24 +010027
Sapan Bhatia01ddea62017-02-10 11:28:48 -080028 echo "==> "$1": Starting"
29 $1
30 echo "==> "$1": Complete"
Sapan Bhatiaa94c2db2017-02-27 20:18:24 +010031
32 cd $CORDDIR
Sapan Bhatiaeb7819c2017-03-01 15:26:17 +010033 python build/elk-logger/mixpanel --event $1-end --corddir $CORDDIR
Sapan Bhatia01ddea62017-02-10 11:28:48 -080034}
35
Andy Bavier99c11d32016-09-14 17:21:20 -040036function cleanup_from_previous_test() {
Andy Bavier99c11d32016-09-14 17:21:20 -040037 echo "## Cleanup ##"
38
Andy Baviera4883ba2016-12-21 15:46:58 -050039 if [ -d $CORDDIR/build ]
40 then
41 echo "Destroying all Vagrant VMs"
42 cd $CORDDIR/build
Andy Baviere65abba2017-03-09 06:01:52 -050043 for i in `seq 12`; do sudo su $USER -c 'vagrant destroy' && break; done
Andy Baviera4883ba2016-12-21 15:46:58 -050044 fi
Andy Bavier99c11d32016-09-14 17:21:20 -040045
Andy Bavier2505f592016-11-11 15:58:55 -050046 echo "Removing $CORDDIR"
47 cd ~
Andy Bavier99c11d32016-09-14 17:21:20 -040048 rm -rf $CORDDIR
Andy Bavier99c11d32016-09-14 17:21:20 -040049}
50
51function bootstrap() {
Sapan Bhatia95692092017-03-01 06:48:19 +010052 echo "Generating build id"
53 dd bs=18 count=1 if=/dev/urandom | base64 | tr +/ _. > /tmp/cord-build
Andy Bavier99c11d32016-09-14 17:21:20 -040054 cd ~
55 sudo apt-get update
56 [ -e vagrant_1.8.5_x86_64.deb ] || wget https://releases.hashicorp.com/vagrant/1.8.5/vagrant_1.8.5_x86_64.deb
Andy Bavierad3ea842016-12-21 16:19:07 -050057 dpkg -l vagrant || sudo dpkg -i vagrant_1.8.5_x86_64.deb
Sapan Bhatia01ddea62017-02-10 11:28:48 -080058 sudo apt-get -y install qemu-kvm libvirt-bin libvirt-dev curl nfs-kernel-server git build-essential python-pip
Sapan Bhatiaa94c2db2017-02-27 20:18:24 +010059 sudo pip install pyparsing python-logstash mixpanel
Andy Bavier99c11d32016-09-14 17:21:20 -040060
61 [ -e ~/.ssh/id_rsa ] || ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
Andy Bavier99c11d32016-09-14 17:21:20 -040062
Andy Bavier99c11d32016-09-14 17:21:20 -040063 sudo adduser $USER libvirtd
64
65 sudo curl -o /usr/local/bin/repo https://storage.googleapis.com/git-repo-downloads/repo
66 sudo chmod a+x /usr/local/bin/repo
67
68 if [ ! -d "$CORDDIR" ]
69 then
70 mkdir $CORDDIR && cd $CORDDIR
Sapan Bhatia868e0012017-02-15 22:14:11 -080071
Zack Williamsf4e65222017-03-01 14:22:37 -070072
Andy Bavier99c11d32016-09-14 17:21:20 -040073 git config --global user.name 'Test User'
74 git config --global user.email 'test@null.com'
75 git config --global color.ui false
76
Scott Baker0ab86822017-02-01 14:33:40 -080077 repo init -u https://gerrit.opencord.org/manifest -b $REPO_BRANCH -g build,onos,orchestration,voltha
Andy Bavier99c11d32016-09-14 17:21:20 -040078 repo sync
79
Zack Williamsdae7ff62016-11-14 15:20:06 -070080 # check out gerrit branches using repo
81 for gerrit_branch in ${GERRIT_BRANCHES[@]}; do
82 echo "checking out opencord gerrit branch: $gerrit_branch"
83 repo download ${gerrit_branch/:/ }
84 done
Andy Bavier99c11d32016-09-14 17:21:20 -040085 fi
86
Sapan Bhatia868e0012017-02-15 22:14:11 -080087 exec > >(tee -i $CORDDIR/install.out)
88 exec 2>&1
89
Andy Bavier99c11d32016-09-14 17:21:20 -040090 cd $CORDDIR/build
Andy Bavierad3ea842016-12-21 16:19:07 -050091 vagrant plugin list | grep vagrant-libvirt || vagrant plugin install vagrant-libvirt --plugin-version 0.0.35
92 vagrant plugin list | grep vagrant-mutate || vagrant plugin install vagrant-mutate
Andy Bavier0f07bb32017-01-17 10:20:26 -050093 add_box ubuntu/trusty64
Sapan Bhatia95692092017-03-01 06:48:19 +010094
95 # Start tracking failures from this point
96 trap finish EXIT
97
Andy Bavier99c11d32016-09-14 17:21:20 -040098}
99
100function cloudlab_setup() {
Andy Bavier8b4ed1f2017-02-13 17:06:58 -0800101
Andy Bavier46dfda62017-03-02 05:40:08 -0500102 # Don't do anything if not a CloudLab node
103 [ ! -d /usr/local/etc/emulab ] && return
104
Andy Bavier8b4ed1f2017-02-13 17:06:58 -0800105 # The watchdog will sometimes reset groups, turn it off
106 if [ -e /usr/local/etc/emulab/watchdog ]
107 then
108 sudo /usr/bin/perl -w /usr/local/etc/emulab/watchdog stop
109 sudo mv /usr/local/etc/emulab/watchdog /usr/local/etc/emulab/watchdog-disabled
110 fi
111
Zack Williamsf4e65222017-03-01 14:22:37 -0700112 # Mount extra space, if haven't already
113 if [ ! -d /mnt/extra ]
Andy Bavier99c11d32016-09-14 17:21:20 -0400114 then
Zack Williamsf4e65222017-03-01 14:22:37 -0700115 # for NVME SSD on Utah Cloudlab, not supported by mkextrafs
116 if $(df | grep -q nvme0n1p1) && [ -e /usr/testbed/bin/mkextrafs ]
Andy Bavier2505f592016-11-11 15:58:55 -0500117 then
Zack Williamsf4e65222017-03-01 14:22:37 -0700118 sudo mkdir -p /mnt/extra
119
120 # set partition type of 4th partition to Linux, ignore errors
121 echo -e "t\n4\n82\np\nw\nq" | sudo fdisk /dev/nvme0n1 || true
122
123 sudo mkfs.ext4 /dev/nvme0n1p4
124 echo "/dev/nvme0n1p4 /mnt/extra/ ext4 defaults 0 0" | sudo tee -a /etc/fstab
125 sudo mount /mnt/extra
126 mount | grep nvme0n1p4 || (echo "ERROR: NVME mkfs/mount failed, exiting!" && exit 1)
127
128 elif [ -e /usr/testbed/bin/mkextrafs ] # if on Clemson/Wisconsin Cloudlab
129 then
130 sudo mkdir -p /mnt/extra
131
132 # Sometimes this command fails on the first try
133 sudo /usr/testbed/bin/mkextrafs -r /dev/sdb -qf "/mnt/extra/" || sudo /usr/testbed/bin/mkextrafs -r /dev/sdb -qf "/mnt/extra/"
134
135 # Check that the mount succeeded (sometimes mkextrafs succeeds but device not mounted)
136 mount | grep sdb || (echo "ERROR: mkextrafs failed, exiting!" && exit 1)
Andy Bavier2505f592016-11-11 15:58:55 -0500137 fi
Andy Bavier99c11d32016-09-14 17:21:20 -0400138 fi
Zack Williamsf4e65222017-03-01 14:22:37 -0700139
140 # replace /var/lib/libvirt/images with a symlink
141 [ -d /var/lib/libvirt/images/ ] && [ ! -h /var/lib/libvirt/images ] && sudo rmdir /var/lib/libvirt/images
142 sudo mkdir -p /mnt/extra/libvirt_images
143
144 if [ ! -e /var/lib/libvirt/images ]
145 then
146 sudo ln -s /mnt/extra/libvirt_images /var/lib/libvirt/images
147 fi
Andy Bavier99c11d32016-09-14 17:21:20 -0400148}
149
Sapan Bhatia01ddea62017-02-10 11:28:48 -0800150function elk_up() {
151 cd $CORDDIR/build
152
153 sudo su $USER -c 'vagrant up elastic --provider libvirt'
154
155 # This is a workaround for a weird issue with ARP cache timeout breaking 'vagrant ssh'
156 # It allows SSH'ing to the machine via 'ssh corddev'
157 sudo su $USER -c "vagrant ssh-config elastic > $SSHCONFIG"
158
159 cd $CORDDIR
160 if [ ! -f /tmp/elk-patch-applied ]; then
161 touch /tmp/elk-patch-applied
162 sh build/scripts/repo-apply.sh build/elk-logger/elk-ciab.diff
163 fi
164
165 sudo chmod +x build/elk-logger/logstash_tail
Zack Williamsf4e65222017-03-01 14:22:37 -0700166 build/elk-logger/logstash_tail --file install.out --hostport 10.100.198.222:5617 &
Sapan Bhatia01ddea62017-02-10 11:28:48 -0800167}
168
Andy Bavier2505f592016-11-11 15:58:55 -0500169function vagrant_vms_up() {
Andy Bavier99c11d32016-09-14 17:21:20 -0400170 cd $CORDDIR/build
171
Andy Bavier65c8e152016-12-22 16:01:27 -0500172 sudo su $USER -c 'vagrant up corddev prod --provider libvirt'
Andy Baviera69ee722016-11-17 07:26:01 -0800173
174 # This is a workaround for a weird issue with ARP cache timeout breaking 'vagrant ssh'
175 # It allows SSH'ing to the machine via 'ssh corddev'
Andy Bavier2505f592016-11-11 15:58:55 -0500176 sudo su $USER -c "vagrant ssh-config corddev prod > $SSHCONFIG"
177
178 scp ~/.ssh/id_rsa* corddev:.ssh
179 ssh corddev "chmod go-r ~/.ssh/id_rsa"
Andy Bavier99c11d32016-09-14 17:21:20 -0400180}
181
182function install_head_node() {
183 cd $CORDDIR/build
184
Andy Baviera69ee722016-11-17 07:26:01 -0800185 # SSH config saved earlier allows us to connect to VM without running 'vagrant'
Zack Williams0620c932017-01-25 14:36:31 -0700186 ssh corddev "cd /cord/build; ./gradlew -PdeployConfig=$VMDIR/$CONFIG fetch"
187 ssh corddev "cd /cord/build; ./gradlew -PdeployConfig=$VMDIR/$CONFIG buildImages"
Andy Bavier2505f592016-11-11 15:58:55 -0500188 ssh corddev "cd /cord/build; ping -c 3 prod; ./gradlew -PdeployConfig=$VMDIR/$CONFIG -PtargetReg=10.100.198.201:5000 publish"
Andy Baviera69ee722016-11-17 07:26:01 -0800189 ssh corddev "cd /cord/build; ./gradlew -PdeployConfig=$VMDIR/$CONFIG deploy"
Andy Bavier99c11d32016-09-14 17:21:20 -0400190}
191
192function set_up_maas_user() {
Andy Bavier2505f592016-11-11 15:58:55 -0500193 # Set up MAAS user on server to restart nodes via libvirt
194 grep maas /etc/passwd || sudo useradd -m maas
Andy Bavier99c11d32016-09-14 17:21:20 -0400195 sudo adduser maas libvirtd
196
Andy Bavier2505f592016-11-11 15:58:55 -0500197 # Copy generated public key to maas user's authorized_keys
198 sudo su maas -c "mkdir -p ~/.ssh"
199 sudo cp $HOME/.ssh/id_rsa.pub ~maas/.ssh/authorized_keys
200 sudo chown maas:maas ~maas/.ssh/authorized_keys
Andy Bavier99c11d32016-09-14 17:21:20 -0400201
Andy Bavier2505f592016-11-11 15:58:55 -0500202 # Copy generated private key to maas user's home dir in prod VM
203 scp $HOME/.ssh/id_rsa prod:/tmp
204 ssh prod "sudo mkdir -p ~maas/.ssh"
205 ssh prod "sudo cp /tmp/id_rsa ~maas/.ssh/id_rsa"
206 ssh prod "sudo chown -R maas:maas ~maas/.ssh"
207}
Srikanth Vavilapallib1c4da02016-11-17 15:24:28 -0600208
Andy Bavier0f07bb32017-01-17 10:20:26 -0500209function turn_off_learning () {
210 NET=$1
211 BRIDGE=`sudo virsh net-info $NET|grep "Bridge:"|awk '{print $2}'`
212 sudo brctl setageing $BRIDGE 0
213 sudo brctl stp $BRIDGE off
214}
215
216function leaf_spine_up() {
217 cd $CORDDIR/build
218
219 if [[ $FABRIC -ne 0 ]]
220 then
221 sudo su $USER -c "FABRIC=$FABRIC vagrant up leaf-1 leaf-2 spine-1 spine-2 --provider libvirt"
222 else
223 # Linux bridging seems to be having issues with two spine switches
224 sudo su $USER -c "FABRIC=$FABRIC vagrant up leaf-1 leaf-2 spine-1 --provider libvirt"
225 fi
226
227 # Turn off MAC learning on "links" -- i.e., bridges created by libvirt.
228 # Without this, sometimes packets are dropped because the bridges
229 # think they are not local -- this needs further investigation.
230 # A better solution might be to replace the bridges with UDP tunnels, but this
231 # is not supported with the version of libvirt available on Ubuntu 14.04.
232 turn_off_learning head-node-leaf-1
233 turn_off_learning compute-node-1-leaf-1
234 turn_off_learning compute-node-2-leaf-2
235 turn_off_learning compute-node-3-leaf-2
236 turn_off_learning leaf-1-spine-1
237 turn_off_learning leaf-1-spine-2
238 turn_off_learning leaf-2-spine-1
239 turn_off_learning leaf-2-spine-2
240}
241
Andy Bavier99c11d32016-09-14 17:21:20 -0400242function add_compute_node() {
Srikanth Vavilapallib1c4da02016-11-17 15:24:28 -0600243 echo add_compute_node: $1 $2
Andy Bavier2505f592016-11-11 15:58:55 -0500244
Andy Bavier99c11d32016-09-14 17:21:20 -0400245 cd $CORDDIR/build
Srikanth Vavilapallib1c4da02016-11-17 15:24:28 -0600246 sudo su $USER -c "vagrant up $1 --provider libvirt"
Andy Bavier99c11d32016-09-14 17:21:20 -0400247
Andy Bavier2505f592016-11-11 15:58:55 -0500248 # Set up power cycling for the compute node and wait for it to be provisioned
249 ssh prod "cd /cord/build/ansible; ansible-playbook maas-provision.yml --extra-vars \"maas_user=maas vagrant_name=$2\""
Andy Bavier99c11d32016-09-14 17:21:20 -0400250
251 echo ""
Andy Bavier0f07bb32017-01-17 10:20:26 -0500252 echo "$1 is fully provisioned!"
253}
254
255function initialize_fabric() {
256 echo "Initializing fabric"
257 ssh prod "cd /cord/build/platform-install; ansible-playbook -i /etc/maas/ansible/pod-inventory cord-refresh-fabric.yml"
258
259 echo "Fabric ping test"
260 ssh prod "cd /cord/build/platform-install; ansible-playbook -i /etc/maas/ansible/pod-inventory cord-fabric-pingtest.yml"
Andy Bavier99c11d32016-09-14 17:21:20 -0400261}
262
263function run_e2e_test () {
264 cd $CORDDIR/build
265
Andy Bavier2505f592016-11-11 15:58:55 -0500266 # User has been added to the lbvirtd group, but su $USER to be safe
Andy Baviera69ee722016-11-17 07:26:01 -0800267 ssh corddev "cd /cord/build; ./gradlew -PdeployConfig=$VMDIR/$CONFIG postDeployTests"
Andy Bavier99c11d32016-09-14 17:21:20 -0400268}
269
270function run_diagnostics() {
Zack Williams4fd3dcc2017-02-08 20:46:14 -0700271 ssh corddev "cd /cord/build; ./gradlew -PdeployConfig=$VMDIR/$CONFIG PIrunDiag"
Andy Bavier99c11d32016-09-14 17:21:20 -0400272}
273
274# Parse options
Zack Williamsdae7ff62016-11-14 15:20:06 -0700275GERRIT_BRANCHES=
Andy Bavier99c11d32016-09-14 17:21:20 -0400276RUN_TEST=0
Andy Bavier5c2e4fa2016-10-31 13:50:52 -0400277SETUP_ONLY=0
Andy Bavier99c11d32016-09-14 17:21:20 -0400278DIAGNOSTICS=0
279CLEANUP=0
Andy Bavier0f07bb32017-01-17 10:20:26 -0500280FABRIC=0
Srikanth Vavilapallib1c4da02016-11-17 15:24:28 -0600281#By default, cord-in-a-box creates 1 compute node. If more than one compute is
282#needed, use -n option
283NUM_COMPUTE_NODES=1
Andy Bavier99c11d32016-09-14 17:21:20 -0400284
Andy Bavier0f07bb32017-01-17 10:20:26 -0500285while getopts "b:cdfhn:stv" opt; do
Andy Bavier99c11d32016-09-14 17:21:20 -0400286 case ${opt} in
Zack Williamsdae7ff62016-11-14 15:20:06 -0700287 b ) GERRIT_BRANCHES+=("$OPTARG")
Andy Bavier99c11d32016-09-14 17:21:20 -0400288 ;;
289 c ) CLEANUP=1
290 ;;
291 d ) DIAGNOSTICS=1
292 ;;
Andy Bavier0f07bb32017-01-17 10:20:26 -0500293 f ) FABRIC=1
294 ;;
Andy Bavier99c11d32016-09-14 17:21:20 -0400295 h ) echo "Usage:"
296 echo " $0 install OpenStack and prep XOS and ONOS VMs [default]"
Zack Williamsdae7ff62016-11-14 15:20:06 -0700297 echo " $0 -b <project:changeset/revision> checkout a changesets from gerrit. Can"
298 echo " be used multiple times."
Andy Bavier99c11d32016-09-14 17:21:20 -0400299 echo " $0 -c cleanup from previous test"
300 echo " $0 -d run diagnostic collector"
Andy Bavier0f07bb32017-01-17 10:20:26 -0500301 echo " $0 -f use ONOS fabric (EXPERIMENTAL)"
Andy Bavier99c11d32016-09-14 17:21:20 -0400302 echo " $0 -h display this help message"
Zack Williamsa9e76ec2017-01-20 16:17:35 -0700303 echo " $0 -n # number of compute nodes to setup. Currently max 2 nodes can be supported"
Andy Bavier5c2e4fa2016-10-31 13:50:52 -0400304 echo " $0 -s run initial setup phase only (don't start building CORD)"
Andy Bavier99c11d32016-09-14 17:21:20 -0400305 echo " $0 -t do install, bring up cord-pod configuration, run E2E test"
Andy Bavierd1165102017-01-13 16:38:57 -0500306 echo " $0 -v print CiaB version and exit"
Andy Bavier99c11d32016-09-14 17:21:20 -0400307 exit 0
308 ;;
Srikanth Vavilapallib1c4da02016-11-17 15:24:28 -0600309 n ) NUM_COMPUTE_NODES=$OPTARG
310 ;;
Andy Bavier5c2e4fa2016-10-31 13:50:52 -0400311 s ) SETUP_ONLY=1
312 ;;
Andy Bavier99c11d32016-09-14 17:21:20 -0400313 t ) RUN_TEST=1
314 ;;
Andy Bavierd1165102017-01-13 16:38:57 -0500315 v ) echo "$VERSION_STRING ($REPO_BRANCH branch)"
316 exit 0
317 ;;
Andy Bavier99c11d32016-09-14 17:21:20 -0400318 \? ) echo "Invalid option: -$OPTARG"
319 exit 1
320 ;;
321 esac
322done
323
324# What to do
325if [[ $CLEANUP -eq 1 ]]
326then
Sapan Bhatia3f454b32017-03-01 05:24:19 +0100327 cleanup_from_previous_test
Andy Bavier99c11d32016-09-14 17:21:20 -0400328fi
329
Andy Bavierd1165102017-01-13 16:38:57 -0500330echo ""
331echo "Preparing to install $VERSION_STRING ($REPO_BRANCH branch)"
332echo ""
333
Sapan Bhatiaa94c2db2017-02-27 20:18:24 +0100334bootstrap
Sapan Bhatia01ddea62017-02-10 11:28:48 -0800335run_stage cloudlab_setup
336run_stage elk_up
337run_stage vagrant_vms_up
Andy Bavier5c2e4fa2016-10-31 13:50:52 -0400338
339if [[ $SETUP_ONLY -ne 0 ]]
340then
341 echo "Finished build environment setup, exiting..."
342 exit 0
343fi
344
Sapan Bhatia01ddea62017-02-10 11:28:48 -0800345run_stage install_head_node
346run_stage set_up_maas_user
347run_stage leaf_spine_up
Srikanth Vavilapallib1c4da02016-11-17 15:24:28 -0600348
Andy Bavier0f07bb32017-01-17 10:20:26 -0500349if [[ $NUM_COMPUTE_NODES -gt 3 ]]
Srikanth Vavilapallib1c4da02016-11-17 15:24:28 -0600350then
Andy Bavier0f07bb32017-01-17 10:20:26 -0500351 echo "currently max only three compute nodes can be supported..."
352 NUM_COMPUTE_NODES=3
Srikanth Vavilapallib1c4da02016-11-17 15:24:28 -0600353fi
354
Sapan Bhatia01ddea62017-02-10 11:28:48 -0800355echo "==> Adding compute nodes: Starting"
Srikanth Vavilapallib1c4da02016-11-17 15:24:28 -0600356for i in `seq 1 $NUM_COMPUTE_NODES`;
357do
358 echo adding the compute node: compute-node-$i
Andy Bavier0f07bb32017-01-17 10:20:26 -0500359 add_compute_node compute-node-$i build_compute-node-$i
Srikanth Vavilapallib1c4da02016-11-17 15:24:28 -0600360done
Sapan Bhatia01ddea62017-02-10 11:28:48 -0800361echo "==> Adding compute nodes: Complete"
Andy Bavier99c11d32016-09-14 17:21:20 -0400362
Zack Williams4fd3dcc2017-02-08 20:46:14 -0700363# run diagnostics both before/after the fabric/e2e tests
364if [[ $DIAGNOSTICS -eq 1 ]]
365then
366 run_diagnostics
367fi
368
369
Andy Bavier0f07bb32017-01-17 10:20:26 -0500370if [[ $FABRIC -ne 0 ]]
371then
Sapan Bhatia01ddea62017-02-10 11:28:48 -0800372 run_stage initialize_fabric
Andy Bavier0f07bb32017-01-17 10:20:26 -0500373fi
374
Andy Bavier99c11d32016-09-14 17:21:20 -0400375if [[ $RUN_TEST -eq 1 ]]
376then
Sapan Bhatia01ddea62017-02-10 11:28:48 -0800377 run_stage run_e2e_test
Andy Bavier99c11d32016-09-14 17:21:20 -0400378fi
379
380if [[ $DIAGNOSTICS -eq 1 ]]
381then
Sapan Bhatia01ddea62017-02-10 11:28:48 -0800382 run_stage run_diagnostics
Andy Bavier99c11d32016-09-14 17:21:20 -0400383fi
384
385exit 0