cli

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2025 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package cli provides an API to send CLI commands to a DUT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI struct {
	// contains filtered or unexported fields
}

CLI is the device CLI API.

func New

func New(dut binding.DUT) *CLI

New constructs a new instance of the CLI API. Tests must not call this directly

func (*CLI) Run

func (c *CLI) Run(t testing.TB, cmd string) string

Run runs the specified CLI command on the DUT and returns its output. Run fails fatally if either (a) the command runs and reports an error, or (b) an error occurs that prevents the command from being run at all. To capture the error from case (a) instead, use CLI.RunResult.

func (*CLI) RunResult

func (c *CLI) RunResult(t testing.TB, cmd string) binding.CommandResult

RunResult runs the specified CLI command on the DUT and returns its result. RunResult fails fatally if an error occurs that prevents the command from being run. If the command runs and reports an error, that error is available in the result. To fail fatally in the latter case instead, use CLI.Run.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL