]> rtime.felk.cvut.cz Git - can-benchmark.git/blob - gw-tests/filter.sh
Modification of *-time tests so that they don't break if the test was skipped.
[can-benchmark.git] / gw-tests / filter.sh
1 #!/bin/bash
2
3 . lib.sh
4
5 ids="0 $(seq 255 256 2047)"
6
7 prepare() {
8     sshgw 'for i in `seq 0 2047`; do cangw -A -s can0 -d can1 -f $(printf %x $i):7ff; done'
9 }
10
11 main() {
12     if [ "$kvers" = 3.0.4-rt14-00008-gb2052fd -a "$load" = eth -a $traffic != oneatatime ]; then echo "Skipping eth test"; SKIPPED=1; return; fi
13     for i in $ids; do
14         latester -d can0 -d can1 -d can2 -c $COUNT -i $i $(traffic_and_length 2) -n id-$i
15     done
16 }
17
18 ADDITIONAL_PLOTS=detail
19
20 plot_cmds() {
21     if [[ "$1" = detail ]]; then
22         range=0:0.8
23         echo "set logscale y"
24     else
25         range=0.01:100
26         echo "set logscale xy"
27     fi
28     cat <<EOF
29 set title "2048 GW rules (one per id, mask 0x7FF), no modifications"
30 set grid xtics mxtics ytics mytics lw 1, lw 0.5
31 set xlabel "GW latency [ms]"
32 set ylabel "Latency profile [frames]"
33 plot [$range] [1:$COUNT] \\
34 EOF
35     lt=1
36     for i in $ids; do
37         echo_plot "\"id-$i-hist.txt\" with lp lt $lt title \"Message id $i\""
38         lt=$((lt+1))
39     done
40 }
41     
42 test_end