convert fs publish to MQ
[oweals/gnunet.git] / src / dns / test_gnunet_dns.sh
index 98842e95eda1692fd8a7e6b87411fab3544a962a..ab8cca4b1569b0b7495505f0a61e2b85af43984b 100755 (executable)
@@ -4,18 +4,34 @@ ME=`whoami`
 if [ "$ME" != "root" ]
 then
   echo "This test only works if run as root.  Skipping."
-  exit 0
+  exit 77
+fi
+if ! which sudo > /dev/null 
+then
+  echo "This test requires sudo.  Skipping."
+  exit 77
 fi
 if [ ! -x `which sudo` ]
 then
   echo "This test requires sudo.  Skipping."
-  exit 0
+  exit 77
+fi
+if ! which nslookup > /dev/null
+then 
+  echo "This test requires nslookup.  Skipping."
+  exit 77
 fi
 if [ ! -x `which nslookup` ]
 then
   echo "This test requires nslookup.  Skipping."
-  exit 0
+  exit 77
+fi
+if ! iptables -t mangle --list &> /dev/null
+then
+  echo "This test requires iptables with 'mangle' support. Skipping."
+  exit 77
 fi
+
 export PATH=".:$PATH"
 gnunet-service-dns -c dns.conf &
 gnunet-dns-redirector -c dns.conf -4 127.0.0.1 &
@@ -28,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`