Files
dragonpilot/selfdrive/boardd/tests/fuzzer.py

21 lines
493 B
Python
Raw Normal View History

2019-10-09 18:43:53 +00:00
#!/usr/bin/env python3
from __future__ import print_function
2019-05-16 13:20:29 -07:00
import time
import random
from boardd_old import can_init, can_recv, can_send_many, can_health
if __name__ == "__main__":
can_init()
while 1:
c = random.randint(0, 3)
if c == 0:
2019-10-09 18:43:53 +00:00
print(can_recv())
2019-05-16 13:20:29 -07:00
elif c == 1:
2019-10-09 18:43:53 +00:00
print(can_health())
2019-05-16 13:20:29 -07:00
elif c == 2:
many = [[0x123, 0, "abcdef", 0]] * random.randint(1, 10)
can_send_many(many)
elif c == 3:
time.sleep(random.randint(0, 100) / 1000.0)