diff mbox

test:linux-generic: add process mode tests

Message ID 1471381804-15326-1-git-send-email-mike.holmes@linaro.org
State Superseded
Headers show

Commit Message

Mike Holmes Aug. 16, 2016, 9:10 p.m. UTC
Add process mode run for odp_crypto_run, odp_l2fwd_run,
odp_pktio_perf_run.

Currently failing tests retun SKIP (77) until process mode is fixed

Signed-off-by: Mike Holmes <mike.holmes@linaro.org>

---
 test/linux-generic/performance/Makefile.am         |   5 +-
 .../performance/odp_crypto_run_proc.sh             |  22 ++++
 .../performance/odp_l2fwd_run_proc.sh              | 117 +++++++++++++++++++++
 .../performance/odp_pktio_perf_run_proc.sh         |  24 +++++
 4 files changed, 167 insertions(+), 1 deletion(-)
 create mode 100755 test/linux-generic/performance/odp_crypto_run_proc.sh
 create mode 100755 test/linux-generic/performance/odp_l2fwd_run_proc.sh
 create mode 100755 test/linux-generic/performance/odp_pktio_perf_run_proc.sh

-- 
2.7.4

Comments

Mike Holmes Aug. 26, 2016, 4:19 p.m. UTC | #1
ping

On 16 August 2016 at 17:10, Mike Holmes <mike.holmes@linaro.org> wrote:

> Add process mode run for odp_crypto_run, odp_l2fwd_run,

> odp_pktio_perf_run.

>

> Currently failing tests retun SKIP (77) until process mode is fixed

>

> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>

> ---

>  test/linux-generic/performance/Makefile.am         |   5 +-

>  .../performance/odp_crypto_run_proc.sh             |  22 ++++

>  .../performance/odp_l2fwd_run_proc.sh              | 117

> +++++++++++++++++++++

>  .../performance/odp_pktio_perf_run_proc.sh         |  24 +++++

>  4 files changed, 167 insertions(+), 1 deletion(-)

>  create mode 100755 test/linux-generic/performance/odp_crypto_run_proc.sh

>  create mode 100755 test/linux-generic/performance/odp_l2fwd_run_proc.sh

>  create mode 100755 test/linux-generic/performance/odp_pktio_perf_

> run_proc.sh

>

> diff --git a/test/linux-generic/performance/Makefile.am

> b/test/linux-generic/performance/Makefile.am

> index cb72fce..41aead5 100644

> --- a/test/linux-generic/performance/Makefile.am

> +++ b/test/linux-generic/performance/Makefile.am

> @@ -2,7 +2,10 @@ include $(top_srcdir)/test/Makefile.inc

>

>  TESTS_ENVIRONMENT += TEST_DIR=${builddir}

>

> -TESTSCRIPTS = odp_scheduling_run_proc.sh

> +TESTSCRIPTS = odp_scheduling_run_proc.sh \

> +             odp_crypto_run_proc.sh \

> +             odp_pktio_perf_run_proc.sh \

> +             odp_l2fwd_run_proc.sh

>

>  TEST_EXTENSIONS = .sh

>

> diff --git a/test/linux-generic/performance/odp_crypto_run_proc.sh

> b/test/linux-generic/performance/odp_crypto_run_proc.sh

> new file mode 100755

> index 0000000..a8fdeb0

> --- /dev/null

> +++ b/test/linux-generic/performance/odp_crypto_run_proc.sh

> @@ -0,0 +1,22 @@

> +#!/bin/sh

> +#

> +# Copyright (c) 2016, Linaro Limited

> +# All rights reserved.

> +#

> +# SPDX-License-Identifier:     BSD-3-Clause

> +#

> +# Script that passes command line arguments to odp_crypto test when

> +# launched by 'make check'

> +

> +TEST_DIR="${TEST_DIR:-$(dirname $0)}"

> +PERFORMANCE="$TEST_DIR/../../common_plat/performance"

> +ret=0

> +

> +run()

> +{

> +       $PERFORMANCE/odp_crypto${EXEEXT} --odph_proc  || ret=1

> +}

> +

> +run

> +

> +exit $ret

> diff --git a/test/linux-generic/performance/odp_l2fwd_run_proc.sh

> b/test/linux-generic/performance/odp_l2fwd_run_proc.sh

> new file mode 100755

> index 0000000..5e0b0a6

> --- /dev/null

> +++ b/test/linux-generic/performance/odp_l2fwd_run_proc.sh

> @@ -0,0 +1,117 @@

> +#!/bin/sh

> +#

> +# Copyright (c) 2016, Linaro Limited

> +# All rights reserved.

> +#

> +# SPDX-License-Identifier:     BSD-3-Clause

> +#

> +

> +# TEST_DIR is set by Makefile, when we add a rule to Makefile for

> odp_l2fwd_run

> +# we can use TEST_DIR the same way odp_pktio_run uses it now.

> +# If TEST_DIR is not set it means we are not running with make, and in

> this case

> +# there are two situations:

> +# 1. user build ODP in the same dir as the source (most likely)

> +#    here the user can simply call odp_l2fwd_run

> +# 2. user may have built ODP in a separate build dir (like bitbake

> usually does)

> +#    here the user has to do something like $ODP/test/performance/odp_

> l2fwd_run

> +#

> +# In both situations the script assumes that the user is in the directory

> where

> +# odp_l2fwd exists. If that's not true, then the user has to specify the

> path

> +# to it and run:

> +# TEST_DIR=$builddir $ODP/test/performance/odp_l2fwd_run

> +

> +# directory where test binaries have been built

> +TEST_DIR="${TEST_DIR:-$PWD}"

> +PERFORMANCE="$TEST_DIR/../../common_plat/performance"

> +

> +# directory where test sources are, including scripts

> +TEST_SRC_DIR=$(dirname $0)

> +

> +PATH=$TEST_DIR:$TEST_DIR/../../../example/generator:$PATH

> +

> +# exit codes expected by automake for skipped tests

> +TEST_SKIPPED=77

> +

