function run test

NAME [edit section]

run_test

SYNOPSIS [edit section]

Run a Fuego test using "ftc run-test"

DESCRIPTION [edit section]

This function can be used by a test to run another "nested" test. It is used primarily by batch tests to execute the sub-tests (child tests) that are part of the batch.

This runs the test on the board defined by $NODE_NAME, which is usually the same board as the parent (ie calling) test.

Usually, the caller will define the variable FUEGO_BATCH_ID, which is used to assign the sub-test to a group of tests. If FUEGO_BATCH_ID is not defined on entry to the function, it will be set to a value using the function allocate_next_batch_id.

It is possible to control the timeout of the test using an 'ftc run-test' argument, or by setting the variable DEFAULT_TIMEOUT.

The result of the test is output and logged to the host-side log for the test. The format of the result line is similar to TAP13, but with a prefix, like so:

That is, the line consists of the batch id in double-square brackets, followed by the result string (either 'ok' or 'not ok') followed by the testcase number and testcase name.

You can control both the testcase number and testcase name explicitly using variables TC_NUM and TC_NAME, but if these are not specified the function will define them for you (and increment TC_NUM for you automatically).

EXAMPLES [edit section]

Here are some sample invocations:

Simple invocation:


Invocation with FUEGO_BATCH_ID, and using 'ftc run-test' arguments

Any 'ftc run-test' arguments can be used. The example above uses:


Invocation showing use of TC_NAME to set the testcase name for each sub-test:


Invocation showing use of DEFAULT_TIMEOUT, and explicit timeout:

The timeout for tests 'hello_world' and 'bc' would be 5 minutes, while the timeout for Functional.LTP would be 30 minutes.

ENVIRONMENT and ARGUMENTS [edit section]

Positional arguments:

Environment variables:

RETURN [edit section]

Returns non-zero on error.

SOURCE [edit section]

Located in scripts/functions.sh

SEE ALSO [edit section]