# FT-P-09-iNav — iNav MSP2_SENSOR_GPS contract conformance

**Task**: AZ-417_ft_p_09_inav
**Name**: iNav `MSP2_SENSOR_GPS` contract + provider state (AC-4.3)
**Description**: Implement FT-P-09-iNav — start SUT with `inav` adapter; TCP connection to `inav-sitl:5760` established; SUT emits `MSP2_SENSOR_GPS` (ID 0x1F03) frames at 5 Hz during 60 s of Derkachi replay; iNav GPS state shows `gpsSol.fixType ≥ 3`, `gpsSol.numSat` reflects emitted value, `provider=MSP`.
**Complexity**: 3 points
**Dependencies**: AZ-406, AZ-407
**Component**: Blackbox Tests / Positive / FC contract (epic AZ-262)
**Tracker**: AZ-417
**Epic**: AZ-262 (E-BBT)

## Problem

iNav uses MSP2 over TCP rather than MAVLink — a separate protocol pathway with no signing (per Mode B Fact #109 accepted residual risk). The protocol-conformance leg is small but distinct from the AP path; it must be validated independently.

## Outcome

- pytest scenario at `e2e/tests/positive/test_ft_p_09_inav.py`.
- Forces `fc_adapter=inav`; SUT connects to `inav-sitl:5760` via TCP; emits `MSP2_SENSOR_GPS` (ID 0x1F03) frames during 60 s of Derkachi replay.
- Reads iNav GPS state via MSP query; asserts `gpsSol.fixType ≥ 3`, `gpsSol.numSat` matches the emitted value, `provider=MSP`.

## Scope

### Included
- iNav-only test method.
- TCP connection establishment check.
- MSP2 frame ID + rate observation (5 Hz target).
- iNav GPS state read via MSP query (`msp_gps_toy` Rust binary called via subprocess per `environment.md`).

### Excluded
- AP variant — owned by FT-P-09-AP.
- Signing handshake — N/A for iNav.
- Source-set switch — N/A for iNav (no equivalent to AP `EK3_SRC1_POSXY`).

## Acceptance Criteria

**AC-1: TCP connection to iNav SITL**
Given SUT started with `fc_adapter=inav`
Then the SUT establishes a TCP connection to `inav-sitl:5760` within ≤5 s.

**AC-2: MSP2_SENSOR_GPS frame flow**
When 60 s of Derkachi replays
Then `MSP2_SENSOR_GPS` (ID 0x1F03) frames reach iNav at the configured rate (≥4.5 Hz observed for a 5 Hz target).

**AC-3: iNav GPS state**
Given the frame flow
Then a follow-up MSP query reports `gpsSol.fixType ≥ 3`, `gpsSol.numSat` reflects the emitted value, `provider=MSP` (no fallback to internal GPS).

**AC-4: vio_strategy parameterization**
Given the conftest's `vio_strategy` parameterization
Then the scenario runs once per VIO strategy; `fc_adapter` is fixed to `inav`.

## System Under Test Boundary

End-to-end through public boundaries with a real (SITL-simulated) FC.

- **Allowed**: TCP connection observation, MSP query.
- **Forbidden**: importing SUT internal state; if the TCP connection fails, the test fails (no fallback to UDP or MAVLink).

## Constraints

- The MSP2 protocol implementation in the runner uses the same `msp_gps_toy` library that the consumer-side ground tooling uses; the runner does not embed iNav internals.

## Document Dependencies

- `_docs/02_document/tests/blackbox-tests.md` § FT-P-09-iNav
- `_docs/02_document/tests/test-data.md` § FC contract & startup (FT-P-09-iNav row)