> +PLATFORM_VALIDATION=${TEST_SRC_DIR}/../../$ODP_PLATFORM/validation

> +

> +# Use installed pktio env or for make check take it from platform

> directory

> +if [ -f "./pktio_env" ]; then

> +       . ./pktio_env

> +elif  [ "$ODP_PLATFORM" = "" ]; then

> +       echo "$0: error: ODP_PLATFORM must be defined"

> +       # not skipped as this should never happen via "make check"

> +       exit 1

> +elif [ -f ${PLATFORM_VALIDATION}/api/pktio/pktio_env ]; then

> +       . ${PLATFORM_VALIDATION}/api/pktio/pktio_env

> +else

> +       echo "BUG: unable to find pktio_env!"

> +       echo "pktio_env has to be in current directory or in \

> +             platform/\$ODP_PLATFORM/test."

> +       echo "ODP_PLATFORM=\"$ODP_PLATFORM\""

> +       exit 1

> +fi

> +

> +run_l2fwd()

> +{

> +       setup_pktio_env clean # install trap to call cleanup_pktio_env

> +

> +       if [ $? -ne 0 ]; then

> +               echo "setup_pktio_env error $?"

> +               exit $TEST_SKIPPED

> +       fi

> +

> +       type odp_generator > /dev/null

> +       if [ $? -ne 0 ]; then

> +               echo "odp_generator not installed. Aborting."

> +               cleanup_pktio_env

> +               exit 1

> +       fi

> +

> +       #@todo: limit odp_generator to cores

> +       #https://bugs.linaro.org/show_bug.cgi?id=1398

> +       (odp_generator${EXEEXT} -I $IF0 \

> +                       --srcip 192.168.0.1 --dstip 192.168.0.2 \

> +                       -m u 2>&1 > /dev/null) \

> +                       2>&1 > /dev/null &

> +       GEN_PID=$!

> +

> +       # this just turns off output buffering so that you still get

> periodic

> +       # output while piping to tee, as long as stdbuf is available.

> +       if [ "$(which stdbuf)" != "" ]; then

> +               STDBUF="stdbuf -o 0"

> +       else

> +               STDBUF=

> +       fi

> +       LOG=odp_l2fwd_tmp.log

> +

> +       #skip this because process mode is broken

> +       #$STDBUF ${PERFORMANCE}/odp_l2fwd${EXEEXT} --odph_proc -i

> $IF1,$IF2 \

> +       #-m 0 -t 30 -c 2 | tee $LOG

> +       #ret=$?

> +       ret=77

> +

> +       kill ${GEN_PID}

> +

> +       if [ ! -f $LOG ]; then

> +               echo "FAIL: $LOG not found"

> +               ret=1

> +       elif [ $ret -eq 0 ]; then

> +               PASS_PPS=5000

> +               MAX_PPS=$(awk '/TEST RESULT/ {print $3}' $LOG)

> +               if [ "$MAX_PPS" -lt "$PASS_PPS" ]; then

> +                       echo "FAIL: pps below threshold $MAX_PPS <

> $PASS_PPS"

> +                       ret=1

> +               fi

> +       fi

> +

> +       rm -f $LOG

> +       cleanup_pktio_env

> +

> +       exit $ret

> +}

> +

> +case "$1" in

> +       setup)   setup_pktio_env   ;;

> +       cleanup) cleanup_pktio_env ;;

> +       *)       run_l2fwd ;;

> +esac

> diff --git a/test/linux-generic/performance/odp_pktio_perf_run_proc.sh

> b/test/linux-generic/performance/odp_pktio_perf_run_proc.sh

> new file mode 100755

> index 0000000..fccc7eb

> --- /dev/null

> +++ b/test/linux-generic/performance/odp_pktio_perf_run_proc.sh

> @@ -0,0 +1,24 @@

> +#!/bin/sh

> +#

> +# Copyright (c) 2016, Linaro Limited

> +# All rights reserved.

> +#

> +# SPDX-License-Identifier:     BSD-3-Clause

> +#

> +# Script that passes command line arguments to odp_crypto test when

> +# launched by 'make check'

> +

> +TEST_DIR="${TEST_DIR:-$(dirname $0)}"

> +PERFORMANCE="$TEST_DIR/../../common_plat/performance"

> +ret=0

> +

> +run()

> +{

> +       #skip because process mode is broken

> +       #$PERFORMANCE/odp_pktio_perf${EXEEXT} --odph_proc || ret=1

> +       ret=77

> +}

> +

> +run

> +

> +exit $ret

> --

> 2.7.4

>

>



-- 
Mike Holmes
Program Manager - Linaro Networking Group
Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"
Bill Fischofer Aug. 29, 2016, 6:44 p.m. UTC | #2
On Tue, Aug 16, 2016 at 4:10 PM, Mike Holmes <mike.holmes@linaro.org> wrote:

> Add process mode run for odp_crypto_run, odp_l2fwd_run,

> odp_pktio_perf_run.

>

> Currently failing tests retun SKIP (77) until process mode is fixed

>

> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>

>


Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>



> ---

>  test/linux-generic/performance/Makefile.am         |   5 +-

>  .../performance/odp_crypto_run_proc.sh             |  22 ++++

>  .../performance/odp_l2fwd_run_proc.sh              | 117

> +++++++++++++++++++++

>  .../performance/odp_pktio_perf_run_proc.sh         |  24 +++++

>  4 files changed, 167 insertions(+), 1 deletion(-)

>  create mode 100755 test/linux-generic/performance/odp_crypto_run_proc.sh

>  create mode 100755 test/linux-generic/performance/odp_l2fwd_run_proc.sh

>  create mode 100755 test/linux-generic/performance/odp_pktio_perf_

> run_proc.sh

>

> diff --git a/test/linux-generic/performance/Makefile.am

> b/test/linux-generic/performance/Makefile.am

> index cb72fce..41aead5 100644

> --- a/test/linux-generic/performance/Makefile.am

> +++ b/test/linux-generic/performance/Makefile.am

> @@ -2,7 +2,10 @@ include $(top_srcdir)/test/Makefile.inc

