Skip to content

Commit

Permalink
try running vcan tests under docker
Browse files Browse the repository at this point in the history
  • Loading branch information
driftregion committed May 19, 2024
1 parent 2d0bfb9 commit 5bc8229
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,5 @@ jobs:
continue-on-error: true

- name: run unit tests
run: ip link help dev && \
sudo ip link add name vcan0 type vcan && \
sudo ip link set vcan0 up && \
bazel test //test:all
run: docker run -it --cap-add NET_ADMIN --rm -v $(pwd):$(pwd) -w $(pwd) iso14229 bazel test //test:all

12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ubuntu:22.04

RUN apt update && apt install apt-transport-https curl gnupg -y && \
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor >bazel-archive-keyring.gpg &&\
mv bazel-archive-keyring.gpg /usr/share/keyrings && \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/bazel-archive-keyring.gpg] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list && \
apt update &&\
apt install net-tools iproute2 can-utils bazel clang-15 -y

ADD docker-entrypoint.sh .

ENTRYPOINT ["sh", "docker-entrypoint.sh"]
13 changes: 13 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
set -e

# Display configuration
echo Using following configuration
echo VCAN_INTERFACE: "${VCAN_INTERFACE:=vcan0}"

# Setting up vcan
ip link add "$VCAN_INTERFACE" type vcan
ip link set up "$VCAN_INTERFACE"
echo Created vcan

$@
1 change: 1 addition & 0 deletions src/tp.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "tp.h"
#include <assert.h>

/**
* @brief
Expand Down

0 comments on commit 5bc8229

Please sign in to comment.