Fix tincd logfile location when running tests.
[tinc] / test / testlib.sh
index e65127d..d60b9da 100644 (file)
@@ -8,9 +8,18 @@ sptps_test=../src/sptps_test
 
 # Test directories
 
-d1=$PWD/$_.1
-d2=$PWD/$_.2
-d3=$PWD/$_.3
+case "$_" in
+       /*)
+               d1=$_.1
+               d2=$_.2
+               d3=$_.3
+       ;;
+       *)
+               d1=$PWD/$_.1
+               d2=$PWD/$_.2
+               d3=$PWD/$_.3
+       ;;
+esac
 
 # Remove test directories
 
@@ -25,8 +34,8 @@ 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"
 
 # Exit on errors, log all commands being executed