>

>  TESTS_ENVIRONMENT += TEST_DIR=${builddir}

>

> -TESTSCRIPTS = odp_scheduling_run_proc.sh

> +TESTSCRIPTS = odp_scheduling_run_proc.sh \

> +             odp_crypto_run_proc.sh \

> +             odp_pktio_perf_run_proc.sh \

> +             odp_l2fwd_run_proc.sh

>

>  TEST_EXTENSIONS = .sh

>

> diff --git a/test/linux-generic/performance/odp_crypto_run_proc.sh

> b/test/linux-generic/performance/odp_crypto_run_proc.sh

> new file mode 100755

> index 0000000..a8fdeb0

> --- /dev/null

> +++ b/test/linux-generic/performance/odp_crypto_run_proc.sh

> @@ -0,0 +1,22 @@

> +#!/bin/sh

> +#

> +# Copyright (c) 2016, Linaro Limited

> +# All rights reserved.

> +#

> +# SPDX-License-Identifier:     BSD-3-Clause

> +#

> +# Script that passes command line arguments to odp_crypto test when

> +# launched by 'make check'

> +

> +TEST_DIR="${TEST_DIR:-$(dirname $0)}"

> +PERFORMANCE="$TEST_DIR/../../common_plat/performance"

> +ret=0

> +

> +run()

> +{

> +       $PERFORMANCE/odp_crypto${EXEEXT} --odph_proc  || ret=1

> +}

> +

> +run

> +

> +exit $ret

> diff --git a/test/linux-generic/performance/odp_l2fwd_run_proc.sh

> b/test/linux-generic/performance/odp_l2fwd_run_proc.sh

> new file mode 100755

> index 0000000..5e0b0a6

> --- /dev/null

> +++ b/test/linux-generic/performance/odp_l2fwd_run_proc.sh

> @@ -0,0 +1,117 @@

> +#!/bin/sh

> +#

> +# Copyright (c) 2016, Linaro Limited

> +# All rights reserved.

> +#

> +# SPDX-License-Identifier:     BSD-3-Clause

> +#

> +

> +# TEST_DIR is set by Makefile, when we add a rule to Makefile for

> odp_l2fwd_run

> +# we can use TEST_DIR the same way odp_pktio_run uses it now.

> +# If TEST_DIR is not set it means we are not running with make, and in

> this case

> +# there are two situations:

> +# 1. user build ODP in the same dir as the source (most likely)

> +#    here the user can simply call odp_l2fwd_run

> +# 2. user may have built ODP in a separate build dir (like bitbake

> usually does)

> +#    here the user has to do something like $ODP/test/performance/odp_

> l2fwd_run

> +#

> +# In both situations the script assumes that the user is in the directory

> where

> +# odp_l2fwd exists. If that's not true, then the user has to specify the

> path

> +# to it and run:

> +# TEST_DIR=$builddir $ODP/test/performance/odp_l2fwd_run

> +

> +# directory where test binaries have been built

> +TEST_DIR="${TEST_DIR:-$PWD}"

> +PERFORMANCE="$TEST_DIR/../../common_plat/performance"

> +

> +# directory where test sources are, including scripts

> +TEST_SRC_DIR=$(dirname $0)

> +

> +PATH=$TEST_DIR:$TEST_DIR/../../../example/generator:$PATH

> +

> +# exit codes expected by automake for skipped tests

> +TEST_SKIPPED=77

> +

> +PLATFORM_VALIDATION=${TEST_SRC_DIR}/../../$ODP_PLATFORM/validation

> +

> +# Use installed pktio env or for make check take it from platform

> directory

> +if [ -f "./pktio_env" ]; then

> +       . ./pktio_env

> +elif  [ "$ODP_PLATFORM" = "" ]; then

> +       echo "$0: error: ODP_PLATFORM must be defined"

> +       # not skipped as this should never happen via "make check"

> +       exit 1

> +elif [ -f ${PLATFORM_VALIDATION}/api/pktio/pktio_env ]; then

> +       . ${PLATFORM_VALIDATION}/api/pktio/pktio_env

> +else

> +       echo "BUG: unable to find pktio_env!"

> +       echo "pktio_env has to be in current directory or in \

> +             platform/\$ODP_PLATFORM/test."

> +       echo "ODP_PLATFORM=\"$ODP_PLATFORM\""

> +       exit 1

> +fi

> +

> +run_l2fwd()

> +{

> +       setup_pktio_env clean # install trap to call cleanup_pktio_env

> +

> +       if [ $? -ne 0 ]; then

> +               echo "setup_pktio_env error $?"

> +               exit $TEST_SKIPPED

> +       fi

> +

> +       type odp_generator > /dev/null

> +       if [ $? -ne 0 ]; then

> +               echo "odp_generator not installed. Aborting."

> +               cleanup_pktio_env

> +               exit 1

> +       fi

> +

> +       #@todo: limit odp_generator to cores

> +       #https://bugs.linaro.org/show_bug.cgi?id=1398

> +       (odp_generator${EXEEXT} -I $IF0 \

> +                       --srcip 192.168.0.1 --dstip 192.168.0.2 \

> +                       -m u 2>&1 > /dev/null) \

> +                       2>&1 > /dev/null &

> +       GEN_PID=$!

> +

> +       # this just turns off output buffering so that you still get

> periodic

> +       # output while piping to tee, as long as stdbuf is available.

> +       if [ "$(which stdbuf)" != "" ]; then

> +               STDBUF="stdbuf -o 0"

> +       else

> +               STDBUF=

> +       fi

> +       LOG=odp_l2fwd_tmp.log

> +

> +       #skip this because process mode is broken

> +       #$STDBUF ${PERFORMANCE}/odp_l2fwd${EXEEXT} --odph_proc -i

> $IF1,$IF2 \

> +       #-m 0 -t 30 -c 2 | tee $LOG

> +       #ret=$?

> +       ret=77

> +

> +       kill ${GEN_PID}

> +

> +       if [ ! -f $LOG ]; then

> +               echo "FAIL: $LOG not found"

> +               ret=1

> +       elif [ $ret -eq 0 ]; then

> +               PASS_PPS=5000

> +               MAX_PPS=$(awk '/TEST RESULT/ {print $3}' $LOG)

> +               if [ "$MAX_PPS" -lt "$PASS_PPS" ]; then

> +                       echo "FAIL: pps below threshold $MAX_PPS <

> $PASS_PPS"

> +                       ret=1

> +               fi

> +       fi

> +

> +       rm -f $LOG

> +       cleanup_pktio_env

> +

> +       exit $ret

> +}

