1.1.3.1.1.1.2. test_automation.targets.fvp.fvp_controller

1.1.3.1.1.1.2.1. Attributes

logger

1.1.3.1.1.1.2.2. Exceptions

FVPError

Base exception for FVP related errors.

FVPStartError

Raised when the FVP fails to start.

FVPTimeout

Raised when the FVP does not become ready within

FVPStopped

Raised when the FVP process is unexpectedly stopped.

1.1.3.1.1.1.2.3. Classes

LocalFVP

Local FVP controller to start/stop/reset an FVP process using parameters

1.1.3.1.1.1.2.4. Module Contents

test_automation.targets.fvp.fvp_controller.logger[source]
exception test_automation.targets.fvp.fvp_controller.FVPError[source]

Bases: RuntimeError

Base exception for FVP related errors.

exception test_automation.targets.fvp.fvp_controller.FVPStartError[source]

Bases: FVPError

Raised when the FVP fails to start.

exception test_automation.targets.fvp.fvp_controller.FVPTimeout[source]

Bases: FVPError

Raised when the FVP does not become ready within the expected timeout.

exception test_automation.targets.fvp.fvp_controller.FVPStopped[source]

Bases: FVPError

Raised when the FVP process is unexpectedly stopped.

class test_automation.targets.fvp.fvp_controller.LocalFVP(platform_config, *args, **options)[source]

Bases: test_automation.utils.device.Device

Local FVP controller to start/stop/reset an FVP process using parameters from YAML.

Parameters:

platform_config (dict)

_init_required_fields(platform_config)[source]

Populate fields derived directly from the platform configuration.

Parameters:

platform_config (dict) – Parsed platform configuration mapping.

Returns:

None

Return type:

None

_init_optional_and_telnet(platform_config, args, options)[source]

Resolve optional log settings and initialize the Telnet manager.

Parameters:
  • platform_config (dict) – Parsed platform configuration mapping.

  • args (tuple) – Legacy positional args. If present, the first element may be a TelnetSessionManager instance.

  • options (dict) – Keyword options that may include: * log_dir (str, optional) – Override log directory path. * log_prefix (str, optional) – Override log filename prefix. * telnet_log_dir (str, optional) – Directory for Telnet logs. * telnet_manager (TelnetSessionManager, optional) – Telnet session manager instance. Defaults to a new instance.

Returns:

None

Return type:

None

_init_runtime_state()[source]

Initialize mutable runtime state and atexit hook.

Return type:

None

init()[source]

Initialize any pre-provisioning steps, currently no-op.

Return type:

None

start()[source]

Start the FVP process with the configured parameters.

Raises:

FVPStartError – If the FVP process fails to start.

Return type:

None

_cleanup_threads_and_state()[source]

Join read thread, clear flags/state.

Return type:

None

_signal(sig)[source]

Send a signal to the FVP process or its process group.

Parameters:

sig (int) – Signal number (e.g. signal.SIGTERM).

Returns:

None

Return type:

None

_terminate_proc()[source]

Terminate the FVP process normally, then forcefully if needed.

Return type:

None

stop()[source]

Stop the FVP process and clean up telnet sessions. Ensures the reader thread exits, the process is terminated, and all telnet sessions are closed.

Return type:

None

reset()[source]

Restart the FVP process so the device returns to a known-good state. If it’s running, stop then start; otherwise just start.

Return type:

None

wait_ready(timeout_s=None)[source]

Block until the FVP is ready or the timeout expires.

Parameters:

timeout_s (Optional[int]) – Timeout in seconds. Defaults to configured ready_timeout_s.

Raises:

FVPTimeout – If the FVP is not ready within the timeout.

Return type:

None

is_running()[source]

Return True if the FVP process is currently running.

Return type:

bool

get_ports()[source]

Return mapping of terminal names to telnet ports.

Return type:

Dict[str, int]

log_path()[source]

Get the path to the current boot log file.

Raises:

FVPError – If start() has not been called yet.

Return type:

pathlib.Path

_build_cmd()[source]

Construct the final command string for launching the FVP.

Return type:

str

_make_log_path()[source]
Return type:

pathlib.Path

_process_stdout_line(line, pattern, first_port_seen)[source]

Process one line of FVP stdout, update ports, and set readiness state.

Parameters:
  • line (str) – A single line from the FVP process stdout.

  • pattern (re.Pattern[str]) – Compiled regex to match terminal/port info.

  • first_port_seen (bool) – Whether a port was already discovered before.

Returns:

True if this line contained the first discovered port, otherwise the prior first_port_seen value.

Return type:

bool

_read_loop()[source]

Read process output, write to boot log, and capture telnet port mappings. Sets ready after the first port is discovered.

Return type:

None

_atexit()[source]

Ensure the FVP process and sessions are stopped on exit.

Return type:

None