agentExec - Execute command on Agent

Added in version pltOS: v2.0.42

Execute a command on an SBC or PC running a PLT Agent and await its completion. The agent handle must already be configured with agentCfg - Configure Agent; agentExec fails if the handle is unknown.

Execution differs by connection type:

  • Ethernet/USB-NET agents (link-local) send the command line to the agent and await a completed response; a non-zero/FAIL result fails the step and returns the agent’s log output.

  • USB-CDC agents send the command line over the UART console, appending a shell snippet that echoes a unique tag and the command’s exit status. The step fails if that tag is not seen before the timeout, or if the command’s exit status is non-zero.

Usage:

- command: agentExec <handle> <commandLine>
  [retry: <retryCount>]
  [timeout: <timeout>]

Argument

Description

handle

Indicates the agent to use, as configured with agentCfg - Configure Agent.

commandLine

Command line to execute through the agent.

retryCount

Optional: Number of times to retry the test step

timeout

Optional: Timeout waiting for the command to complete, with suffix or in milliseconds (default: 1000ms). Applies to USB-CDC (UART) agents.

Examples