Skip to content

volvo: add safety tests + docs on running them - #10

Open
joeywritesc wants to merge 4 commits into
paper5590:master-cma-dev5from
joeywritesc:volvo-safety-tests
Open

joeywritesc wants to merge 4 commits into
paper5590:master-cma-dev5from
joeywritesc:volvo-safety-tests

Conversation

@joeywritesc

Copy link
Copy Markdown

Description

Brings ellie's Volvo safety tests into master-cma-dev5 and documents how to run them.

  • test_volvo.py (ellie, from cschmittiey/opendbc main): CMA + SPA tests for gas/brake/cruise disengage, standstill from main-bus SPEED, TX bus allowlist, relay malfunction, fwd blacklist, and consistency of the speed scale / gas thresholds between volvo.h, carstate.py and the test.
  • common.py: skip CMA<->SPA in test_tx_hook_on_wrong_safety_mode, like Toyota/Ford/Subaru (same safety mode, shared TX msgs).
  • volvo.h: GCOV_EXCL markers around the unreachable wrong-bus branches in volvo_tx_hook (ellie). Comment-only, no behavior change.
  • opendbc/car/volvo/README.md: setup, how to run the tests, gotchas.

Verification

  • Before: opendbc/safety/tests/test.sh on master-cma-dev5 fails the coverage gate (volvo.h at 0%).
  • After: test.sh passes with 100% coverage, full safety suite OK.
  • Tested on Ubuntu 24.04 (WSL) and a clean clone. Not tested on macOS.

Not covered yet: LCA_5 angle limits and RX counter/checksum checks.

Alternative for volvo.h: delete the redundant wrong-bus checks instead of excluding them from coverage. Happy to switch if you prefer.

cschmittiey and others added 4 commits November 13, 2026 15:46
Ported from cschmittiey/opendbc main (56b1b58).
Both use the volvo safety mode with a different safetyParam and share TX_MSGS.
Ported from cschmittiey/opendbc 9efaf9d. Comment-only: the TX allowlist already
pins each address to one bus, so these branches can't be reached. Brings volvo.h
to 100% line coverage so opendbc/safety/tests/test.sh passes.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing to opendbc! In order for us to review your PR as quickly as possible, check the following:

  • Convert your PR to a draft unless it's ready to review
  • Read the contributing docs
  • Before marking as "ready for review", ensure:
    • the goal is clearly stated in the description
    • all the tests are passing
    • include a route or your device' dongle ID if relevant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants