Test Step Commands

This page describes the structure of test files, stages, and test steps in FirmwareCI.

Test Step Structure

Each test step in a stage has this structure:

AttributeTypeRequiredDescription
cmdstringYesIdentifies which test step to execute
namestringYesUniquely identifies the step for reports and logs
transportTransportObjectYesDefines how the command is executed
parametersobjectYesCommand-specific parameters
optionsOptionsObjectNoAdditional command options

Example

name: "Firmware Test Suite"
description: "Tests firmware functionality and boot process"
defaults:
  transport: &default_transport
    proto: ssh
    options:
      host: "[[.Host]]"
      user: root
      identity_file: /root/.ssh/id_ecdsa

tools:
  - "flasher"
  - "serial_monitor"

pre-stage:
  name: "Setup"
  steps:
    - cmd: dutctl
      name: "Power On"
      transport: *default_transport
      parameters:
        command: "power"
        args: ["on"]

stages:
  - name: "Boot Test Stage"
    steps:
      - cmd: firmware-version
        name: "Check BIOS Version"
        transport: *default_transport
        parameters:
          tool_path: "/usr/sbin/fw_version"
          format: "hex"
          expect:
            version: "0xA5"
      
      - cmd: cmd
        name: "Verify Boot Status"
        transport: *default_transport
        parameters:
          executable: "systemctl"
          args: ["is-system-running"]
          expect:
            - regex: "running"

post-stage:
  name: "Cleanup"
  steps:
    - cmd: dutctl
      name: "Power Off"
      transport: *default_transport
      parameters:
        command: "power"
        args: ["off"]

Transport

The transport object defines how test steps are executed, either locally or on a remote machine. This configuration ensures proper command execution and authentication.

AttributeTypeRequiredDescription
protostringYesProtocol for command execution: local (local execution) or ssh (remote execution)
optionsTransportOptionsRequired for SSHProtocol-specific configuration options

Transport Options

When using the SSH protocol (proto: "ssh"), the following options are available:

AttributeTypeRequiredDefaultDescription
hoststringYesHostname or IP address of remote machine
userstringYesUsername for authentication
portintegerNo22SSH port number
passwordstringOne of these required*User’s password
identity_filestringOne of these required*Path to SSH private key

* You must provide either password or identity_file, but not both.

Protocol-Specific Requirements

Local Protocol

When using proto: "local":

  • No options are required or allowed
  • Commands execute on the local machine

SSH Protocol

When using proto: "ssh":

  • The options object is required
  • Must provide host and user
  • Must provide either password or identity_file
  • Cannot provide both password and identity_file

Examples

Local Execution

transport:
  proto: local

SSH with Password

transport:
  proto: ssh
  options:
    host: "192.168.1.100"
    user: "admin"
    password: "secretpassword"

SSH with Identity File

transport:
  proto: ssh
  options:
    host: "[[.Host]]"
    user: "root"
    identity_file: "/root/.ssh/id_ecdsa"
    port: 2222  # Optional custom port

Options

The options object provides common configuration settings that can be applied to any test step. These settings control the test step’s execution behavior.

AttributeTypeRequiredDefaultDescription
timeoutstringNo6h00m00sMaximum duration for test step execution. If the step takes longer than this timeout, it will fail. Format: hours(h), minutes(m), seconds(s)

Timeout Format

The timeout value must follow this pattern: ^((\\d+h)?(\\d+m)?(\\d+s)?)?$

Valid examples:

  • "30s" - 30 seconds
  • "5m" - 5 minutes
  • "2h30m" - 2 hours and 30 minutes
  • "1h30m45s" - 1 hour, 30 minutes, and 45 seconds

Examples

Basic Timeout

options:
  timeout: "30s"

Complex Timeout

options:
  timeout: "1h30m45s"

Complete Test Step with Options

cmd: firmware-version
name: "Check BIOS Version"
transport:
  proto: ssh
  options:
    host: "[[.Host]]"
    user: root
    identity_file: /root/.ssh/id_ecdsa
parameters:
  tool_path: "/usr/sbin/fw_version"
  format: "hex"
  expect:
    version: "0xA5"
options:
  timeout: "5m"  # Step will fail if not completed within 5 minutes

Teststep Commands

Binarly

The Binarly test step executes a scan using the Binarly service to analyze firmware binaries.

AttributeTypeRequiredDescription
cmdconstYesMust be binarly report
namestringYesUniquely identifies the test step in reports and logs
parametersBinarlyParametersYesBinarly-specific parameters
optionsOptionsObjectNoAdditional command options

Binarly Parameters

