diff --git a/TESTING_FRAMEWORK_GUIDE.md b/TESTING_FRAMEWORK_GUIDE.md
index 1474937..560f702 100644
--- a/TESTING_FRAMEWORK_GUIDE.md
+++ b/TESTING_FRAMEWORK_GUIDE.md
@@ -1,14 +1,17 @@
# ECU Testing Framework - Complete Guide
+> **Heads-up:** the BabyLIN LIN adapter is **deprecated** and retained for backward compatibility only. New tests and deployments should target the MUM (Melexis Universal Master) adapter — see `docs/16_mum_internals.md`. The BabyLIN-related sections below are kept so existing rigs can still be maintained.
+
## Overview
-This comprehensive ECU Testing Framework provides a robust solution for testing Electronic Control Units (ECUs) using pytest with BabyLIN LIN bus communication. The framework includes detailed test documentation, enhanced reporting, mock interfaces for development, and real hardware integration capabilities.
+This comprehensive ECU Testing Framework provides a robust solution for testing Electronic Control Units (ECUs) using pytest with the MUM LIN adapter (current) or the deprecated BabyLIN adapter. The framework includes detailed test documentation, enhanced reporting, mock interfaces for development, and real hardware integration capabilities.
## Framework Features
### ✅ **Complete Implementation Status**
- **✅ pytest-based testing framework** with custom plugins
-- **✅ BabyLIN LIN communication integration** via the official SDK Python wrapper (`BabyLIN_library.py`)
+- **✅ MUM (Melexis Universal Master) LIN integration** via the `pylin` / `pymumclient` packages — current default
+- **⚠️ BabyLIN LIN integration (DEPRECATED)** via the official SDK Python wrapper (`BabyLIN_library.py`)
- **✅ Mock interface for hardware-independent development**
- **✅ Enhanced HTML/XML reporting with test metadata**
- **✅ Detailed test documentation extraction**
@@ -76,20 +79,20 @@ ecu_tests/
│ ├── lin/ # LIN communication interfaces
│ │ ├── base.py # Abstract LinInterface definition
│ │ ├── mock.py # Mock interface for development
-│ │ └── babylin.py # Real BabyLin hardware interface
+│ │ └── babylin.py # DEPRECATED BabyLin hardware interface (kept for legacy rigs)
│ └── flashing/ # Hex file flashing capabilities
│ └── hex_flasher.py # ECU flash programming
├── tests/ # Test suite
│ ├── conftest.py # pytest fixtures and configuration
│ ├── test_smoke_mock.py # Mock interface validation tests
-│ ├── test_babylin_hardware_smoke.py # Hardware smoke tests
+│ ├── test_babylin_hardware_smoke.py # Hardware smoke tests (deprecated BabyLIN)
│ └── test_hardware_placeholder.py # Future hardware tests
├── config/ # Configuration files
│ ├── test_config.yaml # Main test configuration
-│ └── babylin.example.yaml # BabyLin configuration template
-├── vendor/ # BabyLIN SDK placement
-| ├── BabyLIN_library.py # Official SDK Python wrapper
-| └── platform libs # OS-specific native libs (DLL/.so/.dylib)
+│ └── babylin.example.yaml # DEPRECATED BabyLin configuration template
+├── vendor/ # SDK placement (BabyLIN paths are deprecated)
+| ├── BabyLIN_library.py # Official SDK Python wrapper (deprecated)
+| └── platform libs # OS-specific native libs (DLL/.so/.dylib) — deprecated
├── reports/ # Generated test reports
│ ├── report.html # Enhanced HTML report
│ └── junit.xml # JUnit XML report
@@ -114,7 +117,8 @@ python -m pytest tests\test_smoke_mock.py -v
python -m pytest -m "smoke" -v
python -m pytest -m "req_001" -v
-# Run hardware tests (requires BabyLIN hardware); join with adapter marker
+# Run hardware tests (requires deprecated BabyLIN hardware); join with adapter marker
+# Prefer MUM for new work: pytest -m "hardware and mum" -v
python -m pytest -m "hardware and babylin" -v
```
@@ -166,7 +170,7 @@ Tests automatically generate enhanced reports:
```yaml
interface:
- type: mock # or babylin for hardware
+ type: mock # or "mum" for hardware (current); "babylin" is deprecated
timeout: 1.0
flash:
@@ -178,11 +182,13 @@ ecu:
lin_id_range: [0x01, 0x3F]
```
-### BabyLIN Configuration (`config/babylin.example.yaml`)
+### BabyLIN Configuration (`config/babylin.example.yaml`) — DEPRECATED
+
+> Retained for backward compatibility. Prefer `config/mum.example.yaml` for new work.
```yaml
interface:
- type: babylin
+ type: babylin # deprecated; prefer "mum"
channel: 0 # channel index used by the SDK wrapper
bitrate: 19200 # typically set by SDF
sdf_path: ./vendor/Example.sdf
@@ -202,9 +208,9 @@ interface:
**Status**: **7 tests passing** - Complete implementation
-### 2. Hardware Smoke Tests (`test_babylin_hardware_smoke.py`)
+### 2. Hardware Smoke Tests (`test_babylin_hardware_smoke.py`) — DEPRECATED
-**Purpose**: Basic BabyLIN hardware connectivity validation
+**Purpose**: Basic BabyLIN hardware connectivity validation (deprecated path; prefer the MUM smoke tests under `tests/hardware/`)
- ✅ SDK wrapper import and device open
- ✅ Interface connection establishment
- ✅ Basic send/receive operations
@@ -231,8 +237,9 @@ The framework includes custom markers for test categorization and requirement tr
markers =
smoke: Basic functionality tests
integration: Integration tests requiring hardware
- hardware: Tests requiring physical BabyLin hardware
- babylin: Tests targeting the BabyLIN SDK adapter
+ hardware: Tests requiring physical hardware (MUM or, deprecated, BabyLin)
+ babylin: DEPRECATED. Tests targeting the legacy BabyLIN SDK adapter
+ mum: Tests targeting the current MUM (Melexis Universal Master) adapter
unit: Fast unit tests (no hardware)
boundary: Boundary condition and edge case tests
req_001: Tests validating requirement REQ-001 (LIN Interface Basic Operations)
@@ -241,11 +248,13 @@ markers =
req_004: Tests validating requirement REQ-004 (Timeout Handling)
```
-## BabyLIN Integration Details
+## BabyLIN Integration Details (DEPRECATED)
+
+> Kept for backward compatibility only. New tests should use the MUM adapter (`docs/16_mum_internals.md`).
### SDK Python wrapper
-The framework uses the official SDK Python wrapper `BabyLIN_library.py` (placed under `vendor/`) and calls its BLC_* APIs.
+The deprecated BabyLIN adapter uses the official SDK Python wrapper `BabyLIN_library.py` (placed under `vendor/`) and calls its BLC_* APIs.
Key calls in the adapter (`ecu_framework/lin/babylin.py`):
- `BLC_getBabyLinPorts`, `BLC_openPort` — discovery and open
@@ -264,7 +273,8 @@ python -m pytest tests\test_smoke_mock.py -v
### 2. Hardware Integration Phase
```powershell
-# Test with real BabyLIN hardware
+# Test with deprecated BabyLIN hardware (legacy rigs only)
+# Prefer MUM: python -m pytest -m "hardware and mum" -v
python -m pytest -m "hardware and babylin" -v
```
@@ -303,7 +313,7 @@ The enhanced HTML report includes:
**Configuration System**: ✅ **Complete**
- YAML configuration loading: ✅ Working
- Environment variable override: ✅ Working
-- BabyLIN SDF/schedule configuration: ✅ Working
+- BabyLIN SDF/schedule configuration: ✅ Working (deprecated path)
- Power supply (PSU) configuration: ✅ Working (see `config/test_config.yaml` → `power_supply`)
## Owon Power Supply (PSU) Integration
@@ -342,7 +352,7 @@ power_supply:
## Next Steps
-1. **Hardware Testing**: Connect BabyLin hardware and validate hardware smoke tests
+1. **Hardware Testing**: Connect MUM hardware (or, for legacy rigs, BabyLin) and validate the corresponding hardware smoke tests
2. **ECU Integration**: Define ECU-specific communication protocols and diagnostic commands
3. **Hex Flashing**: Implement complete hex file flashing workflow
4. **CI/CD Integration**: Set up automated testing pipeline with generated reports
@@ -356,4 +366,4 @@ pytest-xdist>=3.8.0
pyyaml>=6.0.2
```
-This framework provides a complete, production-ready testing solution for ECU development with BabyLIN communication, featuring enhanced documentation, traceability, and reporting capabilities.
\ No newline at end of file
+This framework provides a complete, production-ready testing solution for ECU development. The current LIN path uses the MUM adapter; the BabyLIN adapter is retained as a deprecated fallback for legacy rigs. Enhanced documentation, traceability, and reporting are available regardless of the adapter in use.
\ No newline at end of file
diff --git a/config/babylin.example.yaml b/config/babylin.example.yaml
index 8e112ff..fff53f3 100644
--- a/config/babylin.example.yaml
+++ b/config/babylin.example.yaml
@@ -1,4 +1,6 @@
-# Example configuration for BabyLIN hardware runs (SDK Python wrapper)
+# DEPRECATED: example configuration for BabyLIN hardware runs (SDK Python wrapper).
+# The BabyLIN adapter is kept for backward compatibility only. New environments
+# should target MUM — see config/mum.example.yaml.
interface:
type: babylin
channel: 0 # Channel index (0-based) as used by the SDK
diff --git a/config/examples.yaml b/config/examples.yaml
index eff08a4..a13a025 100644
--- a/config/examples.yaml
+++ b/config/examples.yaml
@@ -1,4 +1,5 @@
-# Examples: Mock-only and BabyLIN hardware configurations
+# Examples: Mock-only and (DEPRECATED) BabyLIN hardware configurations.
+# For current MUM-based hardware setups, see config/mum.example.yaml.
#
# How to use (Windows PowerShell):
# # Point the framework to a specific config file
@@ -21,11 +22,13 @@ mock_profile:
enabled: false
hex_path:
-# --- BABYLIN PROFILE --------------------------------------------------------
+# --- BABYLIN PROFILE (DEPRECATED) -------------------------------------------
+# Retained for backward compatibility with existing BabyLIN rigs only. New
+# setups should use config/mum.example.yaml.
# Requires: vendor/BabyLIN_library.py and platform libraries placed per vendor/README.md
babylin_profile:
interface:
- type: babylin
+ type: babylin # deprecated
channel: 0 # SDK channel index (0-based)
bitrate: 19200 # Informational; SDF usually defines effective timing
node_name: ECU_TEST_NODE # Optional label
diff --git a/config/test_config.yaml b/config/test_config.yaml
index 68d0687..06e6871 100644
--- a/config/test_config.yaml
+++ b/config/test_config.yaml
@@ -1,6 +1,7 @@
interface:
# MUM (Melexis Universal Master) is the current default. Switch type to
- # 'babylin' for the legacy SDK flow, or 'mock' for hardware-free runs.
+ # 'mock' for hardware-free runs, or to 'babylin' for the DEPRECATED legacy
+ # SDK flow (kept only so existing BabyLIN rigs can keep running).
type: mum
host: 192.168.7.2 # MUM IP (USB-RNDIS default)
lin_device: lin0 # MUM LIN device name
@@ -14,7 +15,7 @@ interface:
ldf_path: ./vendor/4SEVEN_color_lib_test.ldf
frame_lengths: {} # leave empty unless you need a non-LDF override
- # --- BabyLIN (legacy) settings, used only when type: babylin ---
+ # --- BabyLIN (DEPRECATED) settings, used only when type: babylin ---
channel: 0
node_name: ECU_TEST_NODE
sdf_path: .\vendor\4SEVEN_color_lib_test.sdf
diff --git a/docs/01_run_sequence.md b/docs/01_run_sequence.md
index 4cc8c96..d6247e6 100644
--- a/docs/01_run_sequence.md
+++ b/docs/01_run_sequence.md
@@ -9,7 +9,7 @@ This document walks through the exact order of operations when you run the frame
3. Test discovery collects tests under `tests/`
4. Session fixtures run:
- `config()` loads YAML configuration
- - `lin()` selects and connects the LIN interface (Mock, MUM, or legacy BabyLIN)
+ - `lin()` selects and connects the LIN interface (Mock, MUM, or the deprecated BabyLIN)
- `flash_ecu()` optionally flashes the ECU (if enabled)
5. Tests execute using fixtures and call interface methods
6. Our plugin extracts test metadata (Title, Requirements, Steps) from docstrings
@@ -78,7 +78,7 @@ Session fixture: lin(config)
→ chooses interface by config.interface.type
- mock → ecu_framework.lin.mock.MockBabyLinInterface(...)
- mum → ecu_framework.lin.mum.MumLinInterface(host, lin_device, power_device, ...)
- - babylin → ecu_framework.lin.babylin.BabyLinInterface(...) [legacy]
+ - babylin → ecu_framework.lin.babylin.BabyLinInterface(...) [DEPRECATED]
→ lin.connect()
- MUM connect() also powers up the ECU via power_out0 and waits boot_settle_seconds
↓
@@ -104,7 +104,7 @@ Reports written
- pytest configuration: `pytest.ini`
- YAML config (default): `config/test_config.yaml`
- YAML override via env var: `ECU_TESTS_CONFIG`
-- BabyLIN SDK wrapper and SDF path: `interface.sdf_path` and `interface.schedule_nr` in YAML
+- BabyLIN SDK wrapper and SDF path (DEPRECATED): `interface.sdf_path` and `interface.schedule_nr` in YAML
- Test metadata: parsed from each test’s docstring
- Markers: declared in `pytest.ini`, attached in tests via `@pytest.mark.*`
@@ -115,13 +115,13 @@ Reports written
- `ecu_framework/lin/base.py`: abstract LIN interface contract and frame shape
- `ecu_framework/lin/mock.py`: mock behavior for send/receive/request
- `ecu_framework/lin/mum.py`: MUM adapter (Melexis Universal Master via pylin + pymumclient)
-- `ecu_framework/lin/babylin.py`: BabyLIN SDK wrapper adapter (legacy real hardware via BabyLIN_library.py)
+- `ecu_framework/lin/babylin.py`: BabyLIN SDK wrapper adapter (DEPRECATED real hardware path via BabyLIN_library.py; emits `DeprecationWarning` on use)
- `ecu_framework/flashing/hex_flasher.py`: placeholder flashing logic
- `conftest_plugin.py`: report customization and metadata extraction
## Edge cases and behavior
-- If `interface.type` is `babylin` but the SDK wrapper or libraries cannot be loaded, hardware tests are skipped
+- If `interface.type` is `babylin` (deprecated) but the SDK wrapper or libraries cannot be loaded, hardware tests are skipped
- If `interface.type` is `mum` but `pylin` / `pymumclient` aren't importable, or `interface.host` is unset, hardware tests are skipped with a clear message
- If `flash.enabled` is true but `hex_path` is missing, flashing fixture skips
- Timeouts are honored in `receive()` and `request()` implementations
diff --git a/docs/02_configuration_resolution.md b/docs/02_configuration_resolution.md
index 0f7b7eb..40c0ca5 100644
--- a/docs/02_configuration_resolution.md
+++ b/docs/02_configuration_resolution.md
@@ -15,13 +15,13 @@ From highest to lowest precedence:
- `EcuTestConfig`
- `interface: InterfaceConfig`
- - `type`: `mock`, `mum`, or `babylin`
- - `channel`: LIN channel index (0-based in SDK wrapper) — BabyLIN-specific
- - `bitrate`: LIN baudrate (e.g., 19200). The MUM uses this directly; BabyLIN typically takes it from the SDF
- - `sdf_path`: Path to SDF file (BabyLIN; required for typical operation)
- - `schedule_nr`: Schedule number to start on connect (BabyLIN). `-1` = skip
+ - `type`: `mock`, `mum`, or `babylin` (deprecated)
+ - `channel`: LIN channel index (0-based in SDK wrapper) — BabyLIN-specific (deprecated)
+ - `bitrate`: LIN baudrate (e.g., 19200). The MUM uses this directly; BabyLIN typically takes it from the SDF (deprecated path)
+ - `sdf_path`: Path to SDF file (BabyLIN; deprecated — required for typical BabyLIN operation)
+ - `schedule_nr`: Schedule number to start on connect (BabyLIN; deprecated). `-1` = skip
- `node_name`: Optional node identifier (informational)
- - `dll_path`, `func_names`: Legacy fields from the old ctypes adapter; not used with the SDK wrapper
+ - `dll_path`, `func_names`: Deprecated legacy fields from the old ctypes adapter; not used with the SDK wrapper
- `host`: MUM IP address (MUM-only). Required when `type: mum`
- `lin_device`: MUM LIN device name (MUM-only, default `lin0`)
- `power_device`: MUM power-control device (MUM-only, default `power_out0`)
@@ -71,11 +71,11 @@ flash:
enabled: false
```
-Hardware (BabyLIN SDK wrapper) configuration:
+Hardware (BabyLIN SDK wrapper) configuration — DEPRECATED, prefer the MUM example above:
```yaml
interface:
- type: babylin
+ type: babylin # deprecated
channel: 0 # 0-based channel index
bitrate: 19200 # optional; typically driven by SDF
node_name: "ECU_TEST_NODE"
@@ -128,10 +128,10 @@ central defaults in `config/test_config.yaml`.
## How tests and adapters consume config
-- `lin` fixture picks `mock`, `mum`, or `babylin` based on `interface.type`
+- `lin` fixture picks `mock`, `mum`, or `babylin` (deprecated) based on `interface.type`
- Mock adapter uses `bitrate` and `channel` to simulate timing/behavior
- MUM adapter uses `host`, `lin_device`, `power_device`, `bitrate`, `boot_settle_seconds`, and `frame_lengths` to open the MUM, set up the LIN bus, and power up the ECU on connect
-- BabyLIN adapter (SDK wrapper) uses `sdf_path`, `schedule_nr`, `channel` to open the device, load the SDF, and start a schedule. `bitrate` is informational unless explicitly applied via commands/SDF
+- BabyLIN adapter (SDK wrapper, **DEPRECATED**) uses `sdf_path`, `schedule_nr`, `channel` to open the device, load the SDF, and start a schedule. `bitrate` is informational unless explicitly applied via commands/SDF. Selecting `interface.type: babylin` emits a `DeprecationWarning`.
- `flash_ecu` uses `flash.enabled` and `flash.hex_path`
- PSU-related tests or utilities read `config.power_supply` for serial parameters
and optional actions (IDN assertions, on/off toggle, set/measure). The reference
@@ -142,7 +142,7 @@ central defaults in `config/test_config.yaml`.
- Keep multiple YAMLs and switch via `ECU_TESTS_CONFIG`
- Check path validity for `sdf_path` and `hex_path` before running hardware tests
-- Ensure `vendor/BabyLIN_library.py` and the platform-specific libraries from the SDK are available on `PYTHONPATH`
+- For the deprecated BabyLIN path only: ensure `vendor/BabyLIN_library.py` and the platform-specific libraries from the SDK are available on `PYTHONPATH`
- Use environment-specific YAML files for labs vs. CI
- For PSU, prefer `OWON_PSU_CONFIG` or `config/owon_psu.yaml` to avoid committing
local COM port settings. Central defaults can live in `config/test_config.yaml`.
diff --git a/docs/04_lin_interface_call_flow.md b/docs/04_lin_interface_call_flow.md
index a55f198..c2407a9 100644
--- a/docs/04_lin_interface_call_flow.md
+++ b/docs/04_lin_interface_call_flow.md
@@ -1,6 +1,6 @@
# LIN Interface Call Flow
-This document explains how LIN operations flow through the abstraction for the Mock, MUM, and legacy BabyLIN adapters.
+This document explains how LIN operations flow through the abstraction for the Mock, MUM, and the deprecated BabyLIN adapters.
## Contract (base)
@@ -61,9 +61,11 @@ Configuration:
- `interface.bitrate` is the actual LIN baudrate the MUM drives
- `interface.frame_lengths` lets you map slave frame IDs to their fixed data lengths so `receive(id)` can fetch the correct number of bytes; built-in defaults cover ALM_Status (4) and ALM_Req_A (8)
-## BabyLIN adapter flow (SDK wrapper)
+## BabyLIN adapter flow (SDK wrapper) — DEPRECATED
-File: `ecu_framework/lin/babylin.py`
+> Retained only so existing BabyLIN rigs can keep running. New work should use the MUM flow above.
+
+File: `ecu_framework/lin/babylin.py` (emits `DeprecationWarning` on instantiation)
- `connect()`: import SDK `BabyLIN_library.py`, discover ports, open first, optionally `BLC_loadSDF`, get channel handle, and `BLC_sendCommand("start schedule N;")`
- `send(frame)`: calls `BLC_mon_set_xmit(channelHandle, frameId, data, slotTime=0)`
diff --git a/docs/05_architecture_overview.md b/docs/05_architecture_overview.md
index 31d4ce8..0194de3 100644
--- a/docs/05_architecture_overview.md
+++ b/docs/05_architecture_overview.md
@@ -10,7 +10,7 @@ This document provides a high-level view of the framework’s components and how
- LIN Abstraction — `ecu_framework/lin/base.py` (`LinInterface`, `LinFrame`)
- Mock LIN Adapter — `ecu_framework/lin/mock.py`
- MUM LIN Adapter — `ecu_framework/lin/mum.py` (Melexis Universal Master via `pylin` + `pymumclient`)
-- BabyLIN Adapter — `ecu_framework/lin/babylin.py` (SDK wrapper → BabyLIN_library.py; legacy)
+- BabyLIN Adapter — `ecu_framework/lin/babylin.py` (SDK wrapper → BabyLIN_library.py; **DEPRECATED**, kept for legacy rigs only)
- LDF Database — `ecu_framework/lin/ldf.py` (`LdfDatabase`/`Frame` over `ldfparser`; per-frame `pack`/`unpack`)
- Flasher — `ecu_framework/flashing/hex_flasher.py`
- Power Supply (PSU) control — `ecu_framework/power/owon_psu.py` (serial SCPI)
@@ -33,7 +33,7 @@ flowchart TB
BASE[ecu_framework/lin/base.py]
MOCK[ecu_framework/lin/mock.py]
MUM[ecu_framework/lin/mum.py]
- BABY[ecu_framework/lin/babylin.py]
+ BABY[ecu_framework/lin/babylin.py
DEPRECATED]
LDF[ecu_framework/lin/ldf.py]
FLASH[ecu_framework/flashing/hex_flasher.py]
POWER[ecu_framework/power/owon_psu.py]
@@ -41,10 +41,10 @@ flowchart TB
subgraph Artifacts
REP[reports/report.html
reports/junit.xml]
- YAML[config/*.yaml
test_config.yaml
mum.example.yaml
babylin.example.yaml]
+ YAML[config/*.yaml
test_config.yaml
mum.example.yaml
babylin.example.yaml — deprecated]
PSU_YAML[config/owon_psu.yaml
OWON_PSU_CONFIG]
MELEXIS[Melexis pylin + pymumclient
MUM @ 192.168.7.2]
- SDK[vendor/BabyLIN_library.py
platform-specific libs]
+ SDK[vendor/BabyLIN_library.py
platform-specific libs
DEPRECATED]
OWON[vendor/Owon/owon_psu_quick_demo.py]
LDFFILE[vendor/*.ldf]
LDFLIB[ldfparser PyPI]
diff --git a/docs/07_flash_sequence.md b/docs/07_flash_sequence.md
index cc91248..fed4dfe 100644
--- a/docs/07_flash_sequence.md
+++ b/docs/07_flash_sequence.md
@@ -16,7 +16,7 @@ sequenceDiagram
participant P as pytest
participant F as flash_ecu fixture
participant H as HexFlasher
- participant L as LinInterface (mock/mum/babylin)
+ participant L as LinInterface (mock/mum/babylin — babylin deprecated)
participant E as ECU
P->>F: Evaluate flashing precondition
diff --git a/docs/08_babylin_internals.md b/docs/08_babylin_internals.md
index 7f866c1..818b7f1 100644
--- a/docs/08_babylin_internals.md
+++ b/docs/08_babylin_internals.md
@@ -1,5 +1,7 @@
# BabyLIN Adapter Internals (SDK Python wrapper)
+> **Status: DEPRECATED.** The BabyLIN adapter is retained for backward compatibility only. New tests and deployments should target the MUM (Melexis Universal Master) adapter — see `16_mum_internals.md`. This document is kept so existing BabyLIN setups can still be maintained.
+
This document describes how the real hardware adapter binds to the BabyLIN SDK via the official Python wrapper `BabyLIN_library.py` and how frames move across the boundary.
## Overview
diff --git a/docs/09_raspberry_pi_deployment.md b/docs/09_raspberry_pi_deployment.md
index d008adb..c0c7c65 100644
--- a/docs/09_raspberry_pi_deployment.md
+++ b/docs/09_raspberry_pi_deployment.md
@@ -1,17 +1,18 @@
# Raspberry Pi Deployment Guide
-This guide explains how to run the ECU testing framework on a Raspberry Pi (Debian/Raspberry Pi OS). It covers environment setup, hardware integration via MUM (recommended) or BabyLin (legacy), running tests headless, and installing as a systemd service.
+This guide explains how to run the ECU testing framework on a Raspberry Pi (Debian/Raspberry Pi OS). It covers environment setup, hardware integration via MUM (recommended) or the deprecated BabyLin (legacy rigs only), running tests headless, and installing as a systemd service.
> Note: The MUM (Melexis Universal Master) is **networked**, so the Pi only
> needs IP reachability to the MUM (default `192.168.7.2`) — there are no
-> Pi-side native libs to worry about. BabyLin needs ARM Linux native
-> libraries; if those aren't available, use Mock or MUM on the Pi instead.
+> Pi-side native libs to worry about. BabyLin (deprecated) needs ARM Linux
+> native libraries; if those aren't available, use Mock or MUM on the Pi
+> instead. New deployments should not target BabyLin.
## 1) Choose your interface
- **MUM (recommended for hardware on Pi)**: `interface.type: mum`. Requires Melexis `pylin` + `pymumclient` (see `vendor/automated_lin_test/install_packages.sh`) and IP reachability to the MUM device.
- Mock (recommended for headless/dev on Pi): `interface.type: mock`
-- BabyLIN (only if ARM/Linux support is available): `interface.type: babylin` and ensure the SDK's `BabyLIN_library.py` and corresponding Linux/ARM shared libraries are available under `vendor/` or on PYTHONPATH/LD_LIBRARY_PATH.
+- BabyLIN (**DEPRECATED** — only for legacy rigs and only if ARM/Linux support is available): `interface.type: babylin` and ensure the SDK's `BabyLIN_library.py` and corresponding Linux/ARM shared libraries are available under `vendor/` or on PYTHONPATH/LD_LIBRARY_PATH. Selecting this path emits a `DeprecationWarning`.
## 2) Install prerequisites
@@ -20,7 +21,7 @@ sudo apt update
sudo apt install -y python3 python3-venv python3-pip git
```
-Optional (for BabyLin or USB tools):
+Optional (for the deprecated BabyLin path or USB tools):
```bash
sudo apt install -y libusb-1.0-0 udev
```
@@ -46,7 +47,7 @@ Create or edit `config/test_config.yaml`:
```yaml
interface:
- type: mock # or babylin (if supported on ARM/Linux)
+ type: mock # or "mum" for hardware (current); "babylin" is deprecated
channel: 1
bitrate: 19200
flash:
@@ -79,11 +80,11 @@ Confirm reachability before running tests:
ping -c 2 192.168.7.2
```
-If using BabyLIN on Linux/ARM with the SDK wrapper, set:
+If using BabyLIN on Linux/ARM with the SDK wrapper (**DEPRECATED**, legacy rigs only), set:
```yaml
interface:
- type: babylin
+ type: babylin # deprecated; prefer "mum"
channel: 0
sdf_path: "/home/pi/ecu_tests/vendor/Example.sdf"
schedule_nr: 0
@@ -160,12 +161,12 @@ systemctl status ecu-tests.service
- Create udev rules for your device (if required by vendor)
- Add user to dialout or plugdev groups if serial/USB access is needed
- Confirm your hardware library is found by Python and the dynamic linker:
- - Ensure `vendor/BabyLIN_library.py` is importable (add `vendor/` to PYTHONPATH if needed)
+ - For the deprecated BabyLIN path only: ensure `vendor/BabyLIN_library.py` is importable (add `vendor/` to PYTHONPATH if needed)
- Ensure `.so` files are discoverable (e.g., place in `/usr/local/lib` and run `sudo ldconfig`, or set `LD_LIBRARY_PATH`)
## 8) Tips
- Use the mock interface on Pi for quick smoke tests and documentation/report generation
- For full HIL on Pi, the **MUM is the easiest path** — it's IP-reachable so the Pi doesn't need vendor-specific native libraries, just the Melexis Python packages (`pylin`, `pymumclient`)
-- For BabyLIN HIL, ensure vendor SDK supports Linux/ARM and provide a shared object (`.so`) and headers
+- For the deprecated BabyLIN HIL path, ensure vendor SDK supports Linux/ARM and provide a shared object (`.so`) and headers — but prefer migrating these rigs to MUM
- If only Windows is supported by your hardware path, run the hardware suite on a Windows host and use the Pi for lightweight tasks (archiving, reporting, quick checks)
diff --git a/docs/10_build_custom_image.md b/docs/10_build_custom_image.md
index b413fe5..84bc96c 100644
--- a/docs/10_build_custom_image.md
+++ b/docs/10_build_custom_image.md
@@ -6,9 +6,10 @@ This guide walks you through building your own Raspberry Pi OS image that alread
> the recommended hardware path — it's IP-reachable so the Pi only needs the
> Melexis Python packages (`pylin`, `pymumclient`), no native libraries. Bake
> those into the image's site-packages from the Melexis IDE bundle. BabyLin
-> support on ARM/Linux depends on vendor SDKs; if no `.so` is provided for
-> ARM, either use the Mock or MUM interface on the Pi, or keep BabyLIN
-> hardware tests on Windows.
+> is **deprecated**; its support on ARM/Linux depends on vendor SDKs and is
+> kept only for legacy rigs. If no `.so` is provided for ARM, either use the
+> Mock or MUM interface on the Pi, or keep deprecated BabyLIN hardware tests
+> on Windows until you can migrate.
## Approach A: Using pi-gen (official)
@@ -40,7 +41,7 @@ This guide walks you through building your own Raspberry Pi OS image that alread
sudo install -Dm644 "$REPO_DIR/scripts/ecu-tests.timer" /etc/systemd/system/ecu-tests.timer
sudo systemctl enable ecu-tests.service
sudo systemctl enable ecu-tests.timer || true
- # Optional udev rules
+ # Optional udev rules (DEPRECATED: only needed for legacy BabyLIN hardware)
if [ -f "$REPO_DIR/scripts/99-babylin.rules" ]; then
sudo install -Dm644 "$REPO_DIR/scripts/99-babylin.rules" /etc/udev/rules.d/99-babylin.rules
fi
@@ -71,7 +72,7 @@ This guide walks you through building your own Raspberry Pi OS image that alread
## Hardware Notes
-- If using BabyLin, ensure: `.so` for ARM, udev rules, and any kernel modules.
+- If using the deprecated BabyLin path (legacy rigs), ensure: `.so` for ARM, udev rules, and any kernel modules. New deployments should target MUM instead.
- Validate the SDK wrapper and libraries are present under `/opt/ecu_tests/vendor/` (or your chosen path). Ensure `.so` files are on the linker path (run `sudo ldconfig`) and `BabyLIN_library.py` is importable.
## Boot-time Behavior
diff --git a/docs/12_using_the_framework.md b/docs/12_using_the_framework.md
index 64ce50d..06dd984 100644
--- a/docs/12_using_the_framework.md
+++ b/docs/12_using_the_framework.md
@@ -7,7 +7,7 @@ This guide shows common ways to run the test framework: from fast local mock run
- Python 3.x and a virtual environment
- Dependencies installed (see `requirements.txt`)
- For MUM hardware: Melexis `pylin` and `pymumclient` Python packages on `PYTHONPATH` (see `vendor/automated_lin_test/install_packages.sh`) plus a reachable MUM (default IP `192.168.7.2`)
-- For BabyLIN (legacy) hardware: SDK files placed under `vendor/` as described in `vendor/README.md`
+- For BabyLIN (**DEPRECATED**, legacy rigs only) hardware: SDK files placed under `vendor/` as described in `vendor/README.md`
## Configuring tests
@@ -23,7 +23,7 @@ $env:ECU_TESTS_CONFIG = ".\config\mock.yml"
# Use a hardware config with the MUM (current default)
$env:ECU_TESTS_CONFIG = ".\config\mum.example.yaml"
-# Use a hardware config with the BabyLIN SDK wrapper (legacy)
+# Use a hardware config with the BabyLIN SDK wrapper (DEPRECATED, legacy rigs only)
$env:ECU_TESTS_CONFIG = ".\config\babylin.example.yaml"
```
@@ -34,8 +34,8 @@ Quick try with provided examples:
$env:ECU_TESTS_CONFIG = ".\config\examples.yaml"
# The 'active' section defaults to the mock profile; run non-hardware tests
pytest -m "not hardware" -v
-# Edit 'active' to the mum or babylin profile (or point to mum.example.yaml /
-# babylin.example.yaml) and run hardware tests
+# Edit 'active' to the mum (preferred) or babylin (deprecated) profile, or
+# point to mum.example.yaml / babylin.example.yaml, and run hardware tests
```
## Running locally (mock interface)
@@ -84,7 +84,9 @@ Tips:
- The MUM is master-driven: `lin.receive(id)` requires a frame ID. The default `frame_lengths` covers ALM_Status (4 B) and ALM_Req_A (8 B); add others in YAML when you need slave-published frames at non-standard lengths.
- For BSM-SNPD diagnostic frames (service ID 0xB5), use `lin.send_raw(bytes)` — it routes through the transport layer's `ld_put_raw`, which uses LIN 1.x **Classic** checksum. `send()` uses Enhanced and the firmware will reject these frames.
-## Running on hardware (BabyLIN SDK wrapper — legacy)
+## Running on hardware (BabyLIN SDK wrapper — DEPRECATED)
+
+> Retained only so existing BabyLIN rigs can keep running. New work should use the MUM section above. Selecting `interface.type: babylin` emits a `DeprecationWarning`.
1) Place SDK files per `vendor/README.md`.
2) Select a config that defines `interface.type: babylin`, `sdf_path`, and `schedule_nr`.
@@ -113,7 +115,7 @@ Markers in use:
- `smoke`: quick confidence tests
- `hardware`: needs real device (any LIN master)
- `mum`: targets the Melexis Universal Master adapter (current default)
-- `babylin`: targets the legacy BabyLIN SDK adapter
+- `babylin`: targets the **deprecated** BabyLIN SDK adapter
- `unit`: pure unit tests (no hardware, no external I/O)
- `req_XXX`: requirement mapping (e.g., `@pytest.mark.req_001`)
@@ -193,15 +195,15 @@ pytest -m smoke --maxfail=1 -q
Running tests headless via systemd typically involves:
- A service that sets `ECU_TESTS_CONFIG` to a hardware YAML
-- Running `pytest -m "hardware and mum"` (or `"hardware and babylin"`) on boot or via timer
+- Running `pytest -m "hardware and mum"` (or, for legacy rigs only, `"hardware and babylin"` — deprecated) on boot or via timer
## Troubleshooting quick hits
- ImportError for `pylin` / `pymumclient`: install Melexis packages (`vendor/automated_lin_test/install_packages.sh`); the MUM adapter raises a clear error pointing at this script.
- "interface.host is required when interface.type == 'mum'": set `interface.host` in YAML.
- MUM unreachable: `ping 192.168.7.2`; check the USB-RNDIS link.
-- ImportError for `BabyLIN_library`: verify placement under `vendor/` and native library presence.
-- No BabyLIN devices found: check USB connection, drivers, and permissions.
+- ImportError for `BabyLIN_library` (DEPRECATED path): verify placement under `vendor/` and native library presence. Consider migrating the rig to MUM, which avoids vendor DLLs.
+- No BabyLIN devices found (DEPRECATED): check USB connection, drivers, and permissions.
- Timeouts on receive: increase `timeout` or verify schedule activity and SDF correctness.
- Missing reports: ensure `pytest.ini` includes the HTML/JUnit plugins and the custom plugin is loaded.
diff --git a/docs/13_unit_testing_guide.md b/docs/13_unit_testing_guide.md
index b22efb9..c9fc64f 100644
--- a/docs/13_unit_testing_guide.md
+++ b/docs/13_unit_testing_guide.md
@@ -13,7 +13,7 @@ This guide explains how the project's unit tests are organized, how to run them
- `tests/unit/` — pure unit tests (no hardware, no external I/O)
- `test_config_loader.py` — config precedence and defaults
- `test_linframe.py` — `LinFrame` validation
- - `test_babylin_adapter_mocked.py` — BabyLIN adapter error paths with a mocked SDK wrapper
+ - `test_babylin_adapter_mocked.py` — DEPRECATED BabyLIN adapter error paths with a mocked SDK wrapper
- `test_mum_adapter_mocked.py` — MUM adapter (`MumLinInterface`) plumbing exercised through fake `pylin` / `pymumclient` modules
- `test_hex_flasher.py` — flashing scaffold against a stub LIN interface
- `tests/plugin/` — plugin self-tests using `pytester`
@@ -59,10 +59,10 @@ pytest -q -o addopts=""
## Writing unit tests
- Prefer small, focused tests
-- For BabyLIN adapter logic, inject `wrapper_module` with the mock:
+- For the **deprecated** BabyLIN adapter logic, inject `wrapper_module` with the mock (kept for legacy coverage; new tests should target MUM):
```python
-from ecu_framework.lin.babylin import BabyLinInterface
+from ecu_framework.lin.babylin import BabyLinInterface # DeprecationWarning on use
from vendor import mock_babylin_wrapper as mock_bl
lin = BabyLinInterface(wrapper_module=mock_bl)
@@ -84,7 +84,7 @@ lin.connect()
# exercise send / receive / send_raw / power_*
```
-- To simulate specific SDK signatures, use a thin shim (see `_MockBytesOnly` in `tests/test_babylin_wrapper_mock.py`).
+- To simulate specific (deprecated) SDK signatures, use a thin shim (see `_MockBytesOnly` in `tests/test_babylin_wrapper_mock.py`).
- Include a docstring with Title/Description/Requirements/Steps/Expected Result so the reporting plugin can extract metadata (this also helps the HTML report).
- When testing the plugin itself, use the `pytester` fixture to generate a temporary test run and validate artifacts exist and contain expected entries.
@@ -130,7 +130,7 @@ start .\reports\report.html
- Run `-m unit` and `tests/plugin` on every PR
- Optionally run mock integration/smoke on PR
-- Run hardware test matrix on a nightly or on-demand basis (`-m "hardware and mum"` or `-m "hardware and babylin"`)
+- Run hardware test matrix on a nightly or on-demand basis (`-m "hardware and mum"`; `-m "hardware and babylin"` is deprecated and only for legacy rigs)
- Publish artifacts from `reports/`: HTML/JUnit/coverage JSON/summary MD
## Troubleshooting
diff --git a/docs/14_power_supply.md b/docs/14_power_supply.md
index 7a2541b..51efc17 100644
--- a/docs/14_power_supply.md
+++ b/docs/14_power_supply.md
@@ -7,7 +7,7 @@ This guide covers using the Owon bench power supply via SCPI over serial with th
> `connect()` / `disconnect()` automatically. The Owon PSU is **not required**
> for the standard MUM flow — leave `power_supply.enabled: false`. The Owon
> remains useful for over/under-voltage scenarios, separate-rail tests, or
-> when running with the legacy BabyLIN adapter (which has no built-in power).
+> when running with the deprecated BabyLIN adapter (which has no built-in power).
- Library: `ecu_framework/power/owon_psu.py`
- Hardware test: `tests/hardware/test_owon_psu.py`
diff --git a/docs/15_report_properties_cheatsheet.md b/docs/15_report_properties_cheatsheet.md
index 684979b..ceeb7dc 100644
--- a/docs/15_report_properties_cheatsheet.md
+++ b/docs/15_report_properties_cheatsheet.md
@@ -9,7 +9,7 @@ This keeps reports consistent and easy to scan across suites.
- config_source: defaults | file | env | env+overrides (already used in unit tests)
## LIN (common)
-- lin_type: mock | babylin
+- lin_type: mock | mum | babylin (babylin is deprecated)
- tx_id: hex string or int (e.g., "0x12")
- tx_data: list of ints (bytes)
- rx_present: bool
@@ -17,7 +17,7 @@ This keeps reports consistent and easy to scan across suites.
- rx_data: list of ints
- timeout_s: float seconds
-## BabyLIN specifics
+## BabyLIN specifics (DEPRECATED)
- sdf_path: string
- schedule_nr: int
- receive_result: frame | timeout
@@ -42,7 +42,7 @@ This keeps reports consistent and easy to scan across suites.
- flash_result: ok | fail (for future real flashing)
## Configuration highlights
-- interface_type: mock | babylin
+- interface_type: mock | mum | babylin (babylin is deprecated)
- interface_channel: int
- flash_enabled: bool
diff --git a/docs/18_test_catalog.md b/docs/18_test_catalog.md
index eeafeb1..374b37c 100644
--- a/docs/18_test_catalog.md
+++ b/docs/18_test_catalog.md
@@ -13,7 +13,7 @@ Generated by hand from the source files; rerun
| Mock-loopback smoke | 2 | 6 | none |
| Plugin self-test | 1 | 1 | none |
| Hardware – MUM | 4 | 12 | MUM + ECU |
-| Hardware – BabyLIN (legacy) | 4 | 4 | BabyLIN + ECU + Owon PSU |
+| Hardware – BabyLIN (DEPRECATED) | 4 | 4 | BabyLIN + ECU + Owon PSU |
| Hardware – Owon PSU | 1 | 1 | Owon PSU |
| **Total** | **18** | **52** | mixed |
@@ -27,7 +27,7 @@ The numbers count the cases pytest reports when collecting. Some tests are
pytest -m "unit" # pure unit tests
pytest -m "not hardware" # everything except hardware (≈ 35 cases)
pytest -m "hardware and mum" # MUM-only hardware tests
-pytest -m "hardware and babylin" # legacy BabyLIN hardware tests
+pytest -m "hardware and babylin" # DEPRECATED BabyLIN hardware tests (legacy rigs only)
pytest -m "hardware and not slow" # hardware excluding the slow auto-addressing test
```
@@ -232,17 +232,19 @@ Source: [tests/hardware/test_mum_auto_addressing.py](tests/hardware/test_mum_aut
- Marked `slow` because the full sequence runs in ~3-4 seconds (two BSM cycles plus settle). Skip with `-m "hardware and mum and not slow"`.
- Restore is best-effort: if the second BSM cycle fails, the bench stays at the target NAD. The restore failure is visible as `restore_warning` / `restore_error` in the report properties.
-### 4.4 `test_e2e_power_on_lin_smoke.py` *(legacy, BabyLIN-marked)*
+### 4.4 `test_e2e_power_on_lin_smoke.py` *(DEPRECATED, BabyLIN-marked)*
Source: [tests/hardware/test_e2e_power_on_lin_smoke.py](tests/hardware/test_e2e_power_on_lin_smoke.py)
-Despite living in `tests/hardware/`, this file targets the **BabyLIN** adapter (it predates the MUM migration). See section 5.4.
+Despite living in `tests/hardware/`, this file targets the **deprecated BabyLIN** adapter (it predates the MUM migration). See section 5.4.
---
-## 5. Hardware – BabyLIN (legacy)
+## 5. Hardware – BabyLIN (DEPRECATED)
-Tests gated on `interface.type == "babylin"`. Require:
+> Retained only so existing BabyLIN rigs can keep running. New work should add tests under section 4 (Hardware – MUM).
+
+Tests gated on `interface.type == "babylin"` (deprecated). Require:
- BabyLIN device + native libraries placed under `vendor/`
- An SDF compiled from your LDF, path supplied via `interface.sdf_path`
@@ -310,7 +312,7 @@ When adding new tests, follow these patterns so the catalog stays scannable:
- **Unit tests** live in `tests/unit/` and carry `@pytest.mark.unit`. Filename starts with `test__` (e.g., `test_mum_adapter_mocked.py`).
- **Mock smoke tests** live in `tests/` and use either the in-process Mock adapter (override the `lin` fixture locally) or an injected SDK mock wrapper.
-- **Hardware tests** live in `tests/hardware/` (preferred) or `tests/` (legacy) and carry `@pytest.mark.hardware` plus an adapter marker (`mum` / `babylin`).
+- **Hardware tests** live in `tests/hardware/` (preferred) or `tests/` (legacy) and carry `@pytest.mark.hardware` plus an adapter marker (`mum` for current work, `babylin` for the deprecated path).
- **Slow tests** (>5 s) carry `@pytest.mark.slow` so they can be excluded with `-m "not slow"`.
- **Requirement traceability** is via `req_NNN` markers on the test function and a `Requirements:` line in the docstring (parsed by the reporting plugin).
diff --git a/docs/DEVELOPER_COMMIT_GUIDE.md b/docs/DEVELOPER_COMMIT_GUIDE.md
index 7395b5f..17acea3 100644
--- a/docs/DEVELOPER_COMMIT_GUIDE.md
+++ b/docs/DEVELOPER_COMMIT_GUIDE.md
@@ -8,7 +8,7 @@ This guide explains exactly what to commit to source control for this repository
- `ecu_framework/config.py`
- `ecu_framework/lin/base.py`
- `ecu_framework/lin/mock.py`
-- `ecu_framework/lin/babylin.py`
+- `ecu_framework/lin/babylin.py` (deprecated, retained for backward compatibility)
- `ecu_framework/flashing/hex_flasher.py`
### Pytest plugin and config
@@ -20,7 +20,7 @@ This guide explains exactly what to commit to source control for this repository
### Tests and fixtures
- `tests/conftest.py`
- `tests/test_smoke_mock.py`
-- `tests/test_babylin_hardware_smoke.py` (if present)
+- `tests/test_babylin_hardware_smoke.py` (if present; deprecated BabyLIN path)
- `tests/test_hardware_placeholder.py` (if present)
### Documentation
@@ -34,7 +34,7 @@ This guide explains exactly what to commit to source control for this repository
- `docs/05_architecture_overview.md`
- `docs/06_requirement_traceability.md`
- `docs/07_flash_sequence.md`
-- `docs/08_babylin_internals.md`
+- `docs/08_babylin_internals.md` (deprecated)
### Vendor guidance (no binaries)
- `vendor/README.md`
diff --git a/docs/README.md b/docs/README.md
index 9f4159d..f9999e1 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -6,18 +6,18 @@ A guided tour of the ECU testing framework. Start here:
2. `02_configuration_resolution.md` — How configuration is loaded and merged
3. `03_reporting_and_metadata.md` — How test documentation becomes report metadata
4. `11_conftest_plugin_overview.md` — Custom pytest plugin: hooks, call sequence, and artifacts
-5. `04_lin_interface_call_flow.md` — LIN abstraction and adapter behavior (Mock, MUM, legacy BabyLIN)
+5. `04_lin_interface_call_flow.md` — LIN abstraction and adapter behavior (Mock, MUM, and the deprecated BabyLIN)
6. `05_architecture_overview.md` — High-level architecture and components
7. `06_requirement_traceability.md` — Requirement markers and coverage visuals
8. `07_flash_sequence.md` — ECU flashing workflow and sequence diagram
-9. `08_babylin_internals.md` — BabyLIN SDK wrapper internals and call flow (legacy)
+9. `08_babylin_internals.md` — BabyLIN SDK wrapper internals and call flow (DEPRECATED)
10. `16_mum_internals.md` — MUM (Melexis Universal Master) adapter internals and call flow
11. `17_ldf_parser.md` — LDF parser, `ldf` fixture, and per-frame `pack`/`unpack` helpers
12. `18_test_catalog.md` — Per-test catalog: purpose, markers, hardware needs, expected result
13. `DEVELOPER_COMMIT_GUIDE.md` — What to commit vs ignore, commands
14. `09_raspberry_pi_deployment.md` — Run on Raspberry Pi (venv, service, hardware notes)
15. `10_build_custom_image.md` — Build a custom Raspberry Pi OS image with the framework baked in
-16. `12_using_the_framework.md` — Practical usage: local, hardware (MUM/BabyLIN), CI, and Pi
+16. `12_using_the_framework.md` — Practical usage: local, hardware (MUM, or the deprecated BabyLIN), CI, and Pi
17. `13_unit_testing_guide.md` — Unit tests layout, markers, coverage, and tips
18. `14_power_supply.md` — Owon PSU control, configuration, tests, and quick demo script
19. `15_report_properties_cheatsheet.md` — Standardized keys for record_property/rp across suites
@@ -26,6 +26,6 @@ Related references:
- Root project guide: `../README.md`
- Full framework guide: `../TESTING_FRAMEWORK_GUIDE.md`
-- BabyLIN placement and integration: `../vendor/README.md`
+- BabyLIN placement and integration: `../vendor/README.md` (deprecated; only relevant for legacy rigs)
- MUM source scripts and protocol details: `../vendor/automated_lin_test/README.md`
- PSU quick demo and scripts: `../vendor/Owon/`
diff --git a/ecu_framework/__init__.py b/ecu_framework/__init__.py
index 284a1fa..3fa41f5 100644
--- a/ecu_framework/__init__.py
+++ b/ecu_framework/__init__.py
@@ -3,7 +3,7 @@ ECU Tests framework package.
Provides:
- config: YAML configuration loader and types
-- lin: LIN interface abstraction and adapters (mock and BabyLIN)
+- lin: LIN interface abstraction and adapters (mock, MUM, and the deprecated BabyLIN)
Package version is exposed as __version__.
"""
diff --git a/ecu_framework/config.py b/ecu_framework/config.py
index 53d2ee0..80c4c00 100644
--- a/ecu_framework/config.py
+++ b/ecu_framework/config.py
@@ -24,15 +24,15 @@ class FlashConfig:
class InterfaceConfig:
"""LIN interface configuration.
- type: Adapter type — "mock" (simulated), "babylin" (legacy BabyLIN SDK), or "mum"
- (Melexis Universal Master).
- channel: Channel index to use (0-based in most SDKs); BabyLIN-specific.
+ type: Adapter type — "mock" (simulated), "mum" (Melexis Universal Master, current),
+ or "babylin" (DEPRECATED BabyLIN SDK).
+ channel: Channel index to use (0-based in most SDKs); BabyLIN-specific (deprecated).
bitrate: Effective LIN bitrate; the MUM uses this directly, the BabyLIN SDF may override.
- dll_path: Legacy/optional pointer to vendor DLLs when using ctypes (not used by SDK wrapper).
+ dll_path: DEPRECATED. Legacy/optional pointer to vendor DLLs when using ctypes (not used by SDK wrapper).
node_name: Optional friendly name for display/logging.
- func_names: Legacy mapping for ctypes function names; ignored by SDK wrapper.
- sdf_path: Path to the SDF to load on connect (BabyLIN only).
- schedule_nr: Schedule index to start after connect (BabyLIN only). -1 = skip.
+ func_names: DEPRECATED. Legacy mapping for ctypes function names; ignored by SDK wrapper.
+ sdf_path: DEPRECATED. Path to the SDF to load on connect (BabyLIN only).
+ schedule_nr: DEPRECATED. Schedule index to start after connect (BabyLIN only). -1 = skip.
host: MUM IP address (MUM only).
lin_device: MUM LIN device name (MUM only, default 'lin0').
power_device: MUM power-control device name (MUM only, default 'power_out0').
@@ -41,13 +41,13 @@ class InterfaceConfig:
MUM adapter when receiving slave-published frames.
"""
- type: str = "mock" # "mock", "babylin", or "mum"
+ type: str = "mock" # "mock", "mum", or "babylin" (deprecated)
channel: int = 1
bitrate: int = 19200
- dll_path: Optional[str] = None
+ dll_path: Optional[str] = None # deprecated (BabyLIN)
node_name: Optional[str] = None
- func_names: Dict[str, str] = field(default_factory=dict)
- # BabyLIN-specific
+ func_names: Dict[str, str] = field(default_factory=dict) # deprecated (BabyLIN)
+ # BabyLIN-specific (deprecated)
sdf_path: Optional[str] = None
schedule_nr: int = 0
# MUM-specific
@@ -65,7 +65,7 @@ class InterfaceConfig:
class EcuTestConfig:
"""Top-level, fully-typed configuration for the framework.
- interface: Settings for LIN communication (mock or BabyLIN).
+ interface: Settings for LIN communication (mock, MUM, or the deprecated BabyLIN).
flash: Optional flashing behavior configuration.
"""
diff --git a/ecu_framework/lin/__init__.py b/ecu_framework/lin/__init__.py
index c8ad2b7..46dd9c6 100644
--- a/ecu_framework/lin/__init__.py
+++ b/ecu_framework/lin/__init__.py
@@ -4,11 +4,12 @@ LIN interface package.
Exports:
- LinInterface, LinFrame: core abstraction and frame type
- MockBabyLinInterface: mock implementation for fast, hardware-free tests
+ (the ``BabyLin`` part of the name is historical; the mock is interface-agnostic)
Real hardware adapters live in their own modules and are imported by the
fixture only when selected by config:
-- babylin.BabyLinInterface (legacy; needs the BabyLIN SDK + native libs)
- mum.MumLinInterface (current; needs Melexis pylin + pymumclient)
+- babylin.BabyLinInterface (DEPRECATED; needs the BabyLIN SDK + native libs)
"""
from .base import LinInterface, LinFrame
from .mock import MockBabyLinInterface
diff --git a/ecu_framework/lin/babylin.py b/ecu_framework/lin/babylin.py
index 8db87d6..fe4cf0b 100644
--- a/ecu_framework/lin/babylin.py
+++ b/ecu_framework/lin/babylin.py
@@ -1,5 +1,12 @@
+"""DEPRECATED: Legacy BabyLIN SDK adapter.
+
+This module is retained for backward compatibility only. New work should use
+the MUM (Melexis Universal Master) adapter in ``ecu_framework.lin.mum``.
+Instantiating :class:`BabyLinInterface` emits a :class:`DeprecationWarning`.
+"""
from __future__ import annotations # Enable postponed evaluation of annotations (PEP 563/649 style)
+import warnings # Used to surface the deprecation notice on instantiation
from typing import Optional # For optional type hints
from .base import LinInterface, LinFrame # Base abstraction and frame dataclass used by all LIN adapters
@@ -8,6 +15,11 @@ from .base import LinInterface, LinFrame # Base abstraction and frame dataclass
class BabyLinInterface(LinInterface):
"""LIN adapter that uses the vendor's BabyLIN Python SDK wrapper.
+ .. deprecated::
+ The BabyLIN adapter is deprecated and kept only for backward
+ compatibility. Use :class:`ecu_framework.lin.mum.MumLinInterface`
+ for new tests and deployments.
+
- Avoids manual ctypes; relies on BabyLIN_library.py BLC_* functions.
- Keeps the same LinInterface contract for send/receive/request/flush.
"""
@@ -23,6 +35,11 @@ class BabyLinInterface(LinInterface):
schedule_nr: int = 0, # Schedule number to start after connect
wrapper_module: Optional[object] = None, # Inject a wrapper (e.g., mock) for tests
) -> None:
+ warnings.warn(
+ "BabyLinInterface is deprecated; use ecu_framework.lin.mum.MumLinInterface instead.",
+ DeprecationWarning,
+ stacklevel=2,
+ )
self.bitrate = bitrate # Store configured (informational) bitrate
self.channel_index = channel # Desired channel index
self.node_name = node_name or "ECU_TEST_NODE" # Default node name if not provided
diff --git a/pytest.ini b/pytest.ini
index c66654a..0161775 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -17,7 +17,7 @@ addopts = -ra --junitxml=reports/junit.xml --html=reports/report.html --self-con
# Use with: pytest -m "markername"
markers =
hardware: requires real hardware (LIN master + ECU); excluded by default in mock runs
- babylin: tests that use the legacy BabyLIN interface (may require hardware)
+ babylin: DEPRECATED. Tests targeting the legacy BabyLIN interface; use the `mum` marker for new tests.
mum: tests that use the Melexis Universal Master (MUM) interface (requires hardware)
unit: fast, isolated tests (no hardware, no external I/O)
req_001: REQ-001 - Mock interface shall echo transmitted frames for local testing
diff --git a/scripts/99-babylin.rules b/scripts/99-babylin.rules
index 10327dd..c35e1c2 100644
--- a/scripts/99-babylin.rules
+++ b/scripts/99-babylin.rules
@@ -1,4 +1,7 @@
-# Example udev rules for BabyLin-like USB device
+# DEPRECATED: example udev rules for the legacy BabyLin USB device.
+# Kept for backward compatibility only; new deployments target the MUM adapter
+# over Ethernet and do not need a udev rule.
+#
# Replace ATTRS{idVendor} and ATTRS{idProduct} with actual values
# Find values with: lsusb
diff --git a/scripts/pi_install.sh b/scripts/pi_install.sh
index 23b716c..de93a22 100644
--- a/scripts/pi_install.sh
+++ b/scripts/pi_install.sh
@@ -54,6 +54,9 @@ if [[ -f /etc/systemd/system/ecu-tests.timer ]]; then
fi
log "Installing udev rules (if provided)..."
+# DEPRECATED: the babylin udev rule is only needed for the legacy BabyLIN USB
+# adapter. MUM deployments do not require this and the block can be removed
+# once no babylin hardware remains in the field.
if [[ -f scripts/99-babylin.rules ]]; then
install -Dm644 scripts/99-babylin.rules /etc/udev/rules.d/99-babylin.rules
udevadm control --reload-rules || true
diff --git a/tests/conftest.py b/tests/conftest.py
index e735e63..c593095 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -2,6 +2,7 @@ import os
import pathlib
import sys
import typing as t
+import warnings
import pytest
@@ -10,7 +11,7 @@ from ecu_framework.lin.base import LinInterface
from ecu_framework.lin.mock import MockBabyLinInterface
try:
- from ecu_framework.lin.babylin import BabyLinInterface # type: ignore
+ from ecu_framework.lin.babylin import BabyLinInterface # type: ignore # deprecated
except Exception:
BabyLinInterface = None # type: ignore
@@ -37,6 +38,12 @@ def lin(config: EcuTestConfig) -> t.Iterator[LinInterface]:
elif iface_type == "babylin":
if BabyLinInterface is None:
pytest.skip("BabyLin interface not available in this environment")
+ warnings.warn(
+ "interface.type='babylin' selects the deprecated BabyLIN adapter; "
+ "switch to interface.type='mum' for new tests.",
+ DeprecationWarning,
+ stacklevel=2,
+ )
lin = BabyLinInterface(
dll_path=config.interface.dll_path,
bitrate=config.interface.bitrate,
diff --git a/vendor/README.md b/vendor/README.md
index 2ddbb9a..0414197 100644
--- a/vendor/README.md
+++ b/vendor/README.md
@@ -1,4 +1,6 @@
-# BabyLIN SDK placement
+# BabyLIN SDK placement (DEPRECATED)
+
+> The BabyLIN adapter is deprecated and retained for backward compatibility only. New deployments should target the MUM (Melexis Universal Master) adapter — see `automated_lin_test/README.md` and `../docs/16_mum_internals.md`. This guide is kept so existing BabyLIN rigs can still be set up.
Place the SDK's Python wrapper and platform-specific libraries here so the test framework can import and use them.
@@ -42,7 +44,7 @@ Point your config to the SDF and schedule:
```yaml
interface:
- type: babylin
+ type: babylin # deprecated; emits a DeprecationWarning at runtime
channel: 0
sdf_path: ./vendor/Example.sdf
schedule_nr: 0