[Fuego] [PATCH 1/4] LTP: add support for users to do some customizable configurations

Tim.Bird at sony.com Tim.Bird at sony.com
Tue Mar 20 04:34:23 UTC 2018


This is an interesting approach to solving this problem.  However I have some concerns.
These "test operation" scripts seem like they have elements of both
board configuration and possibly farm configuration (host/client physical connections).

More questions and comments inline below and on other patches in this series.

Sorry for the delayed response.  I've been out of the office for a week.
 -- Tim


> -----Original Message-----
> From: Liu Wenlong on Sunday, March 11, 2018 8:39 AM
> 
> Different tests needs different pre-configs on different distro.
> Now, I added this feature which can flexibly help users to do
> their own configurations before or after one test.
> 
> Signed-off-by: Liu Wenlong <liuwl.fnst at cn.fujitsu.com>
> ---
>  engine/tests/Functional.LTP/fuego_test.sh | 25 +++++++++++++++++++++-
> ---
>  1 file changed, 21 insertions(+), 4 deletions(-)
> 
> diff --git a/engine/tests/Functional.LTP/fuego_test.sh
> b/engine/tests/Functional.LTP/fuego_test.sh
> index 1617974..2b01b5d 100755
> --- a/engine/tests/Functional.LTP/fuego_test.sh
> +++ b/engine/tests/Functional.LTP/fuego_test.sh
> @@ -324,6 +324,19 @@ function test_deploy {
>          done
>      fi
> 
> +    # Generate script for test env setup.
> +    # Uses can write their own script to configure the test env before testing,
> and
> +    # they can restore test env after testing.
> +    # This script can be specified in "test_operation" of spec.json file.
> +    echo "# setup test environment." > ${LOGDIR}/set_env.sh
> +    if [ -n "${FUNCTIONAL_LTP_TEST_OPERATION}" ]; then
> +        if [ -f "$FUNCTIONAL_LTP_TEST_OPERATION" ]; then
> +            cat "$FUNCTIONAL_LTP_TEST_OPERATION" >>
> ${LOGDIR}/set_env.sh
> +        else
> +            echo "$FUNCTIONAL_LTP_TEST_OPERATION" >>
> ${LOGDIR}/set_env.sh
If you have a single line, why wouldn't you just use a normal test variable?
I guess in a sense it is a normal test variable, in this case.

Or can FUNCTIONAL_LTP_TEST_OPERATION be multi-line?

> +        fi
> +    fi
> +
>      # make a staging area
>      cp -r target_bin ltp
>      cp ${LOGDIR}/skiplist.txt ltp
> @@ -336,6 +349,9 @@ function test_deploy {
>              echo "Removing syscalls binaries"
>              awk '/^[^#]/ { print "rm -f ltp/testcases/bin/" $2 }' ltp/runtest/syscalls
> | sh
>          fi
> +
> +        cp ${LOGDIR}/set_env.sh ltp
> +
>          put ltp/* $LTP_DESTDIR
>      else
>          echo "Skipping LTP deploy to board"
> @@ -353,10 +369,11 @@ function test_deploy {
> 
>      # pre-installed LTP needs a few fuego-specific items
>      if [ -n "$FUNCTIONAL_LTP_HOMEDIR" ] ; then
> -       cmd "mkdir -p
> $FUNCTIONAL_LTP_HOMEDIR/testcases/realtime/scripts"
> -       put testcases/realtime/scripts/setenv.sh
> $FUNCTIONAL_LTP_HOMEDIR/testcases/realtime/scripts
> -       put $TEST_HOME/ltp_target_run.sh $FUNCTIONAL_LTP_HOMEDIR
> -       put ${LOGDIR}/skiplist.txt $FUNCTIONAL_LTP_HOMEDIR
> +        cmd "mkdir -p
> $FUNCTIONAL_LTP_HOMEDIR/testcases/realtime/scripts"
> +        put testcases/realtime/scripts/setenv.sh
> $FUNCTIONAL_LTP_HOMEDIR/testcases/realtime/scripts
> +        put $TEST_HOME/ltp_target_run.sh $FUNCTIONAL_LTP_HOMEDIR
> +        put ${LOGDIR}/skiplist.txt $FUNCTIONAL_LTP_HOMEDIR
> +        put ${LOGDIR}/set_env.sh $FUNCTIONAL_LTP_HOMEDIR
>      fi
>  }
> 
> --
> 2.7.4
> 
> 
> 
> _______________________________________________
> Fuego mailing list
> Fuego at lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/fuego


More information about the Fuego mailing list