2 # Copyright (c) 2017 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 ARCHIVE_ARTIFACTS=(log.html output.xml report.html output_perf_data.xml output_perf_data.json)
32 # If we run this script from CSIT jobs we want to use stable vpp version
33 if [[ ${JOB_NAME} == csit-* ]] ;
38 if [[ ${TEST_TAG} == *NIGHTLY ]] || \
39 [[ ${TEST_TAG} == *DAILY ]] || \
40 [[ ${TEST_TAG} == *WEEKLY ]];
42 # Download the latest VPP build .deb install packages
43 echo Downloading VPP packages...
44 bash ${SCRIPT_DIR}/resources/tools/scripts/download_install_vpp_pkgs.sh --skip-install
46 VPP_DEBS="$( readlink -f *.deb | tr '\n' ' ' )"
47 # Take vpp package and get the vpp version
48 VPP_STABLE_VER="$( expr match $(ls *.deb | head -n 1) 'vpp-\(.*\)-deb.deb' )"
50 DPDK_STABLE_VER=$(cat ${SCRIPT_DIR}/DPDK_STABLE_VER)_amd64
51 VPP_REPO_URL=$(cat ${SCRIPT_DIR}/VPP_REPO_URL_UBUNTU)
52 VPP_STABLE_VER=$(cat ${SCRIPT_DIR}/VPP_STABLE_VER_UBUNTU)
54 # Download vpp build from nexus and set VPP_DEBS variable
55 wget -q "${VPP_REPO_URL}/vpp/${VPP_STABLE_VER}/vpp-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
56 wget -q "${VPP_REPO_URL}/vpp-dbg/${VPP_STABLE_VER}/vpp-dbg-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
57 wget -q "${VPP_REPO_URL}/vpp-dev/${VPP_STABLE_VER}/vpp-dev-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
58 wget -q "${VPP_REPO_URL}/vpp-dpdk-dkms/${DPDK_STABLE_VER}/vpp-dpdk-dkms-${DPDK_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
59 wget -q "${VPP_REPO_URL}/vpp-lib/${VPP_STABLE_VER}/vpp-lib-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
60 wget -q "${VPP_REPO_URL}/vpp-plugins/${VPP_STABLE_VER}/vpp-plugins-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
61 VPP_DEBS="$( readlink -f *.deb | tr '\n' ' ' )"
66 # If we run this script from vpp project we want to use local build
67 elif [[ ${JOB_NAME} == vpp-* ]] ;
69 # Use local packages provided as argument list
70 # Jenkins VPP deb paths (convert to full path)
71 VPP_DEBS="$( readlink -f $@ | tr '\n' ' ' )"
72 # Take vpp package and get the vpp version
73 VPP_STABLE_VER="$( expr match $1 'vpp-\(.*\)-deb.deb' )"
75 echo "Unable to identify job type based on JOB_NAME variable: ${JOB_NAME}"
80 export PYTHONPATH=${SCRIPT_DIR}
82 sudo apt-get -y update
83 sudo apt-get -y install libpython2.7-dev python-virtualenv
85 virtualenv --system-site-packages env
89 pip install -r requirements.txt
91 # We iterate over available topologies and wait until we reserve topology
93 for TOPOLOGY in ${TOPOLOGIES};
95 python ${SCRIPT_DIR}/resources/tools/scripts/topo_reservation.py -t ${TOPOLOGY}
97 WORKING_TOPOLOGY=${TOPOLOGY}
98 echo "Reserved: ${WORKING_TOPOLOGY}"
103 if [ ! -z "${WORKING_TOPOLOGY}" ]; then
104 # Exit the infinite while loop if we made a reservation
108 # Wait ~3minutes before next try
109 SLEEP_TIME=$[ ( $RANDOM % 20 ) + 180 ]s
110 echo "Sleeping ${SLEEP_TIME}"
114 function cancel_all {
115 python ${SCRIPT_DIR}/resources/tools/scripts/topo_installation.py -c -d ${INSTALLATION_DIR} -t $1
116 python ${SCRIPT_DIR}/resources/tools/scripts/topo_reservation.py -c -t $1
119 # On script exit we cancel the reservation and installation and delete all vpp
121 trap "cancel_all ${WORKING_TOPOLOGY}" EXIT
123 python ${SCRIPT_DIR}/resources/tools/scripts/topo_installation.py -t ${WORKING_TOPOLOGY} \
124 -d ${INSTALLATION_DIR} \
126 if [ $? -eq 0 ]; then
127 echo "VPP Installed on hosts from: ${WORKING_TOPOLOGY}"
129 echo "Failed to copy vpp deb files to DUTs"
134 # run specific performance tests based on jenkins job type variable
136 pybot ${PYBOT_ARGS} \
137 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
138 -s "tests.vpp.perf" \
139 --include ndrdiscANDnic_intel-x520-da2AND1t1cORndrdiscANDnic_intel-x520-da2AND2t2c \
140 --include ndrdiscAND1t1cANDipsecORndrdiscAND2t2cANDipsec \
142 RETURN_STATUS=$(echo $?)
144 PERFTEST_SEMI_WEEKLY )
145 pybot ${PYBOT_ARGS} \
146 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
147 -s "tests.vpp.perf" \
148 --include ndrdiscANDnic_intel-x710AND1t1cORndrdiscANDnic_intel-x710AND2t2cORndrdiscANDnic_intel-xl710AND1t1cORndrdiscANDnic_intel-xl710AND2t2c \
150 RETURN_STATUS=$(echo $?)
152 VERIFY-PERF-NDRDISC )
153 pybot ${PYBOT_ARGS} \
154 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
155 -s "tests.vpp.perf" \
156 --include ndrdiscAND1t1cORndrdiscAND2t2c \
158 RETURN_STATUS=$(echo $?)
160 VERIFY-PERF-PDRDISC )
161 pybot ${PYBOT_ARGS} \
162 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
163 -s "tests.vpp.perf" \
164 --include pdrdiscAND1t1cORpdrdiscAND2t2c \
166 RETURN_STATUS=$(echo $?)
169 pybot ${PYBOT_ARGS} \
170 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
171 -s "tests.vpp.perf" \
172 --include mrrAND1t1cORmrrAND2t2c \
174 RETURN_STATUS=$(echo $?)
177 pybot ${PYBOT_ARGS} \
178 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
179 -s "tests.vpp.perf" \
180 --include mrrAND64bAND1t1c \
181 --include mrrAND64bAND2t2c \
182 --include mrrAND64bAND4t4c \
183 --include mrrAND78bAND1t1c \
184 --include mrrAND78bAND2t2c \
185 --include mrrAND78bAND4t4c \
187 RETURN_STATUS=$(echo $?)
190 pybot ${PYBOT_ARGS} \
191 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
192 -s "tests.vpp.perf" \
193 --include ndrdiscANDnic_intel-x520-da2AND1t1cANDip4baseORndrdiscANDnic_intel-x520-da2AND1t1cANDip4fwdANDfib_2m \
195 RETURN_STATUS=$(echo $?)
198 pybot ${PYBOT_ARGS} \
199 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
200 -s "tests.vpp.perf" \
201 --include ndrdiscANDnic_intel-x520-da2AND1t1cANDip6baseORndrdiscANDnic_intel-x520-da2AND1t1cANDip6fwdANDfib_2m \
203 RETURN_STATUS=$(echo $?)
206 pybot ${PYBOT_ARGS} \
207 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
208 -s "tests.vpp.perf" \
209 --include ndrdiscANDnic_intel-x520-da2AND1t1cANDl2xcbaseORndrdiscANDnic_intel-x520-da2AND1t1cANDl2bdbase \
211 RETURN_STATUS=$(echo $?)
214 pybot ${PYBOT_ARGS} \
215 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
216 -s "tests.vpp.perf" \
217 --include ndrdiscANDnic_intel-x520-da2AND1t1cANDlisp \
219 RETURN_STATUS=$(echo $?)
222 pybot ${PYBOT_ARGS} \
223 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
224 -s "tests.vpp.perf" \
225 --include ndrdiscANDnic_intel-x520-da2AND1t1cANDvxlan \
227 RETURN_STATUS=$(echo $?)
230 pybot ${PYBOT_ARGS} \
231 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
232 -s "tests.vpp.perf" \
233 --include ndrdiscANDnic_intel-x520-da2AND1t1cANDvhost \
235 RETURN_STATUS=$(echo $?)
238 pybot ${PYBOT_ARGS} \
239 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
240 -s "tests.vpp.perf" \
241 --include ndrdiscANDnic_intel-x520-da2AND1t1cANDmemif \
243 RETURN_STATUS=$(echo $?)
245 VERIFY-PERF-IPSECHW )
246 pybot ${PYBOT_ARGS} \
247 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
248 -s "tests.vpp.perf.crypto" \
249 --include ndrdiscANDnic_intel-xl710AND1t1cANDipsechw \
250 --include ndrdiscANDnic_intel-xl710AND2t2cANDipsechw \
253 VPP-VERIFY-PERF-IP4 )
254 pybot ${PYBOT_ARGS} \
255 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
256 -s "tests.vpp.perf" \
257 --include mrrANDnic_intel-x520-da2AND1t1cANDip4baseORmrrANDnic_intel-x520-da2AND1t1cANDip4fwdANDfib_2m \
259 RETURN_STATUS=$(echo $?)
261 VPP-VERIFY-PERF-IP6 )
262 pybot ${PYBOT_ARGS} \
263 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
264 -s "tests.vpp.perf" \
265 --include mrrANDnic_intel-x520-da2AND1t1cANDip6baseORmrrANDnic_intel-x520-da2AND1t1cANDip6fwdANDfib_2m \
267 RETURN_STATUS=$(echo $?)
270 pybot ${PYBOT_ARGS} \
271 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
272 -s "tests.vpp.perf" \
273 --include mrrANDnic_intel-x520-da2AND1t1cANDl2xcbaseORmrrANDnic_intel-x520-da2AND1t1cANDl2bdbase \
275 RETURN_STATUS=$(echo $?)
277 VPP-VERIFY-PERF-LISP )
278 pybot ${PYBOT_ARGS} \
279 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
280 -s "tests.vpp.perf" \
281 --include pdrchkANDnic_intel-x520-da2AND1t1cANDlisp \
283 RETURN_STATUS=$(echo $?)
285 VPP-VERIFY-PERF-VXLAN )
286 pybot ${PYBOT_ARGS} \
287 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
288 -s "tests.vpp.perf" \
289 --include pdrchkANDnic_intel-x520-da2AND1t1cANDvxlan \
291 RETURN_STATUS=$(echo $?)
293 VPP-VERIFY-PERF-VHOST )
294 pybot ${PYBOT_ARGS} \
295 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
296 -s "tests.vpp.perf" \
297 --include pdrdiscANDnic_intel-x520-da2AND1t1cANDvhost \
299 RETURN_STATUS=$(echo $?)
301 VPP-VERIFY-PERF-MEMIF )
302 pybot ${PYBOT_ARGS} \
303 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
304 -s "tests.vpp.perf" \
305 --include pdrdiscANDnic_intel-x520-da2AND1t1cANDmemif \
306 --include pdrdiscANDnic_intel-x520-da2AND2t2cANDmemif \
308 RETURN_STATUS=$(echo $?)
310 VPP-VERIFY-PERF-ACL )
311 pybot ${PYBOT_ARGS} \
312 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
313 -s "tests.vpp.perf" \
314 --include pdrdiscANDnic_intel-x520-da2AND1t1cANDacl \
315 --include pdrdiscANDnic_intel-x520-da2AND2t2cANDacl \
317 RETURN_STATUS=$(echo $?)
319 VPP-VERIFY-PERF-IPSECHW )
320 pybot ${PYBOT_ARGS} \
321 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
322 -s "tests.vpp.perf.crypto" \
323 --include pdrdiscANDnic_intel-xl710AND1t1cANDipsechw \
324 --include pdrdiscANDnic_intel-xl710AND2t2cANDipsechw \
326 RETURN_STATUS=$(echo $?)
329 pybot ${PYBOT_ARGS} \
330 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
331 -s "tests.vpp.perf" \
332 --exclude SKIP_PATCH \
335 RETURN_STATUS=$(echo $?)
338 pybot ${PYBOT_ARGS} \
339 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
340 -s "tests.vpp.perf" \
343 RETURN_STATUS=$(echo $?)
346 # run full performance test suite and exit on fail
347 pybot ${PYBOT_ARGS} \
348 -v TOPOLOGY_PATH:${WORKING_TOPOLOGY} \
349 -s "tests.vpp.perf" \
351 RETURN_STATUS=$(echo $?)
354 # Pybot output post-processing
355 echo Post-processing test data...
357 python ${SCRIPT_DIR}/resources/tools/scripts/robot_output_parser.py \
358 -i ${SCRIPT_DIR}/output.xml \
359 -o ${SCRIPT_DIR}/output_perf_data.xml \
361 if [ ! $? -eq 0 ]; then
362 echo "Parsing ${SCRIPT_DIR}/output.xml failed"
367 for i in ${ARCHIVE_ARTIFACTS[@]}; do
368 cp $( readlink -f ${i} | tr '\n' ' ' ) archive/
371 echo Post-processing finished.
373 exit ${RETURN_STATUS}