2 # Copyright (c) 2018 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_testbed1.yaml \
19 topologies/available/lf_testbed2.yaml \
20 topologies/available/lf_testbed3.yaml"
22 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
25 RESERVATION_DIR="/tmp/reservation_dir"
26 INSTALLATION_DIR="/tmp/install_dir"
28 PYBOT_ARGS="-W 150 -L TRACE"
30 JOB_ARCHIVE_ARTIFACTS=(log.html output.xml report.html)
31 LOG_ARCHIVE_ARTIFACTS=(log.html output.xml report.html)
32 JOB_ARCHIVE_DIR="archive"
33 LOG_ARCHIVE_DIR="$WORKSPACE/archives"
34 mkdir -p ${JOB_ARCHIVE_DIR}
35 mkdir -p ${LOG_ARCHIVE_DIR}
37 # If we run this script from CSIT jobs we want to use stable vpp version
38 if [[ ${JOB_NAME} == csit-* ]] ;
43 if [[ ${TEST_TAG} == *DAILY ]] || \
44 [[ ${TEST_TAG} == *WEEKLY ]];
46 # Download the latest VPP build .deb install packages
47 echo Downloading VPP packages...
48 bash ${SCRIPT_DIR}/resources/tools/scripts/download_install_vpp_pkgs.sh --skip-install
50 VPP_DEBS="$( readlink -f *.deb | tr '\n' ' ' )"
51 # Take vpp package and get the vpp version
52 VPP_STABLE_VER="$( expr match $(ls *.deb | head -n 1) 'vpp-\(.*\)-deb.deb' )"
54 DPDK_STABLE_VER=$(cat ${SCRIPT_DIR}/DPDK_STABLE_VER)_amd64
55 VPP_REPO_URL=$(cat ${SCRIPT_DIR}/VPP_REPO_URL_UBUNTU)
56 VPP_STABLE_VER=$(cat ${SCRIPT_DIR}/VPP_STABLE_VER_UBUNTU)
58 # Download vpp build from nexus and set VPP_DEBS variable
59 wget -q "${VPP_REPO_URL}/vpp/${VPP_STABLE_VER}/vpp-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
60 wget -q "${VPP_REPO_URL}/vpp-dbg/${VPP_STABLE_VER}/vpp-dbg-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
61 wget -q "${VPP_REPO_URL}/vpp-dev/${VPP_STABLE_VER}/vpp-dev-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
62 wget -q "${VPP_REPO_URL}/vpp-dpdk-dkms/${DPDK_STABLE_VER}/vpp-dpdk-dkms-${DPDK_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
63 wget -q "${VPP_REPO_URL}/vpp-lib/${VPP_STABLE_VER}/vpp-lib-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
64 wget -q "${VPP_REPO_URL}/vpp-plugins/${VPP_STABLE_VER}/vpp-plugins-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
65 VPP_DEBS="$( readlink -f *.deb | tr '\n' ' ' )"
70 # If we run this script from vpp project we want to use local build
71 elif [[ ${JOB_NAME} == vpp-* ]] ;
73 # Use local packages provided as argument list
74 # Jenkins VPP deb paths (convert to full path)
75 VPP_DEBS="$( readlink -f $@ | tr '\n' ' ' )"
76 # Take vpp package and get the vpp version
77 VPP_STABLE_VER="$( expr match $1 'vpp-\(.*\)-deb.deb' )"
79 echo "Unable to identify job type based on JOB_NAME variable: ${JOB_NAME}"
84 export PYTHONPATH=${SCRIPT_DIR}
86 sudo apt-get -y update
87 sudo apt-get -y install libpython2.7-dev python-virtualenv
89 virtualenv --system-site-packages env
93 pip install -r requirements.txt
95 # We iterate over available topologies and wait until we reserve topology
97 for TOPOLOGY in ${TOPOLOGIES};
99 python ${SCRIPT_DIR}/resources/tools/scripts/topo_reservation.py -t ${TOPOLOGY}
100 if [ $? -eq 0 ]; then
101 WORKING_TOPOLOGY=${TOPOLOGY}
102 echo "Reserved: ${WORKING_TOPOLOGY}"
107 if [ ! -z "${WORKING_TOPOLOGY}" ]; then
108 # Exit the infinite while loop if we made a reservation
112 # Wait ~3minutes before next try
113 SLEEP_TIME=$[ ( $RANDOM % 20 ) + 180 ]s
114 echo "Sleeping ${SLEEP_TIME}"
118 function cancel_all {
119 python ${SCRIPT_DIR}/resources/tools/scripts/topo_installation.py -c -d ${INSTALLATION_DIR} -t $1
120 python ${SCRIPT_DIR}/resources/tools/scripts/topo_reservation.py -c -t $1
123 # On script exit we cancel the reservation and installation and delete all vpp
125 trap "cancel_all ${WORKING_TOPOLOGY}" EXIT
127 python ${SCRIPT_DIR}/resources/tools/scripts/topo_installation.py \
128 -t ${WORKING_TOPOLOGY} -d ${INSTALLATION_DIR} -p ${VPP_DEBS}
129 if [ $? -eq 0 ]; then
130 echo "VPP Installed on hosts from: ${WORKING_TOPOLOGY}"
132 echo "Failed to copy vpp deb files to DUTs"
136 # Based on job we will identify DUT
137 if [[ ${JOB_NAME} == *hc2vpp* ]] ;
140 elif [[ ${JOB_NAME} == *vpp* ]] ;
143 elif [[ ${JOB_NAME} == *ligato* ]] ;
146 elif [[ ${JOB_NAME} == *dpdk* ]] ;
150 echo "Unable to identify dut type based on JOB_NAME variable: ${JOB_NAME}"
155 # run specific performance tests based on jenkins job type variable
157 pybot ${PYBOT_ARGS} \
158 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
159 -s "tests.${DUT}.perf" \
160 --include ndrdiscANDnic_intel-x520-da2AND1t1cORndrdiscANDnic_intel-x520-da2AND2t2c \
161 --include ndrdiscAND1t1cANDipsecORndrdiscAND2t2cANDipsec \
163 RETURN_STATUS=$(echo $?)
165 PERFTEST_SEMI_WEEKLY )
166 pybot ${PYBOT_ARGS} \
167 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
168 -s "tests.${DUT}.perf" \
169 --include ndrdiscANDnic_intel-x710AND1t1cORndrdiscANDnic_intel-x710AND2t2cORndrdiscANDnic_intel-xl710AND1t1cORndrdiscANDnic_intel-xl710AND2t2c \
171 RETURN_STATUS=$(echo $?)
174 pybot ${PYBOT_ARGS} \
175 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
176 -s "tests.${DUT}.perf" \
177 --include mrrAND64bAND1t1c \
178 --include mrrAND64bAND2t2c \
179 --include mrrAND64bAND4t4c \
180 --include mrrAND78bAND1t1c \
181 --include mrrAND78bAND2t2c \
182 --include mrrAND78bAND4t4c \
183 --include mrrANDimixAND1t1cANDvhost \
184 --include mrrANDimixAND2t2cANDvhost \
185 --include mrrANDimixAND4t4cANDvhost \
186 --include mrrANDimixAND1t1cANDmemif \
187 --include mrrANDimixAND2t2cANDmemif \
188 --include mrrANDimixAND4t4cANDmemif \
190 RETURN_STATUS=$(echo $?)
192 VERIFY-PERF-NDRDISC )
193 pybot ${PYBOT_ARGS} \
194 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
195 -s "tests.${DUT}.perf" \
196 --include ndrdiscAND1t1cORndrdiscAND2t2c \
198 RETURN_STATUS=$(echo $?)
200 VERIFY-PERF-PDRDISC )
201 pybot ${PYBOT_ARGS} \
202 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
203 -s "tests.${DUT}.perf" \
204 --include pdrdiscAND1t1cORpdrdiscAND2t2c \
206 RETURN_STATUS=$(echo $?)
209 pybot ${PYBOT_ARGS} \
210 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
211 -s "tests.${DUT}.perf" \
212 --include mrrAND1t1cORmrrAND2t2c \
214 RETURN_STATUS=$(echo $?)
217 pybot ${PYBOT_ARGS} \
218 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
219 -s "tests.${DUT}.perf" \
220 --include ndrdiscANDnic_intel-x520-da2AND1t1cANDip4baseORndrdiscANDnic_intel-x520-da2AND1t1cANDip4fwdANDfib_2m \
222 RETURN_STATUS=$(echo $?)
225 pybot ${PYBOT_ARGS} \
226 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
227 -s "tests.${DUT}.perf" \
228 --include ndrdiscANDnic_intel-x520-da2AND1t1cANDip6baseORndrdiscANDnic_intel-x520-da2AND1t1cANDip6fwdANDfib_2m \
230 RETURN_STATUS=$(echo $?)
233 pybot ${PYBOT_ARGS} \
234 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
235 -s "tests.${DUT}.perf" \
236 --include ndrdiscANDnic_intel-x520-da2AND1t1cANDl2xcbaseORndrdiscANDnic_intel-x520-da2AND1t1cANDl2bdbase \
238 RETURN_STATUS=$(echo $?)
241 pybot ${PYBOT_ARGS} \
242 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
243 -s "tests.${DUT}.perf" \
244 --include ndrdiscANDnic_intel-x520-da2AND1t1cANDlisp \
246 RETURN_STATUS=$(echo $?)
249 pybot ${PYBOT_ARGS} \
250 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
251 -s "tests.${DUT}.perf" \
252 --include ndrdiscANDnic_intel-x520-da2AND1t1cANDvxlan \
254 RETURN_STATUS=$(echo $?)
257 pybot ${PYBOT_ARGS} \
258 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
259 -s "tests.${DUT}.perf" \
260 --include ndrdiscANDnic_intel-x520-da2AND1t1cANDvhost \
262 RETURN_STATUS=$(echo $?)
265 pybot ${PYBOT_ARGS} \
266 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
267 -s "tests.${DUT}.perf" \
268 --include ndrdiscANDnic_intel-x520-da2AND1t1cANDmemif \
270 RETURN_STATUS=$(echo $?)
272 VERIFY-PERF-IPSECHW )
273 pybot ${PYBOT_ARGS} \
274 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
275 -s "tests.${DUT}.perf.crypto" \
276 --include ndrdiscANDnic_intel-xl710AND1t1cANDipsechw \
277 --include ndrdiscANDnic_intel-xl710AND2t2cANDipsechw \
278 --include mrrANDnic_intel-xl710AND1t1cANDipsechw \
279 --include mrrANDnic_intel-xl710AND2t2cANDipsechw \
281 RETURN_STATUS=$(echo $?)
283 VPP-VERIFY-PERF-IP4 )
284 pybot ${PYBOT_ARGS} \
285 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
286 -s "tests.${DUT}.perf" \
287 --include mrrANDnic_intel-x520-da2AND1t1cANDip4baseORmrrANDnic_intel-x520-da2AND1t1cANDip4fwdANDfib_2m \
289 RETURN_STATUS=$(echo $?)
291 VPP-VERIFY-PERF-IP6 )
292 pybot ${PYBOT_ARGS} \
293 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
294 -s "tests.${DUT}.perf" \
295 --include mrrANDnic_intel-x520-da2AND1t1cANDip6baseORmrrANDnic_intel-x520-da2AND1t1cANDip6fwdANDfib_2m \
297 RETURN_STATUS=$(echo $?)
300 pybot ${PYBOT_ARGS} \
301 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
302 -s "tests.${DUT}.perf" \
303 --include mrrANDnic_intel-x520-da2AND1t1cANDl2xcbaseORmrrANDnic_intel-x520-da2AND1t1cANDl2bdbase \
305 RETURN_STATUS=$(echo $?)
307 VPP-VERIFY-PERF-LISP )
308 pybot ${PYBOT_ARGS} \
309 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
310 -s "tests.${DUT}.perf" \
311 --include pdrchkANDnic_intel-x520-da2AND1t1cANDlisp \
313 RETURN_STATUS=$(echo $?)
315 VPP-VERIFY-PERF-VXLAN )
316 pybot ${PYBOT_ARGS} \
317 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
318 -s "tests.${DUT}.perf" \
319 --include pdrchkANDnic_intel-x520-da2AND1t1cANDvxlan \
321 RETURN_STATUS=$(echo $?)
323 VPP-VERIFY-PERF-VHOST )
324 pybot ${PYBOT_ARGS} \
325 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
326 -s "tests.${DUT}.perf" \
327 --include pdrdiscANDnic_intel-x520-da2AND1t1cANDvhost \
329 RETURN_STATUS=$(echo $?)
331 VPP-VERIFY-PERF-MEMIF )
332 pybot ${PYBOT_ARGS} \
333 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
334 -s "tests.${DUT}.perf" \
335 --include pdrdiscANDnic_intel-x520-da2AND1t1cANDmemif \
336 --include pdrdiscANDnic_intel-x520-da2AND2t2cANDmemif \
337 --include mrrANDnic_intel-x520-da2AND1t1cANDmemif \
338 --include mrrANDnic_intel-x520-da2AND2t2cANDmemif \
340 RETURN_STATUS=$(echo $?)
342 VPP-VERIFY-PERF-ACL )
343 pybot ${PYBOT_ARGS} \
344 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
345 -s "tests.${DUT}.perf" \
346 --include pdrdiscANDnic_intel-x520-da2AND1t1cANDacl \
347 --include pdrdiscANDnic_intel-x520-da2AND2t2cANDacl \
349 RETURN_STATUS=$(echo $?)
351 VPP-VERIFY-PERF-IPSECHW )
352 pybot ${PYBOT_ARGS} \
353 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
354 -s "tests.${DUT}.perf.crypto" \
355 --include pdrdiscANDnic_intel-xl710AND1t1cANDipsechw \
356 --include pdrdiscANDnic_intel-xl710AND2t2cANDipsechw \
357 --include mrrANDnic_intel-xl710AND1t1cANDipsechw \
358 --include mrrANDnic_intel-xl710AND2t2cANDipsechw \
360 RETURN_STATUS=$(echo $?)
363 # run full performance test suite and exit on fail
364 pybot ${PYBOT_ARGS} \
365 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
366 -s "tests.${DUT}.perf" \
368 RETURN_STATUS=$(echo $?)
371 # Archive JOB artifacts in jenkins
372 for i in ${JOB_ARCHIVE_ARTIFACTS[@]}; do
373 cp $( readlink -f ${i} | tr '\n' ' ' ) ${JOB_ARCHIVE_DIR}/
375 # Archive JOB artifacts to logs.fd.io
376 for i in ${LOG_ARCHIVE_ARTIFACTS[@]}; do
377 cp $( readlink -f ${i} | tr '\n' ' ' ) ${LOG_ARCHIVE_DIR}/
380 exit ${RETURN_STATUS}