2.1.1. tests.conftest
2.1.1.1. Attributes
2.1.1.2. Functions
|
Create a unique run directory and return run metadata dict. |
|
Dynamically import target plugin (e.g., for FVP) if selected. |
|
Enable CLI logging if --debug-logs was passed. |
|
Ensure bundle paths (manager + driver) are set up; return run paths dict. |
|
Bring the platform up and wait until ready. |
|
Best-effort session cleanup on the manager. |
|
Attempt graceful power-off and session cleanup. |
|
Configure pytest logging and conditionally load target plugins. |
|
Load the YAML configuration once per test session. |
Return a list of platform 'name' values from cfg.platforms, or an empty |
|
|
Temporarily inject cfg2 specific configs before boot. |
|
Resolve and return the selected platform dictionary from the YAML config. |
|
Build the platform bundle once from the config. |
|
Provide the platform driver object for tests. |
|
Provide the session/console manager for tests. |
|
Normalize the selected platform name to a canonical short name. |
|
Construct the base platform helper object once per session. |
|
Session-scoped FPGA device fixture. |
|
Register custom CLI options used by the test framework. |
Return the expected prompt for si_cluster1 based on build type. |
2.1.1.3. Module Contents
- tests.conftest._compute_run_paths(config)[source]
Create a unique run directory and return run metadata dict.
- Parameters:
pytestconfig – Pytest configuration object.
config (pytest.Config)
- Returns:
Dictionary.
- Return type:
dict
- tests.conftest._load_target_plugin(config)[source]
Dynamically import target plugin (e.g., for FVP) if selected.
- Parameters:
pytestconfig – Pytest configuration object.
config (pytest.Config)
- Returns:
None.
- Return type:
None
- tests.conftest._apply_debug_logging(config)[source]
Enable CLI logging if –debug-logs was passed.
- Parameters:
pytestconfig – Pytest configuration object.
config (pytest.Config)
- Returns:
None.
- Return type:
None
- tests.conftest._prepare_bundle_paths(pytestconfig, bundle)[source]
Ensure bundle paths (manager + driver) are set up; return run paths dict.
If pytest_configure already created run paths, reuse them; otherwise, compute a fallback here.
- Parameters:
pytestconfig (pytest.Config)
- Return type:
dict
- tests.conftest._power_on(bundle, ptype, plat)[source]
Bring the platform up and wait until ready.
- Parameters:
ptype (str)
plat (dict)
- Return type:
None
- tests.conftest._cleanup_manager(mgr)[source]
Best-effort session cleanup on the manager.
- Return type:
None
- tests.conftest._power_off(bundle)[source]
Attempt graceful power-off and session cleanup.
- Parameters:
- Return type:
None
- tests.conftest.pytest_configure(config)[source]
Configure pytest logging and conditionally load target plugins.
- Parameters:
config (pytest.Config) – Pytest configuration object.
- Returns:
None.
- Return type:
None
- tests.conftest.cfg(pytestconfig)[source]
Load the YAML configuration once per test session.
- Parameters:
pytestconfig (pytest.Config) – Pytest configuration object.
- Returns:
Parsed
Configinstance.- Return type:
- tests.conftest._available_platform_names(cfg)[source]
Return a list of platform ‘name’ values from cfg.platforms, or an empty list if cfg.platforms is not present.
- Parameters:
cfg (test_automation.configs.config.Config) – Parsed configuration object.
- Returns:
List of platform names defined in the configuration.
- Return type:
list
- tests.conftest._apply_cfg2_overrides(platform_config)[source]
Temporarily inject cfg2 specific configs before boot.
- Parameters:
platform_config (dict)
- Return type:
None
- tests.conftest.auto_platform_config_data(pytestconfig, cfg)[source]
Resolve and return the selected platform dictionary from the YAML config.
- Parameters:
pytestconfig (pytest.Config) – Pytest configuration object.
cfg (test_automation.configs.config.Config) – Parsed configuration object.
- Returns:
Platform configuration dictionary.
- Return type:
dict
- tests.conftest.platform_bundle(pytestconfig, cfg, auto_platform_config_data)[source]
Build the platform bundle once from the config.
- Parameters:
pytestconfig – Pytest configuration object.
cfg (test_automation.configs.config.Config) – Parsed configuration object.
auto_platform_config_data – Platform configuration dictionary.
- Returns:
Yields an initialized
DriverBundle.
- tests.conftest.platform_driver(platform_bundle)[source]
Provide the platform driver object for tests.
- Parameters:
platform_bundle – Initialized driver bundle.
- Returns:
Driver instance from the bundle.
- tests.conftest.session_manager(platform_bundle)[source]
Provide the session/console manager for tests.
- Parameters:
platform_bundle – Initialized driver bundle.
- Returns:
Session manager object.
- tests.conftest.platform_name(platform_base_obj, cfg)[source]
Normalize the selected platform name to a canonical short name.
- Parameters:
platform_base_obj – Initialized
AutoTestPlatformBase.cfg (test_automation.configs.config.Config) – Parsed configuration object.
- Returns:
Canonical name like
'aspne'.- Return type:
str
- tests.conftest.platform_base_obj(session_manager, auto_platform_config_data, pytestconfig)[source]
Construct the base platform helper object once per session.
- Parameters:
session_manager – Session/console manager instance.
auto_platform_config_data – Platform configuration dictionary.
pytestconfig – Pytest configuration object.
- Returns:
Initialized
AutoTestPlatformBaseinstance.- Return type:
test_automation.utils.auto_platform_base.AutoTestPlatformBase
- tests.conftest.fpga_device(request)[source]
Session-scoped FPGA device fixture.
Initializes and starts the FPGA platform
Waits for ready state
Starts UART keepalive
Ensures graceful shutdown and log collection