Commit Graph

2764 Commits

Author SHA1 Message Date
Adeeb Shihadeh 4c0d2505b7
remove k-line driver (#1743) 2023-11-23 17:09:10 -08:00
Adeeb Shihadeh 3b22bc18c6
safety: more int -> bool (#1742) 2023-11-23 16:48:08 -08:00
Adeeb Shihadeh f1cd12651c
safety: remove LIN hook (#1741)
* safety: remove LIN hook

* rm more
2023-11-23 16:30:20 -08:00
Adeeb Shihadeh 194f2d9657 safety: cleanup comments 2023-11-23 16:16:03 -08:00
Shane Smiskol 83acc65743
safety: check interceptor msg counter (#1738)
* toyota: check interceptor counter

* add counters and check rx

* honda: check counter

* clean up
2023-11-21 17:23:37 -08:00
Shane Smiskol 8b068880d1
safety tests: common interceptor msg (#1737)
* common interceptor msg creation

* cnt not needed yet
2023-11-21 14:35:35 -08:00
Adeeb Shihadeh 897e3d8c28
pre-commit: autoupdate hooks (#1736)
Update pre-commit hook versions

Co-authored-by: adeebshihadeh <adeebshihadeh@users.noreply.github.com>
2023-11-21 13:08:12 -08:00
Shane Smiskol 42a62936fb
Honda: fix alt brake address check race condition (#1723)
* common honda addr checks

* oohhhh

* rename RxCheck from merge

* more rename

* checked data and found 0x1A6 does not exist on any Bosch, so combining with 0x296 is safe

* formatting

* need this since refactor

* clean up

* fixup

* misra

* coverage caught another bug!

* another duplicate addr from multi tests

* proper base class

* formatting

* misra

* flat

* Revert "flat"

This reverts commit d5ea2adf26.
2023-11-20 19:27:18 -08:00
Shane Smiskol c345bc3cae
Rename forgotten functions (#1731)
fix forgotten functions
2023-11-20 11:37:51 -08:00
Adeeb Shihadeh 933a301cad
safety: do TX whitelist check in top level hook (#1730)
* new fields

* add check

* do first one

* first two

* all done

* fix all output

* simpler

* unused now

* fix body and elm

* fix that

* fix misra

* revert that
2023-11-20 00:15:46 -08:00
Adeeb Shihadeh b1ca493580
safety: fix ambiguous names (#1729)
renames
2023-11-19 22:44:13 -08:00
Adeeb Shihadeh 606d7580c8
safety: cleanup init return struct (#1728)
* try 1

* do the rest

* fix misra
2023-11-19 21:05:53 -08:00
Adeeb Shihadeh 3d2f99dd40
safety: move RX addr check into top level hook (#1727)
* safety: move RX addr check into top level hook

* tesla

* rest

* can't forget about the body

* rm more

* fix that

* cleanup

* drop the fn
2023-11-19 20:03:35 -08:00
Adeeb Shihadeh c6248d6504
safety: cleanup ints that are bools (#1726)
* safety: cleanup ints that are bools

* update tests
2023-11-19 16:47:09 -08:00
Shane Smiskol 9fed95003e
Ford: fix possible standstill mismatch (#1725)
fix ford standstill mismatch
2023-11-18 00:04:34 -08:00
Shane Smiskol 3b165ed21b
Hyundai: fix brake pressed bitmask (#1724)
* fix

* test this
2023-11-17 19:58:53 -08:00
Shane Smiskol 7c84475410
safety: use address check helper (#1721)
use SET_ADDR_CHECKS
2023-11-16 22:36:05 -08:00
Adeeb Shihadeh 37f53acece
pre-commit: autoupdate hooks (#1720)
Update pre-commit hook versions

Co-authored-by: adeebshihadeh <adeebshihadeh@users.noreply.github.com>
2023-11-14 15:03:06 -08:00
Shane Smiskol 5fe1d67b77
safety: test coverage (#1699)
* run in CI

* test

* make report optional

* 100% GM coverage

comments

* more coverage: these are unhittable lines

* vw mqb: convert switch to if, consistent with all other safety modes

* we don't check any of these yet

* rm

* ensure honda_fwd_brake is reset

* can rm this

* test honda brake latching

* honda: add rx brake function

* use loops for more coverage and more compact code

* other honda stuff

* remove car-specific stuff from init_tests

* don't need to have car safety modes reset interceptor detected (global init does)

* use get_bit

* ahh ford counter is unhittable: counter check disabled due to skipping

* misra

* test nooutput and alloutput

* required changes for that

* fix test

* more all/nooutput coverage

* start on lin

* rx coverage

* lin tx coverage

* some barebones body test

* double negative

* draft elm327 safety (git stash)

* fixes from merge

* clean up test cov

* add rm

* no body

* failed grep returns exit code 1

* more clear msgs
2023-11-10 19:37:41 -08:00
Shane Smiskol 57e280ad29
safety: add body safety tests (#1716)
* partial body safety tests

* cmt

* test this flasher msg

* move

* address check on can flashing msg

* no other test tests this, valid when we rx one

* this is more reflective on the current behavior

* better test

* clean up

* stash

* clean up

* revert

* Update board/safety/safety_body.h

* fix misra
2023-11-10 19:02:32 -08:00
Shane Smiskol 4383ac35f5
safety: add ELM327 safety test (#1715)
* elm safety test

* comment
2023-11-10 03:03:35 -08:00
Shane Smiskol 55946a060d
safety tests: more coverage (#1714)
* more coverage

* we don't check the counter of this ford message

* there are no messages with these lengths to check
2023-11-10 01:53:41 -08:00
Shane Smiskol 5e22e87cf6
Hyundai CAN: update driver braking signal (#1713)
* use DriverOverride

* Update board/safety/safety_hyundai.h
2023-11-10 01:03:33 -08:00
Adeeb Shihadeh a1d699b87d
SOM boot recovery (#1712)
* reset

* simpler

* only once per panda boot

* cleanup

* also check serial
2023-11-09 18:01:46 -08:00
Adeeb Shihadeh d2ea9ad293
refactor bootkick (#1690)
* bootkick refactor + reset

* simplify

* revert reset stuff

* cleanup

---------

Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-11-08 22:54:55 -08:00
Adeeb Shihadeh cd0f0bd034
CI: make bootkick test robust to health struct changes (#1711)
* CI: make bootkick test robust to health struct changes

* comment

* panda
2023-11-08 16:46:41 -08:00
Jason Wen 3f25ccabd6
Subaru Pre-Global: Reverse driver torque signal for certain platforms (#1648)
* Subaru Pre-Global: Reverse driver torque signal for certain platforms

* added flag

* fix tests

* use dbc instead

* duplicate

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: Justin Newberry <jnewberry0502@gmail.com>
Co-authored-by: Justin Newberry <justin@comma.ai>
2023-11-08 15:27:20 -08:00
Justin Newberry 708303d613
Subaru: cleaner wrong safety mode checks (#1709)
cleaner
2023-11-08 12:03:39 -08:00
Shane Smiskol fa04f47600
safety tests: support multiple relay malfunction addresses (#1707)
* gm: test the other relay malfunction addr when using long with gmcam (ASCMGasRegenCmd)

* make it a dict

* might want to split these changes

* messy

* Revert "messy"

This reverts commit 25cd68fcab.

* some more

* ford: check longitudinal addr

* chrysler

* fix ford!

* gm and subaru

* common

* draft

* clean up

* clean up check

* rm line

* clean up

* add context

* apparently None isn't optional

* conventional test

* Revert "conventional test"

This reverts commit 4b265ad4ab.

* whoops, clean that up

* more clean up

* add a helpful cmt

* more hlpfl cmt

* can remove this test now

* hyundai cmts

* not really needed
2023-11-07 19:03:08 -08:00
Shane Smiskol 619f6f31b7 safety: _torque_driver_msg is used 2023-11-07 15:49:50 -08:00
Adeeb Shihadeh 90c4e8e76d
pre-commit: autoupdate hooks (#1708)
Update pre-commit hook versions

Co-authored-by: adeebshihadeh <adeebshihadeh@users.noreply.github.com>
2023-11-07 10:58:46 -08:00
Shane Smiskol 2560349fbb
safety: use CLAMP for update_counter (#1706)
Update safety.h
2023-11-06 22:08:24 -08:00
Shane Smiskol e7f8b598d7
safety tests: safety_defaults (#1705)
* test safety_defaults

* rename panda safety test

* add PandaSafetyTest base back

* remove car-specific tests from PandaSafetyTest (for ALLOUTPUT, NOOUTPUT, ELM327 tests)

duh

* Add TestAllOutput comparison

* needs to be list

* fix extra loops (faster)

* create lin msg correctly

according to ad79b7f4d2

* use bytes

* some clean up

* revert coverage

* ensure same

* fix typing

* rx hook: scan all addrs

* this is cleanest

* parameterized_class doesn't work nicely

* Revert "parameterized_class doesn't work nicely"

This reverts commit 3a46f1f514.

* add test for silent

* rm spaces

* common?

forgot

* Revert "common?"

This reverts commit f136ae276f.

* Update tests/safety/test_defaults.py
2023-11-06 16:19:27 -08:00
Shane Smiskol d2f9e14062
Honda: add latching AEB test (#1704)
* use get bit

* simplify parsing

* add get_honda_fwd_brake for latching test

rm print

* can also test with txing brake

* Revert "can also test with txing brake"

This reverts commit f75eb6eb56.

* rm this
2023-10-31 21:20:59 -07:00
Shane Smiskol bc69d25335
safety tests: clean up state reset (#1703)
* this is already reset in set_safety_hooks

* move these car-specific variables into their own init hooks
2023-10-31 21:19:55 -07:00
Shane Smiskol 120ea2c5bb
safety test: fix incorrect error message (#1702)
don't add a generator
2023-10-31 18:04:40 -07:00
Shane Smiskol 7304f92663
safety test: simplify tx address check (#1701)
* convert to set

* Revert "convert to set"

This reverts commit 85863c37a7.

* minor speed up
2023-10-31 17:58:30 -07:00
Adeeb Shihadeh b3a611e17d
pre-commit: autoupdate hooks (#1700)
Update pre-commit hook versions

Co-authored-by: adeebshihadeh <adeebshihadeh@users.noreply.github.com>
2023-10-31 11:34:27 -07:00
Shane Smiskol f3bdfdd435 Rename safety coverage flag 2023-10-30 11:43:56 -07:00
Shane Smiskol da66779b43
safety: coverage report (#1696)
* coverage report

* test script

* not needed

* option

* options

* re-build if file missing

* rename

* rename flag

* just always build

* cmt

* fix rebuild, panda.c is what does gens gcno

* clean up

* check coverage

* rename

* add skip flag

* Revert "add skip flag"

This reverts commit 6991c174ce.

* both do same thing

* clean up script

* don't test here

* Revert "don't test here"

This reverts commit 43fe4c961f.

* try running in CI

* nproc

* move

* Revert "try running in CI"

This reverts commit 912017c7fa.

* don't test here

* fix path

* re-compiling does this
2023-10-25 22:01:01 -07:00
Shane Smiskol f62d1723fd
Hyundai CAN: fix driver torque safety scaling (#1695)
* how does this/did that pass?!

* fix misra

* add comment

* we could do this

* or could do what eps torque does

* another pr

* not unused

* need this for special gm

* support testing integer torque

cmt

* there we go

* stash again

* Revert "stash again"

This reverts commit 4ecf6cc91c.

* this works!

* clean up

* cmt

* ugh this test was broken

* add some comments for this behemoth, and switch to rxing real msgs

* for now, no measurement test since we don't have any info about driver torque on can. for ex:

max value, factor on CAN, etc.

clean up

* more clean up

* just use it everywhere

* better cmt

* cmt
2023-10-24 23:20:33 -07:00
Shane Smiskol f8c2041a9c
safety tests: fix driver torque override test (#1698)
* this was failing for the wrong reason

* stash

* Revert "stash"

This reverts commit b29e09ca85.

* call it driver torque

* Revert "call it driver torque"

This reverts commit 1ed5ce5ebe.
2023-10-24 22:44:30 -07:00
Adeeb Shihadeh 1a0d5fac81
pre-commit: autoupdate hooks (#1697)
Update pre-commit hook versions

Co-authored-by: adeebshihadeh <adeebshihadeh@users.noreply.github.com>
2023-10-24 14:38:00 -07:00
Shane Smiskol 331829bfac
safety tests: clean up measurement tests (#1694)
* hmm this works

* hyundai fix in another pr

* support testing integer torque

cmt

* there we go

* Revert "there we go"

This reverts commit 6c5a19aad8.

* Revert "support testing integer torque"

This reverts commit 2c381077d5.

* clean up

* Update tests/safety/common.py
2023-10-23 20:04:05 -07:00
Shane Smiskol 229107f120
replay drive: fix space formatting 2023-10-19 19:57:10 -07:00
Adeeb Shihadeh 8255ee81ab
pre-commit: autoupdate hooks (#1692)
Update pre-commit hook versions

Co-authored-by: adeebshihadeh <adeebshihadeh@users.noreply.github.com>
2023-10-19 11:29:38 -07:00
Shane Smiskol 549fa32fc7
safety replay: support Toyota LTA angle control (#1693)
* safety replay: support toyota lta

* one line
2023-10-17 16:48:13 -07:00
shameer99 b496de2d08
Linkify `board/README.md` in panda/README.md, (#1691) 2023-10-13 22:34:43 -07:00
Adeeb Shihadeh 95c4449d96
pre-commit: autoupdate hooks (#1689)
Update pre-commit hook versions

Co-authored-by: adeebshihadeh <adeebshihadeh@users.noreply.github.com>
2023-10-10 13:24:45 -07:00
Adeeb Shihadeh 7b323413d2
jenkins: run bootkick tests (#1688)
* jenkins: run bootkick tests

* flip that

* little longer

* increase

* disable can

---------

Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-10-09 21:52:15 -07:00