AttributeTypeRequiredDescription
urlstringYesURL of the Binarly endpoint
tokenstringYesAuthentication token for Binarly service
file_pathstringYesPath to the binary file to be scanned

Example

cmd: binarly report
name: "Scan BIOS for vulnerabilities"
parameters:
  url: "https://api.binarly.io/v1"
  token: "your-binarly-token"
  file_path: "/path/to/firmware.bin"
options:
  timeout: "30m"  # Scan might take a while

ChipSec

AttributeTypeDefaultParentDescription
cmdconstchipsec
namestringName to uniquely identify the teststep. This name will show up in reports, logs and the WebUI
parametersChipSecOptionsOptions passed into ChipSec
inputChipSecInputOptionsparameterschipsec Input Options

ChipSec Options

ChipSec only supports one set of options.

ChipSec Input Options
AttributeTypeDefaultParentDescription
pchstringinputPCH parameter that gets passed into ChipSec as --pch parameter
modules[]stringinputList of modules that get executed from the ChipSec test suite
nix_osboolfalseinputSpecify if the ChipSec tooling gets executed on a NixOS platform

ChipSec Example

Copy

AttributeTypeDefaultParentDescription
cmdconstcopy
namestringName to uniquely identify the teststep. This name will show up in reports, logs and the WebUI
parametersCopyOptionsOptions passed into the copy cmd
inputCopyInputOptionsparameterscopy Input Options

Copy Options

Copy Input Options
AttributeTypeDefaultParentDescription
sourcestringinputSource Location of the file to copy to the DUT.
destinationstringinputDestination Location of the file to copy to the DUT
recursiveboolfalseinputCopy false recursively. Available options: false, true.

Copy Example

CPULoad

CPULoad is a subcommand of the System-Suite. Check out the System-Suite for full documentation.

AttributeTypeDefaultParentDescription
cmdconstcpuload
namestringName to uniquely identify the teststep. This name will show up in reports, logs and the WebUI
parametersCPULoadOptionsOptions passed into the cpuload cmd
inputCPULoadInputOptionsparameterscpuload Input Options
expectCPULoadExpectOptionsparameterscpuload Input Options

CPULoad Options

CPULoad Input Options
AttributeTypeDefaultParentDescription
tool_pathstringinputPath to the tool on the DUT
args[]stringinputArray of strings with arguments passed into the cpuload tool. Available options: XXXTODOXXX
cpus[]integerinputArray of CPUs that should be put under load.
durationstringinputDuration of the load. Format: ^((\\d+h)?(\\d+m)?(\\d+s)?)?$
CPULoad Expect Options
AttributeTypeDefaultParentDescription
general[]GeneralObjectexpectGeneralObject Description
individual[]IndividualObjectexpectIndividualObject Description
General Object
AttributeTypeDefaultParentDescription
optionstringgeneralName of the option
valuestringgeneralValue of the option
Individual Object
AttributeTypeDefaultParentDescription
cpu[]integerindividualArray of CPUs where the option should be applied to
optionstringindividualName of the option
valuestringindividualValue of the option

CPULoad Example

CPUSet

cpuset is part of the System-Suite. Check out the documentation of the System-Suite for more information.

AttributeTypeDefaultParentDescription
cmdconstcpuset
namestringName to uniquely identify the teststep. This name will show up in reports, logs and the WebUI
parametersCPUSetOptionsOptions passed into the cpuset cmd
inputCPUSetInputOptionsparameterscpuset Input Options

CPUSet Options

CPUSet Input Options
AttributeTypeDefaultParentDescription
tool_pathstringinputPath to the tool on the DUT
commandstringinputCommand to run. Available options: core, or profile.
args[]stringinputArray of strings with arguments passed into the cpuset tool. Available options: XXXTODOXXX
cores[]integerinputArray of Cores where the command should be applied to.
durationstringinputDuration of the load. Format: ^((\\d+h)?(\\d+m)?(\\d+s)?)?$

CPUSet Example

CPUStats

cpustats is part of the System-Suite. Check out the documentation of the System-Suite for more information.

AttributeTypeDefaultParentDescription
cmdconstcpustats
namestringName to uniquely identify the teststep. This name will show up in reports, logs and the WebUI
parametersCPUStatsOptionsOptions passed into the cpustats cmd
inputCPUStatsInputOptionsparameterscpustats input options
expectCPUStatsExpectOptionsparameterscpustats expect options

CPUStats Options

CPUStats Input Options
AttributeTypeDefaultParentDescription
tool_pathstringinputPath to the tool on the DUT
intervalstringinputInterval to check the CPU Stats
CPUStats Expect Options
AttributeTypeDefaultParentDescription
general[]GeneralObjectexpectGeneralObject Description
individual[]IndividualObjectexpectIndividualObject Description

