autocaps

package
v0.0.0-...-d046166 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

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 https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/master/chromeos-base/autotest-capability-default/ for more information about autotest-capability.

Index

Constants

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

Variables

This section is empty.

Functions

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 https://chromium.googlesource.com/chromiumos/platform/tast/+/HEAD/docs/test_dependencies.md.

Types

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.
	No
	// Disable is functionally equivalent to No. It is set to temporarily disable the capability.
	Disable
)

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