From: Matthias Wachs Date: Tue, 30 Aug 2011 13:23:04 +0000 (+0000) Subject: check if gnunet-nat-server is correctly installed X-Git-Tag: initial-import-from-subversion-38251~17279 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c526fb6819ff203838e5fa2b5905b5d9f6309380;p=oweals%2Fgnunet.git check if gnunet-nat-server is correctly installed --- 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",