CPUStats Example

DUTCTL

AttributeTypeDefaultParentDescription
cmdconstdutctl
namestringName to uniquely identify the teststep. This name will show up in reports, logs and the WebUI
parametersDUTCTLOptionsOptions passed into the dutctl cmd
inputDUTCTLInputOptionsparametersdutctl input options

DUTCTL Options

DUTCTL Input Options
AttributeTypeDefaultParentDescription
hoststringinputHostname or IP address of the device.
uartintegerinputUART number to use for serial communication.
commandstringinputCommand to execute on the device. Available commands: power, flash, serial.
args[]stringinputArguments for the command. Arguments depend on the command that is executed.
inputstringinputInput for the command, used only if command is set to serial.
DUTCTL Expect Options
AttributeTypeDefaultParentDescription
regexstringexpectRegular expression to match against the output of the device for the serial command.

Firmware Version

AttributeTypeDefaultParentDescription
cmdconstfirmware version
namestringName to uniquely identify the teststep. This name will show up in reports, logs and the WebUI
parametersFirmwareVersionOptionsOptions passed into the firmware version cmd
inputFirmwareVersionInputOptionsparametersfirmware version input options
expectFirmwareVersionExpectOptionsparametersfirmware version expect options

Firmware Version Options

Firmware Version Input Options
AttributeTypeDefaultParentDescription
tool_pathstringinputPath to the tool used to retrieve the firmware version.
formatstringinputFormat of the tool’s output. Available options: number, hex, pair, triplet, quad.
Firmware Version Expect Options
AttributeTypeDefaultParentDescription
versionstringexpectExpected firmware version in the specified format.

FWHunt

AttributeTypeDefaultParentDescription
cmdconstfwhunt
namestringName to uniquely identify the teststep. This name will show up in reports, logs and the WebUI
parametersFWHuntOptionsOptions passed into the fwhunt cmd
inputFWHuntInputOptionsparametersfwhunt input options

FWHunt Options

FWHunt Input Options
AttributeTypeDefaultParentDescription
rules_dirs[]stringinputList of directories to search for rules. If not specified, the default rules directory will be used.
rules[]stringinputList of rules to run.
report_onlybooleaninputOnly report findings, do not interpret the output.

FWTS

AttributeTypeDefaultParentDescription
cmdconstfwts
namestringName to uniquely identify the teststep. This name will show up in reports, logs and the WebUI
parametersFWTSOptionsOptions passed into the fwts cmd
inputFWTSInputOptionsparametersfwts input options

FWTS Options

FWTS Input Options
AttributeTypeDefaultParentDescription
flags[]stringinputList of flags to pass to fwts.
report_onlybooleaninputOnly report findings, do not interpret the output.

Ping

AttributeTypeDefaultParentDescription
cmdconstping
namestringName to uniquely identify the teststep. This name will show up in reports, logs and the WebUI
parametersPingOptionsOptions passed into the ping cmd
inputPingInputOptionsparametersping input options

Ping Options

Ping Input Options
AttributeTypeDefaultParentDescription
hoststringinputHostname or IP address used for the ping.
portinteger22inputPort to use for the ping.
expectPingExpectOptionsparametersping expect options
Ping Expect Options
AttributeTypeDefaultParentDescription
should_failbooleanfalseexpectIf set to true, the expected behavior is that the ping won’t work. Otherwise, a successful ping is expected.

Qemu

AttributeTypeDefaultParentDescription
cmdconstqemu
namestringName to uniquely identify the teststep. This name will show up in reports, logs and the WebUI
parametersQemuOptionsOptions passed into the qemu cmd
inputQemuInputOptionsparametersqemu input options

Qemu Options

Qemu Input Options
AttributeTypeDefaultParentDescription
executablestringinputThe executable that should be executed.
firmwarestringinputThe firmware that should be used.
imagestringinputThe image that should be used.
logfilestringinputThe logfile that should be used.
nprocintegerinputThe number of processors that should be used.
memintegerinputThe amount of memory that should be used.
stepsQemuStepsOptionsinputSteps to interact with during test execution.
Qemu Steps Options
AttributeTypeDefaultParentDescription
sendstringinputA string that should be sent as input.
timeoutstringinputTimeout for the interaction. Format: h for hours, m for minutes, s for seconds (e.g., 1h30m20s).
expectQemuExpectOptionsinputExpectation for the interaction output.
Qemu Expect Options
AttributeTypeDefaultParentDescription
regexstringexpectRegular expression that should be matched against the output of the interaction.

