]> rtime.felk.cvut.cz Git - can-benchmark.git/blobdiff - gw-tests/vcans.sh
Add vcans test
[can-benchmark.git] / gw-tests / vcans.sh
diff --git a/gw-tests/vcans.sh b/gw-tests/vcans.sh
new file mode 100755 (executable)
index 0000000..153529d
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+. lib.sh
+
+numjobs=`seq 1 2 10`
+
+main() {
+    for i in $numjobs; do
+       cleanupgw
+       lastif=can0
+       for j in `seq $((i-1))`; do
+           sshgw "if ! ip l show dev vcan$j >/dev/null 2>&1; then ip link add dev vcan$j type vcan && ip link set vcan$j up; fi"
+           sshgw cangw -A -s $lastif -d vcan$j -e -f $(printf %x:C00007FF $((j-1))) -m SET:I:$(printf %x $j).0.0000000000000000
+           lastif=vcan$j
+       done
+       sshgw cangw -A -s $lastif -d can1 -f $(printf %x:C00007FF $((i-1)))
+
+       latester -d can0 -d can1 -d can2 -o -c $COUNT -i 0 -h hist-$i.dat -f time-$i.dat
+    done
+}
+
+plot_cmds() {
+    cat <<EOF
+set title "Chained GWs on multiple VCAN interfaces"
+set logscale y
+set grid
+set xlabel "Time [{/Symbol m}s]"
+set ylabel "Latency profile [messages]"
+plot [0:1000] [1:$COUNT] \\
+EOF
+    lt=1
+    for i in $numjobs; do
+       echo_plot "\"hist-$i.dat\" with lp lt $lt title \"$i GW jobs\""
+        lt=$((lt+1))
+    done
+}
+
+
+test_end