Re: [Fuego] [PATCH] tests: use get_program_path in test_run function

<[email protected]> Tue, 26 Oct 2021 17:40:17 +0000
Newsgroups dev.linux.lists.fuego
Message-ID <BYAPR13MB250349A278639492CC95DEA8FD849@BYAPR13MB2503.namprd13.prod.outlook.com>

> -----Original Message-----
> From: [email protected] <[email protected]>
> 
> From: venkata <[email protected]>
> 
> Inordred to use the test programs installed in the board's
In order ...

> default PATH use get_program_path function which will first
> check the program in the PATH location then checks in the
> board test directory.
Actually, the order of the checks is board test dir, then PATH,
but in any event, I changed the wording here slightly to
be ambiguous about the search order (as that doesn't matter
for the description of this particular commit).


> 
> Signed-off-by: venkata <[email protected]>
> ---
>  tests/Benchmark.IOzone/fuego_test.sh     | 3 ++-
>  tests/Benchmark.bonnie/fuego_test.sh     | 9 ++-------
>  tests/Benchmark.cyclictest/fuego_test.sh | 3 ++-
>  tests/Benchmark.hackbench/fuego_test.sh  | 3 ++-
>  4 files changed, 8 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/Benchmark.IOzone/fuego_test.sh b/tests/Benchmark.IOzone/fuego_test.sh
> index 86ec12f..8bbf826 100755
> --- a/tests/Benchmark.IOzone/fuego_test.sh
> +++ b/tests/Benchmark.IOzone/fuego_test.sh
> @@ -39,7 +39,8 @@ function test_deploy {
>  function test_run {
>      hd_test_mount_prepare $BENCHMARK_IOZONE_MOUNT_BLOCKDEV $BENCHMARK_IOZONE_MOUNT_POINT
> 
> -    report "cd $BENCHMARK_IOZONE_MOUNT_POINT; $BOARD_TESTDIR/fuego.$TESTDIR/iozone -a $BENCHMARK_IOZONE_TESTS -O -R -
> b $BOARD_TESTDIR/fuego.$TESTDIR/results.${BUILD_ID}.${BUILD_NUMBER}.xls -g $BENCHMARK_IOZONE_FILE_SIZE"
> +    get_program_path iozone
> +    report "cd $BENCHMARK_IOZONE_MOUNT_POINT; $PROGRAM_IOZONE -a $BENCHMARK_IOZONE_TESTS -O -R -b
> $BOARD_TESTDIR/fuego.$TESTDIR/results.${BUILD_ID}.${BUILD_NUMBER}.xls -g $BENCHMARK_IOZONE_FILE_SIZE"
>      get $BOARD_TESTDIR/fuego.$TESTDIR/results.${BUILD_ID}.${BUILD_NUMBER}.xls ${LOGDIR}/results.xls
> 
>      hd_test_clean_umount $BENCHMARK_IOZONE_MOUNT_BLOCKDEV $BENCHMARK_IOZONE_MOUNT_POINT
> diff --git a/tests/Benchmark.bonnie/fuego_test.sh b/tests/Benchmark.bonnie/fuego_test.sh
> index 115b3d4..8a7f6ad 100755
> --- a/tests/Benchmark.bonnie/fuego_test.sh
> +++ b/tests/Benchmark.bonnie/fuego_test.sh
> @@ -50,13 +50,8 @@ function test_run {
>          BONNIE_ROOT_PARAM=""
>      fi
> 
> -    if [ -z "$PROGRAM_BONNIE" ]; then
> -        BONNIE_CMD="./bonnie\+\+"
> -    else
> -        BONNIE_CMD="bonnie\+\+"
> -    fi
This is nice to get rid of.

> -
> -    report "cd $BOARD_TESTDIR/fuego.$TESTDIR; pwd; ls; $BONNIE_CMD -d $BENCHMARK_BONNIE_MOUNT_POINT/fuego.$TESTDIR
> $BONNIE_ROOT_PARAM -s $BENCHMARK_BONNIE_SIZE -r $BENCHMARK_BONNIE_RAM -n $BENCHMARK_BONNIE_NUM_FILES -m
> $NODE_NAME"
> +    get_program_path "bonnie++"
> +    report "pwd; ls; $PROGRAM_BONNIE__ -d $BENCHMARK_BONNIE_MOUNT_POINT/fuego.$TESTDIR $BONNIE_ROOT_PARAM -s
> $BENCHMARK_BONNIE_SIZE -r $BENCHMARK_BONNIE_RAM -n $BENCHMARK_BONNIE_NUM_FILES -m $NODE_NAME"
> 
>      sync
> 
> diff --git a/tests/Benchmark.cyclictest/fuego_test.sh b/tests/Benchmark.cyclictest/fuego_test.sh
> index 74d9d24..352a148 100755
> --- a/tests/Benchmark.cyclictest/fuego_test.sh
> +++ b/tests/Benchmark.cyclictest/fuego_test.sh
> @@ -24,5 +24,6 @@ function test_deploy {
>  }
> 
>  function test_run {
> -    report "cd $BOARD_TESTDIR/fuego.$TESTDIR; ./cyclictest $BENCHMARK_CYCLICTEST_PARAMS"
> +    get_program_path cyclictest
> +    report "$PROGRAM_CYCLICTEST $BENCHMARK_CYCLICTEST_PARAMS"
>  }
> diff --git a/tests/Benchmark.hackbench/fuego_test.sh b/tests/Benchmark.hackbench/fuego_test.sh
> index cc05c74..be42509 100755
> --- a/tests/Benchmark.hackbench/fuego_test.sh
> +++ b/tests/Benchmark.hackbench/fuego_test.sh
> @@ -16,5 +16,6 @@ function test_deploy {
>  }
> 
>  function test_run {
> -    report "cd $BOARD_TESTDIR/fuego.$TESTDIR; ./hackbench $BENCHMARK_HACKBENCH_PARAMS"
> +    get_program_path hackbench
> +    report "$PROGRAM_HACKBENCH $BENCHMARK_HACKBENCH_PARAMS"
>  }
> --
> 2.20.1
> 

The code all looks good.  I applied and tested, and didn't see any problems.
So this has been pushed to the bitbucket.

Thanks.

Note - I did find one issue with the bonnie++ test, but it's unrelated to this change.
I'll try to take a look at that today, and there may be a fix for that coming soon.
 -- Tim