> +

> +case "$1" in

> +       setup)   setup_pktio_env   ;;

> +       cleanup) cleanup_pktio_env ;;

> +       *)       run_l2fwd ;;

> +esac

> diff --git a/test/linux-generic/performance/odp_pktio_perf_run_proc.sh

> b/test/linux-generic/performance/odp_pktio_perf_run_proc.sh

> new file mode 100755

> index 0000000..fccc7eb

> --- /dev/null

> +++ b/test/linux-generic/performance/odp_pktio_perf_run_proc.sh

> @@ -0,0 +1,24 @@

> +#!/bin/sh

> +#

> +# Copyright (c) 2016, Linaro Limited

> +# All rights reserved.

> +#

> +# SPDX-License-Identifier:     BSD-3-Clause

> +#

> +# Script that passes command line arguments to odp_crypto test when

> +# launched by 'make check'

> +

> +TEST_DIR="${TEST_DIR:-$(dirname $0)}"

> +PERFORMANCE="$TEST_DIR/../../common_plat/performance"

> +ret=0

> +

> +run()

> +{

> +       #skip because process mode is broken

> +       #$PERFORMANCE/odp_pktio_perf${EXEEXT} --odph_proc || ret=1

> +       ret=77

> +}

> +

> +run

> +

> +exit $ret

> --

> 2.7.4

>

>
Maxim Uvarov Aug. 30, 2016, 7:46 a.m. UTC | #3
On 08/17/16 00:10, Mike Holmes wrote:
> Add process mode run for odp_crypto_run, odp_l2fwd_run,

> odp_pktio_perf_run.

>

> Currently failing tests retun SKIP (77) until process mode is fixed

>

> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>

> ---

>   test/linux-generic/performance/Makefile.am         |   5 +-

>   .../performance/odp_crypto_run_proc.sh             |  22 ++++

>   .../performance/odp_l2fwd_run_proc.sh              | 117 +++++++++++++++++++++

>   .../performance/odp_pktio_perf_run_proc.sh         |  24 +++++

>   4 files changed, 167 insertions(+), 1 deletion(-)

>   create mode 100755 test/linux-generic/performance/odp_crypto_run_proc.sh

>   create mode 100755 test/linux-generic/performance/odp_l2fwd_run_proc.sh

>   create mode 100755 test/linux-generic/performance/odp_pktio_perf_run_proc.sh

>

> diff --git a/test/linux-generic/performance/Makefile.am b/test/linux-generic/performance/Makefile.am

> index cb72fce..41aead5 100644

> --- a/test/linux-generic/performance/Makefile.am

> +++ b/test/linux-generic/performance/Makefile.am

> @@ -2,7 +2,10 @@ include $(top_srcdir)/test/Makefile.inc

>   

>   TESTS_ENVIRONMENT += TEST_DIR=${builddir}

>   

> -TESTSCRIPTS = odp_scheduling_run_proc.sh

> +TESTSCRIPTS = odp_scheduling_run_proc.sh \

> +	      odp_crypto_run_proc.sh \

> +	      odp_pktio_perf_run_proc.sh \

> +	      odp_l2fwd_run_proc.sh


please correct alphabetical order here.
>   

>   TEST_EXTENSIONS = .sh

>   

> diff --git a/test/linux-generic/performance/odp_crypto_run_proc.sh b/test/linux-generic/performance/odp_crypto_run_proc.sh

> new file mode 100755

> index 0000000..a8fdeb0

> --- /dev/null

> +++ b/test/linux-generic/performance/odp_crypto_run_proc.sh

> @@ -0,0 +1,22 @@

> +#!/bin/sh

> +#

> +# Copyright (c) 2016, Linaro Limited

> +# All rights reserved.

> +#

> +# SPDX-License-Identifier:	BSD-3-Clause

> +#

> +# Script that passes command line arguments to odp_crypto test when

> +# launched by 'make check'

> +

> +TEST_DIR="${TEST_DIR:-$(dirname $0)}"

> +PERFORMANCE="$TEST_DIR/../../common_plat/performance"

> +ret=0

> +

> +run()

> +{

> +	$PERFORMANCE/odp_crypto${EXEEXT} --odph_proc  || ret=1

> +}

> +

> +run

> +

> +exit $ret


why function is needed here?

$PERFORMANCE/odp_crypto${EXEEXT} --odph_proc

exit $?



> diff --git a/test/linux-generic/performance/odp_l2fwd_run_proc.sh b/test/linux-generic/performance/odp_l2fwd_run_proc.sh

> new file mode 100755

> index 0000000..5e0b0a6

> --- /dev/null

> +++ b/test/linux-generic/performance/odp_l2fwd_run_proc.sh

> @@ -0,0 +1,117 @@

> +#!/bin/sh

> +#

> +# Copyright (c) 2016, Linaro Limited

> +# All rights reserved.

> +#

> +# SPDX-License-Identifier:	BSD-3-Clause

> +#

> +

> +# TEST_DIR is set by Makefile, when we add a rule to Makefile for odp_l2fwd_run

> +# we can use TEST_DIR the same way odp_pktio_run uses it now.

> +# If TEST_DIR is not set it means we are not running with make, and in this case

> +# there are two situations:

> +# 1. user build ODP in the same dir as the source (most likely)

> +#    here the user can simply call odp_l2fwd_run

> +# 2. user may have built ODP in a separate build dir (like bitbake usually does)

> +#    here the user has to do something like $ODP/test/performance/odp_l2fwd_run

> +#

> +# In both situations the script assumes that the user is in the directory where

