9ba978a93cc382e9479effee498a4aa6e07ae6c1
[dpdk.git] / examples / ipsec-secgw / test / data_rxtx.sh
1 #! /bin/bash
2
3 TCP_PORT=22222
4
5 ping_test1()
6 {
7         dst=$1
8         i=${2:-0}
9         end=${3:-1200}
10
11         st=0
12         while [[ $i -ne $end && $st -eq 0 ]];
13         do
14                 ping -c 1 -s ${i} -M dont ${dst}
15                 st=$?
16                 let i++
17         done
18
19         if [[ $st -ne 0 ]]; then
20                 echo "ERROR: $0 failed for dst=${dst}, sz=${i}"
21         fi
22         return $st;
23 }
24
25 ping6_test1()
26 {
27         dst=$1
28         i=${2:-0}
29         end=${3:-1200}
30
31         st=0
32         while [[ $i -ne $end && $st -eq 0 ]];
33         do
34                 ping6 -c 1 -s ${i} -M dont ${dst}
35                 st=$?
36                 let i++
37         done
38
39         if [[ $st -ne 0 ]]; then
40                 echo "ERROR: $0 failed for dst=${dst}, sz=${i}"
41         fi
42         return $st;
43 }
44
45 scp_test1()
46 {
47         dst=$1
48
49         for sz in 1234 23456 345678 4567890 56789102 ; do
50                 x=`basename $0`.${sz}
51                 dd if=/dev/urandom of=${x} bs=${sz} count=1
52                 scp ${x} [${dst}]:${x}
53                 scp [${dst}]:${x} ${x}.copy1
54                 diff -u ${x} ${x}.copy1
55                 st=$?
56                 rm -f ${x} ${x}.copy1
57                 ssh ${REMOTE_HOST} rm -f ${x}
58                 if [[ $st -ne 0 ]]; then
59                         return $st
60                 fi
61         done
62
63         return 0;
64 }