#!/bin/sh N=10 MODE=oneattime CAN=vcan0 UDP_SRC=127.0.0.1:10501 UDP_DST=127.0.0.1:10502 evalmsg() { if test $1 -eq 0; then echo -e "\033[32mOK" else echo -e "\033[31mFAIL" fi; echo -ne "\033[0m" } if test $# -ne 0; then if test $# -eq 1; then N=$1; else if test $# -eq 4; then CAN=$1 UDP_SRC=$2 UDP_DST=$3 N=$4 else echo "unexpected number of arguments" return; fi fi fi echo -n "Testing eth->can: " cegwbench -s udp@$UDP_SRC -d can@$CAN -n $N -m $MODE -t 1 &> /dev/zero evalmsg $? echo -n "Testing can->eth: " cegwbench -s can@vcan0 -d udp@$UDP_DST -n $N -m $MODE -t 1 &> /dev/zero evalmsg $?