> +# odp_l2fwd exists. If that's not true, then the user has to specify the path

> +# to it and run:

> +# TEST_DIR=$builddir $ODP/test/performance/odp_l2fwd_run

> +

> +# directory where test binaries have been built

> +TEST_DIR="${TEST_DIR:-$PWD}"

> +PERFORMANCE="$TEST_DIR/../../common_plat/performance"

> +

> +# directory where test sources are, including scripts

> +TEST_SRC_DIR=$(dirname $0)

> +

> +PATH=$TEST_DIR:$TEST_DIR/../../../example/generator:$PATH

> +

> +# exit codes expected by automake for skipped tests

> +TEST_SKIPPED=77

> +

> +PLATFORM_VALIDATION=${TEST_SRC_DIR}/../../$ODP_PLATFORM/validation

> +

> +# Use installed pktio env or for make check take it from platform directory

> +if [ -f "./pktio_env" ]; then

> +	. ./pktio_env

> +elif  [ "$ODP_PLATFORM" = "" ]; then

> +	echo "$0: error: ODP_PLATFORM must be defined"

> +	# not skipped as this should never happen via "make check"

> +	exit 1

> +elif [ -f ${PLATFORM_VALIDATION}/api/pktio/pktio_env ]; then

> +	. ${PLATFORM_VALIDATION}/api/pktio/pktio_env

> +else

> +	echo "BUG: unable to find pktio_env!"

> +	echo "pktio_env has to be in current directory or in \

> +	      platform/\$ODP_PLATFORM/test."

> +	echo "ODP_PLATFORM=\"$ODP_PLATFORM\""

> +	exit 1

> +fi

> +

> +run_l2fwd()

> +{

> +	setup_pktio_env clean # install trap to call cleanup_pktio_env

> +

> +	if [ $? -ne 0 ]; then

> +		echo "setup_pktio_env error $?"

> +		exit $TEST_SKIPPED

> +	fi

> +

> +	type odp_generator > /dev/null

> +	if [ $? -ne 0 ]; then

> +		echo "odp_generator not installed. Aborting."

> +		cleanup_pktio_env

> +		exit 1

> +	fi

> +

> +	#@todo: limit odp_generator to cores

> +	#https://bugs.linaro.org/show_bug.cgi?id=1398

> +	(odp_generator${EXEEXT} -I $IF0 \

> +			--srcip 192.168.0.1 --dstip 192.168.0.2 \

> +			-m u 2>&1 > /dev/null) \

> +			2>&1 > /dev/null &

> +	GEN_PID=$!

> +

> +	# this just turns off output buffering so that you still get periodic

> +	# output while piping to tee, as long as stdbuf is available.

> +	if [ "$(which stdbuf)" != "" ]; then

> +		STDBUF="stdbuf -o 0"

> +	else

> +		STDBUF=

> +	fi

> +	LOG=odp_l2fwd_tmp.log

> +

> +	#skip this because process mode is broken

> +	#$STDBUF ${PERFORMANCE}/odp_l2fwd${EXEEXT} --odph_proc -i $IF1,$IF2 \

> +	#-m 0 -t 30 -c 2 | tee $LOG

> +	#ret=$?

> +	ret=77

> +

> +	kill ${GEN_PID}

> +

> +	if [ ! -f $LOG ]; then

> +		echo "FAIL: $LOG not found"

> +		ret=1

> +	elif [ $ret -eq 0 ]; then

> +		PASS_PPS=5000

> +		MAX_PPS=$(awk '/TEST RESULT/ {print $3}' $LOG)

> +		if [ "$MAX_PPS" -lt "$PASS_PPS" ]; then

> +			echo "FAIL: pps below threshold $MAX_PPS < $PASS_PPS"

> +			ret=1

> +		fi

> +	fi

> +

> +	rm -f $LOG

> +	cleanup_pktio_env

> +

> +	exit $ret

> +}

> +

> +case "$1" in

> +	setup)   setup_pktio_env   ;;

> +	cleanup) cleanup_pktio_env ;;

> +	*)       run_l2fwd ;;

> +esac

> diff --git a/test/linux-generic/performance/odp_pktio_perf_run_proc.sh b/test/linux-generic/performance/odp_pktio_perf_run_proc.sh

> new file mode 100755

> index 0000000..fccc7eb

> --- /dev/null

> +++ b/test/linux-generic/performance/odp_pktio_perf_run_proc.sh

> @@ -0,0 +1,24 @@

> +#!/bin/sh

> +#

> +# Copyright (c) 2016, Linaro Limited

> +# All rights reserved.

> +#

> +# SPDX-License-Identifier:	BSD-3-Clause

> +#

> +# Script that passes command line arguments to odp_crypto test when

> +# launched by 'make check'

> +

> +TEST_DIR="${TEST_DIR:-$(dirname $0)}"

> +PERFORMANCE="$TEST_DIR/../../common_plat/performance"

> +ret=0

> +

> +run()

> +{

> +	#skip because process mode is broken

> +	#$PERFORMANCE/odp_pktio_perf${EXEEXT} --odph_proc || ret=1

> +	ret=77

> +}

> +

> +run

> +

> +exit $ret

Same thing here, need link to bug for commented out things. And
function is not needed.

Maxim.
Mike Holmes Aug. 30, 2016, 11:44 a.m. UTC | #4
On 30 August 2016 at 03:46, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> On 08/17/16 00:10, Mike Holmes wrote:

>

>> Add process mode run for odp_crypto_run, odp_l2fwd_run,

>> odp_pktio_perf_run.

>>

>> Currently failing tests retun SKIP (77) until process mode is fixed

>>

>> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>

>> ---

>>   test/linux-generic/performance/Makefile.am         |   5 +-

>>   .../performance/odp_crypto_run_proc.sh             |  22 ++++

>>   .../performance/odp_l2fwd_run_proc.sh              | 117

>> +++++++++++++++++++++

>>   .../performance/odp_pktio_perf_run_proc.sh         |  24 +++++

>>   4 files changed, 167 insertions(+), 1 deletion(-)

