]> rtime.felk.cvut.cz Git - can-benchmark.git/commitdiff
Add test with one vcan
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 1 Dec 2010 11:56:11 +0000 (12:56 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 1 Dec 2010 11:56:11 +0000 (12:56 +0100)
gw-tests/vcan.sh [new file with mode: 0755]

diff --git a/gw-tests/vcan.sh b/gw-tests/vcan.sh
new file mode 100755 (executable)
index 0000000..ff7b967
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+. lib.sh
+
+numjobs=`seq 0 2 10`
+
+main() {
+    sshgw 'ip link add dev vcan0 type vcan && ip link set vcan0 up'
+    for i in $numjobs; do
+       cleanupgw
+       sshgw cangw -A -s can0 -d vcan0 -e -f 0:C00007FF
+       for j in `seq $i`; do
+           sshgw cangw -A -s vcan0 -d vcan0 -e -f $(printf %x:C00007FF $((j-1))) -m SET:I:$(printf %x $j).0.0000000000000000
+       done
+       sshgw cangw -A -s vcan0 -d can1 -f $(printf %x:C00007FF $i)
+
+       latester -d can0 -d can1 -d can2 -o -c $COUNT -i 0 -h hist-$i.dat -f time-$i.dat
+
+       echo
+       sshgw cangw -L
+
+    done
+    sshgw ip link del dev vcan0
+}
+
+plot_cmds() {
+    cat <<EOF
+set title "Chained GWs on a signle VCAN interface"
+set logscale y
+set grid
+set xlabel "Time [{/Symbol m}s]"
+set ylabel "Latency profile [messages]"
+plot [0:1500] [1:$COUNT] \\
+EOF
+    lt=1
+    for i in $numjobs; do
+       echo_plot "\"hist-$i.dat\" with lp lt $lt title \"$i GW jobs on vcan\""
+        lt=$((lt+1))
+    done
+}
+
+
+test_end