Don't assume sa.sa_family is a short int.
[tinc] / test / testlib.sh
1 #!/bin/sh
2
3 # Paths to executables
4
5 tincd=../src/tincd
6 tinc=../src/tinc
7 sptps_test=../src/sptps_test
8 sptps_keypair=../src/sptps_keypair
9
10 # Test directories
11
12 case "$_" in
13         /*)
14                 d1=$_.1
15                 d2=$_.2
16                 d3=$_.3
17         ;;
18         *)
19                 d1=$PWD/$_.1
20                 d2=$PWD/$_.2
21                 d3=$PWD/$_.3
22         ;;
23 esac
24
25 # Default arguments for both tinc and tincd
26
27 c1="--config=$d1 --pidfile=$d1/pid"
28 c2="--config=$d2 --pidfile=$d2/pid"
29 c3="--config=$d3 --pidfile=$d3/pid"
30
31 # Arguments when running tincd
32
33 r1="--logfile=$d1/log -d5"
34 r2="--logfile=$d2/log -d5"
35 r3="--logfile=$d3/log -d5"
36
37 # Check for leftover tinc daemons
38
39 [ -f $d1/pid ] && $tinc $c1 stop
40 [ -f $d2/pid ] && $tinc $c2 stop
41 [ -f $d3/pid ] && $tinc $c3 stop
42
43 # Remove test directories
44
45 rm -rf $d1 $d2 $d3
46
47 # Exit on errors, log all commands being executed
48
49 set -ex