Skip to content

Commit

Permalink
Fixes safety replay
Browse files Browse the repository at this point in the history
  • Loading branch information
rbiasini committed Sep 26, 2019
1 parent 2c220b6 commit 6280509
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/language/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:16.04

RUN apt-get update && apt-get install -y make python-dev python-pip locales curl git zlib1g-dev libffi-dev bzip2 libssl-dev
RUN apt-get update && apt-get install -y make python python-pip locales curl git zlib1g-dev libffi-dev bzip2 libssl-dev

RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen
ENV LANG en_US.UTF-8
Expand Down
16 changes: 14 additions & 2 deletions tests/safety_replay/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
FROM ubuntu:16.04

RUN apt-get update && apt-get install -y make clang python python-pip git libarchive-dev libusb-1.0-0
RUN apt-get update && apt-get install -y make clang python python-pip git libarchive-dev libusb-1.0-0 locales curl zlib1g-dev libffi-dev bzip2 libssl-dev libbz2-dev

RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash

ENV PATH="/root/.pyenv/bin:/root/.pyenv/shims:${PATH}"
RUN pyenv install 3.7.3
RUN pyenv global 3.7.3
RUN pyenv rehash

COPY tests/safety_replay/requirements.txt requirements.txt
RUN pip install -r requirements.txt
Expand All @@ -17,4 +29,4 @@ COPY . /openpilot/panda
WORKDIR /openpilot/panda/tests/safety_replay
RUN git clone https://github.com/commaai/openpilot-tools.git tools || true
WORKDIR tools
RUN git checkout feb724a14f0f5223c700c94317efaf46923fd48a
RUN git checkout d69c6bc85f221766305ec53956e9a1d3bf283160
1 change: 1 addition & 0 deletions tests/safety_replay/helpers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
import struct
import panda.tests.safety.libpandasafety_py as libpandasafety_py

Expand Down
2 changes: 1 addition & 1 deletion tests/safety_replay/replay_drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def replay_drive(lr, safety_mode, param):
for msg in lr:
if start_t is None:
start_t = msg.logMonoTime
safety.set_timer(((msg.logMonoTime / 1000)) % 0xFFFFFFFF)
safety.set_timer(((msg.logMonoTime // 1000)) % 0xFFFFFFFF)

if msg.which() == 'sendcan':
for canmsg in msg.sendcan:
Expand Down
6 changes: 3 additions & 3 deletions tests/safety_replay/test_safety_replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os
import requests

from .helpers import safety_modes
from .replay_drive import replay_drive
from helpers import safety_modes
from replay_drive import replay_drive
from tools.lib.logreader import LogReader

BASE_URL = "https://commadataci.blob.core.windows.net/openpilotci/"
Expand All @@ -23,7 +23,7 @@
if __name__ == "__main__":
for route, _, _ in logs:
if not os.path.isfile(route):
with open(route, "w") as f:
with open(route, "wb") as f:
f.write(requests.get(BASE_URL + route).content)

failed = []
Expand Down

0 comments on commit 6280509

Please sign in to comment.