2 # Copyright (c) 2016 Cisco and/or its affiliates.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at:
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
17 # Space separated list of available testbeds, described by topology files
18 TOPOLOGIES="topologies/available/lf_testbed2-710-520.yaml"
19 VPP_STABLE_VER="1.0.0-437~g8f15e92_amd64"
20 VPP_REPO_URL="https://nexus.fd.io/service/local/repositories/fd.io.dev/content/io/fd/vpp"
23 RESERVATION_DIR="/tmp/reservation_dir"
24 INSTALLATION_DIR="/tmp/install_dir"
26 PYBOT_ARGS="--noncritical MULTI_THREAD"
28 # If we run this script from CSIT jobs we want to use stable vpp version
29 if [[ ${JOB_NAME} == csit-* ]] ;
33 #download vpp build from nexus and set VPP_DEBS variable
34 wget -q "${VPP_REPO_URL}/vpp/${VPP_STABLE_VER}/vpp-${VPP_STABLE_VER}.deb" || exit
35 wget -q "${VPP_REPO_URL}/vpp-dbg/${VPP_STABLE_VER}/vpp-dbg-${VPP_STABLE_VER}.deb" || exit
36 wget -q "${VPP_REPO_URL}/vpp-dev/${VPP_STABLE_VER}/vpp-dev-${VPP_STABLE_VER}.deb" || exit
37 wget -q "${VPP_REPO_URL}/vpp-dpdk-dev/${VPP_STABLE_VER}/vpp-dpdk-dev-${VPP_STABLE_VER}.deb" || exit
38 wget -q "${VPP_REPO_URL}/vpp-dpdk-dkms/${VPP_STABLE_VER}/vpp-dpdk-dkms-${VPP_STABLE_VER}.deb" || exit
39 wget -q "${VPP_REPO_URL}/vpp-lib/${VPP_STABLE_VER}/vpp-lib-${VPP_STABLE_VER}.deb" || exit
40 VPP_DEBS="$( readlink -f *.deb | tr '\n' ' ' )"
41 PYBOT_ARGS="${PYBOT_ARGS} --exitonfailure"
44 # If we run this script from vpp project we want to use local build
45 elif [[ ${JOB_NAME} == vpp-* ]] ;
47 #use local packages provided as argument list
48 # Jenkins VPP deb paths (convert to full path)
49 VPP_DEBS="$( readlink -f $@ | tr '\n' ' ' )"
51 echo "Unable to identify job type based on JOB_NAME variable: ${JOB_NAME}"
55 CUR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
57 export PYTHONPATH=${CUR_DIR}
59 sudo apt-get -y update
60 sudo apt-get -y install libpython2.7-dev python-virtualenv
66 pip install -r requirements.txt
68 # We iterate over available topologies and wait until we reserve topology
70 for TOPOLOGY in ${TOPOLOGIES};
72 python ${CUR_DIR}/resources/tools/topo_reservation.py -t ${TOPOLOGY}
74 WORKING_TOPOLOGY=${TOPOLOGY}
75 echo "Reserved: ${WORKING_TOPOLOGY}"
80 if [ ! -z "${WORKING_TOPOLOGY}" ]; then
81 # Exit the infinite while loop if we made a reservation
85 # Wait ~3minutes before next try
86 SLEEP_TIME=$[ ( $RANDOM % 20 ) + 180 ]s
87 echo "Sleeping ${SLEEP_TIME}"
92 python ${CUR_DIR}/resources/tools/topo_installation.py -c -d ${INSTALLATION_DIR} -t $1
93 python ${CUR_DIR}/resources/tools/topo_reservation.py -c -t $1
96 # On script exit we cancel the reservation and installation and delete all vpp
98 trap "cancel_all ${WORKING_TOPOLOGY}" EXIT
100 python ${CUR_DIR}/resources/tools/topo_installation.py -t ${WORKING_TOPOLOGY} \
101 -d ${INSTALLATION_DIR} \
103 if [ $? -eq 0 ]; then
104 echo "VPP Installed on hosts from: ${WORKING_TOPOLOGY}"
106 echo "Failed to copy vpp deb files to DUTs"
111 # run specific performance tests based on jenkins job type variable
114 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
120 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
124 PERFTEST_LONG_BRIDGE )
126 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
127 -s performance.long_bridge_domain \
132 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
133 -s performance.long_ipv4 \
138 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
139 -s performance.long_ipv6 \
142 PERFTEST_LONG_XCONNECT )
144 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
145 -s performance.long_xconnect \
149 # run full performance test suite and exit on fail
150 pybot ${PYBOT_ARGS} \
152 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \