mcbluetooth-esp32/tests/integration/test_ssp_just_works.py
Ryan Malloy 6398a5223a ESP32 Bluetooth test harness MCP server
UART-controlled ESP32 peripheral for automated E2E Bluetooth testing.
Dual-mode (Classic BT + BLE) via Bluedroid on original ESP32.

Firmware (ESP-IDF v5.x, 2511 lines C):
- NDJSON protocol over UART1 (115200 baud)
- System commands: ping, reset, get_info, get_status
- Classic BT: GAP, SPP, all 4 SSP pairing modes
- BLE: GATTS, advertising, GATT service/characteristic management
- 6 device personas: headset, speaker, keyboard, sensor, phone, bare
- Event reporter: thread-safe async event queue to host

Python MCP server (FastMCP, 1626 lines):
- Async serial client with command/response correlation
- Event queue with wait_for pattern matching
- Tools: connection, configure, classic, ble, persona, events
- MCP resources: esp32://status, esp32://events, esp32://personas

Tests: 74 unit tests passing, 5 integration test stubs (skip without hardware)
2026-02-02 15:12:28 -07:00

30 lines
921 B
Python

"""E2E test: SSP Just Works pairing between Linux and ESP32.
Requires both mcbluetooth and mcbluetooth-esp32 MCP servers, plus
real hardware with the test firmware flashed.
"""
from __future__ import annotations
import pytest
from .conftest import requires_esp32
@requires_esp32
class TestSSPJustWorks:
"""SSP Just Works pairing -- both sides declare no_io capability."""
async def test_just_works_pairing(self, esp32_client):
"""Test Just Works pairing mode (no_io on both sides).
Steps (once firmware is ready):
1. Load 'headset' persona (no_io -> Just Works)
2. Enable Classic BT, set discoverable
3. Scan from Linux side via mcbluetooth
4. Initiate pairing from Linux
5. Verify pair_complete event on ESP32
6. Verify device paired on Linux
"""
pytest.skip("Not yet implemented -- waiting for firmware flash")