forked from dave-tucker/odl-openstack-ci
-
Notifications
You must be signed in to change notification settings - Fork 2
/
odl-openstack-dg-run.sh
executable file
·78 lines (69 loc) · 2.48 KB
/
odl-openstack-dg-run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
function run_dg() {
# Need /opt/stack to be there
#sudo mkdir -p /opt/stack
#sudo chmod 777 /opt/stack
# Save existing WORKSPACE
SAVED_WORKSPACE=$WORKSPACE
export WORKSPACE=~/workspace
mkdir -p $WORKSPACE
cd $WORKSPACE
# This is the job which checks out devstack-gate
if [[ ! -e devstack-gate ]]; then
echo "Cloning devstack-gate"
git clone https://git.openstack.org/openstack-infra/devstack-gate
else
echo "Fixing devstack-gate git remotes"
cd devstack-gate
git remote set-url origin https://git.openstack.org/openstack-infra/devstack-gate
git remote update
git reset --hard
if ! git clean -x -f ; then
sleep 1
git clean -x -f
fi
git checkout master
git reset --hard remotes/origin/master
if ! git clean -x -f ; then
sleep 1
git clean -x -f
fi
cd ..
fi
echo "Setting environment variables"
# And this runs devstack-gate
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_TIMEOUT=120
export DEVSTACK_GATE_NEUTRON=1
# Uncomment the below to run the Tempest tests
#export DEVSTACK_GATE_TEMPEST=1
export BRANCH_OVERRIDE=master
if [ "$BRANCH_OVERRIDE" != "default" ] ; then
export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
fi
# Because we are testing a non standard project, add
# our project repository. This makes zuul do the right
# reference magic for testing changes.
export PROJECTS="stackforge/networking-odl $PROJECTS"
# Note the actual url here is somewhat irrelevant because it
# caches in nodepool, however make it a valid url for
# documentation purposes.
export DEVSTACK_LOCAL_CONFIG="enable_plugin networking-odl https://git.openstack.org/stackforge/networking-odl"
# Keep localrc to be able to set some vars in pre_test_hook
export KEEP_LOCALRC=1
# Unset these are face the wrath of KAHN!
unset GIT_BASE
echo "Copying devstack-vm-gate-wrap.sh"
cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh
echo "Running safe-devstack-vm-gate-wrap.sh"
./safe-devstack-vm-gate-wrap.sh
# Restore WORKSPACE
OS_WORKSPACE=$WORKSPACE
export WORKSPACE=$SAVED_WORKSPACE
cp -r $OS_WORKSPACE/logs $WORKSPACE
cp -A /opt/stack/new/logs/q-odl-karaf* $WORKSPACE/logs
# Unzip the logs to make them easier to view
gunzip $WORKSPACE/logs/*.gz
}
# Run the function
run_dg