1.1.2.1.1. test_automation.configs.config

Central loader for config, with optional BUILD_IMAGE_DIR and FVP_BINARY substitution. Supports both list- and mapping-style ‘platforms’ sections in YAML.

1.1.2.1.1.1. Classes

Config

Central config loader to load YAML, set environment variable and expose

1.1.2.1.1.2. Functions

_expand(obj)

Expand ${ENV} in all strings.

_set_env_vars(build_dir, fvp_binary)

Set process environment variables for FVP configuration.

_load_yaml_expanded(path)

Load YAML configuration from a file and expand environment variables.

_normalize_platforms(data)

Normalize the platforms section of the YAML configuration.

1.1.2.1.1.3. Module Contents

test_automation.configs.config._expand(obj)[source]

Expand ${ENV} in all strings.

Parameters:

obj (Any) – Python objects like strings, lists, and dictionaries are transformed.

Returns:

The environment variables and user-home markers expanded wherever applicable.

Return type:

Any

test_automation.configs.config._set_env_vars(build_dir, fvp_binary)[source]

Set process environment variables for FVP configuration.

Parameters:
  • build_dir (Optional[str]) – Path to set as BUILD_DIR. If None, the variable is not set.

  • fvp_binary (Optional[str]) – Path to set as FVP_BINARY. If None, the variable is not set.

Returns:

None

Return type:

None

test_automation.configs.config._load_yaml_expanded(path)[source]

Load YAML configuration from a file and expand environment variables.

Parameters:

path (str) – Path to a YAML configuration file.

Returns:

Parsed and expanded YAML content as a dictionary.

Raises:
  • FileNotFoundError – If the YAML file cannot be found.

  • yaml.YAMLError – If the YAML content cannot be parsed.

Return type:

Dict[str, Any]

test_automation.configs.config._normalize_platforms(data)[source]

Normalize the platforms section of the YAML configuration.

Ensures platforms are returned as a dictionary keyed by platform name, regardless of whether the YAML used mapping or list style.

Parameters:

data (Dict[str, Any]) – Parsed and expanded YAML configuration.

Returns:

Mapping of platform name to platform configuration dictionary.

Return type:

Dict[str, Dict[str, Any]]

class test_automation.configs.config.Config(path, build_dir=None, fvp_binary=None)[source]

Central config loader to load YAML, set environment variable and expose platforms as a dict keyed by name.

Parameters:
  • path (str)

  • build_dir (Optional[str])

  • fvp_binary (Optional[str])

platforms: Dict[str, Dict[str, Any]][source]
_raw[source]
path[source]
build_dir = None[source]
fvp_binary = None[source]
get_platform(name)[source]

Return the configuration dictionary for a specific platform.

Parameters:

name (str) – Platform name key as defined in the YAML platforms.

Returns:

The platform configuration mapping for name.

Raises:

KeyError – If name is not present in platforms.

Return type:

Dict[str, Any]

to_dict()[source]

Return the full expanded YAML content as a dictionary.

Returns:

A shallow copy of the expanded YAML content.

Return type:

Dict[str, Any]