See also
Parsing test output will always involve some amount of pattern matching. The test action creates a stream of output, (typically ASCII), and this needs to be turned into test results either using scripts on the DUT or after transmission over a serial connection.
Interactive test actions move all of the parsing to the test writer commands by setting a sequence of strings with expected output and support for determining failures.
Note
All interactive test actions need to specify all possible failure strings for each command, as well as the type of exception to raise when a string is matched. Interactive test actions must always have a start and end to the parsing or the entire job will simply time out because none of the expected matches exist.
Interactive test actions cannot provide support for monitoring kernel boot messages or LAVA Test Helpers, all pattern matching is done solely by the strings set by the test writer. This rules out support like MultiNode and Lava-Test Test Definition 1.0.
See also
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | device_type: beaglebone-black
job_name: run tests in U-Boot
timeouts:
job:
minutes: 10
action:
minutes: 5
connection:
minutes: 2
priority: medium
visibility: public
metadata:
source: https://git.lavasoftware.org/lava/lava.git
path: doc/v2/examples/test-jobs/bbb-uboot-interactive.yaml
actions:
- boot:
method: bootloader
bootloader: u-boot
commands: []
prompts:
- '=>'
- test:
timeout:
minutes: 4
interactive:
- name: network
prompts: ["=> ", "/ # "]
script:
- command: dhcp
name: dhcp
successes:
- message: "DHCP client bound to address"
failures:
- message: "TIMEOUT"
exception: InfrastructureError
error: "dhcp failed"
|
Download or view example interactive test job: examples/test-jobs/bbb-uboot-interactive.yaml
In some situations, there can be a need to combine two or more
different types of test action in a single test job. For example,
a POSIX overlay test action to do initial setup, then a monitors
or
interactive
test action to parse the output of a specific task.
It is very important to understand that Lava-Test Test Definition 1.0 cannot occur more than once in a single test job once any other test action type is used. If further test actions are required via the POSIX shell, an interactive test action must be used.
A single Lava-Test Test Definition 1.0 test action can already include multiple different tests, potentially from different repositories:
1 2 3 4 5 6 7 8 9 10 11 | # TEST_BLOCK
- test:
timeout:
minutes: 5
definitions:
- repository: http://git.linaro.org/lava-team/lava-functional-tests.git
from: git
path: lava-test-shell/smoke-tests-basic.yaml
name: smoke-tests
- repository: https://git.linaro.org/lava-team/lava-functional-tests.git
from: git
|
It is fully supported to then add an interactive test action:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | - test:
timeout:
minutes: 4
interactive:
- name: network
prompts: ["=> ", "/ # "]
script:
- command: dhcp
name: dhcp
successes:
- message: "DHCP client bound to address"
failures:
- message: "TIMEOUT"
exception: InfrastructureError
error: "dhcp failed"
|
However, until Test Definition 2.0 is fully scoped and delivered, it is not possible to add another Lava-Test Test Definition 1.0 action.
Note
This applies within any one namespace, it does not apply between different namespaces.