>>   create mode 100755 test/linux-generic/performance

>> /odp_crypto_run_proc.sh

>>   create mode 100755 test/linux-generic/performance/odp_l2fwd_run_proc.sh

>>   create mode 100755 test/linux-generic/performance

>> /odp_pktio_perf_run_proc.sh

>>

>> diff --git a/test/linux-generic/performance/Makefile.am

>> b/test/linux-generic/performance/Makefile.am

>> index cb72fce..41aead5 100644

>> --- a/test/linux-generic/performance/Makefile.am

>> +++ b/test/linux-generic/performance/Makefile.am

>> @@ -2,7 +2,10 @@ include $(top_srcdir)/test/Makefile.inc

>>     TESTS_ENVIRONMENT += TEST_DIR=${builddir}

>>   -TESTSCRIPTS = odp_scheduling_run_proc.sh

>> +TESTSCRIPTS = odp_scheduling_run_proc.sh \

>> +             odp_crypto_run_proc.sh \

>> +             odp_pktio_perf_run_proc.sh \

>> +             odp_l2fwd_run_proc.sh

>>

>

> please correct alphabetical order here.



I can do that


>

>     TEST_EXTENSIONS = .sh

>>   diff --git a/test/linux-generic/performance/odp_crypto_run_proc.sh

>> b/test/linux-generic/performance/odp_crypto_run_proc.sh

>> new file mode 100755

>> index 0000000..a8fdeb0

>> --- /dev/null

>> +++ b/test/linux-generic/performance/odp_crypto_run_proc.sh

>> @@ -0,0 +1,22 @@

>> +#!/bin/sh

>> +#

>> +# Copyright (c) 2016, Linaro Limited

>> +# All rights reserved.

>> +#

>> +# SPDX-License-Identifier:     BSD-3-Clause

>> +#

>> +# Script that passes command line arguments to odp_crypto test when

>> +# launched by 'make check'

>> +

>> +TEST_DIR="${TEST_DIR:-$(dirname $0)}"

>> +PERFORMANCE="$TEST_DIR/../../common_plat/performance"

>> +ret=0

>> +

>> +run()

>> +{

>> +       $PERFORMANCE/odp_crypto${EXEEXT} --odph_proc  || ret=1

>> +}

>> +

>> +run

>> +

>> +exit $ret

>>

>

> why function is needed here?

>


becasue it is the common form that that allows multiple calls for different
configurations,  all of which need to be added.


>

> $PERFORMANCE/odp_crypto${EXEEXT} --odph_proc

>

> exit $?

>

>

>

>

> diff --git a/test/linux-generic/performance/odp_l2fwd_run_proc.sh

>> b/test/linux-generic/performance/odp_l2fwd_run_proc.sh

>> new file mode 100755

>> index 0000000..5e0b0a6

>> --- /dev/null

>> +++ b/test/linux-generic/performance/odp_l2fwd_run_proc.sh

>> @@ -0,0 +1,117 @@

>> +#!/bin/sh

>> +#

>> +# Copyright (c) 2016, Linaro Limited

>> +# All rights reserved.

>> +#

>> +# SPDX-License-Identifier:     BSD-3-Clause

>> +#

>> +

>> +# TEST_DIR is set by Makefile, when we add a rule to Makefile for

>> odp_l2fwd_run

>> +# we can use TEST_DIR the same way odp_pktio_run uses it now.

>> +# If TEST_DIR is not set it means we are not running with make, and in

>> this case

>> +# there are two situations:

>> +# 1. user build ODP in the same dir as the source (most likely)

>> +#    here the user can simply call odp_l2fwd_run

>> +# 2. user may have built ODP in a separate build dir (like bitbake

>> usually does)

>> +#    here the user has to do something like

>> $ODP/test/performance/odp_l2fwd_run

>> +#

>> +# In both situations the script assumes that the user is in the

>> directory where

>> +# odp_l2fwd exists. If that's not true, then the user has to specify the

>> path

>> +# to it and run:

>> +# TEST_DIR=$builddir $ODP/test/performance/odp_l2fwd_run

>> +

>> +# directory where test binaries have been built

>> +TEST_DIR="${TEST_DIR:-$PWD}"

>> +PERFORMANCE="$TEST_DIR/../../common_plat/performance"

>> +

>> +# directory where test sources are, including scripts

>> +TEST_SRC_DIR=$(dirname $0)

>> +

>> +PATH=$TEST_DIR:$TEST_DIR/../../../example/generator:$PATH

>> +

>> +# exit codes expected by automake for skipped tests

>> +TEST_SKIPPED=77

>> +

>> +PLATFORM_VALIDATION=${TEST_SRC_DIR}/../../$ODP_PLATFORM/validation

>> +

>> +# Use installed pktio env or for make check take it from platform

>> directory

>> +if [ -f "./pktio_env" ]; then

>> +       . ./pktio_env

>> +elif  [ "$ODP_PLATFORM" = "" ]; then

>> +       echo "$0: error: ODP_PLATFORM must be defined"

>> +       # not skipped as this should never happen via "make check"

>> +       exit 1

>> +elif [ -f ${PLATFORM_VALIDATION}/api/pktio/pktio_env ]; then

>> +       . ${PLATFORM_VALIDATION}/api/pktio/pktio_env

>> +else

>> +       echo "BUG: unable to find pktio_env!"

>> +       echo "pktio_env has to be in current directory or in \

>> +             platform/\$ODP_PLATFORM/test."

>> +       echo "ODP_PLATFORM=\"$ODP_PLATFORM\""

>> +       exit 1

>> +fi

>> +

>> +run_l2fwd()