Robot Test Framework

AttributeTypeDefaultParentDescription
cmdconstrobot
namestringName to uniquely identify the teststep. This name will show up in reports, logs and the WebUI
parametersRobotOptionsOptions passed into the robot cmd
inputRobotInputOptionsparametersrobot input options

Robot Options

Robot Input Options
AttributeTypeDefaultParentDescription
file_pathstringinputPath to the robot test file.
args[]stringinputArguments to pass to the robot test file.
report_onlybooleaninputIf true, the output won’t be validated.

S0ix-Selftest

AttributeTypeDefaultParentDescription
cmdconsts0ix-selftest
namestringName to uniquely identify the teststep. This name will show up in reports, logs and the WebUI
parametersS0ixSelftestOptionsOptions passed into the s0ix-selftest cmd
inputS0ixSelftestInputOptionsparameterss0ix-selftest input options

S0ix-Selftest Options

S0ix-Selftest Input Options
AttributeTypeDefaultParentDescription
tool_pathstringinputPath to the tool used to perform the S0ix self-test.

SecureBoot Management

AttributeTypeDefaultParentDescription
cmdconstSecure Boot Management
namestringName to uniquely identify the teststep. This name will show up in reports, logs and the WebUI
parametersSecureBootOptionsOptions passed into the Secure Boot Management cmd
inputSecureBootInputOptionsparametersSecure Boot Management input options

SecureBoot Options

SecureBoot Input Options
AttributeTypeDefaultParentDescription
commandstringinputCommand to execute. Can be one of: status, enroll-key, rotate-key, reset, custom-key.
tool_pathstringinputPath to the tool that should be executed to run Secure Boot commands.
hierarchystringinputHierarchy to use for the key. Can be one of: db, dbx, KEK, PK.
key_filestringinputPath to the key file used for enroll-key and rotate-key commands.
custom_key_filestringinputPath to the custom key file used for custom-key command.
cert_filestringinputPath to the certificate file used for enroll-key and rotate-key commands.
signing_key_filestringinputPath to the signing key file used for enroll-key and rotate-key commands.
signing_cert_filestringinputPath to the signing certificate file used for enroll-key and rotate-key commands.
appendbooleaninputAppend the key to the existing key database.
expectSecureBootExpectOptionsparametersExpectations for the command execution.
SecureBoot Expect Options
AttributeTypeDefaultParentDescription
should_failbooleanexpectIf set to true, the test step will fail if the command does not fail.
secure_bootbooleanexpectIf set to true, the test step will fail if Secure Boot is not enabled.
setup_modebooleanexpectIf set to true, the test step will fail if Secure Boot is not in setup mode.

Sleep

AttributeTypeDefaultParentDescription
cmdconstsleep
namestringName to uniquely identify the teststep. This name will show up in reports, logs and the WebUI
parametersSleepOptionsOptions passed into the sleep cmd
inputSleepInputOptionsparameterssleep input options

Sleep Options

Sleep Input Options
AttributeTypeDefaultParentDescription
durationstringinputDuration to sleep. Format: 1h2m3s. Units: h, m, s.

SSHCmd

sshcmd is the generic command to execute commands.

AttributeTypeDefaultParentDescription
cmdconstsshcmd
namestringName to uniquely identify the teststep. This name will show up in reports, logs and the WebUI
parametersSSHCmdOptionsOptions passed into the sshcmd cmd
inputSSHCmdInputOptionsparameterssshcmd input options
expectSSHCmdExpectOptionsparameterssshcmd expect options

SSHCmd Options

SSHCmd Input Options
AttributeTypeDefaultParentDescription
executablestringinputExecutable that should be executed. Full Path, or need to be part of $PATH
args[]stringinputArray of arguments passed into the executable
working_dirstringinputPWD the executable will be executed.
report_onlybooleaninputsshcmd is allowed to fail, it only reports the output.
SSHCmd Expect Options
AttributeTypeDefaultParentDescription
regexstringexpectRegex that matches on the expected output value.

SSHCmd Example

SysBench

AttributeTypeDefaultParentDescription
cmdconstsysbench
namestringName to uniquely identify the teststep. This name will show up in reports, logs and the WebUI
parametersSysBenchOptionsOptions passed into the sysbench cmd
inputSysBenchInputOptionsparameterssysbench input options

SysBench Options

SysBench Input Options
AttributeTypeDefaultParentDescription
args[]stringinputArguments to pass to sysbench.
expect[]ExpectOptionsinputExpectations to check against the output of sysbench.