X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=test%2Ftestlib.sh;h=39a2bf4e14468cb7f60b563dfea32957f2c557d7;hb=566ef6bcbae2bb17c30d500c96331d0c7bdca070;hp=d60b9da5b37e6f6cd4c08f99b6b5e02bf2e5f490;hpb=b00a6d0666f13b5206b6fcb21479281270169584;p=tinc diff --git a/test/testlib.sh b/test/testlib.sh index d60b9da5..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" @@ -37,6 +33,16 @@ r1="--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 set -ex