phase 20f: vsomeip-based SD-conformance test (POC, #[ignore]'d)#109
Conversation
First test in the simple-someip crate that catches **protocol non-compliance** bugs against an external SOME/IP-SD reference (the COVESA vsomeip implementation), rather than running our own impl on both sides of the wire and only catching internal- consistency issues. Scope: single SD `OfferService` reception. simple-someip's `Client::bind_discovery()` listens for vsomeip's announcement of a known service+instance pair, asserts the SD entry surfaces on the update stream within a 30 s timeout. That single signal is the load-bearing wire-conformance check we have zero of today. Subsequent phases will layer Subscribe/Ack roundtrips, request/response, E2E protect/check, etc. against the same reference. `#[ignore]`'d by default. The test depends on an external vsomeip Docker container being up — see the test file's module-level docs for the docker setup, the JSON config to mount, and the env-var (`SIMPLE_SOMEIP_TEST_INTERFACE`) to point at the test's listening interface. Phase 20g will wire this into CI via TestContainers-rs (or similar) once the manual setup is proven. Why ignored not a CI step yet: Per FW team confirmation, vsomeip-in-docker on CI is approved-in-principle but not yet stood up. Shipping the test infrastructure first lets the firmware team pick up the test locally for debugging during the codec-MVP integration; CI automation lands as 20g. Cleanup folded in: clippy warnings surfaced under broader feature combos (`--features client-tokio,server-tokio`) by prior phases: - `event_publisher.rs:57` doc-markdown `PhantomData` now backticked. - `event_publisher.rs:670/732` `clippy::type_complexity` `#[allow(...)]`'d on the test type aliases (with reason string explaining why). - `server/mod.rs:929` doc-markdown `TokioSocket` now backticked. - `sd_state.rs` `Default` impl added on `SdStateManager` (clippy::pedantic; bare-metal callers should still prefer the explicit `const` `new()` for `static` initializers). Default-features `cargo clippy --tests` had only 2 pre-existing warnings before this commit and still has only 2 after; no new warnings on the canonical CI gate. The broader-feature warnings were a 20e-introduced side-effect. Gates green: - cargo fmt --check - cargo clippy --tests (default features; 2 pre-existing warnings unrelated to this work) - cargo build --workspace --all-targets - cargo build --no-default-features --features client,server,bare_metal - cargo build -p simple-someip-embassy-net --target thumbv7em-none-eabihf - cargo test --features client-tokio,server-tokio --test client_server -- --test-threads=1 (11/11) - cargo test --features client,server,bare_metal --test bare_metal_e2e (2/2) - cargo test -p simple-someip-embassy-net --test loopback (3/3) - cargo test --features client-tokio,server-tokio --test vsomeip_sd_compat (1 ignored as expected) What this leaves for 20g: - `tests/data/vsomeip-offerer/Dockerfile` building vsomeip from source. - TestContainers-rs (or equivalent) integration so `cargo test --features client-tokio,server-tokio --test vsomeip_sd_compat -- --ignored` works in a CI runner with Docker available. - vsomeip version pin matching whatever the FW team selects for production validation. - Subsequent conformance tests: Subscribe/Ack, request/response, E2E roundtrips. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds an initial (ignored-by-default) integration test to validate SOME/IP-SD OfferService reception against an external reference implementation (COVESA vsomeip), plus a few clippy/doc cleanups and a Default impl for SD state management.
Changes:
- Add
tests/vsomeip_sd_compat.rs: ignored conformance test that waits for vsomeip’sOfferServiceto appear onClient’s discovery update stream. - Add
DefaultforSdStateManager(delegating to the existingconst fn new()). - Doc/clippy hygiene: backtick code identifiers in docs; suppress
clippy::type_complexityon verbose test-local types.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/vsomeip_sd_compat.rs | New ignored vsomeip-based SD conformance test + detailed local-run instructions/config snippet. |
| src/server/sd_state.rs | Adds Default impl for SdStateManager (delegates to new()). |
| src/server/mod.rs | Doc comment: backtick TokioSocket. |
| src/server/event_publisher.rs | Doc comment: backtick PhantomData; clippy suppression for complex test types. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| //! "service-discovery": { | ||
| //! "enable": "true", | ||
| //! "multicast": "224.0.23.0", | ||
| //! "port": "30490", | ||
| //! "protocol": "udp", |
There was a problem hiding this comment.
The sample vsomeip-offerer.json sets "multicast": "224.0.23.0", but the client listens on crate::protocol::sd::MULTICAST_IP (239.255.0.255). Unless vsomeip is configured to match the same group, bind_discovery() won’t receive any SD traffic. Align this JSON snippet with the crate’s multicast constant (or document how to override the client’s multicast group if supported).
| #![cfg(all(feature = "client-tokio", feature = "server-tokio"))] | ||
|
|
||
| use std::env; |
There was a problem hiding this comment.
Unlike other feature-gated integration tests in this repo (e.g. client_server, bare_metal_*), this test isn’t registered in Cargo.toml with [[test]] required-features = ["client-tokio", "server-tokio"]. With only the in-file #![cfg(...)], cargo test --test vsomeip_sd_compat can succeed with “0 tests” when the features aren’t enabled, which is confusing for users following the module docs. Consider adding the [[test]] required-features entry (and optionally keeping this #![cfg] as a belt-and-suspenders guard).
| //! proven; until then, hand-rolled is fine. | ||
| //! | ||
| //! 2. Save the config below as `vsomeip-offerer.json` and start | ||
| //! the container in host-network mode so SD multicast (224.0.23.0) |
There was a problem hiding this comment.
The module docs and sample docker run instructions reference SD multicast 224.0.23.0, but this crate’s SD implementation joins crate::protocol::sd::MULTICAST_IP which is 239.255.0.255 (see src/protocol/sd/mod.rs). As written, following these instructions will configure vsomeip to announce on a different multicast group than the client listens to, so the test will never observe OfferService. Update the docs/config snippets to use 239.255.0.255 (or make the client’s SD multicast group configurable and document that instead).
| //! the container in host-network mode so SD multicast (224.0.23.0) | |
| //! the container in host-network mode so SD multicast (239.255.0.255) |
First test in the simple-someip crate that catches protocol non-compliance bugs against an external SOME/IP-SD reference (the COVESA vsomeip implementation), rather than running our own impl on both sides of the wire and only catching internal- consistency issues.
Scope: single SD
OfferServicereception. simple-someip'sClient::bind_discovery()listens for vsomeip's announcement of a known service+instance pair, asserts the SD entry surfaces on the update stream within a 30 s timeout. That single signal is the load-bearing wire-conformance check we have zero of today. Subsequent phases will layer Subscribe/Ack roundtrips, request/response, E2E protect/check, etc. against the same reference.#[ignore]'d by default. The test depends on an external vsomeip Docker container being up — see the test file's module-level docs for the docker setup, the JSON config to mount, and the env-var (SIMPLE_SOMEIP_TEST_INTERFACE) to point at the test's listening interface. Phase 20g will wire this into CI via TestContainers-rs (or similar) once the manual setup is proven.Why ignored not a CI step yet:
Per FW team confirmation, vsomeip-in-docker on CI is approved-in-principle but not yet stood up. Shipping the test infrastructure first lets the firmware team pick up the test locally for debugging during the codec-MVP integration; CI automation lands as 20g.
Cleanup folded in: clippy warnings surfaced under broader feature combos (
--features client-tokio,server-tokio) by prior phases:event_publisher.rs:57doc-markdownPhantomDatanow backticked.event_publisher.rs:670/732clippy::type_complexity#[allow(...)]'d on the test type aliases (with reason string explaining why).server/mod.rs:929doc-markdownTokioSocketnow backticked.sd_state.rsDefaultimpl added onSdStateManager(clippy::pedantic; bare-metal callers should still prefer the explicitconstnew()forstaticinitializers).Default-features
cargo clippy --testshad only 2 pre-existing warnings before this commit and still has only 2 after; no new warnings on the canonical CI gate. The broader-feature warnings were a 20e-introduced side-effect.Gates green:
What this leaves for 20g:
tests/data/vsomeip-offerer/Dockerfilebuilding vsomeip from source.cargo test --features client-tokio,server-tokio --test vsomeip_sd_compat -- --ignoredworks in a CI runner with Docker available.