Test File Structure
Test File Structure
The test file defines the configuration and execution flow of a test. Below are the key components:
Required Fields
Attribute | Type | Description |
---|
name | string | Name of the test |
description | string | Description of the test |
stages | []stage | List of stages defining test operations |
Optional Fields
Attribute | Type | Description |
---|
pre-stage | stage | Overrides default DUT pre-stage configuration |
post-stage | stage | Overrides default DUT post-stage configuration |
defaults | object | Defines defaults to simplify the test file |
tools | array | List of tools to be used (must be added via CLI tool) |
binary-not-required | boolean | If true, test can run without a binary |
Example
name: Boot Test (Network)
description: Flash the provided firmware binary and conduct a boot test.
defaults:
transport: &transport
proto: ssh
options:
host: "[[.Host]]"
user: root
identity_file: /root/.ssh/fwci
stages:
- name: Boot Test
steps:
- cmd: cmd
name: Cat OS Version
transport: *transport
parameters:
executable: cat
args: ["/etc/os-release"]
- cmd: cmd
name: Power off device
transport: *transport
parameters:
executable: shutdown
args: ["now"]
Example 2
name: Boot Test (Serial)
description: Flash the provided firmware binary and conduct a boot test.
defaults:
transport: &transport
proto: ssh
options:
host: "[[.Host]]"
user: root
identity_file: /root/.ssh/fwci
pre-stage:
name: Setup
steps:
- cmd: dutctl
name: Shutdown the DUT.
parameters:
host: "[[.Pi]]"
command: power
args: ["off"]
- cmd: dutctl
name: Flash the provided binary.
parameters:
host: "[[ .Pi ]]"
command: flash
args: [write, "[[.Binary]]"]
- cmd: sleep
name: Wait for the DUT to settle
parameters:
duration: 15s
- cmd: dutctl
name: Turn the DUT on
parameters:
host: "[[ .Pi ]]"
command: power
args: ["hardreset"]
options:
timeout: 2m
- cmd: dutctl
name: Check Serial
parameters:
host: "[[ .Pi ]]"
command: serial
expect:
- regex: "XhcClearBiosOwnership: called to clear BIOS ownership"
options:
timeout: 5m
stages:
- name: Boot Test
steps:
- cmd: cmd
name: Cat OS Version
transport: *transport
parameters:
executable: cat
args: ["/etc/os-release"]
- cmd: cmd
name: Power off device
transport: *transport
parameters:
executable: shutdown
args: ["now"]