From 87bc08150624a9c9fb22addc10cfc1c5bad06991 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Fri, 3 Dec 2010 22:51:43 +0100 Subject: [PATCH] Make traffic describing parameters common for all tests The idea is to run the same test with different traffic (flood = 100% load, 50% load, one message at a time) --- gw-tests/filter-sff.sh | 2 +- gw-tests/filter.sh | 2 +- gw-tests/lib.sh | 4 ++++ gw-tests/mod.sh | 2 +- gw-tests/nop-highprio.sh | 8 ++++---- gw-tests/nop.sh | 8 ++++---- gw-tests/pc.sh | 8 ++++---- gw-tests/user.sh | 8 ++++---- gw-tests/vcan.sh | 2 +- gw-tests/vcans.sh | 2 +- 10 files changed, 25 insertions(+), 21 deletions(-) diff --git a/gw-tests/filter-sff.sh b/gw-tests/filter-sff.sh index a32ea02..ce86ffe 100755 --- a/gw-tests/filter-sff.sh +++ b/gw-tests/filter-sff.sh @@ -7,7 +7,7 @@ ids="0 $(seq 255 256 2047)" main() { sshgw 'for i in `seq 0 2047`; do cangw -A -s can0 -d can1 -f $(printf %x $i):c00007ff; done' for i in $ids; do - latester -d can0 -d can1 -d can2 -o -c $COUNT -i $i -h hist-$i.dat -f time-$i.dat + latester -d can0 -d can1 -d can2 -c $COUNT -i $i $(traffic_and_length 2) -h hist-$i.dat -f time-$i.dat done } diff --git a/gw-tests/filter.sh b/gw-tests/filter.sh index 183ab1b..5810dc5 100755 --- a/gw-tests/filter.sh +++ b/gw-tests/filter.sh @@ -7,7 +7,7 @@ ids="0 $(seq 255 256 2047)" main() { sshgw 'for i in `seq 0 2047`; do cangw -A -s can0 -d can1 -f $(printf %x $i):7ff; done' for i in $ids; do - latester -d can0 -d can1 -d can2 -o -c $COUNT -i $i -h hist-$i.dat -f time-$i.dat + latester -d can0 -d can1 -d can2 -c $COUNT -i $i $(traffic_and_length 2) -h hist-$i.dat -f time-$i.dat done } diff --git a/gw-tests/lib.sh b/gw-tests/lib.sh index e0ab644..0d7fe2c 100644 --- a/gw-tests/lib.sh +++ b/gw-tests/lib.sh @@ -70,6 +70,10 @@ echo_plot() { echo -n " " $plot } +traffic_and_length() { + echo -o -l $1 +} + _run() { if [[ ! "$OPT_PLOT_ONLY" ]]; then kernel_versions=$(sshgw uname -r) diff --git a/gw-tests/mod.sh b/gw-tests/mod.sh index 8abf53d..9e55168 100755 --- a/gw-tests/mod.sh +++ b/gw-tests/mod.sh @@ -2,7 +2,7 @@ . lib.sh -LATESTER_OPTS="-d can0 -d can1 -d can2 -o -l 8 -c $COUNT" +LATESTER_OPTS="-d can0 -d can1 -d can2 $(traffic_and_length 8) -c $COUNT" main() { sshgw cangw -A -s can0 -d can1 diff --git a/gw-tests/nop-highprio.sh b/gw-tests/nop-highprio.sh index a10aa2c..27f0c8f 100755 --- a/gw-tests/nop-highprio.sh +++ b/gw-tests/nop-highprio.sh @@ -8,10 +8,10 @@ main() { sshgw 'chrt -p -f 99 `pidof irq/146-can1` || :' sshgw 'chrt -p -f 98 `pidof sirq-net-rx/0` || :' sshgw 'chrt -p -f 98 `pidof sirq-net-tx/0` || :' - latester -d can0 -d can1 -d can2 -o -c $COUNT -l 2 -h hist2.dat -f time2.dat - latester -d can0 -d can1 -d can2 -o -c $COUNT -l 4 -h hist4.dat -f time4.dat - latester -d can0 -d can1 -d can2 -o -c $COUNT -l 6 -h hist6.dat -f time6.dat - latester -d can0 -d can1 -d can2 -o -c $COUNT -l 8 -h hist8.dat -f time8.dat + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 2) -h hist2.dat -f time2.dat + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 4) -h hist4.dat -f time4.dat + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 6) -h hist6.dat -f time6.dat + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 8) -h hist8.dat -f time8.dat } plot_cmds() { diff --git a/gw-tests/nop.sh b/gw-tests/nop.sh index e646518..cbdb342 100755 --- a/gw-tests/nop.sh +++ b/gw-tests/nop.sh @@ -4,10 +4,10 @@ main() { sshgw cangw -A -s can0 -d can1 - latester -d can0 -d can1 -d can2 -o -c $COUNT -l 2 -h hist2.dat -f time2.dat - latester -d can0 -d can1 -d can2 -o -c $COUNT -l 4 -h hist4.dat -f time4.dat - latester -d can0 -d can1 -d can2 -o -c $COUNT -l 6 -h hist6.dat -f time6.dat - latester -d can0 -d can1 -d can2 -o -c $COUNT -l 8 -h hist8.dat -f time8.dat + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 2) -h hist2.dat -f time2.dat + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 4) -h hist4.dat -f time4.dat + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 6) -h hist6.dat -f time6.dat + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 8) -h hist8.dat -f time8.dat } plot_cmds() { diff --git a/gw-tests/pc.sh b/gw-tests/pc.sh index 06601fc..ad7ea51 100755 --- a/gw-tests/pc.sh +++ b/gw-tests/pc.sh @@ -3,10 +3,10 @@ . lib.sh main() { - latester -d can0 -d can1 -o -c $COUNT -l 2 -h hist2.dat -f time2.dat - latester -d can0 -d can1 -o -c $COUNT -l 4 -h hist4.dat -f time4.dat - latester -d can0 -d can1 -o -c $COUNT -l 6 -h hist6.dat -f time6.dat - latester -d can0 -d can1 -o -c $COUNT -l 8 -h hist8.dat -f time8.dat + latester -d can0 -d can1 -c $COUNT $(traffic_and_length 2) -h hist2.dat -f time2.dat + latester -d can0 -d can1 -c $COUNT $(traffic_and_length 4) -h hist4.dat -f time4.dat + latester -d can0 -d can1 -c $COUNT $(traffic_and_length 6) -h hist6.dat -f time6.dat + latester -d can0 -d can1 -c $COUNT $(traffic_and_length 8) -h hist8.dat -f time8.dat } plot_cmds() { diff --git a/gw-tests/user.sh b/gw-tests/user.sh index 1edfa74..6f6269c 100755 --- a/gw-tests/user.sh +++ b/gw-tests/user.sh @@ -4,12 +4,12 @@ main() { pid=$(sshgw 'chrt -f 90 candump -s2 -b can1 can0 & echo $!') - latester -d can0 -d can1 -d can2 -o -c $COUNT -l 2 -h uhist2.dat -f utime2.dat - latester -d can0 -d can1 -d can2 -o -c $COUNT -l 8 -h uhist8.dat -f utime8.dat + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 2) -h uhist2.dat -f utime2.dat + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 8) -h uhist8.dat -f utime8.dat sshgw kill $pid sshgw cangw -A -s can0 -d can1 - latester -d can0 -d can1 -d can2 -o -c $COUNT -l 2 -h khist2.dat -f ktime2.dat - latester -d can0 -d can1 -d can2 -o -c $COUNT -l 8 -h khist8.dat -f ktime8.dat + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 2) -h khist2.dat -f ktime2.dat + latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 8) -h khist8.dat -f ktime8.dat } plot_cmds() { diff --git a/gw-tests/vcan.sh b/gw-tests/vcan.sh index a96cac4..a955280 100755 --- a/gw-tests/vcan.sh +++ b/gw-tests/vcan.sh @@ -14,7 +14,7 @@ main() { 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 + latester -d can0 -d can1 -d can2 -c $COUNT -i 0 -h hist-$i.dat -f time-$i.dat done sshgw ip link del dev vcan0 } diff --git a/gw-tests/vcans.sh b/gw-tests/vcans.sh index 6c3cada..70ac60f 100755 --- a/gw-tests/vcans.sh +++ b/gw-tests/vcans.sh @@ -15,7 +15,7 @@ main() { 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 + latester -d can0 -d can1 -d can2 -c $COUNT -i 0 $(traffic_and_length 2) -h hist-$i.dat -f time-$i.dat done } -- 2.39.2