summaryrefslogtreecommitdiffstats
path: root/src/examples
AgeCommit message (Expand)AuthorFilesLines
2019-10-07docs: change VPP_WITH_SAMPLE_PLUGIN to SAMPLE_PLUGIN in sample plugin documen...Haggai Eran1-4/+4
2019-09-25ip: respect buffer boundary when searching for ipv6 headersKlement Sekera1-2/+1
2019-09-25api: split api generated filesOle Troan4-200/+9
2019-09-16api: autogenerate api trace print/endianOle Troan1-1/+1
2019-08-01docs: Small fixes and orderingNathan Skrzypczak1-1/+1
2019-07-29misc: add vnet/pipeline.h exampleDave Barach1-1/+89
2019-07-09vat: unload unused vat pluginsDave Barach1-27/+11
2019-06-24vlib: packet tracer support for pkt thread handoffsDave Barach5-0/+536
2019-05-30sample-plugin: refactor .api to use explicit typesOle Troan1-8/+9
2019-05-16init / exit function orderingDave Barach1-8/+7
2018-11-14Remove c-11 memcpy checks from perf-critical codeDave Barach1-28/+28
2018-11-13vlib rename vlib_frame_args(...) to vlib_frame_scalar_args(..)Damjan Marion1-2/+2
2018-10-23c11 safe string handling supportDave Barach2-2/+2
2018-09-14cpack: add deb/rpm packaging to VPP moduleDamjan Marion2-0/+8
2018-09-12cmake: create cmake VPP module, update sample-plugin so it uses itDamjan Marion5-126/+32
2018-08-22Consolidate the [un]format_mac_address implementationsNeale Ranns1-7/+1
2018-08-01Store USE_DLMALLOC in vppinfra/config.hDamjan Marion2-4/+1
2018-07-26Improve the sample plugin node dispatch functionDave Barach1-128/+473
2018-07-20fix issue with missing sample_main in sample pluginDamjan Marion1-0/+2
2018-07-18Add config option to use dlmalloc instead of mheapDave Barach2-1/+14
2018-04-25Fix sample-plugin build with newer clang versionsDamjan Marion1-0/+20
2018-03-14Clean up vpp build bootstrap stepDave Barach1-3/+4
2018-01-23VPPAPIGEN: vppapigen replacement in Python PLY.Ole Troan2-5/+3
2017-12-06Remove unused, uninteresting codeDave Barach2-527/+122
2017-10-24Add extern to *_main global variable declarations in header files.Dave Wallace2-2/+2
2017-10-09vppapigen: support per-file (major,minor,patch) version stampsDave Barach1-0/+2
2017-10-03Repair vlib API socket serverDave Barach3-3/+0
2017-09-07vlib physmem reworkDamjan Marion1-2/+1
2017-08-23NAT: Rename snat plugin to nat (VPP-955)Matus Fabian1-1/+1
2017-06-09Sample plugin: Add sample plugin documentationRay Kinsella2-7/+89
2017-06-07VPP-872 and End.T function for SRv6Pablo Camarillo1-21/+82
2017-05-05First commit SR MPLSPablo Camarillo2-3/+3
2017-04-25"autoreply" flag: autogenerate standard xxx_reply_t messagesDave Barach1-9/+1
2017-04-20Extend ebuild to specify "configure" subdir, enable verify for sample-pluginDamjan Marion1-2/+0
2017-04-06Use thread local storage for thread indexDamjan Marion1-2/+2
2017-03-29Bugfixing and documentation for SRv6Pablo Camarillo4-0/+470
2017-03-22vlib: add description field in plugin registrationDamjan Marion1-0/+1
2017-03-16API:replaced all REPLY_MACRO's with api_helper_macros.hEyal Bari1-23/+2
2017-03-04Fix duplicate binary API registration messages / bugsDave Barach1-2/+2
2017-02-22Support multiple plugin build in the sample-pluginAnlu Yan3-18/+52
2017-02-16Fix sample plugin breakage.Anlu Yan2-22/+9
2017-02-02Refactor fragile msg macro W and W2 to not burry return control flow.Jon Loeliger1-1/+3
2017-02-02Convert message macro S to accept a message pointer parameter;Jon Loeliger1-1/+1
2017-02-02Ensure all M() and M2() second parameters are the message pointer.Jon Loeliger1-1/+1
2017-01-28Add files to CLEANFILES for robust make clean.Burt Silverman1-0/+2
2017-01-25Repair plugin binary API message numberingDave Barach1-0/+2
2017-01-23binary-api debug CLI works with pluginsDave Barach1-36/+1
2017-01-17sample-plugin: fix buildDamjan Marion2-2/+2
2017-01-01Move java,lua api and remaining plugins to src/Damjan Marion9-0/+951
2016-12-28Reorganize source tree to use single autotools instanceDamjan Marion4-0/+1351
MDkOx7baWKSoLQIDAQABAoIBAQCNBeolNp+JWJ76 gQ4fwLsknyXSV6sxYyhkDW4PEwwcTU06uqce0AAzXVffxne0fMe48x47+zqBgPbb 4huM+Pu8B9nfojUMr5TaYtl9Z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VakibVk9KwDgZ29WtKFzuATLFnOtCS46E= -----END RSA PRIVATE KEY----- EOF chmod 600 ${VIRL_PKEY} # # Pick a random host from the array of VIRL servers for every test set run # 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. # for index in "${!TEST_GROUPS[@]}"; do VIRL_SERVER[${index}]="" while [[ ! "${VIRL_SERVER[${index}]}" ]]; 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[${index}]="$virl_server_candidate" else # Candidate is in bad status. Remove from array. VIRL_SERVERS=("${VIRL_SERVERS[@]:0:$element}" "${VIRL_SERVERS[@]:$[$element+1]}") fi done done echo "Selected VIRL servers: ${VIRL_SERVER[@]}" # Temporarily download VPP packages from nexus.fd.io if [ "${#}" -ne "0" ]; then arr=(${@}) echo ${arr[0]} else rm -f *.deb VPP_STABLE_VER=$(cat ${SCRIPT_DIR}/VPP_STABLE_VER) VPP_REPO_URL=$(cat ${SCRIPT_DIR}/VPP_REPO_URL) VPP_CLASSIFIER="-deb" wget -q "${VPP_REPO_URL}/vpp/${VPP_STABLE_VER}/vpp-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit wget -q "${VPP_REPO_URL}/vpp-dbg/${VPP_STABLE_VER}/vpp-dbg-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit wget -q "${VPP_REPO_URL}/vpp-dev/${VPP_STABLE_VER}/vpp-dev-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit wget -q "${VPP_REPO_URL}/vpp-dpdk-dev/${VPP_STABLE_VER}/vpp-dpdk-dev-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit wget -q "${VPP_REPO_URL}/vpp-dpdk-dkms/${VPP_STABLE_VER}/vpp-dpdk-dkms-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit wget -q "${VPP_REPO_URL}/vpp-lib/${VPP_STABLE_VER}/vpp-lib-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit wget -q "${VPP_REPO_URL}/vpp-plugins/${VPP_STABLE_VER}/vpp-plugins-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit fi VPP_DEBS=(*.deb) echo ${VPP_DEBS[@]} VIRL_DIR_LOC="/tmp" VPP_DEBS_FULL=(${VPP_DEBS[@]}) # Prepend directory location at remote host to deb file list for index in "${!VPP_DEBS_FULL[@]}"; do VPP_DEBS_FULL[${index}]=${VIRL_DIR_LOC}/${VPP_DEBS_FULL[${index}]} done echo "Updated file names: " ${VPP_DEBS_FULL[@]} cat ${VIRL_PKEY} # Copy the files to VIRL hosts DONE="" for index in "${!VIRL_SERVER[@]}"; do # Do not copy files in case they have already been copied to the VIRL host [[ "${DONE[@]}" =~ "${VIRL_SERVER[${index}]}" ]] && copy=0 || copy=1 if [ "${copy}" -eq "0" ]; then echo "VPP deb files have already been copied to the VIRL host ${VIRL_SERVER[${index}]}" else scp ${SSH_OPTIONS} *.deb \ ${VIRL_USERNAME}@${VIRL_SERVER[${index}]}:${VIRL_DIR_LOC}/ result=$? if [ "${result}" -ne "0" ]; then echo "Failed to copy VPP deb files to VIRL host ${VIRL_SERVER[${index}]}" echo ${result} exit ${result} else echo "VPP deb files successfully copied to the VIRL host ${VIRL_SERVER[${index}]}" fi DONE+=(${VIRL_SERVER[${index}]}) fi done # Start a simulation on VIRL server function stop_virl_simulation { for index in "${!VIRL_SERVER[@]}"; do ssh ${SSH_OPTIONS} ${VIRL_USERNAME}@${VIRL_SERVER[${index}]}\ "stop-testcase ${VIRL_SID[${index}]}" done } # Upon script exit, cleanup the simulation execution trap stop_virl_simulation EXIT for index in "${!VIRL_SERVER[@]}"; do echo "Starting simulation nr. ${index} on VIRL server ${VIRL_SERVER[${index}]}" VIRL_SID[${index}]=$(ssh ${SSH_OPTIONS} \ ${VIRL_USERNAME}@${VIRL_SERVER[${index}]} \ "start-testcase -c double-ring-nested ${VPP_DEBS_FULL[@]}") retval=$? if [ "$?" -ne "0" ]; then echo "VIRL simulation start failed on ${VIRL_SERVER[${index}]}" exit ${retval} fi if [[ ! "${VIRL_SID[${index}]}" =~ session-[a-zA-Z0-9_]{6} ]]; then echo "No VIRL session ID reported." exit 127 fi echo "VIRL simulation started on ${VIRL_SERVER[${index}]}" ssh_do ${VIRL_USERNAME}@${VIRL_SERVER[${index}]}\ cat /scratch/${VIRL_SID[${index}]}/topology.yaml # Download the topology file from VIRL session and rename it scp ${SSH_OPTIONS} \ ${VIRL_USERNAME}@${VIRL_SERVER[${index}]}:/scratch/${VIRL_SID[${index}]}/topology.yaml \ topologies/enabled/topology${index}.yaml retval=$? if [ "$?" -ne "0" ]; then echo "Failed to copy topology file from VIRL simulation nr. ${index} on VIRL server ${VIRL_SERVER[${index}]}" exit ${retval} fi done echo ${VIRL_SID[@]} virtualenv --system-site-packages env . env/bin/activate echo pip install pip install -r ${SCRIPT_DIR}/requirements.txt for index in "${!VIRL_SERVER[@]}"; do pykwalify -s ${SCRIPT_DIR}/resources/topology_schemas/3_node_topology.sch.yaml \ -s ${SCRIPT_DIR}/resources/topology_schemas/topology.sch.yaml \ -d ${SCRIPT_DIR}/topologies/enabled/topology${index}.yaml \ -vvv if [ "$?" -ne "0" ]; then echo "Topology${index} schema validation failed." echo "However, the tests will start." fi done function run_test_set() { set +x OLDIFS=$IFS IFS="," nr=$(echo $1) rm -f ${LOG_PATH}/test_run${nr}.log exec &> >(while read line; do echo "$(date +'%H:%M:%S') $line" \ >> ${LOG_PATH}/test_run${nr}.log; done;) suite_str="" for suite in ${TEST_GROUPS[${nr}]}; do suite_str="${suite_str} --suite ${SUITE_PATH}.${suite}" done IFS=$OLDIFS echo "PYTHONPATH=`pwd` pybot -L TRACE -W 136\ -v TOPOLOGY_PATH:${SCRIPT_DIR}/topologies/enabled/topology${nr}.yaml \ ${suite_str} \ --include vm_envAND3_node_single_link_topo \ --include vm_envAND3_node_double_link_topo \ --exclude PERFTEST \ --exclude SKIP_PATCH \ --noncritical EXPECTED_FAILING \ --output ${LOG_PATH}/log_test_set_run${nr} \ tests/" PYTHONPATH=`pwd` pybot -L TRACE -W 136\ -v TOPOLOGY_PATH:${SCRIPT_DIR}/topologies/enabled/topology${nr}.yaml \ ${suite_str} \ --include vm_envAND3_node_single_link_topo \ --include vm_envAND3_node_double_link_topo \ --exclude PERFTEST \ --exclude SKIP_PATCH \ --noncritical EXPECTED_FAILING \ --output ${LOG_PATH}/log_test_set_run${nr} \ tests/ local_run_rc=$? echo ${local_run_rc} > ${SHARED_MEMORY_PATH}/rc_test_run${nr} set -x } set +x # Send to background an instance of the run_test_set() function for each number, # record the pid. for index in "${!VIRL_SERVER[@]}"; do run_test_set ${index} & pid=$! echo "Sent to background: Test_set${index} (pid=$pid)" pids[$pid]=$index done echo echo -n "Waiting..." # Watch the stable of background processes. # If a pid goes away, remove it from the array. while [ -n "${pids[*]}" ]; do for i in $(seq 0 9); do sleep 1 echo -n "." done for pid in "${!pids[@]}"; do if ! ps "$pid" >/dev/null; then echo -e "\n" echo "Test_set${pids[$pid]} with PID $pid finished." unset pids[$pid] fi done if [ -z "${!pids[*]}" ]; then break fi echo -n -e "\nStill waiting for test set(s): ${pids[*]} ..." done echo echo "All test set runs finished." echo set -x RC=0 for index in "${!VIRL_SERVER[@]}"; do echo "Test_set${index} log:" cat ${LOG_PATH}/test_run${index}.log RC_PARTIAL_RUN=$(cat ${SHARED_MEMORY_PATH}/rc_test_run${index}) RC=$((RC+RC_PARTIAL_RUN)) rm -f ${SHARED_MEMORY_PATH}/rc_test_run${index} rm -f ${LOG_PATH}/test_run${index}.log echo done # 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 else 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 fi echo Post-processing test data... partial_logs="" for index in "${!VIRL_SERVER[@]}"; do partial_logs="${partial_logs} ${LOG_PATH}/log_test_set_run${index}.xml" done # Rebot output post-processing rebot --noncritical EXPECTED_FAILING \ --output output.xml ${partial_logs} # Remove unnecessary log files rm -f ${partial_logs} echo Post-processing finished. if [ ${RC} -eq 0 ]; then RETURN_STATUS=0 else RETURN_STATUS=1 fi exit ${RETURN_STATUS}