tinc: Add clean sources of 1.1pre10.
[tomato.git] / release / src / router / tinc / test / testlib.sh
blob39a2bf4e14468cb7f60b563dfea32957f2c557d7
1 #!/bin/sh
3 # Paths to executables
5 tincd=../src/tincd
6 tinc=../src/tinc
7 sptps_test=../src/sptps_test
9 # Test directories
11 case "$_" in
12 /*)
13 d1=$_.1
14 d2=$_.2
15 d3=$_.3
18 d1=$PWD/$_.1
19 d2=$PWD/$_.2
20 d3=$PWD/$_.3
22 esac
24 # Default arguments for both tinc and tincd
26 c1="--config=$d1 --pidfile=$d1/pid"
27 c2="--config=$d2 --pidfile=$d2/pid"
28 c3="--config=$d3 --pidfile=$d3/pid"
30 # Arguments when running tincd
32 r1="--logfile=$d1/log -d5"
33 r2="--logfile=$d2/log -d5"
34 r3="--logfile=$d3/log -d5"
36 # Check for leftover tinc daemons
38 [ -f $d1/pid ] && $tinc $c1 stop
39 [ -f $d2/pid ] && $tinc $c2 stop
40 [ -f $d3/pid ] && $tinc $c3 stop
42 # Remove test directories
44 rm -rf $d1 $d2 $d3
46 # Exit on errors, log all commands being executed
48 set -ex