diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-10-08 07:52:45 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-10-08 07:52:45 +0000 |
commit | 8eaf1e0ab2e3784c3ddd8c923e2bde7987bb12e0 (patch) | |
tree | 3cb05df6bfb059b7f4a7cf82c0bd8493469d847a | |
parent | a1c355ddb246a875bf5f576d2c200e86351d3abe (diff) | |
download | gnunet-8eaf1e0ab2e3784c3ddd8c923e2bde7987bb12e0.tar.gz gnunet-8eaf1e0ab2e3784c3ddd8c923e2bde7987bb12e0.zip |
-cleaning up arm test
-rw-r--r-- | src/arm/Makefile.am | 8 | ||||
-rw-r--r-- | src/arm/test_gnunet_service_arm.c (renamed from src/arm/test_gnunet_service_manager.c) | 39 |
2 files changed, 19 insertions, 28 deletions
diff --git a/src/arm/Makefile.am b/src/arm/Makefile.am index 035681ba6..76aec40b6 100644 --- a/src/arm/Makefile.am +++ b/src/arm/Makefile.am | |||
@@ -58,7 +58,7 @@ mockup_service_SOURCES = \ | |||
58 | check_PROGRAMS = \ | 58 | check_PROGRAMS = \ |
59 | test_arm_api \ | 59 | test_arm_api \ |
60 | test_exponential_backoff \ | 60 | test_exponential_backoff \ |
61 | test_gnunet_service_manager | 61 | test_gnunet_service_arm |
62 | 62 | ||
63 | check_SCRIPTS = \ | 63 | check_SCRIPTS = \ |
64 | test_gnunet_arm.py | 64 | test_gnunet_arm.py |
@@ -79,9 +79,9 @@ test_exponential_backoff_LDADD = \ | |||
79 | $(top_builddir)/src/arm/libgnunetarm.la \ | 79 | $(top_builddir)/src/arm/libgnunetarm.la \ |
80 | $(top_builddir)/src/util/libgnunetutil.la | 80 | $(top_builddir)/src/util/libgnunetutil.la |
81 | 81 | ||
82 | test_gnunet_service_manager_SOURCES = \ | 82 | test_gnunet_service_arm_SOURCES = \ |
83 | test_gnunet_service_manager.c | 83 | test_gnunet_service_arm.c |
84 | test_gnunet_service_manager_LDADD = \ | 84 | test_gnunet_service_arm_LDADD = \ |
85 | $(top_builddir)/src/arm/libgnunetarm.la \ | 85 | $(top_builddir)/src/arm/libgnunetarm.la \ |
86 | $(top_builddir)/src/util/libgnunetutil.la | 86 | $(top_builddir)/src/util/libgnunetutil.la |
87 | 87 | ||
diff --git a/src/arm/test_gnunet_service_manager.c b/src/arm/test_gnunet_service_arm.c index a126a6c94..56a2747d7 100644 --- a/src/arm/test_gnunet_service_manager.c +++ b/src/arm/test_gnunet_service_arm.c | |||
@@ -18,8 +18,8 @@ | |||
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @file arm/test_gnunet_service_manager.c (A mockup testcase, not functionally complete) | 21 | * @file arm/test_gnunet_service_arm.c |
22 | * @brief testcase for gnunet-service-manager.c | 22 | * @brief testcase for gnunet-service-arm.c; tests ARM by making it start the resolver |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "platform.h" | 25 | #include "platform.h" |
@@ -39,9 +39,6 @@ | |||
39 | 39 | ||
40 | static int ret = 1; | 40 | static int ret = 1; |
41 | 41 | ||
42 | |||
43 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | ||
44 | |||
45 | static struct GNUNET_ARM_Handle *arm; | 42 | static struct GNUNET_ARM_Handle *arm; |
46 | 43 | ||
47 | 44 | ||
@@ -109,35 +106,24 @@ static void | |||
109 | run (void *cls, char *const *args, const char *cfgfile, | 106 | run (void *cls, char *const *args, const char *cfgfile, |
110 | const struct GNUNET_CONFIGURATION_Handle *c) | 107 | const struct GNUNET_CONFIGURATION_Handle *c) |
111 | { | 108 | { |
112 | cfg = c; | 109 | arm = GNUNET_ARM_connect (c, NULL); |
113 | arm = GNUNET_ARM_connect (cfg, NULL); | ||
114 | GNUNET_ARM_start_service (arm, "arm", | 110 | GNUNET_ARM_start_service (arm, "arm", |
115 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, START_TIMEOUT, | 111 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, START_TIMEOUT, |
116 | &arm_notify, NULL); | 112 | &arm_notify, NULL); |
117 | } | 113 | } |
118 | 114 | ||
119 | 115 | ||
120 | static void | 116 | int |
121 | check () | 117 | main (int argc, char *argv[]) |
122 | { | 118 | { |
123 | char *const argv[] = { | 119 | static char *const argv[] = { |
124 | "test-gnunet-service-manager", | 120 | "test-gnunet-service-arm", |
125 | "-c", "test_arm_api_data.conf", | 121 | "-c", "test_arm_api_data.conf", |
126 | NULL | 122 | NULL |
127 | }; | 123 | }; |
128 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 124 | static struct GNUNET_GETOPT_CommandLineOption options[] = { |
129 | GNUNET_GETOPT_OPTION_END | 125 | GNUNET_GETOPT_OPTION_END |
130 | }; | 126 | }; |
131 | GNUNET_assert (GNUNET_OK == | ||
132 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, | ||
133 | argv, "test-gnunet-service-manager", | ||
134 | "nohelp", options, &run, NULL)); | ||
135 | } | ||
136 | |||
137 | |||
138 | int | ||
139 | main (int argc, char *argv[]) | ||
140 | { | ||
141 | char hostname[GNUNET_OS_get_hostname_max_length () + 1]; | 127 | char hostname[GNUNET_OS_get_hostname_max_length () + 1]; |
142 | 128 | ||
143 | if (0 != gethostname (hostname, sizeof (hostname) - 1)) | 129 | if (0 != gethostname (hostname, sizeof (hostname) - 1)) |
@@ -155,9 +141,14 @@ main (int argc, char *argv[]) | |||
155 | hostname); | 141 | hostname); |
156 | return 0; | 142 | return 0; |
157 | } | 143 | } |
158 | GNUNET_log_setup ("test-gnunet-service-manager", | 144 | GNUNET_log_setup ("test-gnunet-service-arm", |
159 | "WARNING", | 145 | "WARNING", |
160 | NULL); | 146 | NULL); |
161 | check (); | 147 | GNUNET_assert (GNUNET_OK == |
148 | GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, | ||
149 | argv, "test-gnunet-service-arm", | ||
150 | "nohelp", options, &run, NULL)); | ||
162 | return ret; | 151 | return ret; |
163 | } | 152 | } |
153 | |||
154 | /* end of test_gnunet_service_arm.c */ | ||