v0.0.0-...-15a9a0c Latest Latest

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

Go to latest
Published: May 19, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0



Package autocaps determines the DUT's capabilities by parsing autotest-capability YAML files.

autotest-capability is a pre-Tast system developed to permit Autotest-based video tests to examine the DUT's capabilities to e.g. determine which codecs are supported.

Capabilities are mostly statically assigned in the system image via layered YAML files in /usr/local/etc/autotest-capability, but in order to support the same system image being shared across different SKUs, "detectors" can also be used to determine capabilities at runtime based on the CPU model and the presence of a Kepler PCI device.

See for more information about autotest-capability.



View Source
const (
	// DefaultCapabilityDir is the directory where yaml files are installed by autotest-capability.
	DefaultCapabilityDir = "/usr/local/etc/autotest-capability"

	// ManagedFile is a path to the file listing all know capabilities.
	ManagedFile = "managed-capabilities.yaml"


This section is empty.


func Read

func Read(dir string, info *SysInfo) (map[string]State, error)

Read reads YAML files specifying capabilities from the directory at dir. info is used to determine which capabilities are set; if nil, system info will be loaded by this function. A map containing all managed capabilities with their corresponding states is returned.

Tests should not call this function or check capabilities directly. Instead, they should declare dependencies on required capabilities as described at


type State

type State int

State describes the state of a capability.

const (
	// Yes indicates that the capability is satisfied.
	Yes State = iota
	// No indicates that the capability is unsatisfied.
	// Disable is functionally equivalent to No. It is set to temporarily disable the capability.

func (State) String

func (s State) String() string

type SysInfo

type SysInfo struct {
	// CPUModel contains the value from the "Model name:" line printed by lscpu.
	CPUModel string
	// HasKepler is true if "lspci -n -d <keplerID>" prints non-empty output.
	HasKepler bool
	// HasUsbCamera is true iff there's built-in USB camera.
	HasUsbCamera bool
	// HasMipiCamera is true iff there's built-in MIPI camera.
	HasMipiCamera bool

SysInfo contains information about the system.

Jump to

Keyboard shortcuts

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