X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=test%2Ftestlib.sh;h=39a2bf4e14468cb7f60b563dfea32957f2c557d7;hb=b7d59f035bfa2e546428cac2b72318d4f5c517fb;hp=635bafe332556700c96d4b1719719473064f41d4;hpb=1cdb0c21d42d600d0e89857f4e9f33843f9372c8;p=tinc diff --git a/test/testlib.sh b/test/testlib.sh index 635bafe3..39a2bf4e 100644 --- a/test/testlib.sh +++ b/test/testlib.sh @@ -21,10 +21,6 @@ case "$_" in ;; esac -# Remove test directories - -rm -rf $d1 $d2 $d3 - # Default arguments for both tinc and tincd c1="--config=$d1 --pidfile=$d1/pid" @@ -34,8 +30,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