On 07.12.2015 13:01, Stuart Haslam wrote: > On Wed, Dec 02, 2015 at 04:13:25PM +0300, Ilya Maximets wrote: >> Signed-off-by: Ilya Maximets <i.maxim...@samsung.com> >> --- >> platform/linux-generic/test/Makefile.am | 1 + >> platform/linux-generic/test/pktio/Makefile.am | 3 +- >> platform/linux-generic/test/pktio/pktio_run_tap | 111 >> ++++++++++++++++++++++++ >> 3 files changed, 114 insertions(+), 1 deletion(-) >> create mode 100755 platform/linux-generic/test/pktio/pktio_run_tap >> >> diff --git a/platform/linux-generic/test/Makefile.am >> b/platform/linux-generic/test/Makefile.am >> index 1475589..28bd3dc 100644 >> --- a/platform/linux-generic/test/Makefile.am >> +++ b/platform/linux-generic/test/Makefile.am >> @@ -5,6 +5,7 @@ ODP_MODULES = pktio >> >> if test_vald >> TESTS = pktio/pktio_run \ >> + pktio/pktio_run_tap \ >> ${top_builddir}/test/validation/buffer/buffer_main$(EXEEXT) \ >> >> ${top_builddir}/test/validation/classification/classification_main$(EXEEXT) \ >> ${top_builddir}/test/validation/cpumask/cpumask_main$(EXEEXT) \ >> diff --git a/platform/linux-generic/test/pktio/Makefile.am >> b/platform/linux-generic/test/pktio/Makefile.am >> index 4d39372..ea0ad87 100644 >> --- a/platform/linux-generic/test/pktio/Makefile.am >> +++ b/platform/linux-generic/test/pktio/Makefile.am >> @@ -1,5 +1,6 @@ >> dist_check_SCRIPTS = pktio_env \ >> - pktio_run >> + pktio_run \ >> + pktio_run_tap >> >> if HAVE_PCAP >> dist_check_SCRIPTS += pktio_run_pcap >> diff --git a/platform/linux-generic/test/pktio/pktio_run_tap >> b/platform/linux-generic/test/pktio/pktio_run_tap >> new file mode 100755 >> index 0000000..4e2526f >> --- /dev/null >> +++ b/platform/linux-generic/test/pktio/pktio_run_tap >> @@ -0,0 +1,111 @@ >> +#!/bin/sh >> +# >> +# Copyright (c) 2015, Ilya Maximets <i.maxim...@samsung.com> >> +# All rights reserved. >> +# >> +# SPDX-License-Identifier: BSD-3-Clause >> +# >> + >> +# directories where pktio_main binary can be found: >> +# -in the validation dir when running make check (intree or out of tree) >> +# -in the script directory, when running after 'make install', or >> +# -in the validation when running standalone intree. >> +# -in the current directory. >> +# running stand alone out of tree requires setting PATH >> +PATH=${TEST_DIR}/pktio:$PATH >> +PATH=$(dirname $0):$PATH >> +PATH=$(dirname $0)/../../../../test/validation/pktio:$PATH >> +PATH=.:$PATH >> + >> +pktio_main_path=$(which pktio_main${EXEEXT}) >> +if [ -x "$pktio_main_path" ] ; then >> + echo "running with $pktio_main_path" >> +else >> + echo "cannot find pktio_main${EXEEXT}: please set you PATH for it." >> +fi >> + >> +TAP_BASE_NAME=iotap_vald >> +IF0=${TAP_BASE_NAME}0 >> +IF1=${TAP_BASE_NAME}1 >> +BR=${TAP_BASE_NAME}_br >> + >> +export ODP_PKTIO_IF0="tap:$IF0" >> +export ODP_PKTIO_IF1="tap:$IF1" >> + >> +tap_cleanup() >> +{ >> + ret=$? >> + >> + for iface in $IF0 $IF1; do >> + ip link set dev $iface nomaster >> + done >> + >> + ip link delete $BR type bridge >> + >> + for iface in $IF0 $IF1; do >> + ip tuntap del mode tap $iface >> + done >> + >> + trap - EXIT >> + exit $ret >> +} >> + >> +tap_setup() >> +{ >> + if [ "$(id -u)" != "0" ]; then >> + echo "pktio: need to be root to setup TAP interfaces." >> + return 1 > > This needs to exit with a code of 77 so that the test gets recorded as > SKIPped rather than FAILed. > > -- > Stuart. > >
Thanks. New version posted. Best regards, Ilya Maximets. _______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp