curly wars / auto-indentation
[oweals/gnunet.git] / src / nat / test_nat_test.c
index b1e6235f9b675ece626783b93f5b746feaf83696..c080e8ff3282536944e4c6cfa277a990fc7dc824 100644 (file)
 #include "gnunet_nat_lib.h"
 
 
-#define VERBOSE GNUNET_NO
+#define VERBOSE GNUNET_EXTRA_LOGGING
 
 
 /**
- * Time to wait before stopping NAT test, in seconds 
+ * Time to wait before stopping NAT test, in seconds
  */
 #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15)
 
@@ -85,6 +85,8 @@ main (int argc, char *const argv[])
   };
   struct GNUNET_OS_Process *gns;
 
+  int nat_res;
+
   char *const argv_prog[] = {
     "test-nat-test",
     "-c",
@@ -105,6 +107,16 @@ main (int argc, char *const argv[])
                     "WARNING",
 #endif
                     NULL);
+
+  nat_res = GNUNET_OS_check_helper_binary ("gnunet-nat-server");
+  if (GNUNET_SYSERR == nat_res)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                "Cannot run NAT test: `%s' file not found\n",
+                "gnunet-nat-server");
+    return 0;
+  }
+
   gns =
       GNUNET_OS_start_process (NULL, NULL, "gnunet-nat-server",
                                "gnunet-nat-server",