>> +{

>> +       setup_pktio_env clean # install trap to call cleanup_pktio_env

>> +

>> +       if [ $? -ne 0 ]; then

>> +               echo "setup_pktio_env error $?"

>> +               exit $TEST_SKIPPED

>> +       fi

>> +

>> +       type odp_generator > /dev/null

>> +       if [ $? -ne 0 ]; then

>> +               echo "odp_generator not installed. Aborting."

>> +               cleanup_pktio_env

>> +               exit 1

>> +       fi

>> +

>> +       #@todo: limit odp_generator to cores

>> +       #https://bugs.linaro.org/show_bug.cgi?id=1398

>> +       (odp_generator${EXEEXT} -I $IF0 \

>> +                       --srcip 192.168.0.1 --dstip 192.168.0.2 \

>> +                       -m u 2>&1 > /dev/null) \

>> +                       2>&1 > /dev/null &

>> +       GEN_PID=$!

>> +

>> +       # this just turns off output buffering so that you still get

>> periodic

>> +       # output while piping to tee, as long as stdbuf is available.

>> +       if [ "$(which stdbuf)" != "" ]; then

>> +               STDBUF="stdbuf -o 0"

>> +       else

>> +               STDBUF=

>> +       fi

>> +       LOG=odp_l2fwd_tmp.log

>> +

>> +       #skip this because process mode is broken

>> +       #$STDBUF ${PERFORMANCE}/odp_l2fwd${EXEEXT} --odph_proc -i

>> $IF1,$IF2 \

>> +       #-m 0 -t 30 -c 2 | tee $LOG

>> +       #ret=$?

>> +       ret=77

>> +

>> +       kill ${GEN_PID}

>> +

>> +       if [ ! -f $LOG ]; then

>> +               echo "FAIL: $LOG not found"

>> +               ret=1

>> +       elif [ $ret -eq 0 ]; then

>> +               PASS_PPS=5000

>> +               MAX_PPS=$(awk '/TEST RESULT/ {print $3}' $LOG)

>> +               if [ "$MAX_PPS" -lt "$PASS_PPS" ]; then

>> +                       echo "FAIL: pps below threshold $MAX_PPS <

>> $PASS_PPS"

>> +                       ret=1

>> +               fi

>> +       fi

>> +

>> +       rm -f $LOG

>> +       cleanup_pktio_env

>> +

>> +       exit $ret

>> +}

>> +

>> +case "$1" in

>> +       setup)   setup_pktio_env   ;;

>> +       cleanup) cleanup_pktio_env ;;

>> +       *)       run_l2fwd ;;

>> +esac

>> diff --git a/test/linux-generic/performance/odp_pktio_perf_run_proc.sh

>> b/test/linux-generic/performance/odp_pktio_perf_run_proc.sh

>> new file mode 100755

>> index 0000000..fccc7eb

>> --- /dev/null

>> +++ b/test/linux-generic/performance/odp_pktio_perf_run_proc.sh

>> @@ -0,0 +1,24 @@

>> +#!/bin/sh

>> +#

>> +# Copyright (c) 2016, Linaro Limited

>> +# All rights reserved.

>> +#

>> +# SPDX-License-Identifier:     BSD-3-Clause

>> +#

>> +# Script that passes command line arguments to odp_crypto test when

>> +# launched by 'make check'

>> +

>> +TEST_DIR="${TEST_DIR:-$(dirname $0)}"

>> +PERFORMANCE="$TEST_DIR/../../common_plat/performance"

>> +ret=0

>> +

>> +run()

>> +{

>> +       #skip because process mode is broken

>> +       #$PERFORMANCE/odp_pktio_perf${EXEEXT} --odph_proc || ret=1

>> +       ret=77

>> +}

>> +

>> +run

>> +

>> +exit $ret

>>

> Same thing here, need link to bug for commented out things. And

> function is not needed.

>

> Maxim.

>

>

>

>



-- 
Mike Holmes
Program Manager - Linaro Networking Group
Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"
Maxim Uvarov Aug. 30, 2016, 1:25 p.m. UTC | #5
On 08/30/16 14:44, Mike Holmes wrote:
>

>         +# Script that passes command line arguments to odp_crypto

>         test when

>         +# launched by 'make check'

>         +

>         +TEST_DIR="${TEST_DIR:-$(dirname $0)}"

>         +PERFORMANCE="$TEST_DIR/../../common_plat/performance"

>         +ret=0

>         +

>         +run()

>         +{

>         +       $PERFORMANCE/odp_crypto${EXEEXT} --odph_proc || ret=1

>         +}

>         +

>         +run

>         +

>         +exit $ret

>

>

>     why function is needed here?

>

>

> becasue it is the common form that that allows multiple calls for 

> different configurations,  all of which need to be added.

I'm ok if you plan to extend that.

Maxim.
diff mbox

Patch

diff --git a/test/linux-generic/performance/Makefile.am b/test/linux-generic/performance/Makefile.am
index cb72fce..41aead5 100644
--- a/test/linux-generic/performance/Makefile.am
+++ b/test/linux-generic/performance/Makefile.am
@@ -2,7 +2,10 @@  include $(top_srcdir)/test/Makefile.inc
 
 TESTS_ENVIRONMENT += TEST_DIR=${builddir}
 
-TESTSCRIPTS = odp_scheduling_run_proc.sh
+TESTSCRIPTS = odp_scheduling_run_proc.sh \
+	      odp_crypto_run_proc.sh \
+	      odp_pktio_perf_run_proc.sh \
+	      odp_l2fwd_run_proc.sh
 
 TEST_EXTENSIONS = .sh
 
