tests.conftest ============== .. py:module:: tests.conftest Attributes ---------- .. autoapisummary:: tests.conftest.logger Functions --------- .. autoapisummary:: tests.conftest._compute_run_paths tests.conftest._load_target_plugin tests.conftest._apply_debug_logging tests.conftest._prepare_bundle_paths tests.conftest._power_on tests.conftest._cleanup_manager tests.conftest._power_off tests.conftest.pytest_configure tests.conftest.cfg tests.conftest._available_platform_names tests.conftest._apply_cfg2_overrides tests.conftest.auto_platform_config_data tests.conftest.platform_bundle tests.conftest.platform_driver tests.conftest.session_manager tests.conftest.platform_name tests.conftest.platform_base_obj tests.conftest.fpga_device tests.conftest.pytest_addoption tests.conftest._get_cfg2_si_cluster1_prompt Module Contents --------------- .. py:data:: logger .. py:function:: _compute_run_paths(config) Create a unique run directory and return run metadata dict. :param pytestconfig: Pytest configuration object. :returns: Dictionary. .. py:function:: _load_target_plugin(config) Dynamically import target plugin (e.g., for FVP) if selected. :param pytestconfig: Pytest configuration object. :returns: None. .. py:function:: _apply_debug_logging(config) Enable CLI logging if --debug-logs was passed. :param pytestconfig: Pytest configuration object. :returns: None. .. py:function:: _prepare_bundle_paths(pytestconfig, bundle) 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. .. py:function:: _power_on(bundle, ptype, plat) Bring the platform up and wait until ready. .. py:function:: _cleanup_manager(mgr) Best-effort session cleanup on the manager. .. py:function:: _power_off(bundle) Attempt graceful power-off and session cleanup. .. py:function:: pytest_configure(config) Configure pytest logging and conditionally load target plugins. :param config: Pytest configuration object. :returns: None. .. py:function:: cfg(pytestconfig) Load the YAML configuration once per test session. :param pytestconfig: Pytest configuration object. :returns: Parsed :class:`Config` instance. .. py:function:: _available_platform_names(cfg) Return a list of platform 'name' values from cfg.platforms, or an empty list if cfg.platforms is not present. :param cfg: Parsed configuration object. :returns: List of platform names defined in the configuration. .. py:function:: _apply_cfg2_overrides(platform_config) Temporarily inject cfg2 specific configs before boot. .. py:function:: auto_platform_config_data(pytestconfig, cfg) Resolve and return the selected platform dictionary from the YAML config. :param pytestconfig: Pytest configuration object. :param cfg: Parsed configuration object. :returns: Platform configuration dictionary. .. py:function:: platform_bundle(pytestconfig, cfg, auto_platform_config_data) Build the platform bundle once from the config. :param pytestconfig: Pytest configuration object. :param cfg: Parsed configuration object. :param auto_platform_config_data: Platform configuration dictionary. :returns: Yields an initialized :class:`DriverBundle`. .. py:function:: platform_driver(platform_bundle) Provide the platform driver object for tests. :param platform_bundle: Initialized driver bundle. :returns: Driver instance from the bundle. .. py:function:: session_manager(platform_bundle) Provide the session/console manager for tests. :param platform_bundle: Initialized driver bundle. :returns: Session manager object. .. py:function:: platform_name(platform_base_obj, cfg) Normalize the selected platform name to a canonical short name. :param platform_base_obj: Initialized :class:`AutoTestPlatformBase`. :param cfg: Parsed configuration object. :returns: Canonical name like ``'aspne'``. .. py:function:: platform_base_obj(session_manager, auto_platform_config_data, pytestconfig) Construct the base platform helper object once per session. :param session_manager: Session/console manager instance. :param auto_platform_config_data: Platform configuration dictionary. :param pytestconfig: Pytest configuration object. :returns: Initialized :class:`AutoTestPlatformBase` instance. .. py:function:: fpga_device(request) Session-scoped FPGA device fixture. - Initializes and starts the FPGA platform - Waits for ready state - Starts UART keepalive - Ensures graceful shutdown and log collection .. py:function:: pytest_addoption(parser) Register custom CLI options used by the test framework. :param parser: Pytest argument parser. :returns: None. .. py:function:: _get_cfg2_si_cluster1_prompt() Return the expected prompt for si_cluster1 based on build type.