Correct PPTP server firewall rules chain.
[tomato/davidwu.git] / release / src / router / bridge / tests / stresstest
blob5d529d8a444f651d49b46d482a5e8fea67bdf040
1 #! /bin/bash
3 BR=${1:-"br549"}
4 ETH0=${2:-"eth0"}
5 ETH1=${3:-"eth1"}
6 ETH2=${4:-"eth1"}
8 echo "Ethernet Bridge stress test"
10 IP=`/sbin/ifconfig $ETH0 | sed -n -e 's/^.*inet addr:\([0-9][0-9\.]*\).*$/\1/p'`
11 echo $IP
13 inout() {
14 while true;
16 brctl addif $1 $2
17 sleep $(($RANDOM % 10))
18 brctl delif $1 $2
19 done
22 newdel() {
23 while true;
25 brctl addbr $1
26 brctl delbr $1
27 done
30 updown() {
31 while true;
33 ifconfig $1 down
34 ifconfig $1 up
35 sleep 11
36 done
39 echo "1. Creating bridge $BR"
40 brctl addbr $BR
42 echo -n "2. Add ethernets"
43 ifconfig $ETH0 0.0.0.0
44 brctl addif $BR $ETH0
45 echo -n $ETH0
46 ifconfig $ETH2 0.0.0.0
47 brctl addif $BR $ETH2
48 echo $ETH2
50 echo "4. Starting add/del interface" $ETH1
51 ifconfig $ETH1 0.0.0.0
52 inout $BR $ETH1 &
53 ipid=$!
55 echo "5. Starting add/remove bridge"
56 newdel brtmp1 &
57 npid=$!
59 echo "6. Starting up/down" $ETH1
60 updown $BR $ETH1 &
61 upid=$!
63 trap "kill $ipid $npid $upid" 1 2 3 15
65 echo " Waiting"
66 wait