aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_dvr.py
AgeCommit message (Collapse)AuthorFilesLines
2020-03-27acl: API cleanupJakub Grajciar1-19/+12
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I09fa6c1b6917936351bd376b56c414ce24488095 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2020-03-26acl: revert acl: api cleanupOle Trøan1-12/+19
This reverts commit aad1ee149403994194cf37cef4530b042ba7df3a. Reason for revert: Verify failure. Doesn't build. Type: fix Change-Id: I91b1b26ac43edde4853e4561a0083d0b3a06efee Signed-off-by: Ole Troan <ot@cisco.com>
2020-03-26acl: API cleanupJakub Grajciar1-19/+12
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: If90d753f129312400c4c3669bb86289d0c3e0d99 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-11-08tests: python3 use byte strings in raw()Ole Troan1-9/+9
Raw('\xaf) and Raw(b'\xaf) are two quite different things in python 2 versus 3. In most cases this didn't make a difference, apart from those cases where length of payload actually mattered. Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I3cba5c1486e436a3ca8aa10a7b393da75aa9f6b9
2019-11-05misc: Fix python scripts shebang lineRenato Botelho do Couto1-1/+1
Type: fix Since CentOS 8, RPM build script doesn't accept '#!/usr/bin/env python' as a valid shebang line. It requires scripts to explicitly chose between python2 or python3. Change all to use python3 as suggested by Paul Vinciguerra. Depends-On: https://gerrit.fd.io/r/23170 Signed-off-by: Renato Botelho do Couto <renato@netgate.com> Change-Id: Ie72af9f60fd0609e07f05b70f8d96e738b2754d1
2019-06-18fib: fib api updatesNeale Ranns1-18/+22
Enhance the route add/del APIs to take a set of paths rather than just one. Most unicast routing protocols calcualte all the available paths in one run of the algorithm so updating all the paths at once is beneficial for the client. two knobs control the behaviour: is_multipath - if set the the set of paths passed will be added to those that already exist, otherwise the set will replace them. is_add - add or remove the set is_add=0, is_multipath=1 and an empty set, results in deleting the route. It is also considerably faster to add multiple paths at once, than one at a time: vat# ip_add_del_route 1.1.1.1/32 count 100000 multipath via 10.10.10.11 100000 routes in .572240 secs, 174751.80 routes/sec vat# ip_add_del_route 1.1.1.1/32 count 100000 multipath via 10.10.10.12 100000 routes in .528383 secs, 189256.54 routes/sec vat# ip_add_del_route 1.1.1.1/32 count 100000 multipath via 10.10.10.13 100000 routes in .757131 secs, 132077.52 routes/sec vat# ip_add_del_route 1.1.1.1/32 count 100000 multipath via 10.10.10.14 100000 routes in .878317 secs, 113854.12 routes/sec vat# ip_route_add_del 1.1.1.1/32 count 100000 multipath via 10.10.10.11 via 10.10.10.12 via 10.10.10.13 via 10.10.10.14 100000 routes in .900212 secs, 111084.93 routes/sec Change-Id: I416b93f7684745099c1adb0b33edac58c9339c1a Signed-off-by: Neale Ranns <neale.ranns@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-05-16tests: refactor. Replace literal constant w/ named constant.Paul Vinciguerra1-9/+18
* change literal packet count vlaues from 65 to a named constant of 67. (This value was recommended to exercise single, dual, and quad loops) Change-Id: Ieb1738dddacb8b6ea7fa25883032ac01a98399e1 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-04-10Tests Cleanup: Fix missing calls to setUpClass/tearDownClass.Paul Vinciguerra1-0/+8
Continuation/Part 2 of https://gerrit.fd.io/r/#/c/17092/ Change-Id: Id0122d84eaf2c05d29e5be63a594d5e528ee7c9a Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-29tests: test/vpp_l2.py fix missing name.Paul Vinciguerra1-2/+2
test/vpp_l2.py:213:26: F821 undefined name 'L2_VTR_OP' self.itf.set_vtr(L2_VTR_OP.L2_DISABLED) Move L2_VTR_OP enum to vpp_sub_interface.py where the VTR code is found. Change-Id: I9eb9a3a2c679813c221ce1d0c4fa8aac6076c443 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-28Typos. A bunch of typos I've been collecting.Paul Vinciguerra1-1/+1
Change-Id: I53ab8d17914e6563110354e4052109ac02bf8f3b Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-11vpp_papi_provider: Remove more wrapper functions.Ole Troan1-42/+48
Split this work up into pieces. Please don't add new wrappers to vpp_papi_provider.py. Change-Id: I0f8f2afc4cd2bba07ea70ddecea2d7319f7b2e10 Signed-off-by: Ole Troan <ot@cisco.com>
2019-03-04test framework: Fix wrapper functions to match API message names.Ole Troan1-24/+28
In preparation to remove the wrappers in vpp_papi_provider.py, ensure names used in tests match the actual API message names. Change-Id: I230ca4eb75aa727ff68d702e085a2edbbc6b6d19 Signed-off-by: Ole Troan <ot@cisco.com>
2018-09-25L2 BD: introduce a BD interface on which to send UU packetsNeale Ranns1-3/+5
Change-Id: I21ad6b04c19c8735d057174b1f260a59f2812241 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-06-24Revert "Revert "make test: fix broken interfaces""Klement Sekera1-8/+4
This reverts commit c8efa29b6f9a91381897b54f1147daf922ed7164. Change-Id: I1d5c5773d5f86a63073e255336bd9de628e26179 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-06-22Revert "make test: fix broken interfaces"Ole Troan1-4/+8
This reverts commit d5c60b96a3fd93916fc4af5c8d6d25625c28242e. Change-Id: I3632b9c3f76c615aee897f28f76d094e7031e689 Signed-off-by: Ole Troan <ot@cisco.com>
2018-06-22make test: fix broken interfacesKlement Sekera1-8/+4
Change-Id: I2e092774f81503e04b53cc6c6b5d357fe3fc52ab Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-04-18typo fix: UNKOWN -> UNKNOWNAndrey "Zed" Zaikin1-1/+1
Change-Id: I008a4d7ad7160d1f07e7ceef712a5318a9368308 Signed-off-by: Andrey "Zed" Zaikin <zed.0xff@gmail.com>
2018-03-16remove spurious print statements from DVR testsNeale Ranns1-2/+0
Change-Id: I3b1c71b144b4760922a467086fcdb410cd225c57 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-03-13Common form of fib-path reproting in dumpsNeale Ranns1-0/+17
Change-Id: I8f6fdbbeef2ac7e9fe5d87490ae5cba6e9a0b294 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-01-09DVR: run L3 output featuresNeale Ranns1-16/+44
- rename l2_bridged to is_dvr. Including on the ip.api this was new in the 18.01 release so no compatability issues. - steal the free space in vnet_buffer_opaque_t for use with flags. - run the ipX-output feature arc from the DVR DPO Change-Id: I040e5976d1dbe076fcdda3a40a7804f56337ce3f Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-01-09test: consolidate the multiple versions of send_and_*Neale Ranns1-17/+0
Change-Id: I7fa7d0ebf73dab8264a2e5ddbd412600d78ead05 Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-12-20L2 EmulationNeale Ranns1-28/+214
L2 Emulation is a feautre that is applied to L2 ports to 'extract' IP packets from the L2 path and inject them into the L3 path (i.e. into the appropriate ip[4|6]_input node). L3 routes in the table_id for that interface should then be configured as DVR routes, therefore the forwarded packet has the L2 header preserved and togehter the L3 routed system behaves like an L2 bridge. Change-Id: I8effd7e2f4c67ee277b73c7bc79aa3e5a3e34d03 Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-11-11MPLS disposition actions at the tail of unicast LSPsNeale Ranns1-3/+1
Change-Id: I8c42e26152f2ed1246f91b789887bfc923418bdf Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-10-15Revert "Enforce FIB table creation before use"Florin Coras1-0/+2
This reverts commit f9342023c19887da656133e2688a90d70383b0c5. Reverting to unblock master. No idea why jjb +1ed this patch! On closer inspection it looks like it -1ed it and subsequently changed opinion. CSIT tests should be fixed before re-merging. Change-Id: I26608912a962c52083073e16c7c9d2cc44a3cc8d Signed-off-by: Florin Coras <fcoras@cisco.com>
2017-10-13Enforce FIB table creation before useNeale Ranns1-2/+0
last i the serise of the use of the FIB table create/delete API. VPP now forces the tables to have been explicitly creted before they are used. Change-Id: Ifde3b1bbb76697a01ab71bce4f5264e6d1725467 Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-10-05Distributed Virtual Router SupportNeale Ranns1-0/+178
A distributed virtual router works by attmpeting to switch a packet, but on failing to find a local consumer (i.e. the packet is destined to a locally attached host) then the packet is sent unmodified 'upstream' to where the rest of the 'distributed' router is present. When L3 switching a packet this means the L2 header must not be modifed. This patch adds a 'l2-bridge' object to the L3 FIB which re-injects packets from the L3 path back into the L2 path - use with extreme caution. Change-Id: I069724eb45956647d7980cbe40a80a788ee6ee82 Signed-off-by: Neale Ranns <nranns@cisco.com>
n>"--noncritical MULTI_THREAD" ARCHIVE_ARTIFACTS=(log.html output.xml report.html) SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" export PYTHONPATH=${SCRIPT_DIR} # Create tmp dir mkdir ${SCRIPT_DIR}/tmp # Use tmp dir to store log files LOG_PATH="${SCRIPT_DIR}/tmp" if [ -f "/etc/redhat-release" ]; then DISTRO="CENTOS" sudo yum install -y python-devel python-virtualenv else DISTRO="UBUNTU" export DEBIAN_FRONTEND=noninteractive sudo apt-get -y update sudo apt-get -y install libpython2.7-dev python-virtualenv fi # 1st step: Download and prepare VPP packages # Temporarily download VPP packages from nexus.fd.io if [ "${#}" -ne "0" ]; then arr=(${@}) echo ${arr[0]} else case "$DISTRO" in CENTOS ) PACKAGE=rpm ;; UBUNTU ) PACKAGE=deb esac # Download the latest VPP build install packages rm -f *.${PACKAGE} echo Downloading VPP packages... bash ${SCRIPT_DIR}/resources/tools/scripts/download_install_vpp_pkgs.sh --skip-install fi # Take vpp package and get the vpp version VPP_PKGS=(*.$PACKAGE) case "$DISTRO" in CENTOS ) VPP_VER="$( expr match $(ls *.rpm | head -n 1) 'vpp-\(.*\).rpm' )" ;; UBUNTU ) VPP_VER="$( expr match $(ls *.deb | head -n 1) 'vpp-\(.*\)-deb.deb' )" esac echo ${VPP_PKGS[@]} set +x echo "****************************************************************************************************************************************" echo "1st step: Download VPP packages FINISHED" echo "VPP version to be tested: ${VPP_VER}" echo "****************************************************************************************************************************************" set -x # 2nd step: Start virtual env and install requirements echo Starting virtual env... virtualenv --system-site-packages env . env/bin/activate echo Installing requirements... pip install -r ${SCRIPT_DIR}/requirements.txt set +x echo "****************************************************************************************************************************************" echo "2nd step: Start virtual env and install requirements FINISHED" echo "****************************************************************************************************************************************" set -x # 3rd step: Prepare VIRL system echo Preparing VIRL system... VIRL_SERVERS=("10.30.51.28" "10.30.51.29" "10.30.51.30") VIRL_SERVER="" VIRL_USERNAME=jenkins-in VIRL_PKEY=priv_key VIRL_SERVER_STATUS_FILE="status" VIRL_SERVER_EXPECTED_STATUS="PRODUCTION" VIRL_SESSION_EXPIRY="620" case "$DISTRO" in CENTOS ) VIRL_TOPOLOGY=$(cat ${SCRIPT_DIR}/VIRL_TOPOLOGY_CENTOS) VIRL_RELEASE=$(cat ${SCRIPT_DIR}/VIRL_RELEASE_CENTOS) ;; UBUNTU ) VIRL_TOPOLOGY=$(cat ${SCRIPT_DIR}/VIRL_TOPOLOGY_UBUNTU) VIRL_RELEASE=$(cat ${SCRIPT_DIR}/VIRL_RELEASE_UBUNTU) esac SSH_OPTIONS="-i ${VIRL_PKEY} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o BatchMode=yes -o LogLevel=error" function ssh_do() { echo echo "### " ssh $@ ssh ${SSH_OPTIONS} $@ } rm -f ${VIRL_PKEY} cat > ${VIRL_PKEY} <<EOF -----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEA+IHXq87GcqMR1C47rzx6Cbip5Ghq8pKrbqKrP5Nf41HcYrT6 GOXl9nFWKsMOzIlIn+8y7Il27eZh7csQGApbg8QLiHMtcYEmWNzKZpkqg4nuAPxX VXwlKgnKX902SrET9Gp9TDayiHtCRWVfrlPPPSA0UEXW6BjLN/uHJ+W/Xzrrab+9 asBVa05vT2W6n0KJ66zfCaeDM912mQ6Stt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3ptfsKipZe91ngBPUnL9s0Dolx452RVAj yctHB8uRxWYgqDkjsxtzXf1HnZBBkBS8CUzYj+hdfuddoeKLaY3invXLCiV+PpXS U4KAK9kCgYEAtSv0m5+Fg74BbAiFB6kCh11FYkW94YI6B/E2D/uVTD5dJhyEUFgZ cWsudXjMki8734WSpMBqBp/J8wG3C9ZS6IpQD+U7UXA+roB7Qr+j4TqtWfM+87Rh maOpG56uAyR0w5Z9BhwzA3VakibVk9KwDgZ29WtKFzuATLFnOtCS46E= -----END RSA PRIVATE KEY----- EOF chmod 600 ${VIRL_PKEY} # # Pick a random host from the array of VIRL servers, and attempt # to reach it and verify it's status. # # The server must be reachable, and have a "status" file with # the content "PRODUCTION", to be selected. # # If the server is not reachable, or does not have the correct # status, remove it from the array and start again. # # Abort if there are no more servers left in the array. # while [[ ! "$VIRL_SERVER" ]] do num_hosts=${#VIRL_SERVERS[@]} if [ $num_hosts == 0 ] then echo "No more VIRL candidate hosts available, failing." exit 127 fi element=$[ $RANDOM % $num_hosts ] virl_server_candidate=${VIRL_SERVERS[$element]} virl_server_status=$(ssh ${SSH_OPTIONS} ${VIRL_USERNAME}@${virl_server_candidate} cat $VIRL_SERVER_STATUS_FILE 2>&1) echo VIRL HOST $virl_server_candidate status is \"$virl_server_status\" if [ "$virl_server_status" == "$VIRL_SERVER_EXPECTED_STATUS" ] then # Candidate is in good status. Select this server. VIRL_SERVER="$virl_server_candidate" else # Candidate is in bad status. Remove from array. VIRL_SERVERS=("${VIRL_SERVERS[@]:0:$element}" "${VIRL_SERVERS[@]:$[$element+1]}") fi done VIRL_DIR_LOC="/tmp" VPP_PKGS_VIRL=(${VPP_PKGS[@]}) # Prepend directory location at remote host to deb file list for index in "${!VPP_PKGS_VIRL[@]}"; do VPP_PKGS_VIRL[${index}]=${VIRL_DIR_LOC}/${VPP_PKGS_VIRL[${index}]} done echo "Updated file names: " ${VPP_PKGS_VIRL[@]} cat ${VIRL_PKEY} # Copy the files to VIRL host scp ${SSH_OPTIONS} *.${PACKAGE} \ ${VIRL_USERNAME}@${VIRL_SERVER}:${VIRL_DIR_LOC}/ result=$? if [ "${result}" -ne "0" ]; then echo "Failed to copy vpp deb files to virl host" echo ${result} exit ${result} fi # Start a simulation on VIRL server echo "Starting simulation on VIRL server" function stop_virl_simulation { ssh ${SSH_OPTIONS} ${VIRL_USERNAME}@${VIRL_SERVER}\ "stop-testcase ${VIRL_SID}" } VIRL_SID=$(ssh ${SSH_OPTIONS} \ ${VIRL_USERNAME}@${VIRL_SERVER} \ "start-testcase -vv --copy ${VIRL_TOPOLOGY} \ --expiry ${VIRL_SESSION_EXPIRY} \ --release ${VIRL_RELEASE} ${VPP_PKGS_VIRL[@]}") retval=$? if [ ${retval} -ne "0" ]; then echo "VIRL simulation start failed" exit ${retval} fi if [[ ! "${VIRL_SID}" =~ session-[a-zA-Z0-9_]{6} ]]; then echo "No VIRL session ID reported." exit 127 fi # Upon script exit, cleanup the VIRL simulation execution trap stop_virl_simulation EXIT echo ${VIRL_SID} ssh_do ${VIRL_USERNAME}@${VIRL_SERVER} cat /scratch/${VIRL_SID}/topology.yaml # Download the topology file from VIRL session scp ${SSH_OPTIONS} \ ${VIRL_USERNAME}@${VIRL_SERVER}:/scratch/${VIRL_SID}/topology.yaml \ topologies/enabled/topology_VIRL.yaml retval=$? if [ ${retval} -ne "0" ]; then echo "Failed to copy topology file from VIRL simulation" exit ${retval} fi set +x echo "****************************************************************************************************************************************" echo "3rd step: Start the simulation on the VIRL server FINISHED" echo "****************************************************************************************************************************************" set -x # 4th step: Run functional test suites RC=0 MORE_FAILS=0 echo Running functional tests on the VIRL system... # There are used three iterations of functional tests there # to check the stability and reliability of the results. partial_logs="" for test_set in 1 2 3 do echo echo Functional test loop: ${test_set} echo pybot -L TRACE -W 136\ -v TOPOLOGY_PATH:${SCRIPT_DIR}/topologies/enabled/topology_VIRL.yaml \ --suite "tests.vpp.func" \ --include vm_envAND3_node_single_link_topo \ --include vm_envAND3_node_double_link_topo \ --exclude PERFTEST \ --noncritical EXPECTED_FAILING \ --output ${LOG_PATH}/output_func_test_set${test_set} \ tests/ PARTIAL_RC=$(echo $?) partial_logs="${partial_logs} ${LOG_PATH}/output_func_test_set${test_set}.xml" if [ ${PARTIAL_RC} -eq 250 ]; then MORE_FAILS=1 fi RC=$((RC+PARTIAL_RC)) done set +x echo "****************************************************************************************************************************************" echo "4th step: Run functional tests FINISHED" echo "****************************************************************************************************************************************" set -x # Set RETURN_STATUS=1 if some critical test failed if [ ! ${RC} -eq 0 ]; then RETURN_STATUS=1 fi # Log the final result if [ ${RC} -eq 0 ]; then set +x echo echo "========================================================================================================================================" echo "Final result of all test loops: | PASS |" echo "All critical tests have passed." echo "========================================================================================================================================" echo set -x elif [ ${MORE_FAILS} -eq 0 ]; then if [ ${RC} -eq 1 ]; then HLP_STR="test has" else HLP_STR="tests have" fi set +x echo echo "========================================================================================================================================" echo "Final result of all test loops: | FAIL |" echo "${RC} critical ${HLP_STR} failed." echo "========================================================================================================================================" echo set -x else set +x echo echo "========================================================================================================================================" echo "Final result of all test loops: | FAIL |" echo "More then 250 critical tests have failed in one test loop." echo "========================================================================================================================================" echo set -x fi # 7th step: Post-processing test data echo Post-processing test data... # Rebot output post-processing rebot --noncritical EXPECTED_FAILING \ --output output.xml ${partial_logs} # Remove unnecessary files rm -f ${partial_logs} # Archive artifacts mkdir archive for i in ${ARCHIVE_ARTIFACTS[@]}; do cp $( readlink -f ${i} | tr '\n' ' ' ) archive/ done echo Post-processing finished. exit ${RETURN_STATUS}