diff options
author | Kévin Raymond <kraymond@avencall.com> | 2012-11-13 19:34:07 +0100 |
---|---|---|
committer | Kévin Raymond <kraymond@avencall.com> | 2012-11-13 19:34:07 +0100 |
commit | 41924c575ef40ae2d44af8d5e0af11ff8b91e8ab (patch) | |
tree | a0d8d6e22d29b695f1f0ed3037fca3c4e478b604 | |
parent | 8e86e803b6aca8036cc1c48216bc2af268c59c57 (diff) |
adding CEM testing files
-rw-r--r-- | board/cem/README | 0 | ||||
-rwxr-xr-x | board/cem/eth_perf.sh | 11 | ||||
-rw-r--r-- | board/cem/screen_cem | 16 | ||||
-rwxr-xr-x | board/cem/start_eth_perf.sh | 48 |
4 files changed, 75 insertions, 0 deletions
diff --git a/board/cem/README b/board/cem/README new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/board/cem/README diff --git a/board/cem/eth_perf.sh b/board/cem/eth_perf.sh new file mode 100755 index 0000000..10813fd --- /dev/null +++ b/board/cem/eth_perf.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +exec > >(tee -a iperf.log) +exec 2> >(tee -a iperf_err.log >&2) + +while true +do + iperf -s -f m -y c + echo "" +done + diff --git a/board/cem/screen_cem b/board/cem/screen_cem new file mode 100644 index 0000000..19b9a98 --- /dev/null +++ b/board/cem/screen_cem @@ -0,0 +1,16 @@ +source ~/.screenrc + +screen -t "-testing" + stuff "cd ~/xioh-acceptance/board/cem/
" + stuff "scp eth_perf.sh eth0
" + stuff "ssh eth0
" + stuff "/bin/bash eth_perf.sh
" + +screen -t "-qc_log" + stuff "cd ~/xioh-acceptance/board/cem/
" + stuff "tail -f iperf_s.log
" + +screen -t "-qc" + stuff "cd ~/xioh-acceptance/board/cem/
" + stuff "/bin/bash start_eth_perf.sh
" + diff --git a/board/cem/start_eth_perf.sh b/board/cem/start_eth_perf.sh new file mode 100755 index 0000000..361472d --- /dev/null +++ b/board/cem/start_eth_perf.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# TODO screen to run it and co to the target in order to run the iperf server + +iface=( 10.42.0.1 + 10.42.2.1 ) + +DURATION=40 +SLEEP_DURATION=20 +SIZE_FILE="100MB" +TEST_FILE="random_$SIZE_FILE" + +exec > >(tee -a iperf_s.log) +exec 2>&1 + +# check if iperf exists +! which iperf > /dev/null && exit 233 + +if [ ! -e $TEST_FILE ] +then + dd if=/dev/urandom of=$TEST_FILE bs=$((1024*1024)) count=${SIZE_FILE//[a-zA-Z]/} + /usr/bin/md5sum $TEST_FILE > $TEST_FILE.md5sum +fi + +# this run iperf client on a specified iface +load_iface() +{ + while true + do + iperf -c $1 -d -y c -t `/usr/bin/expr $RANDOM % $DURATION` + sleep 1 + done +} + +scp_test_file() +{ + while true + do + time scp $TEST_FILE root@$1:/tmp/ + sleep `/usr/bin/expr $RANDOM % $SLEEP_DURATION` + done +} + +for i in "${iface[@]}" +do + load_iface $i & + scp_test_file $i & +done + |