Commit Graph

1078 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
Adeeb Shihadeh
aaa1172fa2 HITL bootkick tests (#1685)
* HITL bootkick tests

* both bootkick cases

* more

* som use gpio

* cleanup

* pretty reliable now
2023-10-06 13:38:35 -07:00
Adeeb Shihadeh
ea826ccea6 CI: whitelist hitl jungles (#1687)
Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-10-05 18:27:33 -07:00
Igor Biletskyy
5778c0ae5d H7: fix GMLAN bitbang timer (#1542)
* init

* move Adeeb's test

* bitbang expected to fail can_health
2023-10-03 13:14:14 -07:00
Shane Smiskol
43af1df79e safety: sample_t is not fully reset on safety mode init (#1376)
* found another bug!

* update test

* why does toyota add 1 but not chrysler?!

* test/fix others

* clean up

* more

* global

* clean up

* one function to reset AND update

* without abs and only negative values: this is not caught (since negative error < 1)

* ugly draft

* clean up, tests work

* now only should use this function

* better cmt

* better loc

* constant in python too!

* actually duplicate comment
2023-10-03 03:15:16 -07:00
Shane Smiskol
846c807797 safety tests: fix measurement test (#1679)
* Update common.py

* without abs and only negative values: this is not caught (since negative error < 1)

* ugly draft

* this catches it

* draft

* draft

* draft

* works now!

* no blurry tests

* ugh subaru is like this too

* okay some can scaling makes it slightly off (wheel speeds)

* uncommont

* clean up
2023-10-03 02:46:58 -07:00
Shane Smiskol
635db84095 Subaru: consider true angle sign in safety (#1681)
* this fails

* this doesn't!
2023-10-03 02:18:10 -07:00
Shane Smiskol
9fd1b268b4 Nissan: consider true sign in safety (#1680)
* works

* simpler

* cmt again

* better
2023-10-03 01:50:37 -07:00
Adeeb Shihadeh
43bed1aa47 jungle HITL tests setup (#1665)
* setup new zoo

* run

* fix

---------

Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-09-30 23:19:06 -07:00
Adeeb Shihadeh
b6e37f25b6 Remove flash logging (#1674)
* Revert "Disable flash logging (#1667)"

This reverts commit 62db60595b.

* Revert "Faster log retrieval (#1484)"

This reverts commit 694aae9c26.

* Revert "Flash bounds checking outside of bootstub (#1459)"

This reverts commit 054344de6b.

* Revert "Logging (#1445)"

This reverts commit 0cc91a7f7b.

* cleanup

* cleanup
2023-09-30 12:49:46 -07:00
Adeeb Shihadeh
62db60595b Disable flash logging (#1667)
* disable logging to flash

* update tests

* fix hitl
2023-09-21 15:28:19 -07:00
Justin Newberry
90eb24bf19 Safety: assert that torque safety modes check the steering request bit (#1625)
* test the steering request bit

* not in the angle yet

* not angle yet

* fixes

* draft

* can do this

* adapting the 3 steer req mismatch tests might be too intricate

Revert "can do this"

This reverts commit 775abf877b.

* don't change safety and test the actual behavior

* add comment

* rm

* revert

* For example, now this caught

* "fix"

* Update tests/safety/common.py

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-09-13 01:08:37 -07:00
Adeeb Shihadeh
047d36398d SPI flash dump + restore tools (#1654)
* dump

* restore

* fix

* update

* update

* cleanup

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-09-12 20:04:54 -07:00
Justin Newberry
d4e63daf34 VW PQ: Check steer req bit (#1630)
* vw pq

* misra
2023-09-11 13:59:30 -07:00
Adeeb Shihadeh
d87d33cb51 pre-commit: autoupdate hooks (#1639)
* Update pre-commit hook versions

* fix

---------

Co-authored-by: adeebshihadeh <adeebshihadeh@users.noreply.github.com>
2023-09-07 19:10:30 -07:00
Justin Newberry
cb0cd1bfaa Subaru: add safety around cutting steer req bit (#1632)
* wip

* steer bit

* add tolerance

* increase a bit more

* test too

* Had that backwards

* Here too

* review suggestions

* minimal diff

* minimal diff

* add type hints

* spacing

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* update test name

* add tolerance comment

Co-authored-by: Shane Smiskol <shane@smiskol.com>

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-09-06 20:34:24 -07:00
Justin Newberry
c12cbc1b94 Safety: separate test for steer request bit cutting (#1653)
* common test for that

* canfd too

* we set this everywhere

* never none

* subclass

* Update tests/safety/common.py

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-09-06 19:35:54 -07:00
Jason Wen
39bc5a4886 Nissan Altima: add a param for alternate EPS bus (#1649)
* Nissan Altima: Specify panda flag for alt bus safety config

* test this safety mode

* test this safety mode

* rm

* nl

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-09-06 00:46:33 -07:00
Shane Smiskol
0b6adad9c8 Nissan: test alternate EPS bus param (#1651)
* test this safety mode

* test this safety mode

* use int

* clean up

* clean up
2023-09-06 00:36:25 -07:00
Justin Newberry
104d708547 Precommit: ensure executable bit is set (#1650)
* precommit ensure executable

* fix the violations

* the correct shebang
2023-09-05 15:32:44 -07:00
Justin Newberry
72f1603a89 VW MQB: Check steer req bit (#1631)
vq mqb
2023-09-01 16:32:08 -07:00
Justin Newberry
62bb0c2e33 Subaru: gen2 long safety (#1594)
gen2 long safety
2023-09-01 13:08:04 -07:00
Jason Wen
579fff0c2f Safety tests: Convert message addresses from decimal to hexadecimal (#1633) 2023-08-31 20:13:37 -07:00
Justin Newberry
ef1a9338a1 Chrysler: check steer bit (#1628)
* chrysler

* misra
2023-08-31 16:01:16 -07:00
Justin Newberry
fbe81a1753 GM: check steer req bit (#1629)
for gm
2023-08-31 16:01:05 -07:00
Justin Newberry
f4d0904d94 Subaru: preglobal check steer req bit (#1626) 2023-08-31 14:26:51 -07:00