[Fuego] [PATCH 1/6] dbench: check the version of the command

Tim.Bird at sony.com Tim.Bird at sony.com
Thu Apr 12 00:49:48 UTC 2018



> -----Original Message-----
> From: Daniel Sangorrin
> 
> Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
> ---
>  engine/tests/Benchmark.dbench4/fuego_test.sh | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/engine/tests/Benchmark.dbench4/fuego_test.sh
> b/engine/tests/Benchmark.dbench4/fuego_test.sh
> index 9890618..9eb28da 100755
> --- a/engine/tests/Benchmark.dbench4/fuego_test.sh
> +++ b/engine/tests/Benchmark.dbench4/fuego_test.sh
> @@ -6,7 +6,18 @@ function test_pre_check {
>      assert_define BENCHMARK_DBENCH_MOUNT_POINT
>      assert_define BENCHMARK_DBENCH_TIMELIMIT
>      assert_define BENCHMARK_DBENCH_NPROCS
> +
>      is_on_target_path dbench PROGRAM_DBENCH
> +    if [ ! -z "$PROGRAM_DBENCH" ]; then
> +        help=$(cmd "dbench --help") || true
> +        version=$(echo $help | head -1 | cut -d' ' -f 3)
> +        if [ "$version" != "4.00" ]; then
My only issue is that this is a little strict.  I know that 4.00 matches the version in our
current tarfile, but this check would fail if we found version 4.01 on the target board.

I added a new function version_lt (version "less than"), and use it here so that it reads:

    if version_lt $version 4.00 ; then

This means the check doesn't have to change when we upgrade the version of
dbench in the tarfile, and allows this test to work with newer versions of dbench
found on the target.
 
 -- Tim

> +            echo "dbench found on the target but version $version is not
> supported."
> +            PROGRAM_DBENCH=""
> +        else
> +            echo "dbench found on the target (version $version)."
> +        fi
> +    fi
>  }
> 
>  function test_build {
> --
> 2.7.4



More information about the Fuego mailing list