function_test_run 

Fuego wiki

Login or create account

function test run

NAME [edit section]

test_run

SYNOPSIS [edit section]

Performs the actual steps needed to execute the test software on the target.

DESCRIPTION [edit section]

This function is defined in the base test script for a test, and executes those commands required to build the software.

When this function starts, the test program (if any) has been installed on the target board.

Commonly called functions or programs [edit section]

This function can contain calls to just about any command, but there are some common commands sed for building Linux source
  • cmd - used to execute commands on the target, e.g. for test preparation
  • get_program_path - used to find pre-installed test programs or auxiliary programs on the board
  • report - used to execute the test and save the log output (test stdout) to a file
  • report_append - used to execute another command on the target, and append the log output to the test log
  • log_this - execute a command an log the output on the host

Disk and filesystem tests may use the following routines:

  • hd_test_mount_prepare - mount a filesystem in preparation for a test
  • hd_test_clean_unmount - unmount a filesystem after a test had concluded

Batch tests may use the following routines

  • allocate_next_batch_id
  • run_test

EXAMPLES [edit section]

Some sample contents are:
    function test_run {
        report "cd $BOARD_TESTDIR/fuego.$TESTDIR; ./hello $FUNCTIONAL_HELLO_WORLD_ARG"
    }

    function test_run {
        report "cd /tmp/fuego.$TESTDIR/target_bin; ./bin/run-all-posix-option-group-tests.sh"
    }

    function test_run {
        assert_define BENCHMARK_TIOBENCH_MOUNT_BLOCKDEV
        assert_define BENCHMARK_TIOBENCH_MOUNT_POINT
        assert_define BENCHMARK_TIOBENCH_THREADS
        assert_define BENCHMARK_TIOBENCH_SIZE
    
        hd_test_mount_prepare $BENCHMARK_TIOBENCH_MOUNT_BLOCKDEV $BENCHMARK_TIOBENCH_MOUNT_POINT
    
        report "cd $BOARD_TESTDIR/fuego.$TESTDIR; ./tiotest -d $BENCHMARK_TIOBENCH_MOUNT_POINT -t $BENCHMARK_TIOBENCH_THREADS -f $BENCHMARK_TIOBENCH_SIZE –S"
        report_append "cd $BOARD_TESTDIR/fuego.$TESTDIR; ./tiotest -d $BENCHMARK_TIOBENCH_MOUNT_POINT -t $BENCHMARK_TIOBENCH_THREADS -f $BENCHMARK_TIOBENCH_SIZE –W"
    
        hd_test_clean_umount $BENCHMARK_TIOBENCH_MOUNT_BLOCKDEV $BENCHMARK_TIOBENCH_MOUNT_POINT
    }

ENVIRONMENT and ARGUMENTS [edit section]

A number of environment variables are set (see Core interfaces and Variables)

However, some variables that are commonly used in this function are:

  • $TESTDIR - name of the test directory (which, coincedentally is the name of the test)
  • $BOARD_TESTDIR - the directory where materials for the test are located (on the target)
    • This is usually used with $BOARD_TESTDIR/fuego.$TESTDIR

There are no arguments to this function.

RETURN [edit section]

returns non-zero for error

SOURCE [edit section]

Located in the base script for each test. The base test scripts are located in /home/jenkins/fuego/engine/tests/<test_name>.

An example path would be: /home/jenkins/fuego/engine/tests/Functional.hello_world/hello_world.sh

SEE ALSO [edit section]

TBWiki engine 1.8.3 by Tim Bird