-check if /dev/net/tun exists and skip test otherwise
authorChristian Grothoff <christian@grothoff.org>
Mon, 30 Jan 2012 12:01:15 +0000 (12:01 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 30 Jan 2012 12:01:15 +0000 (12:01 +0000)
src/vpn/test_gnunet_vpn.c

index 2ef5f96e96fb9b3981918e25d6136f0d2c689464..4df9e7eb0ff151f4159da4545a1346f7f0ff843a 100644 (file)
@@ -476,6 +476,15 @@ main (int argc, char *const *argv)
     GNUNET_GETOPT_OPTION_END
   };
 
+  if (0 != ACCESS ("/dev/net/tun", R_OK))
+  {
+    GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
+                             "access",
+                             "/dev/net/tun");
+    fprintf (stderr,
+            "WARNING: System unable to run test, skipping.\n");
+    return 0;
+  }
   if ( (GNUNET_YES !=
        GNUNET_OS_check_helper_binary ("gnunet-helper-vpn")) ||
        (GNUNET_YES !=