examples/ipsec-secgw: add scripts for functional test
[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
9         i=0
10         st=0
11         while [[ $i -ne 1200 && $st -eq 0 ]];
12         do
13                 let i++
14                 ping -c 1 -s ${i} ${dst}
15                 st=$?
16         done
17
18         if [[ $st -ne 0 ]]; then
19                 echo "ERROR: $0 failed for dst=${dst}, sz=${i}"
20         fi
21         return $st;
22 }
23
24 ping6_test1()
25 {
26         dst=$1
27
28         i=0
29         st=0
30         while [[ $i -ne 1200 && $st -eq 0 ]];
31         do
32                 let i++
33                 ping6 -c 1 -s ${i} ${dst}
34                 st=$?
35         done
36
37         if [[ $st -ne 0 ]]; then
38                 echo "ERROR: $0 failed for dst=${dst}, sz=${i}"
39         fi
40         return $st;
41 }
42
43 scp_test1()
44 {
45         dst=$1
46
47         for sz in 1234 23456 345678 4567890 56789102 ; do
48                 x=`basename $0`.${sz}
49                 dd if=/dev/urandom of=${x} bs=${sz} count=1
50                 scp ${x} [${dst}]:${x}
51                 scp [${dst}]:${x} ${x}.copy1
52                 diff -u ${x} ${x}.copy1
53                 st=$?
54                 rm -f ${x} ${x}.copy1
55                 ssh ${REMOTE_HOST} rm -f ${x}
56                 if [[ $st -ne 0 ]]; then
57                         return $st
58                 fi
59         done
60
61         return 0;
62 }