summaryrefslogtreecommitdiff
path: root/src/nat/test_nat_test.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-08-30 13:23:04 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-08-30 13:23:04 +0000
commitc526fb6819ff203838e5fa2b5905b5d9f6309380 (patch)
tree8bbb8494e6934213c1be45f8c9bb2c7840e06bb3 /src/nat/test_nat_test.c
parentb49e9a9daaf7d7b3ad02c7494fe7b570dea3bf92 (diff)
check if gnunet-nat-server is correctly installed
Diffstat (limited to 'src/nat/test_nat_test.c')
-rw-r--r--src/nat/test_nat_test.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/nat/test_nat_test.c b/src/nat/test_nat_test.c
index b8db301aa..5a716bd8e 100644
--- a/src/nat/test_nat_test.c
+++ b/src/nat/test_nat_test.c
@@ -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,25 @@ main (int argc, char *const argv[])
"WARNING",
#endif
NULL);
+
+ nat_res = GNUNET_OS_check_helper_binary ("gnunet-nat-server");
+ if (GNUNET_NO == nat_res)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Cannot run NAT test: `%s' %s \n",
+ "gnunet-nat-server",
+ "SUID not set");
+ return 0;
+ }
+ if (GNUNET_SYSERR == nat_res)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Cannot run NAT test: `%s' %s \n",
+ "gnunet-nat-server",
+ "file not found");
+ return 0;
+ }
+
gns =
GNUNET_OS_start_process (NULL, NULL, "gnunet-nat-server",
"gnunet-nat-server",