aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2023-11-09 18:03:44 +0100
committert3sserakt <t3ss@posteo.de>2023-11-09 18:03:44 +0100
commit03e7efb9f11a123906b4e2138dbb4f435373136d (patch)
tree4c0368113020cd97e7406e27a74c2deb3c3fb1ee
parentc00dfd8e42af7df167c71f75866d4485c767a7da (diff)
parent367265e42f2cb84b944967434d0ef2a27daae1e3 (diff)
downloadgnunet-03e7efb9f11a123906b4e2138dbb4f435373136d.tar.gz
gnunet-03e7efb9f11a123906b4e2138dbb4f435373136d.zip
Merge branch 'master' of ssh://git.gnunet.org/gnunet
-rw-r--r--data/hellos/EFBZMC2ME19SE00QCSF6X4405EQ2NPBG2XKRA1FEM6S3WRQ6N4H0bin248 -> 248 bytes
-rw-r--r--meson.build1
-rw-r--r--src/plugin/namestore/Makefile.am360
-rw-r--r--src/plugin/namestore/meson.build27
-rw-r--r--src/plugin/namestore/test_plugin_namestore.c5
-rw-r--r--src/service/arm/gnunet-service-arm.c2
-rw-r--r--src/service/dht/gnunet-service-dht.c15
-rw-r--r--src/service/namestore/Makefile.am347
-rw-r--r--src/service/namestore/meson.build59
-rw-r--r--src/service/namestore/perf_namestore_api_import.c (renamed from src/plugin/namestore/perf_namestore_api_import.c)4
-rw-r--r--src/service/namestore/perf_namestore_api_postgres.conf (renamed from src/plugin/namestore/perf_namestore_api_postgres.conf)0
-rw-r--r--src/service/namestore/perf_namestore_api_sqlite.conf (renamed from src/plugin/namestore/perf_namestore_api_sqlite.conf)0
-rw-r--r--src/service/namestore/perf_namestore_api_zone_iteration.c (renamed from src/plugin/namestore/perf_namestore_api_zone_iteration.c)4
-rw-r--r--src/service/namestore/test_common.c (renamed from src/plugin/namestore/test_common.c)0
-rw-r--r--src/service/namestore/test_namestore_api.conf (renamed from src/plugin/namestore/test_namestore_api.conf)4
-rw-r--r--src/service/namestore/test_namestore_api_edit_records.c (renamed from src/plugin/namestore/test_namestore_api_edit_records.c)2
-rw-r--r--src/service/namestore/test_namestore_api_lookup_nick.c (renamed from src/plugin/namestore/test_namestore_api_lookup_nick.c)2
-rw-r--r--src/service/namestore/test_namestore_api_monitoring.c (renamed from src/plugin/namestore/test_namestore_api_monitoring.c)4
-rw-r--r--src/service/namestore/test_namestore_api_monitoring_existing.c (renamed from src/plugin/namestore/test_namestore_api_monitoring_existing.c)4
-rw-r--r--src/service/namestore/test_namestore_api_postgres.conf (renamed from src/plugin/namestore/test_namestore_api_postgres.conf)0
-rw-r--r--src/service/namestore/test_namestore_api_remove.c (renamed from src/plugin/namestore/test_namestore_api_remove.c)2
-rw-r--r--src/service/namestore/test_namestore_api_remove_not_existing_record.c (renamed from src/plugin/namestore/test_namestore_api_remove_not_existing_record.c)2
-rw-r--r--src/service/namestore/test_namestore_api_sqlite.conf (renamed from src/plugin/namestore/test_namestore_api_sqlite.conf)0
-rw-r--r--src/service/namestore/test_namestore_api_store.c (renamed from src/plugin/namestore/test_namestore_api_store.c)2
-rw-r--r--src/service/namestore/test_namestore_api_store_update.c (renamed from src/plugin/namestore/test_namestore_api_store_update.c)17
-rw-r--r--src/service/namestore/test_namestore_api_tx_rollback.c (renamed from src/plugin/namestore/test_namestore_api_tx_rollback.c)2
-rw-r--r--src/service/namestore/test_namestore_api_zone_iteration.c (renamed from src/plugin/namestore/test_namestore_api_zone_iteration.c)4
-rw-r--r--src/service/namestore/test_namestore_api_zone_iteration_nick.c (renamed from src/plugin/namestore/test_namestore_api_zone_iteration_nick.c)4
-rw-r--r--src/service/namestore/test_namestore_api_zone_iteration_specific_zone.c (renamed from src/plugin/namestore/test_namestore_api_zone_iteration_specific_zone.c)4
-rw-r--r--src/service/namestore/test_namestore_api_zone_iteration_stop.c (renamed from src/plugin/namestore/test_namestore_api_zone_iteration_stop.c)4
-rw-r--r--src/service/namestore/test_namestore_api_zone_to_name.c (renamed from src/plugin/namestore/test_namestore_api_zone_to_name.c)4
-rw-r--r--src/service/peerstore/gnunet-service-peerstore.c12
-rw-r--r--src/service/testing/testing_api_loop.c57
-rw-r--r--src/service/transport/gnunet-service-transport.c22
-rw-r--r--src/service/util/meson.build13
-rw-r--r--src/service/util/test_resolver_api.c2
36 files changed, 556 insertions, 435 deletions
diff --git a/data/hellos/EFBZMC2ME19SE00QCSF6X4405EQ2NPBG2XKRA1FEM6S3WRQ6N4H0 b/data/hellos/EFBZMC2ME19SE00QCSF6X4405EQ2NPBG2XKRA1FEM6S3WRQ6N4H0
index d0c2e320b..78a0d9721 100644
--- a/data/hellos/EFBZMC2ME19SE00QCSF6X4405EQ2NPBG2XKRA1FEM6S3WRQ6N4H0
+++ b/data/hellos/EFBZMC2ME19SE00QCSF6X4405EQ2NPBG2XKRA1FEM6S3WRQ6N4H0
Binary files differ
diff --git a/meson.build b/meson.build
index ba9e4b3c9..39ac14eb8 100644
--- a/meson.build
+++ b/meson.build
@@ -420,6 +420,7 @@ pkg = import('pkgconfig')
420subdir('src') 420subdir('src')
421subdir('doc') 421subdir('doc')
422subdir('contrib') 422subdir('contrib')
423subdir('data')
423 424
424meson.add_dist_script('meson-dist-script') 425meson.add_dist_script('meson-dist-script')
425 426
diff --git a/src/plugin/namestore/Makefile.am b/src/plugin/namestore/Makefile.am
index 03b743d7a..3db174225 100644
--- a/src/plugin/namestore/Makefile.am
+++ b/src/plugin/namestore/Makefile.am
@@ -19,62 +19,7 @@ if USE_COVERAGE
19endif 19endif
20 20
21 21
22if HAVE_SQLITE
23SQLITE_PLUGIN = libgnunet_plugin_namestore_sqlite.la
24SQLITE_TESTS = test_plugin_namestore_sqlite \
25 test_namestore_api_store_sqlite \
26 test_namestore_api_store_update_sqlite \
27 test_namestore_api_zone_iteration_sqlite \
28 test_namestore_api_remove_sqlite \
29 test_namestore_api_lookup_nick_sqlite \
30 test_namestore_api_monitoring_sqlite \
31 test_namestore_api_remove_not_existing_record_sqlite \
32 test_namestore_api_zone_iteration_nick_sqlite \
33 test_namestore_api_zone_iteration_specific_zone_sqlite \
34 test_namestore_api_zone_iteration_stop_sqlite \
35 test_namestore_api_monitoring_existing_sqlite \
36 test_namestore_api_zone_to_name_sqlite \
37 perf_namestore_api_zone_iteration_sqlite \
38 perf_namestore_api_import_sqlite \
39 perf_namestore_api_import_postgres \
40 test_namestore_api_tx_rollback_sqlite
41endif
42
43
44if HAVE_POSTGRESQL
45POSTGRES_PLUGIN = libgnunet_plugin_namestore_postgres.la
46POSTGRES_TESTS = test_plugin_namestore_postgres \
47 test_namestore_api_store_postgres \
48 test_namestore_api_store_update_postgres \
49 test_namestore_api_remove_postgres \
50 test_namestore_api_zone_iteration_postgres \
51 test_namestore_api_lookup_nick_postgres \
52 test_namestore_api_monitoring_postgres \
53 test_namestore_api_remove_not_existing_record_postgres \
54 test_namestore_api_zone_iteration_nick_postgres \
55 test_namestore_api_zone_iteration_specific_zone_postgres \
56 test_namestore_api_zone_iteration_stop_postgres \
57 test_namestore_api_monitoring_existing_postgres \
58 test_namestore_api_zone_to_name_postgres \
59 perf_namestore_api_zone_iteration_postgres \
60 test_namestore_api_tx_rollback_postgres
61if HAVE_EXPERIMENTAL
62POSTGRES_TESTS += test_namestore_api_edit_records_postgres
63endif
64endif
65
66if HAVE_SQLITE
67check_PROGRAMS = \
68 $(SQLITE_TESTS) \
69 $(POSTGRES_TESTS)
70endif
71 22
72if ENABLE_TEST_RUN
73AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
74TESTS = \
75 $(check_PROGRAMS) \
76 $(check_SCRIPTS)
77endif
78 23
79plugin_LTLIBRARIES = \ 24plugin_LTLIBRARIES = \
80 $(SQLITE_PLUGIN) \ 25 $(SQLITE_PLUGIN) \
@@ -101,311 +46,34 @@ libgnunet_plugin_namestore_postgres_la_LIBADD = \
101libgnunet_plugin_namestore_postgres_la_LDFLAGS = \ 46libgnunet_plugin_namestore_postgres_la_LDFLAGS = \
102 $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS) 47 $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS)
103 48
104test_namestore_api_store_sqlite_SOURCES = \ 49if HAVE_SQLITE
105 test_namestore_api_store.c 50SQLITE_PLUGIN = libgnunet_plugin_namestore_sqlite.la
106test_namestore_api_store_sqlite_LDADD = \ 51SQLITE_TESTS = test_plugin_namestore_sqlite
107 $(top_builddir)/src/service/testing/libgnunettesting.la \
108 $(top_builddir)/src/lib/util/libgnunetutil.la \
109 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
110 $(top_builddir)/src/service/identity/libgnunetidentity.la \
111 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
112
113test_namestore_api_store_postgres_SOURCES = \
114 test_namestore_api_store.c
115test_namestore_api_store_postgres_LDADD = \
116 $(top_builddir)/src/service/testing/libgnunettesting.la \
117 $(top_builddir)/src/lib/util/libgnunetutil.la \
118 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
119 $(top_builddir)/src/service/identity/libgnunetidentity.la \
120 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
121
122test_namestore_api_store_update_sqlite_SOURCES = \
123 test_namestore_api_store_update.c
124test_namestore_api_store_update_sqlite_LDADD = \
125 $(top_builddir)/src/service/testing/libgnunettesting.la \
126 $(top_builddir)/src/lib/util/libgnunetutil.la \
127 $(top_builddir)/src/service/identity/libgnunetidentity.la \
128 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
129 $(top_builddir)/src/service/namecache/libgnunetnamecache.la \
130 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
131
132test_namestore_api_store_update_postgres_SOURCES = \
133 test_namestore_api_store_update.c
134test_namestore_api_store_update_postgres_LDADD = \
135 $(top_builddir)/src/service/testing/libgnunettesting.la \
136 $(top_builddir)/src/lib/util/libgnunetutil.la \
137 $(top_builddir)/src/service/identity/libgnunetidentity.la \
138 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
139 $(top_builddir)/src/service/namecache/libgnunetnamecache.la \
140 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
141
142test_namestore_api_lookup_nick_sqlite_SOURCES = \
143 test_namestore_api_lookup_nick.c
144test_namestore_api_lookup_nick_sqlite_LDADD = \
145 $(top_builddir)/src/service/testing/libgnunettesting.la \
146 $(top_builddir)/src/lib/util/libgnunetutil.la \
147 $(top_builddir)/src/service/identity/libgnunetidentity.la \
148 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
149 $(top_builddir)/src/service/namecache/libgnunetnamecache.la \
150 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
151
152test_namestore_api_lookup_nick_postgres_SOURCES = \
153 test_namestore_api_lookup_nick.c
154test_namestore_api_lookup_nick_postgres_LDADD = \
155 $(top_builddir)/src/service/testing/libgnunettesting.la \
156 $(top_builddir)/src/lib/util/libgnunetutil.la \
157 $(top_builddir)/src/service/identity/libgnunetidentity.la \
158 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
159 $(top_builddir)/src/service/namecache/libgnunetnamecache.la \
160 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
161
162test_namestore_api_remove_sqlite_SOURCES = \
163 test_namestore_api_remove.c
164test_namestore_api_remove_sqlite_LDADD = \
165 $(top_builddir)/src/service/identity/libgnunetidentity.la \
166 $(top_builddir)/src/service/testing/libgnunettesting.la \
167 $(top_builddir)/src/lib/util/libgnunetutil.la \
168 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
169 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
170
171test_namestore_api_remove_postgres_SOURCES = \
172 test_namestore_api_remove.c
173test_namestore_api_remove_postgres_LDADD = \
174 $(top_builddir)/src/service/identity/libgnunetidentity.la \
175 $(top_builddir)/src/service/testing/libgnunettesting.la \
176 $(top_builddir)/src/lib/util/libgnunetutil.la \
177 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
178 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
179
180test_namestore_api_remove_not_existing_record_sqlite_SOURCES = \
181 test_namestore_api_remove_not_existing_record.c
182test_namestore_api_remove_not_existing_record_sqlite_LDADD = \
183 $(top_builddir)/src/service/testing/libgnunettesting.la \
184 $(top_builddir)/src/lib/util/libgnunetutil.la \
185 $(top_builddir)/src/service/identity/libgnunetidentity.la \
186 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
187 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
188
189test_namestore_api_remove_not_existing_record_postgres_SOURCES = \
190 test_namestore_api_remove_not_existing_record.c
191test_namestore_api_remove_not_existing_record_postgres_LDADD = \
192 $(top_builddir)/src/service/testing/libgnunettesting.la \
193 $(top_builddir)/src/service/identity/libgnunetidentity.la \
194 $(top_builddir)/src/lib/util/libgnunetutil.la \
195 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
196 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
197
198test_namestore_api_zone_to_name_sqlite_SOURCES = \
199 test_namestore_api_zone_to_name.c
200test_namestore_api_zone_to_name_sqlite_LDADD = \
201 $(top_builddir)/src/service/identity/libgnunetidentity.la \
202 $(top_builddir)/src/service/testing/libgnunettesting.la \
203 $(top_builddir)/src/lib/util/libgnunetutil.la \
204 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
205
206test_namestore_api_zone_to_name_postgres_SOURCES = \
207 test_namestore_api_zone_to_name.c
208test_namestore_api_zone_to_name_postgres_LDADD = \
209 $(top_builddir)/src/service/identity/libgnunetidentity.la \
210 $(top_builddir)/src/service/testing/libgnunettesting.la \
211 $(top_builddir)/src/lib/util/libgnunetutil.la \
212 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
213
214test_namestore_api_monitoring_sqlite_SOURCES = \
215 test_namestore_api_monitoring.c
216test_namestore_api_monitoring_sqlite_LDADD = \
217 $(top_builddir)/src/service/identity/libgnunetidentity.la \
218 $(top_builddir)/src/service/testing/libgnunettesting.la \
219 $(top_builddir)/src/service/namestore/libgnunetnamestore.la \
220 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
221 $(top_builddir)/src/lib/util/libgnunetutil.la
222
223test_namestore_api_monitoring_postgres_SOURCES = \
224 test_namestore_api_monitoring.c
225test_namestore_api_monitoring_postgres_LDADD = \
226 $(top_builddir)/src/service/testing/libgnunettesting.la \
227 $(top_builddir)/src/service/identity/libgnunetidentity.la \
228 $(top_builddir)/src/service/namestore/libgnunetnamestore.la \
229 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
230 $(top_builddir)/src/lib/util/libgnunetutil.la
231
232test_namestore_api_monitoring_existing_sqlite_SOURCES = \
233 test_namestore_api_monitoring_existing.c
234test_namestore_api_monitoring_existing_sqlite_LDADD = \
235 $(top_builddir)/src/service/testing/libgnunettesting.la \
236 $(top_builddir)/src/service/identity/libgnunetidentity.la \
237 $(top_builddir)/src/service/namestore/libgnunetnamestore.la \
238 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
239 $(top_builddir)/src/lib/util/libgnunetutil.la
240
241test_namestore_api_monitoring_existing_postgres_SOURCES = \
242 test_namestore_api_monitoring_existing.c
243test_namestore_api_monitoring_existing_postgres_LDADD = \
244 $(top_builddir)/src/service/testing/libgnunettesting.la \
245 $(top_builddir)/src/service/namestore/libgnunetnamestore.la \
246 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
247 $(top_builddir)/src/service/identity/libgnunetidentity.la \
248 $(top_builddir)/src/lib/util/libgnunetutil.la
249
250test_namestore_api_tx_rollback_sqlite_SOURCES = \
251 test_namestore_api_tx_rollback.c
252test_namestore_api_tx_rollback_sqlite_LDADD = \
253 $(top_builddir)/src/service/testing/libgnunettesting.la \
254 $(top_builddir)/src/service/identity/libgnunetidentity.la \
255 $(top_builddir)/src/service/namestore/libgnunetnamestore.la \
256 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
257 $(top_builddir)/src/lib/util/libgnunetutil.la
258
259test_namestore_api_tx_rollback_postgres_SOURCES = \
260 test_namestore_api_tx_rollback.c
261test_namestore_api_tx_rollback_postgres_LDADD = \
262 $(top_builddir)/src/service/testing/libgnunettesting.la \
263 $(top_builddir)/src/service/identity/libgnunetidentity.la \
264 $(top_builddir)/src/service/namestore/libgnunetnamestore.la \
265 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
266 $(top_builddir)/src/lib/util/libgnunetutil.la
267
268if HAVE_EXPERIMENTAL
269test_namestore_api_edit_records_postgres_SOURCES = \
270 test_namestore_api_edit_records.c
271test_namestore_api_edit_records_postgres_LDADD = \
272 $(top_builddir)/src/service/testing/libgnunettesting.la \
273 $(top_builddir)/src/service/identity/libgnunetidentity.la \
274 $(top_builddir)/src/service/namestore/libgnunetnamestore.la \
275 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
276 $(top_builddir)/src/lib/util/libgnunetutil.la
277endif 52endif
278 53
279test_namestore_api_zone_iteration_sqlite_SOURCES = \
280 test_namestore_api_zone_iteration.c
281test_namestore_api_zone_iteration_sqlite_LDADD = \
282 $(top_builddir)/src/service/testing/libgnunettesting.la \
283 $(top_builddir)/src/service/identity/libgnunetidentity.la \
284 $(top_builddir)/src/lib/util/libgnunetutil.la \
285 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
286 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
287
288test_namestore_api_zone_iteration_postgres_SOURCES = \
289 test_namestore_api_zone_iteration.c
290test_namestore_api_zone_iteration_postgres_LDADD = \
291 $(top_builddir)/src/service/testing/libgnunettesting.la \
292 $(top_builddir)/src/service/identity/libgnunetidentity.la \
293 $(top_builddir)/src/lib/util/libgnunetutil.la \
294 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
295 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
296
297perf_namestore_api_zone_iteration_postgres_SOURCES = \
298 perf_namestore_api_zone_iteration.c
299perf_namestore_api_zone_iteration_postgres_LDADD = \
300 $(top_builddir)/src/service/testing/libgnunettesting.la \
301 $(top_builddir)/src/lib/util/libgnunetutil.la \
302 $(top_builddir)/src/service/identity/libgnunetidentity.la \
303 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
304 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
305
306perf_namestore_api_import_sqlite_SOURCES = \
307 perf_namestore_api_import.c
308perf_namestore_api_import_sqlite_LDADD = \
309 $(top_builddir)/src/service/testing/libgnunettesting.la \
310 $(top_builddir)/src/lib/util/libgnunetutil.la \
311 $(top_builddir)/src/service/identity/libgnunetidentity.la \
312 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
313 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
314
315perf_namestore_api_import_postgres_SOURCES = \
316 perf_namestore_api_import.c
317perf_namestore_api_import_postgres_LDADD = \
318 $(top_builddir)/src/service/testing/libgnunettesting.la \
319 $(top_builddir)/src/lib/util/libgnunetutil.la \
320 $(top_builddir)/src/service/identity/libgnunetidentity.la \
321 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
322 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
323
324 54
325perf_namestore_api_zone_iteration_sqlite_SOURCES = \ 55if HAVE_POSTGRESQL
326 perf_namestore_api_zone_iteration.c 56POSTGRES_PLUGIN = libgnunet_plugin_namestore_postgres.la
327perf_namestore_api_zone_iteration_sqlite_LDADD = \ 57POSTGRES_TESTS = test_plugin_namestore_postgres
328 $(top_builddir)/src/service/testing/libgnunettesting.la \ 58endif
329 $(top_builddir)/src/service/identity/libgnunetidentity.la \ 59if HAVE_SQLITE
330 $(top_builddir)/src/lib/util/libgnunetutil.la \ 60check_PROGRAMS = \
331 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \ 61 $(SQLITE_TESTS) \
332 $(top_builddir)/src/service/namestore/libgnunetnamestore.la 62 $(POSTGRES_TESTS)
333 63endif
334test_namestore_api_zone_iteration_nick_sqlite_SOURCES = \
335 test_namestore_api_zone_iteration_nick.c
336test_namestore_api_zone_iteration_nick_sqlite_LDADD = \
337 $(top_builddir)/src/service/testing/libgnunettesting.la \
338 $(top_builddir)/src/service/identity/libgnunetidentity.la \
339 $(top_builddir)/src/lib/util/libgnunetutil.la \
340 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
341 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
342
343test_namestore_api_zone_iteration_nick_postgres_SOURCES = \
344 test_namestore_api_zone_iteration_nick.c
345test_namestore_api_zone_iteration_nick_postgres_LDADD = \
346 $(top_builddir)/src/service/testing/libgnunettesting.la \
347 $(top_builddir)/src/service/identity/libgnunetidentity.la \
348 $(top_builddir)/src/lib/util/libgnunetutil.la \
349 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
350 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
351
352test_namestore_api_zone_iteration_specific_zone_sqlite_SOURCES = \
353 test_namestore_api_zone_iteration_specific_zone.c
354test_namestore_api_zone_iteration_specific_zone_sqlite_LDADD = \
355 $(top_builddir)/src/service/testing/libgnunettesting.la \
356 $(top_builddir)/src/service/identity/libgnunetidentity.la \
357 $(top_builddir)/src/lib/util/libgnunetutil.la \
358 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
359 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
360
361test_namestore_api_zone_iteration_specific_zone_postgres_SOURCES = \
362 test_namestore_api_zone_iteration_specific_zone.c
363test_namestore_api_zone_iteration_specific_zone_postgres_LDADD = \
364 $(top_builddir)/src/service/testing/libgnunettesting.la \
365 $(top_builddir)/src/service/identity/libgnunetidentity.la \
366 $(top_builddir)/src/lib/util/libgnunetutil.la \
367 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
368 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
369
370test_namestore_api_zone_iteration_stop_sqlite_SOURCES = \
371 test_namestore_api_zone_iteration_stop.c
372test_namestore_api_zone_iteration_stop_sqlite_LDADD = \
373 $(top_builddir)/src/service/testing/libgnunettesting.la \
374 $(top_builddir)/src/service/identity/libgnunetidentity.la \
375 $(top_builddir)/src/lib/util/libgnunetutil.la \
376 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
377 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
378
379test_namestore_api_zone_iteration_stop_postgres_SOURCES = \
380 test_namestore_api_zone_iteration_stop.c
381test_namestore_api_zone_iteration_stop_postgres_LDADD = \
382 $(top_builddir)/src/service/testing/libgnunettesting.la \
383 $(top_builddir)/src/service/identity/libgnunetidentity.la \
384 $(top_builddir)/src/lib/util/libgnunetutil.la \
385 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
386 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
387 64
388test_plugin_namestore_sqlite_SOURCES = \ 65test_plugin_namestore_sqlite_SOURCES = \
389 test_plugin_namestore.c 66 test_plugin_namestore.c
390test_plugin_namestore_sqlite_LDADD = \ 67test_plugin_namestore_sqlite_LDADD = \
391 $(top_builddir)/src/service/testing/libgnunettesting.la \
392 $(top_builddir)/src/service/identity/libgnunetidentity.la \
393 $(top_builddir)/src/lib/util/libgnunetutil.la 68 $(top_builddir)/src/lib/util/libgnunetutil.la
394 69
395test_plugin_namestore_postgres_SOURCES = \ 70test_plugin_namestore_postgres_SOURCES = \
396 test_plugin_namestore.c 71 test_plugin_namestore.c
397test_plugin_namestore_postgres_LDADD = \ 72test_plugin_namestore_postgres_LDADD = \
398 $(top_builddir)/src/service/identity/libgnunetidentity.la \
399 $(top_builddir)/src/service/testing/libgnunettesting.la \
400 $(top_builddir)/src/lib/util/libgnunetutil.la 73 $(top_builddir)/src/lib/util/libgnunetutil.la
401 74
402EXTRA_DIST = \ 75EXTRA_DIST = \
403 test_common.c \
404 test_namestore_api.conf \
405 test_namestore_api_postgres.conf \
406 test_namestore_api_sqlite.conf \
407 perf_namestore_api_postgres.conf \
408 perf_namestore_api_sqlite.conf \
409 test_plugin_namestore_sqlite.conf \ 76 test_plugin_namestore_sqlite.conf \
410 test_plugin_namestore_postgres.conf \ 77 test_plugin_namestore_postgres.conf \
411 $(sql_DATA) 78 $(sql_DATA)
79
diff --git a/src/plugin/namestore/meson.build b/src/plugin/namestore/meson.build
index d51b4b730..4a077915d 100644
--- a/src/plugin/namestore/meson.build
+++ b/src/plugin/namestore/meson.build
@@ -10,6 +10,10 @@ shared_module('gnunet_plugin_namestore_sqlite',
10 install: true, 10 install: true,
11 install_dir: get_option('libdir')/'gnunet') 11 install_dir: get_option('libdir')/'gnunet')
12 12
13configure_file(copy: true,
14 input: 'test_plugin_namestore_sqlite.conf',
15 output: 'test_plugin_namestore_sqlite.conf')
16
13if pq_dep.found() 17if pq_dep.found()
14 shared_module('gnunet_plugin_namestore_postgres', 18 shared_module('gnunet_plugin_namestore_postgres',
15 ['plugin_namestore_postgres.c'], 19 ['plugin_namestore_postgres.c'],
@@ -20,5 +24,28 @@ if pq_dep.found()
20 include_directories: [incdir, configuration_inc], 24 include_directories: [incdir, configuration_inc],
21 install: true, 25 install: true,
22 install_dir: get_option('libdir')/'gnunet') 26 install_dir: get_option('libdir')/'gnunet')
27configure_file(copy: true,
28 input: 'test_plugin_namestore_postgres.conf',
29 output: 'test_plugin_namestore_postgres.conf')
30
31 testpluginnamestore_pq = executable ('test_plugin_namestore_postgres',
32 ['test_plugin_namestore.c'],
33 dependencies: [
34 libgnunetutil_dep
35 ],
36 include_directories: [incdir, configuration_inc],
37 install: false)
38 test('test_plugin_namestore_postgres', testpluginnamestore_pq, workdir: meson.current_build_dir(),
39 suite: 'namestore')
23endif 40endif
24 41
42testpluginnamestore_sq = executable ('test_plugin_namestore_sqlite',
43 ['test_plugin_namestore.c'],
44 dependencies: [
45 libgnunetutil_dep
46 ],
47 include_directories: [incdir, configuration_inc],
48 install: false)
49test('test_plugin_namestore_sqlite', testpluginnamestore_sq, workdir: meson.current_build_dir(),
50 suite: 'namestore')
51
diff --git a/src/plugin/namestore/test_plugin_namestore.c b/src/plugin/namestore/test_plugin_namestore.c
index 388b23f57..d90651255 100644
--- a/src/plugin/namestore/test_plugin_namestore.c
+++ b/src/plugin/namestore/test_plugin_namestore.c
@@ -25,7 +25,6 @@
25#include "platform.h" 25#include "platform.h"
26#include "gnunet_util_lib.h" 26#include "gnunet_util_lib.h"
27#include "gnunet_namestore_plugin.h" 27#include "gnunet_namestore_plugin.h"
28#include "gnunet_testing_lib.h"
29 28
30#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT 29#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
31 30
@@ -36,7 +35,7 @@ static int ok;
36 */ 35 */
37static const char *plugin_name; 36static const char *plugin_name;
38 37
39 38#ifndef DARWIN // #5582
40/** 39/**
41 * Function called when the service shuts down. Unloads our namestore 40 * Function called when the service shuts down. Unloads our namestore
42 * plugin. 41 * plugin.
@@ -52,7 +51,7 @@ unload_plugin (struct GNUNET_NAMESTORE_PluginFunctions *api)
52 GNUNET_break (NULL == GNUNET_PLUGIN_unload (libname, api)); 51 GNUNET_break (NULL == GNUNET_PLUGIN_unload (libname, api));
53 GNUNET_free (libname); 52 GNUNET_free (libname);
54} 53}
55 54#endif
56 55
57/** 56/**
58 * Load the namestore plugin. 57 * Load the namestore plugin.
diff --git a/src/service/arm/gnunet-service-arm.c b/src/service/arm/gnunet-service-arm.c
index da94efdd8..5ecb1e80b 100644
--- a/src/service/arm/gnunet-service-arm.c
+++ b/src/service/arm/gnunet-service-arm.c
@@ -1120,7 +1120,7 @@ create_listen_socket (struct sockaddr *sa,
1120 GNUNET_free (sa); 1120 GNUNET_free (sa);
1121 return; 1121 return;
1122 } 1122 }
1123 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 1123 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1124 _ ("ARM now monitors connections to service `%s' at `%s'\n"), 1124 _ ("ARM now monitors connections to service `%s' at `%s'\n"),
1125 sl->name, 1125 sl->name,
1126 GNUNET_a2s (sa, addr_len)); 1126 GNUNET_a2s (sa, addr_len));
diff --git a/src/service/dht/gnunet-service-dht.c b/src/service/dht/gnunet-service-dht.c
index c3ce2f284..0689af9aa 100644
--- a/src/service/dht/gnunet-service-dht.c
+++ b/src/service/dht/gnunet-service-dht.c
@@ -24,6 +24,7 @@
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 * @author Nathan Evans 25 * @author Nathan Evans
26 */ 26 */
27#include "gnunet_common.h"
27#include "platform.h" 28#include "platform.h"
28#include "gnunet_block_lib.h" 29#include "gnunet_block_lib.h"
29#include "gnunet_util_lib.h" 30#include "gnunet_util_lib.h"
@@ -264,10 +265,21 @@ u_address_add (void *cls,
264{ 265{
265 struct GDS_Underlay *u = cls; 266 struct GDS_Underlay *u = cls;
266 struct MyAddress *a; 267 struct MyAddress *a;
268 enum GNUNET_GenericReturnValue add_success;
267 269
268 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 270 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
269 "Underlay adds address %s for this peer\n", 271 "Underlay adds address %s for this peer\n",
270 address); 272 address);
273 if (GNUNET_OK != (add_success = GNUNET_HELLO_builder_add_address (
274 GDS_my_hello,
275 address)))
276 {
277 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
278 "Adding address `%s' from underlay %s\n",
279 address,
280 GNUNET_NO == add_success ? "not done" : "failed");
281 return;
282 }
271 a = GNUNET_new (struct MyAddress); 283 a = GNUNET_new (struct MyAddress);
272 a->source = source; 284 a->source = source;
273 a->url = GNUNET_strdup (address); 285 a->url = GNUNET_strdup (address);
@@ -276,8 +288,7 @@ u_address_add (void *cls,
276 a_tail, 288 a_tail,
277 a); 289 a);
278 *ctx = a; 290 *ctx = a;
279 GNUNET_HELLO_builder_add_address (GDS_my_hello, 291
280 address);
281 if (NULL != hello_task) 292 if (NULL != hello_task)
282 GNUNET_SCHEDULER_cancel (hello_task); 293 GNUNET_SCHEDULER_cancel (hello_task);
283 hello_task = GNUNET_SCHEDULER_add_now (&broadcast_hello, 294 hello_task = GNUNET_SCHEDULER_add_now (&broadcast_hello,
diff --git a/src/service/namestore/Makefile.am b/src/service/namestore/Makefile.am
index 7f49e680f..d8f6a5318 100644
--- a/src/service/namestore/Makefile.am
+++ b/src/service/namestore/Makefile.am
@@ -61,3 +61,350 @@ gnunet_service_namestore_LDADD = \
61 $(top_builddir)/src/lib/util/libgnunetutil.la \ 61 $(top_builddir)/src/lib/util/libgnunetutil.la \
62 libgnunetnamestore.la \ 62 libgnunetnamestore.la \
63 $(GN_LIBINTL) 63 $(GN_LIBINTL)
64
65if HAVE_SQLITE
66SQLITE_TESTS = \
67 test_namestore_api_store_sqlite \
68 test_namestore_api_store_update_sqlite \
69 test_namestore_api_zone_iteration_sqlite \
70 test_namestore_api_remove_sqlite \
71 test_namestore_api_lookup_nick_sqlite \
72 test_namestore_api_monitoring_sqlite \
73 test_namestore_api_remove_not_existing_record_sqlite \
74 test_namestore_api_zone_iteration_nick_sqlite \
75 test_namestore_api_zone_iteration_specific_zone_sqlite \
76 test_namestore_api_zone_iteration_stop_sqlite \
77 test_namestore_api_monitoring_existing_sqlite \
78 test_namestore_api_zone_to_name_sqlite \
79 perf_namestore_api_zone_iteration_sqlite \
80 perf_namestore_api_import_sqlite \
81 perf_namestore_api_import_postgres \
82 test_namestore_api_tx_rollback_sqlite
83endif
84
85
86if HAVE_POSTGRESQL
87POSTGRES_TESTS = \
88 test_namestore_api_store_postgres \
89 test_namestore_api_store_update_postgres \
90 test_namestore_api_remove_postgres \
91 test_namestore_api_zone_iteration_postgres \
92 test_namestore_api_lookup_nick_postgres \
93 test_namestore_api_monitoring_postgres \
94 test_namestore_api_remove_not_existing_record_postgres \
95 test_namestore_api_zone_iteration_nick_postgres \
96 test_namestore_api_zone_iteration_specific_zone_postgres \
97 test_namestore_api_zone_iteration_stop_postgres \
98 test_namestore_api_monitoring_existing_postgres \
99 test_namestore_api_zone_to_name_postgres \
100 perf_namestore_api_zone_iteration_postgres \
101 test_namestore_api_tx_rollback_postgres
102if HAVE_EXPERIMENTAL
103POSTGRES_TESTS += test_namestore_api_edit_records_postgres
104endif
105endif
106
107check_PROGRAMS = \
108 $(SQLITE_TESTS) \
109 $(POSTGRES_TESTS)
110
111if ENABLE_TEST_RUN
112AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
113TESTS = \
114 $(check_PROGRAMS) \
115 $(check_SCRIPTS)
116endif
117
118test_namestore_api_store_sqlite_SOURCES = \
119 test_namestore_api_store.c
120test_namestore_api_store_sqlite_LDADD = \
121 $(top_builddir)/src/service/testing/libgnunettesting.la \
122 $(top_builddir)/src/lib/util/libgnunetutil.la \
123 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
124 $(top_builddir)/src/service/identity/libgnunetidentity.la \
125 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
126
127test_namestore_api_store_postgres_SOURCES = \
128 test_namestore_api_store.c
129test_namestore_api_store_postgres_LDADD = \
130 $(top_builddir)/src/service/testing/libgnunettesting.la \
131 $(top_builddir)/src/lib/util/libgnunetutil.la \
132 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
133 $(top_builddir)/src/service/identity/libgnunetidentity.la \
134 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
135
136test_namestore_api_store_update_sqlite_SOURCES = \
137 test_namestore_api_store_update.c
138test_namestore_api_store_update_sqlite_LDADD = \
139 $(top_builddir)/src/service/testing/libgnunettesting.la \
140 $(top_builddir)/src/lib/util/libgnunetutil.la \
141 $(top_builddir)/src/service/identity/libgnunetidentity.la \
142 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
143 $(top_builddir)/src/service/namecache/libgnunetnamecache.la \
144 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
145
146test_namestore_api_store_update_postgres_SOURCES = \
147 test_namestore_api_store_update.c
148test_namestore_api_store_update_postgres_LDADD = \
149 $(top_builddir)/src/service/testing/libgnunettesting.la \
150 $(top_builddir)/src/lib/util/libgnunetutil.la \
151 $(top_builddir)/src/service/identity/libgnunetidentity.la \
152 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
153 $(top_builddir)/src/service/namecache/libgnunetnamecache.la \
154 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
155
156test_namestore_api_lookup_nick_sqlite_SOURCES = \
157 test_namestore_api_lookup_nick.c
158test_namestore_api_lookup_nick_sqlite_LDADD = \
159 $(top_builddir)/src/service/testing/libgnunettesting.la \
160 $(top_builddir)/src/lib/util/libgnunetutil.la \
161 $(top_builddir)/src/service/identity/libgnunetidentity.la \
162 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
163 $(top_builddir)/src/service/namecache/libgnunetnamecache.la \
164 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
165
166test_namestore_api_lookup_nick_postgres_SOURCES = \
167 test_namestore_api_lookup_nick.c
168test_namestore_api_lookup_nick_postgres_LDADD = \
169 $(top_builddir)/src/service/testing/libgnunettesting.la \
170 $(top_builddir)/src/lib/util/libgnunetutil.la \
171 $(top_builddir)/src/service/identity/libgnunetidentity.la \
172 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
173 $(top_builddir)/src/service/namecache/libgnunetnamecache.la \
174 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
175
176test_namestore_api_remove_sqlite_SOURCES = \
177 test_namestore_api_remove.c
178test_namestore_api_remove_sqlite_LDADD = \
179 $(top_builddir)/src/service/identity/libgnunetidentity.la \
180 $(top_builddir)/src/service/testing/libgnunettesting.la \
181 $(top_builddir)/src/lib/util/libgnunetutil.la \
182 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
183 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
184
185test_namestore_api_remove_postgres_SOURCES = \
186 test_namestore_api_remove.c
187test_namestore_api_remove_postgres_LDADD = \
188 $(top_builddir)/src/service/identity/libgnunetidentity.la \
189 $(top_builddir)/src/service/testing/libgnunettesting.la \
190 $(top_builddir)/src/lib/util/libgnunetutil.la \
191 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
192 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
193
194test_namestore_api_remove_not_existing_record_sqlite_SOURCES = \
195 test_namestore_api_remove_not_existing_record.c
196test_namestore_api_remove_not_existing_record_sqlite_LDADD = \
197 $(top_builddir)/src/service/testing/libgnunettesting.la \
198 $(top_builddir)/src/lib/util/libgnunetutil.la \
199 $(top_builddir)/src/service/identity/libgnunetidentity.la \
200 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
201 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
202
203test_namestore_api_remove_not_existing_record_postgres_SOURCES = \
204 test_namestore_api_remove_not_existing_record.c
205test_namestore_api_remove_not_existing_record_postgres_LDADD = \
206 $(top_builddir)/src/service/testing/libgnunettesting.la \
207 $(top_builddir)/src/service/identity/libgnunetidentity.la \
208 $(top_builddir)/src/lib/util/libgnunetutil.la \
209 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
210 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
211
212test_namestore_api_zone_to_name_sqlite_SOURCES = \
213 test_namestore_api_zone_to_name.c
214test_namestore_api_zone_to_name_sqlite_LDADD = \
215 $(top_builddir)/src/service/identity/libgnunetidentity.la \
216 $(top_builddir)/src/service/testing/libgnunettesting.la \
217 $(top_builddir)/src/lib/util/libgnunetutil.la \
218 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
219
220test_namestore_api_zone_to_name_postgres_SOURCES = \
221 test_namestore_api_zone_to_name.c
222test_namestore_api_zone_to_name_postgres_LDADD = \
223 $(top_builddir)/src/service/identity/libgnunetidentity.la \
224 $(top_builddir)/src/service/testing/libgnunettesting.la \
225 $(top_builddir)/src/lib/util/libgnunetutil.la \
226 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
227
228test_namestore_api_monitoring_sqlite_SOURCES = \
229 test_namestore_api_monitoring.c
230test_namestore_api_monitoring_sqlite_LDADD = \
231 $(top_builddir)/src/service/identity/libgnunetidentity.la \
232 $(top_builddir)/src/service/testing/libgnunettesting.la \
233 $(top_builddir)/src/service/namestore/libgnunetnamestore.la \
234 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
235 $(top_builddir)/src/lib/util/libgnunetutil.la
236
237test_namestore_api_monitoring_postgres_SOURCES = \
238 test_namestore_api_monitoring.c
239test_namestore_api_monitoring_postgres_LDADD = \
240 $(top_builddir)/src/service/testing/libgnunettesting.la \
241 $(top_builddir)/src/service/identity/libgnunetidentity.la \
242 $(top_builddir)/src/service/namestore/libgnunetnamestore.la \
243 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
244 $(top_builddir)/src/lib/util/libgnunetutil.la
245
246test_namestore_api_monitoring_existing_sqlite_SOURCES = \
247 test_namestore_api_monitoring_existing.c
248test_namestore_api_monitoring_existing_sqlite_LDADD = \
249 $(top_builddir)/src/service/testing/libgnunettesting.la \
250 $(top_builddir)/src/service/identity/libgnunetidentity.la \
251 $(top_builddir)/src/service/namestore/libgnunetnamestore.la \
252 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
253 $(top_builddir)/src/lib/util/libgnunetutil.la
254
255test_namestore_api_monitoring_existing_postgres_SOURCES = \
256 test_namestore_api_monitoring_existing.c
257test_namestore_api_monitoring_existing_postgres_LDADD = \
258 $(top_builddir)/src/service/testing/libgnunettesting.la \
259 $(top_builddir)/src/service/namestore/libgnunetnamestore.la \
260 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
261 $(top_builddir)/src/service/identity/libgnunetidentity.la \
262 $(top_builddir)/src/lib/util/libgnunetutil.la
263
264test_namestore_api_tx_rollback_sqlite_SOURCES = \
265 test_namestore_api_tx_rollback.c
266test_namestore_api_tx_rollback_sqlite_LDADD = \
267 $(top_builddir)/src/service/testing/libgnunettesting.la \
268 $(top_builddir)/src/service/identity/libgnunetidentity.la \
269 $(top_builddir)/src/service/namestore/libgnunetnamestore.la \
270 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
271 $(top_builddir)/src/lib/util/libgnunetutil.la
272
273test_namestore_api_tx_rollback_postgres_SOURCES = \
274 test_namestore_api_tx_rollback.c
275test_namestore_api_tx_rollback_postgres_LDADD = \
276 $(top_builddir)/src/service/testing/libgnunettesting.la \
277 $(top_builddir)/src/service/identity/libgnunetidentity.la \
278 $(top_builddir)/src/service/namestore/libgnunetnamestore.la \
279 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
280 $(top_builddir)/src/lib/util/libgnunetutil.la
281
282if HAVE_EXPERIMENTAL
283test_namestore_api_edit_records_postgres_SOURCES = \
284 test_namestore_api_edit_records.c
285test_namestore_api_edit_records_postgres_LDADD = \
286 $(top_builddir)/src/service/testing/libgnunettesting.la \
287 $(top_builddir)/src/service/identity/libgnunetidentity.la \
288 $(top_builddir)/src/service/namestore/libgnunetnamestore.la \
289 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
290 $(top_builddir)/src/lib/util/libgnunetutil.la
291endif
292
293test_namestore_api_zone_iteration_sqlite_SOURCES = \
294 test_namestore_api_zone_iteration.c
295test_namestore_api_zone_iteration_sqlite_LDADD = \
296 $(top_builddir)/src/service/testing/libgnunettesting.la \
297 $(top_builddir)/src/service/identity/libgnunetidentity.la \
298 $(top_builddir)/src/lib/util/libgnunetutil.la \
299 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
300 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
301
302test_namestore_api_zone_iteration_postgres_SOURCES = \
303 test_namestore_api_zone_iteration.c
304test_namestore_api_zone_iteration_postgres_LDADD = \
305 $(top_builddir)/src/service/testing/libgnunettesting.la \
306 $(top_builddir)/src/service/identity/libgnunetidentity.la \
307 $(top_builddir)/src/lib/util/libgnunetutil.la \
308 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
309 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
310
311perf_namestore_api_zone_iteration_postgres_SOURCES = \
312 perf_namestore_api_zone_iteration.c
313perf_namestore_api_zone_iteration_postgres_LDADD = \
314 $(top_builddir)/src/service/testing/libgnunettesting.la \
315 $(top_builddir)/src/lib/util/libgnunetutil.la \
316 $(top_builddir)/src/service/identity/libgnunetidentity.la \
317 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
318 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
319
320perf_namestore_api_import_sqlite_SOURCES = \
321 perf_namestore_api_import.c
322perf_namestore_api_import_sqlite_LDADD = \
323 $(top_builddir)/src/service/testing/libgnunettesting.la \
324 $(top_builddir)/src/lib/util/libgnunetutil.la \
325 $(top_builddir)/src/service/identity/libgnunetidentity.la \
326 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
327 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
328
329perf_namestore_api_import_postgres_SOURCES = \
330 perf_namestore_api_import.c
331perf_namestore_api_import_postgres_LDADD = \
332 $(top_builddir)/src/service/testing/libgnunettesting.la \
333 $(top_builddir)/src/lib/util/libgnunetutil.la \
334 $(top_builddir)/src/service/identity/libgnunetidentity.la \
335 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
336 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
337
338
339perf_namestore_api_zone_iteration_sqlite_SOURCES = \
340 perf_namestore_api_zone_iteration.c
341perf_namestore_api_zone_iteration_sqlite_LDADD = \
342 $(top_builddir)/src/service/testing/libgnunettesting.la \
343 $(top_builddir)/src/service/identity/libgnunetidentity.la \
344 $(top_builddir)/src/lib/util/libgnunetutil.la \
345 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
346 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
347
348test_namestore_api_zone_iteration_nick_sqlite_SOURCES = \
349 test_namestore_api_zone_iteration_nick.c
350test_namestore_api_zone_iteration_nick_sqlite_LDADD = \
351 $(top_builddir)/src/service/testing/libgnunettesting.la \
352 $(top_builddir)/src/service/identity/libgnunetidentity.la \
353 $(top_builddir)/src/lib/util/libgnunetutil.la \
354 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
355 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
356
357test_namestore_api_zone_iteration_nick_postgres_SOURCES = \
358 test_namestore_api_zone_iteration_nick.c
359test_namestore_api_zone_iteration_nick_postgres_LDADD = \
360 $(top_builddir)/src/service/testing/libgnunettesting.la \
361 $(top_builddir)/src/service/identity/libgnunetidentity.la \
362 $(top_builddir)/src/lib/util/libgnunetutil.la \
363 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
364 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
365
366test_namestore_api_zone_iteration_specific_zone_sqlite_SOURCES = \
367 test_namestore_api_zone_iteration_specific_zone.c
368test_namestore_api_zone_iteration_specific_zone_sqlite_LDADD = \
369 $(top_builddir)/src/service/testing/libgnunettesting.la \
370 $(top_builddir)/src/service/identity/libgnunetidentity.la \
371 $(top_builddir)/src/lib/util/libgnunetutil.la \
372 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
373 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
374
375test_namestore_api_zone_iteration_specific_zone_postgres_SOURCES = \
376 test_namestore_api_zone_iteration_specific_zone.c
377test_namestore_api_zone_iteration_specific_zone_postgres_LDADD = \
378 $(top_builddir)/src/service/testing/libgnunettesting.la \
379 $(top_builddir)/src/service/identity/libgnunetidentity.la \
380 $(top_builddir)/src/lib/util/libgnunetutil.la \
381 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
382 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
383
384test_namestore_api_zone_iteration_stop_sqlite_SOURCES = \
385 test_namestore_api_zone_iteration_stop.c
386test_namestore_api_zone_iteration_stop_sqlite_LDADD = \
387 $(top_builddir)/src/service/testing/libgnunettesting.la \
388 $(top_builddir)/src/service/identity/libgnunetidentity.la \
389 $(top_builddir)/src/lib/util/libgnunetutil.la \
390 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
391 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
392
393test_namestore_api_zone_iteration_stop_postgres_SOURCES = \
394 test_namestore_api_zone_iteration_stop.c
395test_namestore_api_zone_iteration_stop_postgres_LDADD = \
396 $(top_builddir)/src/service/testing/libgnunettesting.la \
397 $(top_builddir)/src/service/identity/libgnunetidentity.la \
398 $(top_builddir)/src/lib/util/libgnunetutil.la \
399 $(top_builddir)/src/lib/gnsrecord/libgnunetgnsrecord.la \
400 $(top_builddir)/src/service/namestore/libgnunetnamestore.la
401
402
403EXTRA_DIST = \
404 test_common.c \
405 test_namestore_api.conf \
406 test_namestore_api_postgres.conf \
407 test_namestore_api_sqlite.conf \
408 perf_namestore_api_postgres.conf \
409 perf_namestore_api_sqlite.conf
410
diff --git a/src/service/namestore/meson.build b/src/service/namestore/meson.build
index 912b312fa..4169e7fde 100644
--- a/src/service/namestore/meson.build
+++ b/src/service/namestore/meson.build
@@ -55,3 +55,62 @@ executable ('gnunet-namestore-fcfsd',
55 install: true, 55 install: true,
56 install_dir: get_option('libdir')/'gnunet'/'libexec') 56 install_dir: get_option('libdir')/'gnunet'/'libexec')
57 57
58
59configure_file(copy: true,
60 input: 'test_namestore_api.conf',
61 output: 'test_namestore_api.conf')
62
63configure_file(copy: true,
64 input: 'test_namestore_api_sqlite.conf',
65 output: 'test_namestore_api_sqlite.conf')
66
67namestoreapitestnames = [
68 'test_namestore_api_lookup_nick',
69 'test_namestore_api_monitoring',
70 'test_namestore_api_monitoring_existing',
71 'test_namestore_api_remove',
72 'test_namestore_api_remove_not_existing_record',
73 'test_namestore_api_store',
74 'test_namestore_api_store_update',
75 'test_namestore_api_tx_rollback',
76 'test_namestore_api_zone_iteration',
77 'test_namestore_api_zone_iteration_nick',
78 'test_namestore_api_zone_iteration_specific_zone',
79 'test_namestore_api_zone_iteration_stop',
80 'test_namestore_api_zone_to_name'
81 ]
82
83if get_option('experimental')
84 namestoreapitestnames +='test_namestore_api_edit_records'
85endif
86
87foreach tn : namestoreapitestnames
88 t = executable (tn + '_sqlite',
89 [tn + '.c'],
90 dependencies: [
91 libgnunettesting_dep,
92 libgnunetutil_dep,
93 libgnunetgnsrecord_dep,
94 libgnunetidentity_dep,
95 libgnunetnamestore_dep],
96 include_directories: [incdir, configuration_inc],
97 install: false)
98 test(tn + '_sqlite', t, workdir: meson.current_build_dir(),
99 suite: 'namestore')
100 if pq_dep.found()
101 t_pq = executable (tn + '_postgres',
102 [tn + '.c'],
103 dependencies: [
104 libgnunettesting_dep,
105 libgnunetutil_dep,
106 libgnunetgnsrecord_dep,
107 libgnunetidentity_dep,
108 libgnunetnamestore_dep],
109 include_directories: [incdir, configuration_inc],
110 install: false)
111 test(tn + '_postgres', t, workdir: meson.current_build_dir(),
112 suite: 'namestore')
113 endif
114endforeach
115
116# FIXME perf tests missing
diff --git a/src/plugin/namestore/perf_namestore_api_import.c b/src/service/namestore/perf_namestore_api_import.c
index e56fb961c..bf8093f43 100644
--- a/src/plugin/namestore/perf_namestore_api_import.c
+++ b/src/service/namestore/perf_namestore_api_import.c
@@ -25,7 +25,7 @@
25#include "platform.h" 25#include "platform.h"
26#include "gnunet_namestore_service.h" 26#include "gnunet_namestore_service.h"
27#include "gnunet_testing_lib.h" 27#include "gnunet_testing_lib.h"
28#include "namestore.h" 28#include "../service/namestore/namestore.h"
29 29
30#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT 30#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
31 31
@@ -382,7 +382,7 @@ int
382main (int argc, 382main (int argc,
383 char *argv[]) 383 char *argv[])
384{ 384{
385 const char *plugin_name; 385 char *plugin_name;
386 char *cfg_name; 386 char *cfg_name;
387 387
388 SETUP_CFG2 ("perf_namestore_api_%s.conf", plugin_name, cfg_name); 388 SETUP_CFG2 ("perf_namestore_api_%s.conf", plugin_name, cfg_name);
diff --git a/src/plugin/namestore/perf_namestore_api_postgres.conf b/src/service/namestore/perf_namestore_api_postgres.conf
index 5e02c2df3..5e02c2df3 100644
--- a/src/plugin/namestore/perf_namestore_api_postgres.conf
+++ b/src/service/namestore/perf_namestore_api_postgres.conf
diff --git a/src/plugin/namestore/perf_namestore_api_sqlite.conf b/src/service/namestore/perf_namestore_api_sqlite.conf
index 55c3dc812..55c3dc812 100644
--- a/src/plugin/namestore/perf_namestore_api_sqlite.conf
+++ b/src/service/namestore/perf_namestore_api_sqlite.conf
diff --git a/src/plugin/namestore/perf_namestore_api_zone_iteration.c b/src/service/namestore/perf_namestore_api_zone_iteration.c
index e16748f5b..1b669fdac 100644
--- a/src/plugin/namestore/perf_namestore_api_zone_iteration.c
+++ b/src/service/namestore/perf_namestore_api_zone_iteration.c
@@ -25,7 +25,7 @@
25#include "platform.h" 25#include "platform.h"
26#include "gnunet_namestore_service.h" 26#include "gnunet_namestore_service.h"
27#include "gnunet_testing_lib.h" 27#include "gnunet_testing_lib.h"
28#include "namestore.h" 28#include "../service/namestore/namestore.h"
29 29
30#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT 30#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
31 31
@@ -354,7 +354,7 @@ int
354main (int argc, 354main (int argc,
355 char *argv[]) 355 char *argv[])
356{ 356{
357 const char *plugin_name; 357 char *plugin_name;
358 char *cfg_name; 358 char *cfg_name;
359 359
360 SETUP_CFG (plugin_name, cfg_name); 360 SETUP_CFG (plugin_name, cfg_name);
diff --git a/src/plugin/namestore/test_common.c b/src/service/namestore/test_common.c
index 4df24a7f7..4df24a7f7 100644
--- a/src/plugin/namestore/test_common.c
+++ b/src/service/namestore/test_common.c
diff --git a/src/plugin/namestore/test_namestore_api.conf b/src/service/namestore/test_namestore_api.conf
index 1648c7cae..647cd8e20 100644
--- a/src/plugin/namestore/test_namestore_api.conf
+++ b/src/service/namestore/test_namestore_api.conf
@@ -1,5 +1,5 @@
1@INLINE@ ../../contrib/conf/gnunet/no_forcestart.conf 1@INLINE@ ../../../contrib/conf/gnunet/no_forcestart.conf
2@INLINE@ ../../contrib/conf/gnunet/no_autostart_above_core.conf 2@INLINE@ ../../../contrib/conf/gnunet/no_autostart_above_core.conf
3 3
4[PATHS] 4[PATHS]
5GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-namestore/ 5GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-namestore/
diff --git a/src/plugin/namestore/test_namestore_api_edit_records.c b/src/service/namestore/test_namestore_api_edit_records.c
index a6bce7c17..94b4f4fc1 100644
--- a/src/plugin/namestore/test_namestore_api_edit_records.c
+++ b/src/service/namestore/test_namestore_api_edit_records.c
@@ -375,7 +375,7 @@ run (void *cls,
375int 375int
376main (int argc, char *argv[]) 376main (int argc, char *argv[])
377{ 377{
378 const char *plugin_name; 378 char *plugin_name;
379 char *cfg_name; 379 char *cfg_name;
380 380
381 SETUP_CFG (plugin_name, cfg_name); 381 SETUP_CFG (plugin_name, cfg_name);
diff --git a/src/plugin/namestore/test_namestore_api_lookup_nick.c b/src/service/namestore/test_namestore_api_lookup_nick.c
index 21fc1ef79..22734baab 100644
--- a/src/plugin/namestore/test_namestore_api_lookup_nick.c
+++ b/src/service/namestore/test_namestore_api_lookup_nick.c
@@ -323,7 +323,7 @@ run (void *cls,
323int 323int
324main (int argc, char *argv[]) 324main (int argc, char *argv[])
325{ 325{
326 const char *plugin_name; 326 char *plugin_name;
327 char *cfg_name; 327 char *cfg_name;
328 328
329 SETUP_CFG (plugin_name, cfg_name); 329 SETUP_CFG (plugin_name, cfg_name);
diff --git a/src/plugin/namestore/test_namestore_api_monitoring.c b/src/service/namestore/test_namestore_api_monitoring.c
index 74dad3749..0b879786c 100644
--- a/src/plugin/namestore/test_namestore_api_monitoring.c
+++ b/src/service/namestore/test_namestore_api_monitoring.c
@@ -24,7 +24,7 @@
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_namestore_service.h" 25#include "gnunet_namestore_service.h"
26#include "gnunet_testing_lib.h" 26#include "gnunet_testing_lib.h"
27#include "namestore.h" 27#include "../service/namestore/namestore.h"
28 28
29#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT 29#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
30 30
@@ -354,7 +354,7 @@ int
354main (int argc, 354main (int argc,
355 char *argv[]) 355 char *argv[])
356{ 356{
357 const char *plugin_name; 357 char *plugin_name;
358 char *cfg_name; 358 char *cfg_name;
359 359
360 SETUP_CFG (plugin_name, cfg_name); 360 SETUP_CFG (plugin_name, cfg_name);
diff --git a/src/plugin/namestore/test_namestore_api_monitoring_existing.c b/src/service/namestore/test_namestore_api_monitoring_existing.c
index fe17833c8..ff7e39504 100644
--- a/src/plugin/namestore/test_namestore_api_monitoring_existing.c
+++ b/src/service/namestore/test_namestore_api_monitoring_existing.c
@@ -24,7 +24,7 @@
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_namestore_service.h" 25#include "gnunet_namestore_service.h"
26#include "gnunet_testing_lib.h" 26#include "gnunet_testing_lib.h"
27#include "namestore.h" 27#include "../service/namestore/namestore.h"
28 28
29#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT 29#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
30 30
@@ -368,7 +368,7 @@ int
368main (int argc, 368main (int argc,
369 char *argv[]) 369 char *argv[])
370{ 370{
371 const char *plugin_name; 371 char *plugin_name;
372 char *cfg_name; 372 char *cfg_name;
373 373
374 SETUP_CFG (plugin_name, cfg_name); 374 SETUP_CFG (plugin_name, cfg_name);
diff --git a/src/plugin/namestore/test_namestore_api_postgres.conf b/src/service/namestore/test_namestore_api_postgres.conf
index 007168280..007168280 100644
--- a/src/plugin/namestore/test_namestore_api_postgres.conf
+++ b/src/service/namestore/test_namestore_api_postgres.conf
diff --git a/src/plugin/namestore/test_namestore_api_remove.c b/src/service/namestore/test_namestore_api_remove.c
index 1a4a7c867..4efdb7efa 100644
--- a/src/plugin/namestore/test_namestore_api_remove.c
+++ b/src/service/namestore/test_namestore_api_remove.c
@@ -195,7 +195,7 @@ run (void *cls,
195int 195int
196main (int argc, char *argv[]) 196main (int argc, char *argv[])
197{ 197{
198 const char *plugin_name; 198 char *plugin_name;
199 char *cfg_name; 199 char *cfg_name;
200 200
201 SETUP_CFG (plugin_name, cfg_name); 201 SETUP_CFG (plugin_name, cfg_name);
diff --git a/src/plugin/namestore/test_namestore_api_remove_not_existing_record.c b/src/service/namestore/test_namestore_api_remove_not_existing_record.c
index 11a69bea1..4a21b0ff9 100644
--- a/src/plugin/namestore/test_namestore_api_remove_not_existing_record.c
+++ b/src/service/namestore/test_namestore_api_remove_not_existing_record.c
@@ -155,7 +155,7 @@ run (void *cls,
155int 155int
156main (int argc, char *argv[]) 156main (int argc, char *argv[])
157{ 157{
158 const char *plugin_name; 158 char *plugin_name;
159 char *cfg_name; 159 char *cfg_name;
160 160
161 SETUP_CFG (plugin_name, cfg_name); 161 SETUP_CFG (plugin_name, cfg_name);
diff --git a/src/plugin/namestore/test_namestore_api_sqlite.conf b/src/service/namestore/test_namestore_api_sqlite.conf
index 342356247..342356247 100644
--- a/src/plugin/namestore/test_namestore_api_sqlite.conf
+++ b/src/service/namestore/test_namestore_api_sqlite.conf
diff --git a/src/plugin/namestore/test_namestore_api_store.c b/src/service/namestore/test_namestore_api_store.c
index 22b92fbe5..e7b87c28b 100644
--- a/src/plugin/namestore/test_namestore_api_store.c
+++ b/src/service/namestore/test_namestore_api_store.c
@@ -148,7 +148,7 @@ run (void *cls,
148int 148int
149main (int argc, char *argv[]) 149main (int argc, char *argv[])
150{ 150{
151 const char *plugin_name; 151 char *plugin_name;
152 char *cfg_name; 152 char *cfg_name;
153 153
154 SETUP_CFG (plugin_name, cfg_name); 154 SETUP_CFG (plugin_name, cfg_name);
diff --git a/src/plugin/namestore/test_namestore_api_store_update.c b/src/service/namestore/test_namestore_api_store_update.c
index 86495e261..f2af41841 100644
--- a/src/plugin/namestore/test_namestore_api_store_update.c
+++ b/src/service/namestore/test_namestore_api_store_update.c
@@ -143,7 +143,7 @@ lookup_success (void *cls,
143 &rd_new, 143 &rd_new,
144 &put_cont, 144 &put_cont,
145 (void *) name); 145 (void *) name);
146 GNUNET_free (rd_new.data); 146 GNUNET_free_nz ((void*) rd_new.data);
147 update_performed = GNUNET_YES; 147 update_performed = GNUNET_YES;
148 } 148 }
149 else 149 else
@@ -168,22 +168,12 @@ static void
168put_cont (void *cls, 168put_cont (void *cls,
169 enum GNUNET_ErrorCode ec) 169 enum GNUNET_ErrorCode ec)
170{ 170{
171 const char *name = cls;
172 struct GNUNET_HashCode derived_hash;
173
174 nsqe = NULL; 171 nsqe = NULL;
175 GNUNET_assert (NULL != cls); 172 GNUNET_assert (NULL != cls);
176 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 173 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
177 "Name store added record for `%s': %s\n", 174 "Name store added record for `%s': %s\n",
178 name, 175 name,
179 (GNUNET_EC_NONE == ec) ? "SUCCESS" : "FAIL"); 176 (GNUNET_EC_NONE == ec) ? "SUCCESS" : "FAIL");
180 /* Create derived hash */
181 GNUNET_GNSRECORD_query_from_private_key (&privkey,
182 name,
183 &derived_hash);
184 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
185 "Looking in namestore for `%s'\n",
186 GNUNET_h2s (&derived_hash));
187 nsqe = GNUNET_NAMESTORE_records_lookup (nsh, 177 nsqe = GNUNET_NAMESTORE_records_lookup (nsh,
188 &privkey, 178 &privkey,
189 name, 179 name,
@@ -222,6 +212,7 @@ run (void *cls,
222 212
223 nsh = GNUNET_NAMESTORE_connect (cfg); 213 nsh = GNUNET_NAMESTORE_connect (cfg);
224 GNUNET_break (NULL != nsh); 214 GNUNET_break (NULL != nsh);
215
225 nsqe = GNUNET_NAMESTORE_records_store (nsh, 216 nsqe = GNUNET_NAMESTORE_records_store (nsh,
226 &privkey, 217 &privkey,
227 name, 218 name,
@@ -245,13 +236,13 @@ int
245main (int argc, 236main (int argc,
246 char *argv[]) 237 char *argv[])
247{ 238{
248 const char *plugin_name; 239 char *plugin_name;
249 char *cfg_name; 240 char *cfg_name;
250 241
251 SETUP_CFG (plugin_name, cfg_name); 242 SETUP_CFG (plugin_name, cfg_name);
252 res = 1; 243 res = 1;
253 if (0 != 244 if (0 !=
254 GNUNET_TESTING_peer_run ("test--store-update", 245 GNUNET_TESTING_peer_run ("test-namestore-store-update",
255 cfg_name, 246 cfg_name,
256 &run, 247 &run,
257 NULL)) 248 NULL))
diff --git a/src/plugin/namestore/test_namestore_api_tx_rollback.c b/src/service/namestore/test_namestore_api_tx_rollback.c
index 4a701f60e..0c334d374 100644
--- a/src/plugin/namestore/test_namestore_api_tx_rollback.c
+++ b/src/service/namestore/test_namestore_api_tx_rollback.c
@@ -240,7 +240,7 @@ run (void *cls,
240int 240int
241main (int argc, char *argv[]) 241main (int argc, char *argv[])
242{ 242{
243 const char *plugin_name; 243 char *plugin_name;
244 char *cfg_name; 244 char *cfg_name;
245 245
246 SETUP_CFG (plugin_name, cfg_name); 246 SETUP_CFG (plugin_name, cfg_name);
diff --git a/src/plugin/namestore/test_namestore_api_zone_iteration.c b/src/service/namestore/test_namestore_api_zone_iteration.c
index fb69fffcc..403a49a23 100644
--- a/src/plugin/namestore/test_namestore_api_zone_iteration.c
+++ b/src/service/namestore/test_namestore_api_zone_iteration.c
@@ -24,7 +24,7 @@
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_namestore_service.h" 25#include "gnunet_namestore_service.h"
26#include "gnunet_testing_lib.h" 26#include "gnunet_testing_lib.h"
27#include "namestore.h" 27#include "../service/namestore/namestore.h"
28 28
29#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT 29#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
30 30
@@ -440,7 +440,7 @@ run (void *cls,
440int 440int
441main (int argc, char *argv[]) 441main (int argc, char *argv[])
442{ 442{
443 const char *plugin_name; 443 char *plugin_name;
444 char *cfg_name; 444 char *cfg_name;
445 445
446 SETUP_CFG (plugin_name, cfg_name); 446 SETUP_CFG (plugin_name, cfg_name);
diff --git a/src/plugin/namestore/test_namestore_api_zone_iteration_nick.c b/src/service/namestore/test_namestore_api_zone_iteration_nick.c
index c494051d0..1ca7b3559 100644
--- a/src/plugin/namestore/test_namestore_api_zone_iteration_nick.c
+++ b/src/service/namestore/test_namestore_api_zone_iteration_nick.c
@@ -25,7 +25,7 @@
25#include "gnunet_namestore_service.h" 25#include "gnunet_namestore_service.h"
26#include "gnunet_gns_service.h" 26#include "gnunet_gns_service.h"
27#include "gnunet_testing_lib.h" 27#include "gnunet_testing_lib.h"
28#include "namestore.h" 28#include "../service/namestore/namestore.h"
29 29
30#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT 30#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
31 31
@@ -436,7 +436,7 @@ run (void *cls,
436int 436int
437main (int argc, char *argv[]) 437main (int argc, char *argv[])
438{ 438{
439 const char *plugin_name; 439 char *plugin_name;
440 char *cfg_name; 440 char *cfg_name;
441 441
442 SETUP_CFG (plugin_name, cfg_name); 442 SETUP_CFG (plugin_name, cfg_name);
diff --git a/src/plugin/namestore/test_namestore_api_zone_iteration_specific_zone.c b/src/service/namestore/test_namestore_api_zone_iteration_specific_zone.c
index 02587706c..753e550ad 100644
--- a/src/plugin/namestore/test_namestore_api_zone_iteration_specific_zone.c
+++ b/src/service/namestore/test_namestore_api_zone_iteration_specific_zone.c
@@ -25,7 +25,7 @@
25#include "platform.h" 25#include "platform.h"
26#include "gnunet_namestore_service.h" 26#include "gnunet_namestore_service.h"
27#include "gnunet_testing_lib.h" 27#include "gnunet_testing_lib.h"
28#include "namestore.h" 28#include "../service/namestore/namestore.h"
29 29
30#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT 30#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
31 31
@@ -422,7 +422,7 @@ run (void *cls,
422int 422int
423main (int argc, char *argv[]) 423main (int argc, char *argv[])
424{ 424{
425 const char *plugin_name; 425 char *plugin_name;
426 char *cfg_name; 426 char *cfg_name;
427 427
428 SETUP_CFG (plugin_name, cfg_name); 428 SETUP_CFG (plugin_name, cfg_name);
diff --git a/src/plugin/namestore/test_namestore_api_zone_iteration_stop.c b/src/service/namestore/test_namestore_api_zone_iteration_stop.c
index b6b0787ef..dd63837ce 100644
--- a/src/plugin/namestore/test_namestore_api_zone_iteration_stop.c
+++ b/src/service/namestore/test_namestore_api_zone_iteration_stop.c
@@ -24,7 +24,7 @@
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_namestore_service.h" 25#include "gnunet_namestore_service.h"
26#include "gnunet_testing_lib.h" 26#include "gnunet_testing_lib.h"
27#include "namestore.h" 27#include "../service/namestore/namestore.h"
28 28
29#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT 29#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
30 30
@@ -424,7 +424,7 @@ run (void *cls,
424int 424int
425main (int argc, char *argv[]) 425main (int argc, char *argv[])
426{ 426{
427 const char *plugin_name; 427 char *plugin_name;
428 char *cfg_name; 428 char *cfg_name;
429 429
430 SETUP_CFG (plugin_name, cfg_name); 430 SETUP_CFG (plugin_name, cfg_name);
diff --git a/src/plugin/namestore/test_namestore_api_zone_to_name.c b/src/service/namestore/test_namestore_api_zone_to_name.c
index c70eef53a..f41b41642 100644
--- a/src/plugin/namestore/test_namestore_api_zone_to_name.c
+++ b/src/service/namestore/test_namestore_api_zone_to_name.c
@@ -24,7 +24,7 @@
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_namestore_service.h" 25#include "gnunet_namestore_service.h"
26#include "gnunet_testing_lib.h" 26#include "gnunet_testing_lib.h"
27#include "namestore.h" 27#include "../service/namestore/namestore.h"
28 28
29#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT 29#define TEST_RECORD_TYPE GNUNET_DNSPARSER_TYPE_TXT
30 30
@@ -241,7 +241,7 @@ int
241main (int argc, 241main (int argc,
242 char *argv[]) 242 char *argv[])
243{ 243{
244 const char *plugin_name; 244 char *plugin_name;
245 char *cfg_name; 245 char *cfg_name;
246 246
247 (void) argc; 247 (void) argc;
diff --git a/src/service/peerstore/gnunet-service-peerstore.c b/src/service/peerstore/gnunet-service-peerstore.c
index 2a8ecdfa2..364900674 100644
--- a/src/service/peerstore/gnunet-service-peerstore.c
+++ b/src/service/peerstore/gnunet-service-peerstore.c
@@ -157,7 +157,7 @@ static void
157expire_records_continuation (void *cls, int success) 157expire_records_continuation (void *cls, int success)
158{ 158{
159 if (success > 0) 159 if (success > 0)
160 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%d records expired.\n", success); 160 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%d records expired.\n", success);
161 GNUNET_assert (NULL == expire_task); 161 GNUNET_assert (NULL == expire_task);
162 expire_task = GNUNET_SCHEDULER_add_delayed ( 162 expire_task = GNUNET_SCHEDULER_add_delayed (
163 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 163 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
@@ -508,7 +508,7 @@ handle_store (void *cls, const struct StoreRecordMessage *srm)
508 508
509 record = PEERSTORE_parse_record_message (srm); 509 record = PEERSTORE_parse_record_message (srm);
510 GNUNET_log ( 510 GNUNET_log (
511 GNUNET_ERROR_TYPE_INFO, 511 GNUNET_ERROR_TYPE_DEBUG,
512 "Received a store request. Sub system `%s' Peer `%s Key `%s' Options: %u.\n", 512 "Received a store request. Sub system `%s' Peer `%s Key `%s' Options: %u.\n",
513 record->sub_system, 513 record->sub_system,
514 GNUNET_i2s (&record->peer), 514 GNUNET_i2s (&record->peer),
@@ -596,12 +596,18 @@ hosts_directory_scan_callback (void *cls, const char *fullname)
596 } 596 }
597 hello = (const struct GNUNET_MessageHeader *) &buffer[0]; 597 hello = (const struct GNUNET_MessageHeader *) &buffer[0];
598 builder = GNUNET_HELLO_builder_from_msg (hello); 598 builder = GNUNET_HELLO_builder_from_msg (hello);
599 if (NULL == builder)
600 {
601 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
602 "Unable to parse HELLO message\n");
603 return GNUNET_OK;
604 }
599 pid = GNUNET_HELLO_builder_get_id (builder); 605 pid = GNUNET_HELLO_builder_get_id (builder);
600 606
601 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 607 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
602 "store contrib hello for peer %s\n", 608 "store contrib hello for peer %s\n",
603 GNUNET_i2s (pid)); 609 GNUNET_i2s (pid));
604 610
605 if (GNUNET_OK != db->store_record (db->cls, 611 if (GNUNET_OK != db->store_record (db->cls,
606 "peerstore", 612 "peerstore",
607 pid, 613 pid,
diff --git a/src/service/testing/testing_api_loop.c b/src/service/testing/testing_api_loop.c
index 11cd02ec0..559a61c38 100644
--- a/src/service/testing/testing_api_loop.c
+++ b/src/service/testing/testing_api_loop.c
@@ -45,6 +45,11 @@ struct GNUNET_TESTING_Interpreter
45 const struct GNUNET_HELPER_Handle **helper; 45 const struct GNUNET_HELPER_Handle **helper;
46 46
47 /** 47 /**
48 * Handle to a send op
49 */
50 struct GNUNET_HELPER_SendHandle *send_handle;
51
52 /**
48 * Size of the array helper. 53 * Size of the array helper.
49 * 54 *
50 */ 55 */
@@ -357,6 +362,11 @@ finish_test (void *cls)
357 GNUNET_SCHEDULER_cancel (is->timeout_task); 362 GNUNET_SCHEDULER_cancel (is->timeout_task);
358 is->timeout_task = NULL; 363 is->timeout_task = NULL;
359 } 364 }
365 if (NULL != is->send_handle)
366 {
367 GNUNET_HELPER_send_cancel (is->send_handle);
368 is->send_handle = NULL;
369 }
360 GNUNET_free (is->commands); 370 GNUNET_free (is->commands);
361 is->rc (is->rc_cls, 371 is->rc (is->rc_cls,
362 is->result); 372 is->result);
@@ -731,37 +741,6 @@ GNUNET_TESTING_add_netjail_helper (struct GNUNET_TESTING_Interpreter *is,
731} 741}
732 742
733 743
734/**
735 * Send Message to netjail nodes.
736 *
737 * @param is The interpreter.
738 * @param global_node_number The netjail node to inform.
739 * @param header The message to send.
740 */
741static void
742send_message_to_netjail (struct GNUNET_TESTING_Interpreter *is,
743 unsigned int global_node_number,
744 struct GNUNET_MessageHeader *header)
745{
746 const struct GNUNET_HELPER_Handle *helper;
747
748 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
749 "send message of type %u to locals\n",
750 ntohs (header->type));
751 helper = is->helper[global_node_number - 1];
752 /**
753 FIXME: This should probably be put into a linked list
754 inside is and cleaned up at some point.
755 */
756 struct GNUNET_HELPER_SendHandle *sh = GNUNET_HELPER_send (
757 (struct GNUNET_HELPER_Handle *) helper,
758 header,
759 GNUNET_NO,
760 &clear_msg,
761 NULL);
762}
763
764
765void 744void
766TST_interpreter_send_barrier_crossable (struct GNUNET_TESTING_Interpreter *is, 745TST_interpreter_send_barrier_crossable (struct GNUNET_TESTING_Interpreter *is,
767 const char *barrier_name, 746 const char *barrier_name,
@@ -780,9 +759,19 @@ TST_interpreter_send_barrier_crossable (struct GNUNET_TESTING_Interpreter *is,
780 adm->header.type = htons (GNUNET_MESSAGE_TYPE_CMDS_HELPER_BARRIER_CROSSABLE); 759 adm->header.type = htons (GNUNET_MESSAGE_TYPE_CMDS_HELPER_BARRIER_CROSSABLE);
781 adm->header.size = htons ((uint16_t) msg_length); 760 adm->header.size = htons ((uint16_t) msg_length);
782 memcpy (&adm[1], barrier_name, name_len); 761 memcpy (&adm[1], barrier_name, name_len);
783 send_message_to_netjail (is, 762 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
784 global_node_number, 763 "send message of type %u to locals\n",
785 &adm->header); 764 ntohs (adm->header.type));
765 /**
766 FIXME: This should probably be put into a linked list
767 inside is and cleaned up at some point.
768 */
769 is->send_handle = GNUNET_HELPER_send (
770 (struct GNUNET_HELPER_Handle *) is->helper[global_node_number - 1],
771 &adm->header,
772 GNUNET_NO,
773 &clear_msg,
774 NULL);
786 GNUNET_free (adm); 775 GNUNET_free (adm);
787} 776}
788 777
diff --git a/src/service/transport/gnunet-service-transport.c b/src/service/transport/gnunet-service-transport.c
index 9562c1f68..3f0027a98 100644
--- a/src/service/transport/gnunet-service-transport.c
+++ b/src/service/transport/gnunet-service-transport.c
@@ -5526,6 +5526,15 @@ shc_cont (void *cls, int success)
5526 GNUNET_PEERSTORE_STOREOPTION_MULTIPLE, 5526 GNUNET_PEERSTORE_STOREOPTION_MULTIPLE,
5527 &peerstore_store_own_cb, 5527 &peerstore_store_own_cb,
5528 ale); 5528 ale);
5529 if (NULL == ale->sc)
5530 {
5531 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
5532 "Failed to store our address `%s' with peerstore\n",
5533 ale->address);
5534 ale->st = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
5535 &store_pi,
5536 ale);
5537 }
5529} 5538}
5530 5539
5531 5540
@@ -5543,6 +5552,7 @@ store_pi (void *cls)
5543 const char *dash; 5552 const char *dash;
5544 char *address_uri; 5553 char *address_uri;
5545 char *prefix = GNUNET_HELLO_address_to_prefix (ale->address); 5554 char *prefix = GNUNET_HELLO_address_to_prefix (ale->address);
5555 unsigned int add_success;
5546 5556
5547 dash = strchr (ale->address, '-'); 5557 dash = strchr (ale->address, '-');
5548 GNUNET_assert (NULL != dash); 5558 GNUNET_assert (NULL != dash);
@@ -5557,15 +5567,15 @@ store_pi (void *cls)
5557 "Storing our address `%s' in peerstore until %s!\n", 5567 "Storing our address `%s' in peerstore until %s!\n",
5558 ale->address, 5568 ale->address,
5559 GNUNET_STRINGS_absolute_time_to_string (hello_mono_time)); 5569 GNUNET_STRINGS_absolute_time_to_string (hello_mono_time));
5560 if (GNUNET_OK != GNUNET_HELLO_builder_add_address (GST_my_hello, 5570 add_success = GNUNET_HELLO_builder_add_address (GST_my_hello,
5561 address_uri)) 5571 address_uri);
5572 if (GNUNET_OK != add_success)
5562 { 5573 {
5563 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 5574 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
5564 "Address `%s' invalid\n", 5575 "Storing our address `%s' %s\n",
5565 address_uri); 5576 address_uri,
5577 GNUNET_NO == add_success ? "not done" : "failed");
5566 GNUNET_free (address_uri); 5578 GNUNET_free (address_uri);
5567 ale->st =
5568 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &store_pi, ale);
5569 return; 5579 return;
5570 } 5580 }
5571 // FIXME hello_mono_time used here?? What about expiration in ale? 5581 // FIXME hello_mono_time used here?? What about expiration in ale?
diff --git a/src/service/util/meson.build b/src/service/util/meson.build
index a7199fa4b..b7642c905 100644
--- a/src/service/util/meson.build
+++ b/src/service/util/meson.build
@@ -19,3 +19,16 @@ executable ('gnunet-service-resolver',
19 include_directories: [incdir, configuration_inc], 19 include_directories: [incdir, configuration_inc],
20 install: true, 20 install: true,
21 install_dir: get_option('libdir') / 'gnunet' / 'libexec') 21 install_dir: get_option('libdir') / 'gnunet' / 'libexec')
22
23testresolverapi = executable ('test_resolver_api',
24 ['test_resolver_api.c'],
25 dependencies: [libgnunetutil_dep],
26 include_directories: [incdir, configuration_inc],
27 install: false)
28configure_file(copy: true,
29 input: 'test_resolver_api_data.conf',
30 output: 'test_resolver_api_data.conf')
31
32test('test_resolver_api', testresolverapi, workdir: meson.current_build_dir(),
33 suite: 'resolver')
34
diff --git a/src/service/util/test_resolver_api.c b/src/service/util/test_resolver_api.c
index 5ad0c6bf3..f8a2164a2 100644
--- a/src/service/util/test_resolver_api.c
+++ b/src/service/util/test_resolver_api.c
@@ -25,7 +25,7 @@
25#include "platform.h" 25#include "platform.h"
26#include "gnunet_util_lib.h" 26#include "gnunet_util_lib.h"
27#include "gnunet_resolver_service.h" 27#include "gnunet_resolver_service.h"
28#include "resolver.h" 28#include "../lib/util/resolver.h"
29 29
30 30
31static int disable_rootserver_check; 31static int disable_rootserver_check;