From c526fb6819ff203838e5fa2b5905b5d9f6309380 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Tue, 30 Aug 2011 13:23:04 +0000 Subject: [PATCH] check if gnunet-nat-server is correctly installed --- src/nat/test_nat_test.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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", -- 2.25.1