> -----Original Message-----
> From: EXT Maxim Uvarov [mailto:[email protected]]
> Sent: Wednesday, March 02, 2016 2:38 PM
> To: Elo, Matias (Nokia - FI/Espoo) <[email protected]>; lng-
> [email protected]
> Subject: Re: [lng-odp] [API-NEXT PATCH v3 9/9] linux-generic: validation: add
> netmap test
> 
> On 02/26/16 16:48, Elo, Matias (Nokia - FI/Espoo) wrote:
> >
> >> -----Original Message-----
> >> From: lng-odp [mailto:[email protected]] On Behalf Of EXT
> Maxim
> >> Uvarov
> >> Sent: Thursday, February 25, 2016 1:47 PM
> >> To: [email protected]
> >> Subject: Re: [lng-odp] [API-NEXT PATCH v3 9/9] linux-generic: validation: 
> >> add
> >> netmap test
> >>
> >> Matias, I merged all patches, but not this one.
> >> make distcheck fails if netmap is turned on.
> >>
> >> I have suspicious that Makefile ifdefs does not work in
> >> ./platform/l-g/test/pktio/ directory.
> >
> > Hi,
> >
> > I've been trying to debug this and it seems that the problem is that all 
> > tests
> added to 'TESTS' in odp/platform/linux-generic/test/Makefile.am are also being
> run in distcheck. As distcheck seems to always run with default configuration
> options netmap tests will fail. I'm not that familiar with the automake 
> system, so
> do you have ideas how to circumvent this problem?
> >
> > -Matias
> >
> Looks like I understand what is doing on.
> 
> Top level Makefile is generated with netmap support.
> 
> Then on make distcheck, separate folder created and configure run
> without netmap:
> 
>      am_cflags:         -pthread -DHAVE_PCAP  -DODP_DEBUG_PRINT=1
> -DODP_DEBUG=1 -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
> -Wmissing-declarations -Wold-style-definition -Wpointer-arith
> -Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonliteral
> -Wformat-security -Wundef -Wwrite-strings -std=c99
> 
>        && ../configure \
>          --enable-test-cpp --enable-test-perf --enable-test-vald
> --with-testdir \
>           \
>          --srcdir=.. --prefix="$dc_install_base" \
> 
> 
> So that there is some collision in references for test and actually
> configured build.
> 
> That happens in top level Makefile.am:
> 
> AM_DISTCHECK_CONFIGURE_FLAGS = --enable-test-cpp \
>                     --enable-test-perf \
>                     --enable-test-vald \
>                     --with-testdir
> 
> Adding something like:
> 
> if netmap_support
> AM_DISTCHECK_CONFIGURE_FLAGS += --with-netmap-
> path=/opt/Linaro/netmap
> endif
> 
> Fix issue.
> 
> So the problem is more general, we were lucky with pcap, tap and etc. In
> my understanding
> distcheck should inherit all config options from already configured
> Makefile.
> 
> Because of:
> 1) it's more general problem
> 2) our CI does not yet test netmap your, CI tests will not fail.
> 
> I'm applying original patch. And creating bug to fix that problem.
> 
> Maxim.

OK, thanks.

-Matias