diff --git a/test/linux-generic/performance/odp_crypto_run_proc.sh b/test/linux-generic/performance/odp_crypto_run_proc.sh
new file mode 100755
index 0000000..a8fdeb0
--- /dev/null
+++ b/test/linux-generic/performance/odp_crypto_run_proc.sh
@@ -0,0 +1,22 @@ 
+#!/bin/sh
+#
+# Copyright (c) 2016, Linaro Limited
+# All rights reserved.
+#
+# SPDX-License-Identifier:	BSD-3-Clause
+#
+# Script that passes command line arguments to odp_crypto test when
+# launched by 'make check'
+
+TEST_DIR="${TEST_DIR:-$(dirname $0)}"
+PERFORMANCE="$TEST_DIR/../../common_plat/performance"
+ret=0
+
+run()
+{
+	$PERFORMANCE/odp_crypto${EXEEXT} --odph_proc  || ret=1
+}
+
+run
+
+exit $ret
diff --git a/test/linux-generic/performance/odp_l2fwd_run_proc.sh b/test/linux-generic/performance/odp_l2fwd_run_proc.sh
new file mode 100755
index 0000000..5e0b0a6
--- /dev/null
+++ b/test/linux-generic/performance/odp_l2fwd_run_proc.sh
@@ -0,0 +1,117 @@ 
+#!/bin/sh
+#
+# Copyright (c) 2016, Linaro Limited
+# All rights reserved.
+#
+# SPDX-License-Identifier:	BSD-3-Clause
+#
+
+# TEST_DIR is set by Makefile, when we add a rule to Makefile for odp_l2fwd_run
+# we can use TEST_DIR the same way odp_pktio_run uses it now.
+# If TEST_DIR is not set it means we are not running with make, and in this case
+# there are two situations:
+# 1. user build ODP in the same dir as the source (most likely)
+#    here the user can simply call odp_l2fwd_run
+# 2. user may have built ODP in a separate build dir (like bitbake usually does)
+#    here the user has to do something like $ODP/test/performance/odp_l2fwd_run
+#
+# In both situations the script assumes that the user is in the directory where
+# odp_l2fwd exists. If that's not true, then the user has to specify the path
+# to it and run:
+# TEST_DIR=$builddir $ODP/test/performance/odp_l2fwd_run
+
+# directory where test binaries have been built
+TEST_DIR="${TEST_DIR:-$PWD}"
+PERFORMANCE="$TEST_DIR/../../common_plat/performance"
+
+# directory where test sources are, including scripts
+TEST_SRC_DIR=$(dirname $0)
+
+PATH=$TEST_DIR:$TEST_DIR/../../../example/generator:$PATH
+
+# exit codes expected by automake for skipped tests
+TEST_SKIPPED=77
+
+PLATFORM_VALIDATION=${TEST_SRC_DIR}/../../$ODP_PLATFORM/validation
+
+# Use installed pktio env or for make check take it from platform directory
+if [ -f "./pktio_env" ]; then
+	. ./pktio_env
+elif  [ "$ODP_PLATFORM" = "" ]; then
+	echo "$0: error: ODP_PLATFORM must be defined"
+	# not skipped as this should never happen via "make check"
+	exit 1
+elif [ -f ${PLATFORM_VALIDATION}/api/pktio/pktio_env ]; then
+	. ${PLATFORM_VALIDATION}/api/pktio/pktio_env
+else
+	echo "BUG: unable to find pktio_env!"
+	echo "pktio_env has to be in current directory or in \
+	      platform/\$ODP_PLATFORM/test."
+	echo "ODP_PLATFORM=\"$ODP_PLATFORM\""
+	exit 1
+fi
+
+run_l2fwd()
+{
+	setup_pktio_env clean # install trap to call cleanup_pktio_env
+
+	if [ $? -ne 0 ]; then
+		echo "setup_pktio_env error $?"
+		exit $TEST_SKIPPED
+	fi
+
+	type odp_generator > /dev/null
+	if [ $? -ne 0 ]; then
+		echo "odp_generator not installed. Aborting."
+		cleanup_pktio_env
+		exit 1
+	fi
+
+	#@todo: limit odp_generator to cores
+	#https://bugs.linaro.org/show_bug.cgi?id=1398
+	(odp_generator${EXEEXT} -I $IF0 \
+			--srcip 192.168.0.1 --dstip 192.168.0.2 \
+			-m u 2>&1 > /dev/null) \
+			2>&1 > /dev/null &
+	GEN_PID=$!
+
+	# this just turns off output buffering so that you still get periodic
+	# output while piping to tee, as long as stdbuf is available.
+	if [ "$(which stdbuf)" != "" ]; then
+		STDBUF="stdbuf -o 0"
+	else
+		STDBUF=
+	fi
+	LOG=odp_l2fwd_tmp.log
+
+	#skip this because process mode is broken
+	#$STDBUF ${PERFORMANCE}/odp_l2fwd${EXEEXT} --odph_proc -i $IF1,$IF2 \
+	#-m 0 -t 30 -c 2 | tee $LOG
+	#ret=$?
+	ret=77
+
+	kill ${GEN_PID}
+
+	if [ ! -f $LOG ]; then
+		echo "FAIL: $LOG not found"
+		ret=1
+	elif [ $ret -eq 0 ]; then
+		PASS_PPS=5000
+		MAX_PPS=$(awk '/TEST RESULT/ {print $3}' $LOG)
+		if [ "$MAX_PPS" -lt "$PASS_PPS" ]; then
+			echo "FAIL: pps below threshold $MAX_PPS < $PASS_PPS"
+			ret=1
+		fi
+	fi
+
+	rm -f $LOG
+	cleanup_pktio_env
+
+	exit $ret
+}
+
+case "$1" in
+	setup)   setup_pktio_env   ;;
+	cleanup) cleanup_pktio_env ;;
+	*)       run_l2fwd ;;
+esac
diff --git a/test/linux-generic/performance/odp_pktio_perf_run_proc.sh b/test/linux-generic/performance/odp_pktio_perf_run_proc.sh
new file mode 100755
index 0000000..fccc7eb
--- /dev/null
+++ b/test/linux-generic/performance/odp_pktio_perf_run_proc.sh
@@ -0,0 +1,24 @@ 
+#!/bin/sh
+#
+# Copyright (c) 2016, Linaro Limited
+# All rights reserved.
+#
+# SPDX-License-Identifier:	BSD-3-Clause
+#
+# Script that passes command line arguments to odp_crypto test when
+# launched by 'make check'
+
+TEST_DIR="${TEST_DIR:-$(dirname $0)}"
+PERFORMANCE="$TEST_DIR/../../common_plat/performance"
+ret=0
+
+run()
+{
+	#skip because process mode is broken
+	#$PERFORMANCE/odp_pktio_perf${EXEEXT} --odph_proc || ret=1
+	ret=77
+}
+
+run
+
+exit $ret