diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-05-11 11:50:43 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-05-11 11:50:43 +0000 |
commit | 807fcd3b31c5578551326d6fd643c7294b7979ca (patch) | |
tree | 31e06adabcbb28f9ae1dfba32b459ed57ff8344e /src | |
parent | 33890e032acc7c284e2ab82f2ccbc72ae8c2092f (diff) | |
download | gnunet-807fcd3b31c5578551326d6fd643c7294b7979ca.tar.gz gnunet-807fcd3b31c5578551326d6fd643c7294b7979ca.zip |
fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/arm/gnunet-service-arm.c | 1 | ||||
-rw-r--r-- | src/arm/gnunet-service-manager.c | 98 | ||||
-rw-r--r-- | src/arm/test_gnunet_service_manager.c | 153 |
3 files changed, 165 insertions, 87 deletions
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c index f38b6b044..71a2aa446 100644 --- a/src/arm/gnunet-service-arm.c +++ b/src/arm/gnunet-service-arm.c | |||
@@ -749,6 +749,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
749 | #if DEBUG_ARM | 749 | #if DEBUG_ARM |
750 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Stopping all services\n")); | 750 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Stopping all services\n")); |
751 | #endif | 751 | #endif |
752 | stop_listening (NULL); | ||
752 | in_shutdown = GNUNET_YES; | 753 | in_shutdown = GNUNET_YES; |
753 | pos = running; | 754 | pos = running; |
754 | while (NULL != pos) | 755 | while (NULL != pos) |
diff --git a/src/arm/gnunet-service-manager.c b/src/arm/gnunet-service-manager.c index c80c12aa5..a632fea49 100644 --- a/src/arm/gnunet-service-manager.c +++ b/src/arm/gnunet-service-manager.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2009 Christian Grothoff (and other contributing authors) | 3 | (C) 2009, 2010 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -176,26 +176,28 @@ isInDefaultList (const char *serviceName) | |||
176 | static void | 176 | static void |
177 | closeClientAndServiceSockets (struct ForwardedConnection *fc, int reason) | 177 | closeClientAndServiceSockets (struct ForwardedConnection *fc, int reason) |
178 | { | 178 | { |
179 | if (NULL != fc->armClientSocket) | 179 | if ( (0 != (REASON_SERVICE & reason)) && |
180 | (fc->clientReceivingTask != GNUNET_SCHEDULER_NO_TASK) ) | ||
180 | { | 181 | { |
181 | if (0 != (REASON_SERVICE & reason)) | 182 | GNUNET_SCHEDULER_cancel (scheduler, fc->clientReceivingTask); |
182 | GNUNET_SCHEDULER_cancel (scheduler, fc->clientReceivingTask); | 183 | fc->clientReceivingTask = GNUNET_SCHEDULER_NO_TASK; |
183 | if (GNUNET_SYSERR == | ||
184 | GNUNET_NETWORK_socket_close (fc->armClientSocket)) | ||
185 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "close"); | ||
186 | fc->armClientSocket = NULL; | ||
187 | } | 184 | } |
188 | if (NULL != fc->armServiceSocket) | 185 | if ( (0 != (REASON_CLIENT & reason)) && |
186 | (fc->serviceReceivingTask != GNUNET_SCHEDULER_NO_TASK) ) | ||
189 | { | 187 | { |
190 | if (0 != (REASON_CLIENT & reason)) | 188 | GNUNET_SCHEDULER_cancel (scheduler, |
191 | GNUNET_SCHEDULER_cancel (scheduler, | 189 | fc->serviceReceivingTask); |
192 | fc->serviceReceivingTask); | 190 | fc->serviceReceivingTask = GNUNET_SCHEDULER_NO_TASK; |
193 | |||
194 | if (GNUNET_SYSERR == | ||
195 | GNUNET_NETWORK_socket_close (fc->armServiceSocket)) | ||
196 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "close"); | ||
197 | fc->armServiceSocket = NULL; | ||
198 | } | 191 | } |
192 | if ( (fc->clientReceivingTask != GNUNET_SCHEDULER_NO_TASK) || | ||
193 | (fc->serviceReceivingTask != GNUNET_SCHEDULER_NO_TASK) ) | ||
194 | return; | ||
195 | if (GNUNET_SYSERR == | ||
196 | GNUNET_NETWORK_socket_close (fc->armClientSocket)) | ||
197 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "close"); | ||
198 | if (GNUNET_SYSERR == | ||
199 | GNUNET_NETWORK_socket_close (fc->armServiceSocket)) | ||
200 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "close"); | ||
199 | GNUNET_free (fc->listen_info->serviceName); | 201 | GNUNET_free (fc->listen_info->serviceName); |
200 | GNUNET_free (fc->listen_info->service_addr); | 202 | GNUNET_free (fc->listen_info->service_addr); |
201 | GNUNET_free (fc->listen_info); | 203 | GNUNET_free (fc->listen_info); |
@@ -222,12 +224,14 @@ forwardToClient (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
222 | struct ForwardedConnection *fc = cls; | 224 | struct ForwardedConnection *fc = cls; |
223 | ssize_t numberOfBytesSent; | 225 | ssize_t numberOfBytesSent; |
224 | 226 | ||
227 | fc->serviceReceivingTask = GNUNET_SCHEDULER_NO_TASK; | ||
225 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) | 228 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) |
226 | { | 229 | { |
227 | /* Ignore shutdown signal, reschedule yourself */ | 230 | /* Ignore shutdown signal, reschedule yourself */ |
228 | GNUNET_SCHEDULER_add_write_net (scheduler, GNUNET_TIME_UNIT_FOREVER_REL, | 231 | fc->serviceReceivingTask = |
229 | fc->armClientSocket, | 232 | GNUNET_SCHEDULER_add_write_net (scheduler, GNUNET_TIME_UNIT_FOREVER_REL, |
230 | &forwardToClient, fc); | 233 | fc->armClientSocket, |
234 | &forwardToClient, fc); | ||
231 | return; | 235 | return; |
232 | } | 236 | } |
233 | 237 | ||
@@ -250,9 +254,10 @@ forwardToClient (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
250 | fc->serviceBufferDataLength -= numberOfBytesSent; | 254 | fc->serviceBufferDataLength -= numberOfBytesSent; |
251 | 255 | ||
252 | /* Scheduling writing again for completing the remaining data to be sent */ | 256 | /* Scheduling writing again for completing the remaining data to be sent */ |
253 | GNUNET_SCHEDULER_add_write_net (scheduler, GNUNET_TIME_UNIT_FOREVER_REL, | 257 | fc->serviceReceivingTask = |
254 | fc->armClientSocket, | 258 | GNUNET_SCHEDULER_add_write_net (scheduler, GNUNET_TIME_UNIT_FOREVER_REL, |
255 | &forwardToClient, fc); | 259 | fc->armClientSocket, |
260 | &forwardToClient, fc); | ||
256 | } | 261 | } |
257 | else | 262 | else |
258 | { | 263 | { |
@@ -279,6 +284,7 @@ receiveFromService (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
279 | { | 284 | { |
280 | struct ForwardedConnection *fc = cls; | 285 | struct ForwardedConnection *fc = cls; |
281 | 286 | ||
287 | fc->serviceReceivingTask = GNUNET_SCHEDULER_NO_TASK; | ||
282 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) | 288 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) |
283 | { | 289 | { |
284 | /* Neglect shutdown signal, reschedule yourself */ | 290 | /* Neglect shutdown signal, reschedule yourself */ |
@@ -304,19 +310,21 @@ receiveFromService (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
304 | fc->listen_info->serviceName); | 310 | fc->listen_info->serviceName); |
305 | } | 311 | } |
306 | else | 312 | else |
307 | { | 313 | { |
308 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 314 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
309 | _("Error receiving from service: %s\n"), | 315 | _("Error receiving from service: %s\n"), |
310 | STRERROR (errno)); | 316 | STRERROR (errno)); |
317 | abort (); | ||
311 | } | 318 | } |
312 | closeClientAndServiceSockets (fc, REASON_SERVICE); | 319 | closeClientAndServiceSockets (fc, REASON_SERVICE); |
313 | return; | 320 | return; |
314 | } | 321 | } |
315 | 322 | ||
316 | /* Forwarding Service data to Client */ | 323 | /* Forwarding Service data to Client */ |
317 | GNUNET_SCHEDULER_add_write_net (scheduler, GNUNET_TIME_UNIT_FOREVER_REL, | 324 | fc->serviceReceivingTask = |
318 | fc->armClientSocket, | 325 | GNUNET_SCHEDULER_add_write_net (scheduler, GNUNET_TIME_UNIT_FOREVER_REL, |
319 | &forwardToClient, fc); | 326 | fc->armClientSocket, |
327 | &forwardToClient, fc); | ||
320 | } | 328 | } |
321 | 329 | ||
322 | 330 | ||
@@ -332,12 +340,14 @@ forwardToService (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
332 | struct ForwardedConnection *fc = cls; | 340 | struct ForwardedConnection *fc = cls; |
333 | ssize_t numberOfBytesSent; | 341 | ssize_t numberOfBytesSent; |
334 | 342 | ||
343 | fc->clientReceivingTask = GNUNET_SCHEDULER_NO_TASK; | ||
335 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) | 344 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) |
336 | { | 345 | { |
337 | /* Neglect shutdown signal, reschedule ourself */ | 346 | /* Neglect shutdown signal, reschedule ourself */ |
338 | GNUNET_SCHEDULER_add_write_net (scheduler, GNUNET_TIME_UNIT_FOREVER_REL, | 347 | fc->clientReceivingTask = |
339 | fc->armServiceSocket, | 348 | GNUNET_SCHEDULER_add_write_net (scheduler, GNUNET_TIME_UNIT_FOREVER_REL, |
340 | &forwardToService, fc); | 349 | fc->armServiceSocket, |
350 | &forwardToService, fc); | ||
341 | return; | 351 | return; |
342 | } | 352 | } |
343 | 353 | ||
@@ -361,9 +371,10 @@ forwardToService (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
361 | fc->clientBufferDataLength -= numberOfBytesSent; | 371 | fc->clientBufferDataLength -= numberOfBytesSent; |
362 | 372 | ||
363 | /* Scheduling writing again for completing the remaining data to be sent */ | 373 | /* Scheduling writing again for completing the remaining data to be sent */ |
364 | GNUNET_SCHEDULER_add_write_net (scheduler, GNUNET_TIME_UNIT_FOREVER_REL, | 374 | fc->clientReceivingTask = |
365 | fc->armServiceSocket, | 375 | GNUNET_SCHEDULER_add_write_net (scheduler, GNUNET_TIME_UNIT_FOREVER_REL, |
366 | &forwardToService, fc); | 376 | fc->armServiceSocket, |
377 | &forwardToService, fc); | ||
367 | } | 378 | } |
368 | else | 379 | else |
369 | { | 380 | { |
@@ -392,6 +403,7 @@ receiveFromClient (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
392 | { | 403 | { |
393 | struct ForwardedConnection *fc = cls; | 404 | struct ForwardedConnection *fc = cls; |
394 | 405 | ||
406 | fc->clientReceivingTask = GNUNET_SCHEDULER_NO_TASK; | ||
395 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) | 407 | if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) |
396 | { | 408 | { |
397 | /* Neglect the shutdown signal, schedule ourselves */ | 409 | /* Neglect the shutdown signal, schedule ourselves */ |
@@ -424,9 +436,10 @@ receiveFromClient (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
424 | } | 436 | } |
425 | 437 | ||
426 | /* Forwarding request to service */ | 438 | /* Forwarding request to service */ |
427 | GNUNET_SCHEDULER_add_write_net (scheduler, GNUNET_TIME_UNIT_FOREVER_REL, | 439 | fc->clientReceivingTask = |
428 | fc->armServiceSocket, | 440 | GNUNET_SCHEDULER_add_write_net (scheduler, GNUNET_TIME_UNIT_FOREVER_REL, |
429 | &forwardToService, fc); | 441 | fc->armServiceSocket, |
442 | &forwardToService, fc); | ||
430 | } | 443 | } |
431 | 444 | ||
432 | 445 | ||
@@ -512,9 +525,12 @@ void stop_listening (const char *serviceName) | |||
512 | while (NULL != (pos = next)) | 525 | while (NULL != (pos = next)) |
513 | { | 526 | { |
514 | next = pos->next; | 527 | next = pos->next; |
515 | if (strcmp (pos->serviceName, serviceName) != 0) | 528 | if ( (serviceName != NULL) && |
529 | (strcmp (pos->serviceName, serviceName) != 0) ) | ||
516 | continue; | 530 | continue; |
517 | GNUNET_SCHEDULER_cancel (scheduler, pos->acceptTask); | 531 | GNUNET_SCHEDULER_cancel (scheduler, pos->acceptTask); |
532 | fprintf (stderr, "Closing listening socket %p\n", | ||
533 | pos->listeningSocket); | ||
518 | GNUNET_NETWORK_socket_close (pos->listeningSocket); | 534 | GNUNET_NETWORK_socket_close (pos->listeningSocket); |
519 | GNUNET_CONTAINER_DLL_remove (serviceListeningInfoList_head, | 535 | GNUNET_CONTAINER_DLL_remove (serviceListeningInfoList_head, |
520 | serviceListeningInfoList_tail, | 536 | serviceListeningInfoList_tail, |
@@ -565,6 +581,8 @@ acceptConnection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
565 | serviceListeningInfo); | 581 | serviceListeningInfo); |
566 | return; | 582 | return; |
567 | } | 583 | } |
584 | fprintf (stderr, "Closing listening socket %p\n", | ||
585 | serviceListeningInfo->listeningSocket); | ||
568 | GNUNET_NETWORK_socket_close (serviceListeningInfo->listeningSocket); | 586 | GNUNET_NETWORK_socket_close (serviceListeningInfo->listeningSocket); |
569 | GNUNET_CONTAINER_DLL_remove (serviceListeningInfoList_head, | 587 | GNUNET_CONTAINER_DLL_remove (serviceListeningInfoList_head, |
570 | serviceListeningInfoList_tail, | 588 | serviceListeningInfoList_tail, |
@@ -599,9 +617,13 @@ createListeningSocket (struct sockaddr *sa, | |||
599 | { | 617 | { |
600 | case AF_INET: | 618 | case AF_INET: |
601 | socket = GNUNET_NETWORK_socket_create (PF_INET, SOCK_STREAM, 0); | 619 | socket = GNUNET_NETWORK_socket_create (PF_INET, SOCK_STREAM, 0); |
620 | fprintf (stderr, "IPv4 listening at %p\n", | ||
621 | socket); | ||
602 | break; | 622 | break; |
603 | case AF_INET6: | 623 | case AF_INET6: |
604 | socket = GNUNET_NETWORK_socket_create (PF_INET6, SOCK_STREAM, 0); | 624 | socket = GNUNET_NETWORK_socket_create (PF_INET6, SOCK_STREAM, 0); |
625 | fprintf (stderr, "IPv6 listening at %p\n", | ||
626 | socket); | ||
605 | break; | 627 | break; |
606 | default: | 628 | default: |
607 | socket = NULL; | 629 | socket = NULL; |
@@ -708,3 +730,5 @@ prepareServices (const struct GNUNET_CONFIGURATION_Handle | |||
708 | /* Spot the services from the configuration and create a listening socket for each */ | 730 | /* Spot the services from the configuration and create a listening socket for each */ |
709 | GNUNET_CONFIGURATION_iterate (cfg, &checkPortNumberCB, NULL); | 731 | GNUNET_CONFIGURATION_iterate (cfg, &checkPortNumberCB, NULL); |
710 | } | 732 | } |
733 | |||
734 | /* end of gnunet-service-manager.c */ | ||
diff --git a/src/arm/test_gnunet_service_manager.c b/src/arm/test_gnunet_service_manager.c index 2d39e392a..d0c29ded5 100644 --- a/src/arm/test_gnunet_service_manager.c +++ b/src/arm/test_gnunet_service_manager.c | |||
@@ -27,80 +27,133 @@ | |||
27 | #include "gnunet_resolver_service.h" | 27 | #include "gnunet_resolver_service.h" |
28 | #include "gnunet_program_lib.h" | 28 | #include "gnunet_program_lib.h" |
29 | 29 | ||
30 | /** | ||
31 | * Timeout for starting services, very short because of the strange way start works | ||
32 | * (by checking if running before starting, so really this time is always waited on | ||
33 | * startup (annoying)). | ||
34 | */ | ||
35 | #define START_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 50) | ||
36 | |||
30 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) | 37 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) |
31 | 38 | ||
32 | /* Global Variables */ | 39 | #define START_ARM GNUNET_YES |
33 | static int isOK = GNUNET_OK; | 40 | |
41 | static int ret = 1; | ||
42 | |||
43 | static struct GNUNET_SCHEDULER_Handle *sched; | ||
44 | |||
45 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | ||
46 | |||
47 | static struct GNUNET_ARM_Handle *arm; | ||
48 | |||
49 | static void | ||
50 | arm_stopped (void *cls, int success) | ||
51 | { | ||
52 | if (success != GNUNET_OK) | ||
53 | ret = 4; | ||
54 | } | ||
34 | 55 | ||
35 | static void | 56 | static void |
36 | hostNameResolveCB(void *cls, | 57 | hostNameResolveCB(void *cls, |
37 | const struct sockaddr *addr, | 58 | const struct sockaddr *addr, |
38 | socklen_t addrlen) | 59 | socklen_t addrlen) |
39 | { | 60 | { |
40 | if (NULL == addr) | 61 | if ( (ret == 0) || (ret == 4) ) |
41 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Name not resolved!\n"); | 62 | return; |
63 | if (NULL == addr) | ||
64 | { | ||
65 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, | ||
66 | "Name not resolved!\n"); | ||
67 | #if START_ARM | ||
68 | GNUNET_ARM_stop_service (arm, "arm", TIMEOUT, &arm_stopped, NULL); | ||
69 | #endif | ||
70 | ret = 3; | ||
71 | return; | ||
72 | } | ||
73 | ret = 0; | ||
74 | #if START_ARM | ||
75 | GNUNET_ARM_stop_service (arm, "arm", TIMEOUT, &arm_stopped, NULL); | ||
76 | #endif | ||
77 | } | ||
78 | |||
79 | |||
80 | |||
81 | static void | ||
82 | arm_notify (void *cls, int success) | ||
83 | { | ||
84 | if (success != GNUNET_YES) | ||
85 | { | ||
86 | GNUNET_break (0); | ||
87 | ret = 1; | ||
88 | return; | ||
89 | } | ||
90 | /* connect to the resolver service */ | ||
91 | if (NULL == GNUNET_RESOLVER_hostname_resolve (sched, | ||
92 | cfg, AF_UNSPEC, | ||
93 | TIMEOUT, | ||
94 | &hostNameResolveCB, | ||
95 | NULL)) | ||
96 | { | ||
97 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
98 | "Unable to resolve our own hostname!\n"); | ||
99 | ret = 2; | ||
100 | #if START_ARM | ||
101 | GNUNET_ARM_stop_service (arm, "arm", TIMEOUT, &arm_stopped, NULL); | ||
102 | #endif | ||
103 | } | ||
42 | } | 104 | } |
43 | 105 | ||
44 | 106 | ||
45 | static void | 107 | static void |
46 | run(void *cls, | 108 | run(void *cls, |
47 | struct GNUNET_SCHEDULER_Handle *sched, | 109 | struct GNUNET_SCHEDULER_Handle *s, |
48 | char * const *args, | 110 | char * const *args, |
49 | const char *cfgfile, | 111 | const char *cfgfile, |
50 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 112 | const struct GNUNET_CONFIGURATION_Handle *c) |
51 | { | 113 | { |
52 | struct GNUNET_RESOLVER_RequestHandle *resolveRet; | 114 | cfg = c; |
53 | 115 | sched = s; | |
54 | /* connect to the resolver service */ | 116 | arm = GNUNET_ARM_connect (cfg, sched, NULL); |
55 | resolveRet = | 117 | #if START_ARM |
56 | GNUNET_RESOLVER_hostname_resolve (sched, | 118 | GNUNET_ARM_start_service (arm, "arm", START_TIMEOUT, &arm_notify, NULL); |
57 | cfg, AF_UNSPEC, | 119 | #else |
58 | TIMEOUT, | 120 | arm_notify (NULL, GNUNET_YES); |
59 | &hostNameResolveCB, | 121 | #endif |
60 | NULL); | ||
61 | if (NULL == resolveRet) { | ||
62 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Unable to resolve our own hostname!\n"); | ||
63 | isOK = GNUNET_NO; | ||
64 | } | ||
65 | } | 122 | } |
66 | 123 | ||
67 | 124 | ||
68 | static int | 125 | static void |
69 | check() | 126 | check() |
70 | { | 127 | { |
71 | char *const argv[] = { | 128 | char *const argv[] = { |
72 | "test-gnunet-service-manager", | 129 | "test-gnunet-service-manager", |
73 | "-c", "test_arm_api_data.conf", | 130 | "-c", "test_arm_api_data.conf", |
74 | #if VERBOSE | 131 | #if VERBOSE |
75 | "-L", "DEBUG", | 132 | "-L", "DEBUG", |
76 | #endif | 133 | #endif |
77 | NULL | 134 | NULL |
78 | }; | 135 | }; |
79 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 136 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
80 | GNUNET_GETOPT_OPTION_END | 137 | GNUNET_GETOPT_OPTION_END |
81 | }; | 138 | }; |
82 | 139 | GNUNET_assert (GNUNET_OK == | |
83 | /* Running ARM and running the do_nothing task */ | 140 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, |
84 | GNUNET_assert (GNUNET_OK == | 141 | argv, |
85 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, | 142 | "test-gnunet-service-manager", |
86 | argv, | 143 | "nohelp", options, &run, NULL)); |
87 | "test-gnunet-service-manager", | ||
88 | "nohelp", options, &run, NULL)); | ||
89 | return isOK; | ||
90 | } | 144 | } |
91 | 145 | ||
92 | 146 | ||
93 | int | 147 | int |
94 | main (int argc, char *argv[]) | 148 | main (int argc, char *argv[]) |
95 | { | 149 | { |
96 | int ret; | ||
97 | GNUNET_log_setup("test-gnunet-service-manager", | 150 | GNUNET_log_setup("test-gnunet-service-manager", |
98 | #if VERBOSE | 151 | #if VERBOSE |
99 | "DEBUG", | 152 | "DEBUG", |
100 | #else | 153 | #else |
101 | "WARNING", | 154 | "WARNING", |
102 | #endif | 155 | #endif |
103 | NULL); | 156 | NULL); |
104 | ret = check(); | 157 | check(); |
105 | return ret; | 158 | return ret; |
106 | } | 159 | } |