> 
> 
> 
> >> Patch it self is good and all test passes. Only thing is missing is
> >> distcheck.
> >>
> >> Maxim.
> >>
> >>
> >> On 02/23/16 18:25, Matias Elo wrote:
> >>> From: Stuart Haslam <[email protected]>
> >>>
> >>> Add a test for the netmap pktio type. This test will only run as root
> >>> and if the netmap kernel module is loaded, otherwise it will be skipped.
> >>>
> >>> There are three different interface types tested by default, VALE ports,
> >>> pipe ports and veth (veth only if the netmap enabled veth module is
> >>> loaded).
> >>>
> >>> Reviewed-by: Petri Savolainen <[email protected]>
> >>> Signed-off-by: Matias Elo <[email protected]>
> >>> Signed-off-by: Stuart Haslam <[email protected]>
> >>> ---
> >>>    platform/linux-generic/test/Makefile.am            |   3 +
> >>>    platform/linux-generic/test/pktio/pktio_run_netmap | 120
> >> +++++++++++++++++++++
> >>>    2 files changed, 123 insertions(+)
> >>>    create mode 100755 platform/linux-generic/test/pktio/pktio_run_netmap
> >>>
> >>> diff --git a/platform/linux-generic/test/Makefile.am b/platform/linux-
> >> generic/test/Makefile.am
> >>> index 4bf24cb..7a20048 100644
> >>> --- a/platform/linux-generic/test/Makefile.am
> >>> +++ b/platform/linux-generic/test/Makefile.am
> >>> @@ -41,6 +41,9 @@ if PKTIO_IPC
> >>>    TESTS += pktio_ipc/pktio_ipc_run
> >>>    SUBDIRS += pktio_ipc
> >>>    endif
> >>> +if netmap_support
> >>> +TESTS += pktio/pktio_run_netmap
> >>> +endif
> >>>    endif
> >>>
> >>>    dist_check_SCRIPTS = run-test tests-validation.env $(LOG_COMPILER)
> >>> diff --git a/platform/linux-generic/test/pktio/pktio_run_netmap
> >> b/platform/linux-generic/test/pktio/pktio_run_netmap
> >>> new file mode 100755
> >>> index 0000000..b7f2575
> >>> --- /dev/null
> >>> +++ b/platform/linux-generic/test/pktio/pktio_run_netmap
> >>> @@ -0,0 +1,120 @@
> >>> +#!/bin/sh
> >>> +#
> >>> +# Copyright (c) 2016, Linaro Limited
> >>> +# 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 (./pktio_run) 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: $pktio_main_path"
> >>> +else
> >>> + echo "cannot find pktio_main: please set you PATH for it."
> >>> +fi
> >>> +
> >>> +# directory where platform test sources are, including scripts
> >>> +TEST_SRC_DIR=$(dirname $0)
> >>> +
> >>> +# exit codes expected by automake for skipped tests
> >>> +TEST_SKIPPED=77
> >>> +
> >>> +# Use installed pktio env or for make check take it from the test 
> >>> directory
> >>> +if [ -f "./pktio_env" ]; then
> >>> + . ./pktio_env
> >>> +elif [ -f ${TEST_SRC_DIR}/pktio_env ]; then
> >>> + . ${TEST_SRC_DIR}/pktio_env
> >>> +else
> >>> + echo "ERROR: unable to find pktio_env!"
> >>> + echo "pktio_env has to be in current directory or in ${TEST_SRC_DIR}"
> >>> + exit 1
> >>> +fi
> >>> +
> >>> +run_test()
> >>> +{
> >>> + local ret=0
> >>> +
> >>> + pktio_main${EXEEXT}
> >>> + ret=$?
> >>> +
> >>> + if [ $ret -ne 0 ]; then
> >>> +         echo "!!! FAILED !!!"
> >>> + fi
> >>> +
> >>> + return $ret
> >>> +}
> >>> +
> >>> +run_test_vale()
> >>> +{
> >>> + # use two vale ports on the same switch
> >>> + export ODP_PKTIO_IF0=valetest:0
> >>> + export ODP_PKTIO_IF1=valetest:1
> >>> + run_test
> >>> + return $?
> >>> +}
> >>> +
> >>> +run_test_pipe()
> >>> +{
> >>> + # use a netmap pipe
> >>> + export ODP_PKTIO_IF0=valetest:0{0
> >>> + export ODP_PKTIO_IF1=valetest:0}0
> >>> + run_test
> >>> + return $?
> >>> +}
> >>> +
> >>> +run_test_veth()
> >>> +{
> >>> + if [ "$(lsmod | grep veth)" = "" ]; then
> >>> +         echo "netmap enabled veth module not loaded, skipping test."
> >>> +         return 0
> >>> + fi
> >>> +
> >>> + setup_pktio_env clean
> >>> + export ODP_PKTIO_IF0=$IF0
> >>> + export ODP_PKTIO_IF1=$IF1
> >>> + run_test
> >>> + return $?
> >>> +}
> >>> +
> >>> +run()
> >>> +{
> >>> + local ret=0
> >>> +
> >>> + # need to be root to run these tests
> >>> + if [ "$(id -u)" != "0" ]; then
> >>> +         echo "netmap tests must be run as root, skipping test."
> >>> +         exit $TEST_SKIPPED
> >>> + fi
> >>> +
> >>> + if [ "$(lsmod | grep netmap)" = "" ]; then
> >>> +         echo "netmap kernel module not loaded, skipping test."
> >>> +         exit $TEST_SKIPPED
> >>> + fi
> >>> +
> >>> + if [ "$ODP_PKTIO_IF0" != "" ]; then
> >>> +         run_test
> >>> +         ret=$?
> >>> + else
> >>> +         run_test_vale
> >>> +         r=$?; [ $ret = 0 ] && ret=$r
> >>> +         run_test_pipe
> >>> +         r=$?; [ $ret = 0 ] && ret=$r
> >>> +         run_test_veth
> >>> +         r=$?; [ $ret = 0 ] && ret=$r
> >>> + fi
> >>> +
> >>> + exit $ret
> >>> +}
> >>> +
> >>> +run
> >> _______________________________________________
> >> lng-odp mailing list
> >> [email protected]
> >> https://lists.linaro.org/mailman/listinfo/lng-odp

_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to