X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=test%2Ftestlib.sh;h=75b60a792a21598c4c6f272bf71c03c625aab237;hb=a6448291834ca7419553a807ee367c719c2956d0;hp=635bafe332556700c96d4b1719719473064f41d4;hpb=1cdb0c21d42d600d0e89857f4e9f33843f9372c8;p=tinc diff --git a/test/testlib.sh b/test/testlib.sh index 635bafe3..75b60a79 100644 --- a/test/testlib.sh +++ b/test/testlib.sh @@ -5,25 +5,14 @@ tincd=../src/tincd tinc=../src/tinc sptps_test=../src/sptps_test +sptps_keypair=../src/sptps_keypair # Test directories -case "$_" in - /*) - d1=$_.1 - d2=$_.2 - d3=$_.3 - ;; - *) - d1=$PWD/$_.1 - d2=$PWD/$_.2 - d3=$PWD/$_.3 - ;; -esac - -# Remove test directories - -rm -rf $d1 $d2 $d3 +scriptname=`basename $0` +d1=$PWD/$scriptname.1 +d2=$PWD/$scriptname.2 +d3=$PWD/$scriptname.3 # Default arguments for both tinc and tincd @@ -34,8 +23,18 @@ c3="--config=$d3 --pidfile=$d3/pid" # Arguments when running tincd r1="--logfile=$d1/log -d5" -r2="--logfile=$d1/log -d5" -r3="--logfile=$d1/log -d5" +r2="--logfile=$d2/log -d5" +r3="--logfile=$d3/log -d5" + +# Check for leftover tinc daemons + +[ -f $d1/pid ] && $tinc $c1 stop +[ -f $d2/pid ] && $tinc $c2 stop +[ -f $d3/pid ] && $tinc $c3 stop + +# Remove test directories + +rm -rf $d1 $d2 $d3 # Exit on errors, log all commands being executed