More W32 resolver workarounds
[oweals/gnunet.git] / src / dns / test_gnunet_dns.sh
index c60b94c19da432d335effdc6c105a0dbc998af28..4fa47bb6fcad05666a11124d90940f40e4523b42 100755 (executable)
@@ -6,6 +6,32 @@ then
   echo "This test only works if run as root.  Skipping."
   exit 0
 fi
+if ! which sudo > /dev/null 
+then
+  echo "This test requires sudo.  Skipping."
+  exit 0
+fi
+if [ ! -x `which sudo` ]
+then
+  echo "This test requires sudo.  Skipping."
+  exit 0
+fi
+if ! which nslookup > /dev/null
+then 
+  echo "This test requires nslookup.  Skipping."
+  exit 0
+fi
+if [ ! -x `which nslookup` ]
+then
+  echo "This test requires nslookup.  Skipping."
+  exit 0
+fi
+if ! iptables -t mangle --list &> /dev/null
+then
+  echo "This test requires iptables with 'mangle' support. Skipping."
+  exit 0
+fi
+
 export PATH=".:$PATH"
 gnunet-service-dns -c dns.conf &
 gnunet-dns-redirector -c dns.conf -4 127.0.0.1 &
@@ -18,6 +44,7 @@ then
  echo "Fail: got address $LO, wanted 127.0.0.1"
  ret=1
 else
+ echo "Test run, with success."
  ret=0
 fi
 kill `jobs -p`