diff options
24 files changed, 264 insertions, 1385 deletions
diff --git a/po/POTFILES.in b/po/POTFILES.in index edd56bf95..8ed952089 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in | |||
@@ -10,13 +10,21 @@ src/arm/arm_monitor_api.c | |||
10 | src/arm/gnunet-arm.c | 10 | src/arm/gnunet-arm.c |
11 | src/arm/gnunet-service-arm.c | 11 | src/arm/gnunet-service-arm.c |
12 | src/arm/mockup-service.c | 12 | src/arm/mockup-service.c |
13 | src/ats-tests/ats-testing-experiment.c | ||
14 | src/ats-tests/ats-testing-log.c | ||
15 | src/ats-tests/ats-testing-preferences.c | ||
16 | src/ats-tests/ats-testing-traffic.c | ||
17 | src/ats-tests/ats-testing.c | ||
18 | src/ats-tests/gnunet-ats-sim.c | ||
19 | src/ats-tests/gnunet-solver-eval.c | ||
20 | src/ats-tool/gnunet-ats.c | ||
13 | src/ats/ats_api_connectivity.c | 21 | src/ats/ats_api_connectivity.c |
14 | src/ats/ats_api_performance.c | 22 | src/ats/ats_api_performance.c |
15 | src/ats/ats_api_scanner.c | 23 | src/ats/ats_api_scanner.c |
16 | src/ats/ats_api_scheduling.c | 24 | src/ats/ats_api_scheduling.c |
17 | src/ats/gnunet-ats-solver-eval.c | 25 | src/ats/gnunet-ats-solver-eval.c |
18 | src/ats/gnunet-service-ats_addresses.c | ||
19 | src/ats/gnunet-service-ats.c | 26 | src/ats/gnunet-service-ats.c |
27 | src/ats/gnunet-service-ats_addresses.c | ||
20 | src/ats/gnunet-service-ats_connectivity.c | 28 | src/ats/gnunet-service-ats_connectivity.c |
21 | src/ats/gnunet-service-ats_normalization.c | 29 | src/ats/gnunet-service-ats_normalization.c |
22 | src/ats/gnunet-service-ats_performance.c | 30 | src/ats/gnunet-service-ats_performance.c |
@@ -25,14 +33,6 @@ src/ats/gnunet-service-ats_preferences.c | |||
25 | src/ats/gnunet-service-ats_reservations.c | 33 | src/ats/gnunet-service-ats_reservations.c |
26 | src/ats/gnunet-service-ats_scheduling.c | 34 | src/ats/gnunet-service-ats_scheduling.c |
27 | src/ats/plugin_ats_proportional.c | 35 | src/ats/plugin_ats_proportional.c |
28 | src/ats-tests/ats-testing.c | ||
29 | src/ats-tests/ats-testing-experiment.c | ||
30 | src/ats-tests/ats-testing-log.c | ||
31 | src/ats-tests/ats-testing-preferences.c | ||
32 | src/ats-tests/ats-testing-traffic.c | ||
33 | src/ats-tests/gnunet-ats-sim.c | ||
34 | src/ats-tests/gnunet-solver-eval.c | ||
35 | src/ats-tool/gnunet-ats.c | ||
36 | src/auction/gnunet-auction-create.c | 36 | src/auction/gnunet-auction-create.c |
37 | src/auction/gnunet-auction-info.c | 37 | src/auction/gnunet-auction-info.c |
38 | src/auction/gnunet-auction-join.c | 38 | src/auction/gnunet-auction-join.c |
@@ -50,8 +50,8 @@ src/cadet/cadet_api_list_peers.c | |||
50 | src/cadet/cadet_api_list_tunnels.c | 50 | src/cadet/cadet_api_list_tunnels.c |
51 | src/cadet/cadet_test_lib.c | 51 | src/cadet/cadet_test_lib.c |
52 | src/cadet/desirability_table.c | 52 | src/cadet/desirability_table.c |
53 | src/cadet/gnunet-cadet.c | ||
54 | src/cadet/gnunet-cadet-profiler.c | 53 | src/cadet/gnunet-cadet-profiler.c |
54 | src/cadet/gnunet-cadet.c | ||
55 | src/cadet/gnunet-service-cadet.c | 55 | src/cadet/gnunet-service-cadet.c |
56 | src/cadet/gnunet-service-cadet_channel.c | 56 | src/cadet/gnunet-service-cadet_channel.c |
57 | src/cadet/gnunet-service-cadet_connection.c | 57 | src/cadet/gnunet-service-cadet_connection.c |
@@ -67,15 +67,15 @@ src/consensus/gnunet-service-consensus.c | |||
67 | src/consensus/plugin_block_consensus.c | 67 | src/consensus/plugin_block_consensus.c |
68 | src/conversation/conversation_api.c | 68 | src/conversation/conversation_api.c |
69 | src/conversation/conversation_api_call.c | 69 | src/conversation/conversation_api_call.c |
70 | src/conversation/gnunet-conversation.c | ||
71 | src/conversation/gnunet-conversation-test.c | 70 | src/conversation/gnunet-conversation-test.c |
72 | src/conversation/gnunet_gst.c | 71 | src/conversation/gnunet-conversation.c |
73 | src/conversation/gnunet_gst_test.c | ||
74 | src/conversation/gnunet-helper-audio-playback.c | ||
75 | src/conversation/gnunet-helper-audio-playback-gst.c | 72 | src/conversation/gnunet-helper-audio-playback-gst.c |
76 | src/conversation/gnunet-helper-audio-record.c | 73 | src/conversation/gnunet-helper-audio-playback.c |
77 | src/conversation/gnunet-helper-audio-record-gst.c | 74 | src/conversation/gnunet-helper-audio-record-gst.c |
75 | src/conversation/gnunet-helper-audio-record.c | ||
78 | src/conversation/gnunet-service-conversation.c | 76 | src/conversation/gnunet-service-conversation.c |
77 | src/conversation/gnunet_gst.c | ||
78 | src/conversation/gnunet_gst_test.c | ||
79 | src/conversation/microphone.c | 79 | src/conversation/microphone.c |
80 | src/conversation/plugin_gnsrecord_conversation.c | 80 | src/conversation/plugin_gnsrecord_conversation.c |
81 | src/conversation/speaker.c | 81 | src/conversation/speaker.c |
@@ -105,7 +105,6 @@ src/dht/dht_api.c | |||
105 | src/dht/dht_test_lib.c | 105 | src/dht/dht_test_lib.c |
106 | src/dht/gnunet-dht-get.c | 106 | src/dht/gnunet-dht-get.c |
107 | src/dht/gnunet-dht-monitor.c | 107 | src/dht/gnunet-dht-monitor.c |
108 | src/dht/gnunet_dht_profiler.c | ||
109 | src/dht/gnunet-dht-put.c | 108 | src/dht/gnunet-dht-put.c |
110 | src/dht/gnunet-service-dht.c | 109 | src/dht/gnunet-service-dht.c |
111 | src/dht/gnunet-service-dht_clients.c | 110 | src/dht/gnunet-service-dht_clients.c |
@@ -114,6 +113,7 @@ src/dht/gnunet-service-dht_hello.c | |||
114 | src/dht/gnunet-service-dht_neighbours.c | 113 | src/dht/gnunet-service-dht_neighbours.c |
115 | src/dht/gnunet-service-dht_nse.c | 114 | src/dht/gnunet-service-dht_nse.c |
116 | src/dht/gnunet-service-dht_routing.c | 115 | src/dht/gnunet-service-dht_routing.c |
116 | src/dht/gnunet_dht_profiler.c | ||
117 | src/dht/plugin_block_dht.c | 117 | src/dht/plugin_block_dht.c |
118 | src/dhtu/plugin_dhtu_gnunet.c | 118 | src/dhtu/plugin_dhtu_gnunet.c |
119 | src/dhtu/plugin_dhtu_ip.c | 119 | src/dhtu/plugin_dhtu_ip.c |
@@ -150,8 +150,8 @@ src/fs/gnunet-auto-share.c | |||
150 | src/fs/gnunet-daemon-fsprofiler.c | 150 | src/fs/gnunet-daemon-fsprofiler.c |
151 | src/fs/gnunet-directory.c | 151 | src/fs/gnunet-directory.c |
152 | src/fs/gnunet-download.c | 152 | src/fs/gnunet-download.c |
153 | src/fs/gnunet-fs.c | ||
154 | src/fs/gnunet-fs-profiler.c | 153 | src/fs/gnunet-fs-profiler.c |
154 | src/fs/gnunet-fs.c | ||
155 | src/fs/gnunet-helper-fs-publish.c | 155 | src/fs/gnunet-helper-fs-publish.c |
156 | src/fs/gnunet-publish.c | 156 | src/fs/gnunet-publish.c |
157 | src/fs/gnunet-search.c | 157 | src/fs/gnunet-search.c |
@@ -171,9 +171,9 @@ src/gns/gns_tld_api.c | |||
171 | src/gns/gnunet-bcd.c | 171 | src/gns/gnunet-bcd.c |
172 | src/gns/gnunet-dns2gns.c | 172 | src/gns/gnunet-dns2gns.c |
173 | src/gns/gnunet-gns-benchmark.c | 173 | src/gns/gnunet-gns-benchmark.c |
174 | src/gns/gnunet-gns.c | ||
175 | src/gns/gnunet-gns-import.c | 174 | src/gns/gnunet-gns-import.c |
176 | src/gns/gnunet-gns-proxy.c | 175 | src/gns/gnunet-gns-proxy.c |
176 | src/gns/gnunet-gns.c | ||
177 | src/gns/gnunet-service-gns.c | 177 | src/gns/gnunet-service-gns.c |
178 | src/gns/gnunet-service-gns_interceptor.c | 178 | src/gns/gnunet-service-gns_interceptor.c |
179 | src/gns/gnunet-service-gns_resolver.c | 179 | src/gns/gnunet-service-gns_resolver.c |
@@ -191,8 +191,8 @@ src/gnsrecord/json_gnsrecord.c | |||
191 | src/gnsrecord/plugin_gnsrecord_dns.c | 191 | src/gnsrecord/plugin_gnsrecord_dns.c |
192 | src/hello/address.c | 192 | src/hello/address.c |
193 | src/hello/gnunet-hello.c | 193 | src/hello/gnunet-hello.c |
194 | src/hello/hello.c | ||
195 | src/hello/hello-ng.c | 194 | src/hello/hello-ng.c |
195 | src/hello/hello.c | ||
196 | src/hostlist/gnunet-daemon-hostlist.c | 196 | src/hostlist/gnunet-daemon-hostlist.c |
197 | src/hostlist/gnunet-daemon-hostlist_client.c | 197 | src/hostlist/gnunet-daemon-hostlist_client.c |
198 | src/hostlist/gnunet-daemon-hostlist_server.c | 198 | src/hostlist/gnunet-daemon-hostlist_server.c |
@@ -208,8 +208,8 @@ src/json/json_helper.c | |||
208 | src/json/json_mhd.c | 208 | src/json/json_mhd.c |
209 | src/json/json_pack.c | 209 | src/json/json_pack.c |
210 | src/messenger/gnunet-messenger.c | 210 | src/messenger/gnunet-messenger.c |
211 | src/messenger/gnunet-service-messenger_basement.c | ||
212 | src/messenger/gnunet-service-messenger.c | 211 | src/messenger/gnunet-service-messenger.c |
212 | src/messenger/gnunet-service-messenger_basement.c | ||
213 | src/messenger/gnunet-service-messenger_ego_store.c | 213 | src/messenger/gnunet-service-messenger_ego_store.c |
214 | src/messenger/gnunet-service-messenger_handle.c | 214 | src/messenger/gnunet-service-messenger_handle.c |
215 | src/messenger/gnunet-service-messenger_list_handles.c | 215 | src/messenger/gnunet-service-messenger_list_handles.c |
@@ -248,8 +248,8 @@ src/namecache/namecache_api.c | |||
248 | src/namecache/plugin_namecache_flat.c | 248 | src/namecache/plugin_namecache_flat.c |
249 | src/namecache/plugin_namecache_postgres.c | 249 | src/namecache/plugin_namecache_postgres.c |
250 | src/namecache/plugin_namecache_sqlite.c | 250 | src/namecache/plugin_namecache_sqlite.c |
251 | src/namestore/gnunet-namestore.c | ||
252 | src/namestore/gnunet-namestore-fcfsd.c | 251 | src/namestore/gnunet-namestore-fcfsd.c |
252 | src/namestore/gnunet-namestore.c | ||
253 | src/namestore/gnunet-service-namestore.c | 253 | src/namestore/gnunet-service-namestore.c |
254 | src/namestore/gnunet-zoneimport.c | 254 | src/namestore/gnunet-zoneimport.c |
255 | src/namestore/namestore_api.c | 255 | src/namestore/namestore_api.c |
@@ -275,17 +275,17 @@ src/nat/gnunet-service-nat_mini.c | |||
275 | src/nat/gnunet-service-nat_stun.c | 275 | src/nat/gnunet-service-nat_stun.c |
276 | src/nat/nat_api.c | 276 | src/nat/nat_api.c |
277 | src/nat/nat_api_stun.c | 277 | src/nat/nat_api_stun.c |
278 | src/nse/gnunet-nse.c | ||
279 | src/nse/gnunet-nse-profiler.c | 278 | src/nse/gnunet-nse-profiler.c |
279 | src/nse/gnunet-nse.c | ||
280 | src/nse/gnunet-service-nse.c | 280 | src/nse/gnunet-service-nse.c |
281 | src/nse/nse_api.c | 281 | src/nse/nse_api.c |
282 | src/nt/nt.c | 282 | src/nt/nt.c |
283 | src/peerinfo/gnunet-service-peerinfo.c | ||
284 | src/peerinfo/peerinfo_api.c | ||
285 | src/peerinfo/peerinfo_api_notify.c | ||
286 | src/peerinfo-tool/gnunet-peerinfo.c | 283 | src/peerinfo-tool/gnunet-peerinfo.c |
287 | src/peerinfo-tool/gnunet-peerinfo_plugins.c | 284 | src/peerinfo-tool/gnunet-peerinfo_plugins.c |
288 | src/peerinfo-tool/plugin_rest_peerinfo.c | 285 | src/peerinfo-tool/plugin_rest_peerinfo.c |
286 | src/peerinfo/gnunet-service-peerinfo.c | ||
287 | src/peerinfo/peerinfo_api.c | ||
288 | src/peerinfo/peerinfo_api_notify.c | ||
289 | src/peerstore/gnunet-peerstore.c | 289 | src/peerstore/gnunet-peerstore.c |
290 | src/peerstore/gnunet-service-peerstore.c | 290 | src/peerstore/gnunet-service-peerstore.c |
291 | src/peerstore/peerstore_api.c | 291 | src/peerstore/peerstore_api.c |
@@ -335,27 +335,27 @@ src/rest/gnunet-rest-server.c | |||
335 | src/rest/plugin_rest_config.c | 335 | src/rest/plugin_rest_config.c |
336 | src/rest/plugin_rest_copying.c | 336 | src/rest/plugin_rest_copying.c |
337 | src/rest/rest.c | 337 | src/rest/rest.c |
338 | src/revocation/gnunet-revocation.c | ||
339 | src/revocation/gnunet-revocation-tvg.c | 338 | src/revocation/gnunet-revocation-tvg.c |
339 | src/revocation/gnunet-revocation.c | ||
340 | src/revocation/gnunet-service-revocation.c | 340 | src/revocation/gnunet-service-revocation.c |
341 | src/revocation/plugin_block_revocation.c | 341 | src/revocation/plugin_block_revocation.c |
342 | src/revocation/revocation_api.c | 342 | src/revocation/revocation_api.c |
343 | src/rps/gnunet-rps.c | ||
344 | src/rps/gnunet-rps-profiler.c | 343 | src/rps/gnunet-rps-profiler.c |
344 | src/rps/gnunet-rps.c | ||
345 | src/rps/gnunet-service-rps.c | 345 | src/rps/gnunet-service-rps.c |
346 | src/rps/gnunet-service-rps_custommap.c | 346 | src/rps/gnunet-service-rps_custommap.c |
347 | src/rps/gnunet-service-rps_sampler.c | 347 | src/rps/gnunet-service-rps_sampler.c |
348 | src/rps/gnunet-service-rps_sampler_elem.c | 348 | src/rps/gnunet-service-rps_sampler_elem.c |
349 | src/rps/gnunet-service-rps_view.c | 349 | src/rps/gnunet-service-rps_view.c |
350 | src/rps/rps_api.c | ||
351 | src/rps/rps-sampler_client.c | 350 | src/rps/rps-sampler_client.c |
352 | src/rps/rps-sampler_common.c | 351 | src/rps/rps-sampler_common.c |
353 | src/rps/rps-test_util.c | 352 | src/rps/rps-test_util.c |
353 | src/rps/rps_api.c | ||
354 | src/scalarproduct/gnunet-scalarproduct.c | 354 | src/scalarproduct/gnunet-scalarproduct.c |
355 | src/scalarproduct/gnunet-service-scalarproduct_alice.c | ||
356 | src/scalarproduct/gnunet-service-scalarproduct_bob.c | ||
357 | src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c | 355 | src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c |
358 | src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c | 356 | src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c |
357 | src/scalarproduct/gnunet-service-scalarproduct_alice.c | ||
358 | src/scalarproduct/gnunet-service-scalarproduct_bob.c | ||
359 | src/scalarproduct/scalarproduct_api.c | 359 | src/scalarproduct/scalarproduct_api.c |
360 | src/secretsharing/gnunet-secretsharing-profiler.c | 360 | src/secretsharing/gnunet-secretsharing-profiler.c |
361 | src/secretsharing/gnunet-service-secretsharing.c | 361 | src/secretsharing/gnunet-service-secretsharing.c |
@@ -369,12 +369,12 @@ src/set/gnunet-set-ibf-profiler.c | |||
369 | src/set/gnunet-set-profiler.c | 369 | src/set/gnunet-set-profiler.c |
370 | src/set/ibf.c | 370 | src/set/ibf.c |
371 | src/set/ibf_sim.c | 371 | src/set/ibf_sim.c |
372 | src/set/plugin_block_set_test.c | ||
373 | src/set/set_api.c | ||
372 | src/seti/gnunet-service-seti.c | 374 | src/seti/gnunet-service-seti.c |
373 | src/seti/gnunet-seti-profiler.c | 375 | src/seti/gnunet-seti-profiler.c |
374 | src/seti/plugin_block_seti_test.c | 376 | src/seti/plugin_block_seti_test.c |
375 | src/seti/seti_api.c | 377 | src/seti/seti_api.c |
376 | src/set/plugin_block_set_test.c | ||
377 | src/set/set_api.c | ||
378 | src/setu/gnunet-service-setu.c | 378 | src/setu/gnunet-service-setu.c |
379 | src/setu/gnunet-service-setu_strata_estimator.c | 379 | src/setu/gnunet-service-setu_strata_estimator.c |
380 | src/setu/gnunet-setu-ibf-profiler.c | 380 | src/setu/gnunet-setu-ibf-profiler.c |
@@ -393,17 +393,17 @@ src/statistics/gnunet-statistics.c | |||
393 | src/statistics/statistics_api.c | 393 | src/statistics/statistics_api.c |
394 | src/template/gnunet-service-template.c | 394 | src/template/gnunet-service-template.c |
395 | src/template/gnunet-template.c | 395 | src/template/gnunet-template.c |
396 | src/testbed-logger/gnunet-service-testbed-logger.c | ||
397 | src/testbed-logger/testbed_logger_api.c | ||
396 | src/testbed/generate-underlay-topology.c | 398 | src/testbed/generate-underlay-topology.c |
397 | src/testbed/gnunet-cmd.c | ||
398 | src/testbed/gnunet-cmds-helper.c | 399 | src/testbed/gnunet-cmds-helper.c |
399 | src/testbed/gnunet-daemon-latency-logger.c | 400 | src/testbed/gnunet-daemon-latency-logger.c |
400 | src/testbed/gnunet-daemon-testbed-blacklist.c | 401 | src/testbed/gnunet-daemon-testbed-blacklist.c |
401 | src/testbed/gnunet-daemon-testbed-underlay.c | 402 | src/testbed/gnunet-daemon-testbed-underlay.c |
402 | src/testbed/gnunet-helper-testbed.c | 403 | src/testbed/gnunet-helper-testbed.c |
403 | src/testbed/gnunet_mpi_test.c | ||
404 | src/testbed/gnunet-service-test-barriers.c | 404 | src/testbed/gnunet-service-test-barriers.c |
405 | src/testbed/gnunet-service-testbed_barriers.c | ||
406 | src/testbed/gnunet-service-testbed.c | 405 | src/testbed/gnunet-service-testbed.c |
406 | src/testbed/gnunet-service-testbed_barriers.c | ||
407 | src/testbed/gnunet-service-testbed_cache.c | 407 | src/testbed/gnunet-service-testbed_cache.c |
408 | src/testbed/gnunet-service-testbed_connectionpool.c | 408 | src/testbed/gnunet-service-testbed_connectionpool.c |
409 | src/testbed/gnunet-service-testbed_cpustatus.c | 409 | src/testbed/gnunet-service-testbed_cpustatus.c |
@@ -411,67 +411,61 @@ src/testbed/gnunet-service-testbed_links.c | |||
411 | src/testbed/gnunet-service-testbed_meminfo.c | 411 | src/testbed/gnunet-service-testbed_meminfo.c |
412 | src/testbed/gnunet-service-testbed_oc.c | 412 | src/testbed/gnunet-service-testbed_oc.c |
413 | src/testbed/gnunet-service-testbed_peers.c | 413 | src/testbed/gnunet-service-testbed_peers.c |
414 | src/testbed/gnunet_testbed_mpi_spawn.c | ||
415 | src/testbed/gnunet-testbed-profiler.c | 414 | src/testbed/gnunet-testbed-profiler.c |
416 | src/testbed-logger/gnunet-service-testbed-logger.c | 415 | src/testbed/gnunet_mpi_test.c |
417 | src/testbed-logger/testbed_logger_api.c | 416 | src/testbed/gnunet_testbed_mpi_spawn.c |
418 | src/testbed/plugin_testcmd.c | 417 | src/testbed/plugin_testcmd.c |
419 | src/testbed/testbed_api_barriers.c | ||
420 | src/testbed/testbed_api.c | 418 | src/testbed/testbed_api.c |
419 | src/testbed/testbed_api_barriers.c | ||
421 | src/testbed/testbed_api_cmd_block_until_all_peers_started.c | 420 | src/testbed/testbed_api_cmd_block_until_all_peers_started.c |
422 | src/testbed/testbed_api_cmd_controller.c | ||
423 | src/testbed/testbed_api_cmd_local_test_finished.c | 421 | src/testbed/testbed_api_cmd_local_test_finished.c |
424 | src/testbed/testbed_api_cmd_netjail_start.c | 422 | src/testbed/testbed_api_cmd_netjail_start.c |
425 | src/testbed/testbed_api_cmd_netjail_start_testbed.c | 423 | src/testbed/testbed_api_cmd_netjail_start_testbed.c |
426 | src/testbed/testbed_api_cmd_netjail_stop.c | 424 | src/testbed/testbed_api_cmd_netjail_stop.c |
427 | src/testbed/testbed_api_cmd_netjail_stop_testbed.c | 425 | src/testbed/testbed_api_cmd_netjail_stop_testbed.c |
428 | src/testbed/testbed_api_cmd_peer.c | ||
429 | src/testbed/testbed_api_cmd_peer_store.c | ||
430 | src/testbed/testbed_api_cmd_send_peer_ready.c | 426 | src/testbed/testbed_api_cmd_send_peer_ready.c |
431 | src/testbed/testbed_api_cmd_tng_connect.c | ||
432 | src/testbed/testbed_api_cmd_tng_service.c | ||
433 | src/testbed/testbed_api_hosts.c | 427 | src/testbed/testbed_api_hosts.c |
434 | src/testbed/testbed_api_operations.c | 428 | src/testbed/testbed_api_operations.c |
435 | src/testbed/testbed_api_peers.c | 429 | src/testbed/testbed_api_peers.c |
436 | src/testbed/testbed_api_sd.c | 430 | src/testbed/testbed_api_sd.c |
437 | src/testbed/testbed_api_services.c | 431 | src/testbed/testbed_api_services.c |
438 | src/testbed/testbed_api_statistics.c | 432 | src/testbed/testbed_api_statistics.c |
439 | src/testbed/testbed_api_testbed.c | ||
440 | src/testbed/testbed_api_test.c | 433 | src/testbed/testbed_api_test.c |
434 | src/testbed/testbed_api_testbed.c | ||
441 | src/testbed/testbed_api_topology.c | 435 | src/testbed/testbed_api_topology.c |
442 | src/testbed/testbed_api_underlay.c | 436 | src/testbed/testbed_api_underlay.c |
443 | src/testing/gnunet-testing.c | 437 | src/testing/gnunet-testing.c |
444 | src/testing/list-keys.c | 438 | src/testing/list-keys.c |
439 | src/testing/testing.c | ||
445 | src/testing/testing_api_cmd_batch.c | 440 | src/testing/testing_api_cmd_batch.c |
446 | src/testing/testing_api_cmd_hello_world_birth.c | ||
447 | src/testing/testing_api_cmd_hello_world.c | 441 | src/testing/testing_api_cmd_hello_world.c |
442 | src/testing/testing_api_cmd_hello_world_birth.c | ||
448 | src/testing/testing_api_cmd_send_peer_ready.c | 443 | src/testing/testing_api_cmd_send_peer_ready.c |
449 | src/testing/testing_api_cmd_system_create.c | 444 | src/testing/testing_api_cmd_system_create.c |
450 | src/testing/testing_api_loop.c | 445 | src/testing/testing_api_loop.c |
451 | src/testing/testing_api_trait_cmd.c | 446 | src/testing/testing_api_trait_cmd.c |
452 | src/testing/testing_api_trait_process.c | 447 | src/testing/testing_api_trait_process.c |
453 | src/testing/testing_api_traits.c | 448 | src/testing/testing_api_traits.c |
454 | src/testing/testing.c | ||
455 | src/topology/friends.c | 449 | src/topology/friends.c |
456 | src/topology/gnunet-daemon-topology.c | 450 | src/topology/gnunet-daemon-topology.c |
457 | src/transport/gnunet-communicator-tcp.c | 451 | src/transport/gnunet-communicator-tcp.c |
458 | src/transport/gnunet-communicator-udp.c | 452 | src/transport/gnunet-communicator-udp.c |
459 | src/transport/gnunet-communicator-unix.c | 453 | src/transport/gnunet-communicator-unix.c |
460 | src/transport/gnunet-helper-transport-bluetooth.c | 454 | src/transport/gnunet-helper-transport-bluetooth.c |
461 | src/transport/gnunet-helper-transport-wlan.c | ||
462 | src/transport/gnunet-helper-transport-wlan-dummy.c | 455 | src/transport/gnunet-helper-transport-wlan-dummy.c |
456 | src/transport/gnunet-helper-transport-wlan.c | ||
463 | src/transport/gnunet-service-tng.c | 457 | src/transport/gnunet-service-tng.c |
464 | src/transport/gnunet-service-transport_ats.c | ||
465 | src/transport/gnunet-service-transport.c | 458 | src/transport/gnunet-service-transport.c |
459 | src/transport/gnunet-service-transport_ats.c | ||
466 | src/transport/gnunet-service-transport_hello.c | 460 | src/transport/gnunet-service-transport_hello.c |
467 | src/transport/gnunet-service-transport_manipulation.c | 461 | src/transport/gnunet-service-transport_manipulation.c |
468 | src/transport/gnunet-service-transport_neighbours.c | 462 | src/transport/gnunet-service-transport_neighbours.c |
469 | src/transport/gnunet-service-transport_plugins.c | 463 | src/transport/gnunet-service-transport_plugins.c |
470 | src/transport/gnunet-service-transport_validation.c | 464 | src/transport/gnunet-service-transport_validation.c |
471 | src/transport/gnunet-transport.c | ||
472 | src/transport/gnunet-transport-profiler.c | 465 | src/transport/gnunet-transport-profiler.c |
473 | src/transport/gnunet-transport-wlan-receiver.c | 466 | src/transport/gnunet-transport-wlan-receiver.c |
474 | src/transport/gnunet-transport-wlan-sender.c | 467 | src/transport/gnunet-transport-wlan-sender.c |
468 | src/transport/gnunet-transport.c | ||
475 | src/transport/plugin_cmd_simple_send.c | 469 | src/transport/plugin_cmd_simple_send.c |
476 | src/transport/plugin_transport_http_client.c | 470 | src/transport/plugin_transport_http_client.c |
477 | src/transport/plugin_transport_http_common.c | 471 | src/transport/plugin_transport_http_common.c |
@@ -479,14 +473,25 @@ src/transport/plugin_transport_http_server.c | |||
479 | src/transport/plugin_transport_smtp.c | 473 | src/transport/plugin_transport_smtp.c |
480 | src/transport/plugin_transport_tcp.c | 474 | src/transport/plugin_transport_tcp.c |
481 | src/transport/plugin_transport_template.c | 475 | src/transport/plugin_transport_template.c |
482 | src/transport/plugin_transport_udp_broadcasting.c | ||
483 | src/transport/plugin_transport_udp.c | 476 | src/transport/plugin_transport_udp.c |
477 | src/transport/plugin_transport_udp_broadcasting.c | ||
484 | src/transport/plugin_transport_unix.c | 478 | src/transport/plugin_transport_unix.c |
485 | src/transport/plugin_transport_wlan.c | 479 | src/transport/plugin_transport_wlan.c |
486 | src/transport/tcp_connection_legacy.c | 480 | src/transport/tcp_connection_legacy.c |
487 | src/transport/tcp_server_legacy.c | 481 | src/transport/tcp_server_legacy.c |
488 | src/transport/tcp_server_mst_legacy.c | 482 | src/transport/tcp_server_mst_legacy.c |
489 | src/transport/tcp_service_legacy.c | 483 | src/transport/tcp_service_legacy.c |
484 | src/transport/transport-testing-communicator.c | ||
485 | src/transport/transport-testing-filenames.c | ||
486 | src/transport/transport-testing-filenames2.c | ||
487 | src/transport/transport-testing-loggers.c | ||
488 | src/transport/transport-testing-loggers2.c | ||
489 | src/transport/transport-testing-main.c | ||
490 | src/transport/transport-testing-main2.c | ||
491 | src/transport/transport-testing-send.c | ||
492 | src/transport/transport-testing-send2.c | ||
493 | src/transport/transport-testing.c | ||
494 | src/transport/transport-testing2.c | ||
490 | src/transport/transport_api2_application.c | 495 | src/transport/transport_api2_application.c |
491 | src/transport/transport_api2_communication.c | 496 | src/transport/transport_api2_communication.c |
492 | src/transport/transport_api2_core.c | 497 | src/transport/transport_api2_core.c |
@@ -502,17 +507,6 @@ src/transport/transport_api_manipulation.c | |||
502 | src/transport/transport_api_monitor_peers.c | 507 | src/transport/transport_api_monitor_peers.c |
503 | src/transport/transport_api_monitor_plugins.c | 508 | src/transport/transport_api_monitor_plugins.c |
504 | src/transport/transport_api_offer_hello.c | 509 | src/transport/transport_api_offer_hello.c |
505 | src/transport/transport-testing2.c | ||
506 | src/transport/transport-testing.c | ||
507 | src/transport/transport-testing-communicator.c | ||
508 | src/transport/transport-testing-filenames2.c | ||
509 | src/transport/transport-testing-filenames.c | ||
510 | src/transport/transport-testing-loggers2.c | ||
511 | src/transport/transport-testing-loggers.c | ||
512 | src/transport/transport-testing-main2.c | ||
513 | src/transport/transport-testing-main.c | ||
514 | src/transport/transport-testing-send2.c | ||
515 | src/transport/transport-testing-send.c | ||
516 | src/util/bandwidth.c | 510 | src/util/bandwidth.c |
517 | src/util/benchmark.c | 511 | src/util/benchmark.c |
518 | src/util/bio.c | 512 | src/util/bio.c |
@@ -527,8 +521,8 @@ src/util/consttime_memcmp.c | |||
527 | src/util/container_bloomfilter.c | 521 | src/util/container_bloomfilter.c |
528 | src/util/container_heap.c | 522 | src/util/container_heap.c |
529 | src/util/container_meta_data.c | 523 | src/util/container_meta_data.c |
530 | src/util/container_multihashmap32.c | ||
531 | src/util/container_multihashmap.c | 524 | src/util/container_multihashmap.c |
525 | src/util/container_multihashmap32.c | ||
532 | src/util/container_multipeermap.c | 526 | src/util/container_multipeermap.c |
533 | src/util/container_multishortmap.c | 527 | src/util/container_multishortmap.c |
534 | src/util/container_multiuuidmap.c | 528 | src/util/container_multiuuidmap.c |
@@ -554,8 +548,8 @@ src/util/dnsstub.c | |||
554 | src/util/getopt.c | 548 | src/util/getopt.c |
555 | src/util/getopt_helpers.c | 549 | src/util/getopt_helpers.c |
556 | src/util/gnunet-base32.c | 550 | src/util/gnunet-base32.c |
557 | src/util/gnunet-config.c | ||
558 | src/util/gnunet-config-diff.c | 551 | src/util/gnunet-config-diff.c |
552 | src/util/gnunet-config.c | ||
559 | src/util/gnunet-crypto-tvg.c | 553 | src/util/gnunet-crypto-tvg.c |
560 | src/util/gnunet-ecc.c | 554 | src/util/gnunet-ecc.c |
561 | src/util/gnunet-qr.c | 555 | src/util/gnunet-qr.c |
@@ -593,8 +587,8 @@ src/vpn/gnunet-helper-vpn.c | |||
593 | src/vpn/gnunet-service-vpn.c | 587 | src/vpn/gnunet-service-vpn.c |
594 | src/vpn/gnunet-vpn.c | 588 | src/vpn/gnunet-vpn.c |
595 | src/vpn/vpn_api.c | 589 | src/vpn/vpn_api.c |
596 | src/zonemaster/gnunet-service-zonemaster.c | ||
597 | src/zonemaster/gnunet-service-zonemaster-monitor.c | 590 | src/zonemaster/gnunet-service-zonemaster-monitor.c |
591 | src/zonemaster/gnunet-service-zonemaster.c | ||
598 | src/fs/fs_api.h | 592 | src/fs/fs_api.h |
599 | src/include/gnunet_json_lib.h | 593 | src/include/gnunet_json_lib.h |
600 | src/testbed/testbed_api.h | 594 | src/testbed/testbed_api.h |
diff --git a/src/include/gnunet_testbed_ng_service.h b/src/include/gnunet_testbed_ng_service.h index 2ff5228cf..5979cd85a 100644 --- a/src/include/gnunet_testbed_ng_service.h +++ b/src/include/gnunet_testbed_ng_service.h | |||
@@ -38,176 +38,6 @@ | |||
38 | #include "gnunet_util_lib.h" | 38 | #include "gnunet_util_lib.h" |
39 | #include "gnunet_testing_ng_lib.h" | 39 | #include "gnunet_testing_ng_lib.h" |
40 | 40 | ||
41 | struct TngState; | ||
42 | |||
43 | struct PeerCmdState | ||
44 | { | ||
45 | /** | ||
46 | * The label of a controller command. | ||
47 | */ | ||
48 | const char *controller_label; | ||
49 | |||
50 | /** | ||
51 | * Handle to operation | ||
52 | */ | ||
53 | struct GNUNET_TESTBED_Operation *operation; | ||
54 | |||
55 | /** | ||
56 | * Name of the host, use "NULL" for localhost. | ||
57 | */ | ||
58 | const char *hostname; | ||
59 | |||
60 | /** | ||
61 | * Username to use for the login; may be NULL. | ||
62 | */ | ||
63 | const char *username; | ||
64 | |||
65 | /** | ||
66 | * Port number to use for ssh; use 0 to let ssh decide. | ||
67 | */ | ||
68 | uint16_t port; | ||
69 | |||
70 | /** | ||
71 | * The configuration to use as a template while starting a controller | ||
72 | * on this host. Operation queue sizes specific to a host are also | ||
73 | * read from this configuration handle. | ||
74 | */ | ||
75 | struct GNUNET_CONFIGURATION_Handle *cfg; | ||
76 | |||
77 | /** | ||
78 | * The host to run peers and controllers on | ||
79 | */ | ||
80 | struct GNUNET_TESTBED_Host *host; | ||
81 | |||
82 | /** | ||
83 | * Abort task identifier | ||
84 | */ | ||
85 | struct GNUNET_SCHEDULER_Task *abort_task; | ||
86 | |||
87 | /** | ||
88 | * Flag indicating if peer is ready. | ||
89 | */ | ||
90 | int peer_ready; | ||
91 | |||
92 | /** | ||
93 | * Flag indicating controller is going down. | ||
94 | */ | ||
95 | int peer_going_down; | ||
96 | |||
97 | /** | ||
98 | * Interpreter state. | ||
99 | */ | ||
100 | struct GNUNET_TESTING_Interpreter *is; | ||
101 | |||
102 | /** | ||
103 | * Peer to start | ||
104 | */ | ||
105 | struct GNUNET_TESTBED_Peer *peer; | ||
106 | }; | ||
107 | |||
108 | struct ControllerState | ||
109 | { | ||
110 | /** | ||
111 | * The ip address of the controller which will be set as TRUSTED | ||
112 | * HOST(all connections form this ip are permitted by the testbed) when | ||
113 | * starting testbed controller at host. This can either be a single ip | ||
114 | * address or a network address in CIDR notation. | ||
115 | */ | ||
116 | const char *trusted_ip; | ||
117 | |||
118 | /** | ||
119 | * Name of the host, use "NULL" for localhost. | ||
120 | */ | ||
121 | const char *hostname; | ||
122 | |||
123 | /** | ||
124 | * Username to use for the login; may be NULL. | ||
125 | */ | ||
126 | const char *username; | ||
127 | |||
128 | /** | ||
129 | * Port number to use for ssh; use 0 to let ssh decide. | ||
130 | */ | ||
131 | uint16_t port; | ||
132 | |||
133 | /** | ||
134 | * The configuration to use as a template while starting a controller | ||
135 | * on this host. Operation queue sizes specific to a host are also | ||
136 | * read from this configuration handle. | ||
137 | */ | ||
138 | struct GNUNET_CONFIGURATION_Handle *cfg; | ||
139 | |||
140 | /** | ||
141 | * The host to run peers and controllers on | ||
142 | */ | ||
143 | struct GNUNET_TESTBED_Host *host; | ||
144 | |||
145 | /** | ||
146 | * The controller process | ||
147 | */ | ||
148 | struct GNUNET_TESTBED_ControllerProc *cp; | ||
149 | |||
150 | /** | ||
151 | * The controller handle | ||
152 | */ | ||
153 | struct GNUNET_TESTBED_Controller *controller; | ||
154 | |||
155 | /** | ||
156 | * A bit mask with set of events to call the controller for. | ||
157 | */ | ||
158 | uint64_t event_mask; | ||
159 | |||
160 | /** | ||
161 | * Abort task identifier | ||
162 | */ | ||
163 | struct GNUNET_SCHEDULER_Task *abort_task; | ||
164 | |||
165 | /** | ||
166 | * Handle for host registration | ||
167 | */ | ||
168 | struct GNUNET_TESTBED_HostRegistrationHandle *reg_handle; | ||
169 | |||
170 | /** | ||
171 | * Flag indicating if host create with controller is ready. | ||
172 | */ | ||
173 | int host_ready; | ||
174 | |||
175 | /** | ||
176 | * Flag indicating controller is going down. | ||
177 | */ | ||
178 | int controller_going_down; | ||
179 | |||
180 | /** | ||
181 | * Interpreter state. | ||
182 | */ | ||
183 | struct GNUNET_TESTING_Interpreter *is; | ||
184 | }; | ||
185 | |||
186 | /** | ||
187 | * Offer data from trait | ||
188 | * | ||
189 | * @param cmd command to extract the controller from. | ||
190 | * @param pt pointer to controller. | ||
191 | * @return #GNUNET_OK on success. | ||
192 | */ | ||
193 | int | ||
194 | GNUNET_TESTBED_get_trait_controller (const struct GNUNET_TESTING_Command *cmd, | ||
195 | struct GNUNET_TESTBED_Controller ** | ||
196 | controller); | ||
197 | |||
198 | struct GNUNET_TESTING_Command | ||
199 | GNUNET_TESTBED_cmd_controller (const char *label, | ||
200 | const char *host, | ||
201 | uint64_t event_mask); | ||
202 | |||
203 | void | ||
204 | GNUNET_TESTBED_shutdown_controller (struct ControllerState *cs); | ||
205 | |||
206 | void | ||
207 | GNUNET_TESTBED_shutdown_peer (struct PeerCmdState *ps); | ||
208 | |||
209 | void | ||
210 | GNUNET_TESTBED_shutdown_service (struct TngState *ss); | ||
211 | 41 | ||
212 | /** | 42 | /** |
213 | * Create command. | 43 | * Create command. |
@@ -217,7 +47,7 @@ GNUNET_TESTBED_shutdown_service (struct TngState *ss); | |||
217 | * @return command. | 47 | * @return command. |
218 | */ | 48 | */ |
219 | struct GNUNET_TESTING_Command | 49 | struct GNUNET_TESTING_Command |
220 | GNUNET_TESTBED_cmd_netjail_start (const char *label, | 50 | GNUNET_TESTING_cmd_netjail_start (const char *label, |
221 | char *local_m, | 51 | char *local_m, |
222 | char *global_n); | 52 | char *global_n); |
223 | 53 | ||
@@ -230,11 +60,11 @@ GNUNET_TESTBED_cmd_netjail_start (const char *label, | |||
230 | * @return command. | 60 | * @return command. |
231 | */ | 61 | */ |
232 | struct GNUNET_TESTING_Command | 62 | struct GNUNET_TESTING_Command |
233 | GNUNET_TESTBED_cmd_netjail_start_testbed (const char *label, | 63 | GNUNET_TESTING_cmd_netjail_start_testing_system (const char *label, |
234 | char *local_m, | 64 | char *local_m, |
235 | char *global_n, | 65 | char *global_n, |
236 | char *plugin_name, | 66 | char *plugin_name, |
237 | unsigned int *rv); | 67 | unsigned int *rv); |
238 | 68 | ||
239 | 69 | ||
240 | /** | 70 | /** |
@@ -245,29 +75,24 @@ GNUNET_TESTBED_cmd_netjail_start_testbed (const char *label, | |||
245 | * @return command. | 75 | * @return command. |
246 | */ | 76 | */ |
247 | struct GNUNET_TESTING_Command | 77 | struct GNUNET_TESTING_Command |
248 | GNUNET_TESTBED_cmd_netjail_stop (const char *label, | 78 | GNUNET_TESTING_cmd_netjail_stop (const char *label, |
249 | char *local_m, | 79 | char *local_m, |
250 | char *global_n); | 80 | char *global_n); |
251 | 81 | ||
252 | 82 | ||
253 | struct GNUNET_TESTING_Command | 83 | struct GNUNET_TESTING_Command |
254 | GNUNET_TESTBED_cmd_stop_testbed (const char *label, | 84 | GNUNET_TESTING_cmd_stop_testing_system (const char *label, |
255 | const char *helper_start_label, | 85 | const char *helper_start_label, |
256 | char *local_m, | 86 | char *local_m, |
257 | char *global_n); | 87 | char *global_n); |
258 | 88 | ||
259 | 89 | ||
260 | int | 90 | int |
261 | GNUNET_TESTBED_get_trait_helper_handles (const struct | 91 | GNUNET_TESTING_get_trait_helper_handles (const struct |
262 | GNUNET_TESTING_Command *cmd, | 92 | GNUNET_TESTING_Command *cmd, |
263 | struct GNUNET_HELPER_Handle ***helper); | 93 | struct GNUNET_HELPER_Handle ***helper); |
264 | 94 | ||
265 | 95 | ||
266 | int | ||
267 | GNUNET_TESTBED_get_trait_hosts (const struct | ||
268 | GNUNET_TESTING_Command *cmd, | ||
269 | struct GNUNET_TESTBED_Host ***hosts); | ||
270 | |||
271 | struct GNUNET_TESTING_Command | 96 | struct GNUNET_TESTING_Command |
272 | GNUNET_TESTING_cmd_block_until_all_peers_started (const char *label, | 97 | GNUNET_TESTING_cmd_block_until_all_peers_started (const char *label, |
273 | unsigned int * | 98 | unsigned int * |
@@ -275,11 +100,11 @@ GNUNET_TESTING_cmd_block_until_all_peers_started (const char *label, | |||
275 | 100 | ||
276 | struct GNUNET_TESTING_Command | 101 | struct GNUNET_TESTING_Command |
277 | GNUNET_TESTING_cmd_send_peer_ready (const char *label, | 102 | GNUNET_TESTING_cmd_send_peer_ready (const char *label, |
278 | TESTBED_CMD_HELPER_write_cb write_message); | 103 | TESTING_CMD_HELPER_write_cb write_message); |
279 | 104 | ||
280 | struct GNUNET_TESTING_Command | 105 | struct GNUNET_TESTING_Command |
281 | GNUNET_TESTING_cmd_local_test_finished (const char *label, | 106 | GNUNET_TESTING_cmd_local_test_finished (const char *label, |
282 | TESTBED_CMD_HELPER_write_cb | 107 | TESTING_CMD_HELPER_write_cb |
283 | write_message); | 108 | write_message); |
284 | 109 | ||
285 | #endif | 110 | #endif |
diff --git a/src/include/gnunet_testing_plugin.h b/src/include/gnunet_testing_plugin.h index 103eb23be..151827d4b 100644 --- a/src/include/gnunet_testing_plugin.h +++ b/src/include/gnunet_testing_plugin.h | |||
@@ -37,11 +37,11 @@ extern "C" | |||
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | typedef void | 39 | typedef void |
40 | (*TESTBED_CMD_HELPER_write_cb) (struct GNUNET_MessageHeader *message, size_t | 40 | (*TESTING_CMD_HELPER_write_cb) (struct GNUNET_MessageHeader *message, size_t |
41 | msg_length); | 41 | msg_length); |
42 | 42 | ||
43 | typedef void | 43 | typedef void |
44 | (*GNUNET_TESTING_PLUGIN_StartTestCase) (TESTBED_CMD_HELPER_write_cb | 44 | (*GNUNET_TESTING_PLUGIN_StartTestCase) (TESTING_CMD_HELPER_write_cb |
45 | write_message, char *router_ip, | 45 | write_message, char *router_ip, |
46 | char *node_ip, | 46 | char *node_ip, |
47 | char *n, | 47 | char *n, |
diff --git a/src/testbed/Makefile.am b/src/testbed/Makefile.am index b4b2cff97..5a221cd69 100644 --- a/src/testbed/Makefile.am +++ b/src/testbed/Makefile.am | |||
@@ -23,7 +23,6 @@ if HAVE_SQLITE | |||
23 | endif | 23 | endif |
24 | 24 | ||
25 | libexec_PROGRAMS = \ | 25 | libexec_PROGRAMS = \ |
26 | gnunet-cmd \ | ||
27 | gnunet-cmds-helper \ | 26 | gnunet-cmds-helper \ |
28 | gnunet-service-testbed \ | 27 | gnunet-service-testbed \ |
29 | gnunet-helper-testbed \ | 28 | gnunet-helper-testbed \ |
@@ -90,14 +89,6 @@ gnunet_helper_testbed_LDADD = $(XLIB) \ | |||
90 | libgnunettestbed.la \ | 89 | libgnunettestbed.la \ |
91 | $(LTLIBINTL) $(Z_LIBS) | 90 | $(LTLIBINTL) $(Z_LIBS) |
92 | 91 | ||
93 | gnunet_cmd_SOURCES = \ | ||
94 | gnunet-cmd.c | ||
95 | gnunet_cmd_LDADD = $(XLIB) \ | ||
96 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
97 | $(top_builddir)/src/testing/libgnunettesting.la \ | ||
98 | libgnunettestbed.la \ | ||
99 | $(LTLIBINTL) $(Z_LIBS) | ||
100 | |||
101 | gnunet_cmds_helper_SOURCES = \ | 92 | gnunet_cmds_helper_SOURCES = \ |
102 | gnunet-cmds-helper.c | 93 | gnunet-cmds-helper.c |
103 | gnunet_cmds_helper_LDADD = $(XLIB) \ | 94 | gnunet_cmds_helper_LDADD = $(XLIB) \ |
@@ -138,8 +129,6 @@ libgnunettestbed_la_SOURCES = \ | |||
138 | testbed_api_cmd_netjail_stop.c \ | 129 | testbed_api_cmd_netjail_stop.c \ |
139 | testbed_api.c testbed_api.h testbed.h \ | 130 | testbed_api.c testbed_api.h testbed.h \ |
140 | testbed_api_hosts.c testbed_api_hosts.h testbed_helper.h \ | 131 | testbed_api_hosts.c testbed_api_hosts.h testbed_helper.h \ |
141 | testbed_api_cmd_controller.c \ | ||
142 | testbed_api_cmd_peer.c \ | ||
143 | testbed_api_operations.c testbed_api_operations.h \ | 132 | testbed_api_operations.c testbed_api_operations.h \ |
144 | testbed_api_peers.c testbed_api_peers.h \ | 133 | testbed_api_peers.c testbed_api_peers.h \ |
145 | testbed_api_services.c \ | 134 | testbed_api_services.c \ |
diff --git a/src/testbed/gnunet-cmd.c b/src/testbed/gnunet-cmd.c deleted file mode 100644 index 0ba94fdd9..000000000 --- a/src/testbed/gnunet-cmd.c +++ /dev/null | |||
@@ -1,123 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | Copyright (C) 2008--2013, 2016 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software: you can redistribute it and/or modify it | ||
6 | under the terms of the GNU Affero General Public License as published | ||
7 | by the Free Software Foundation, either version 3 of the License, | ||
8 | or (at your option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Affero General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Affero General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | SPDX-License-Identifier: AGPL3.0-or-later | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file testbed/gnunet-cmd.c | ||
23 | * | ||
24 | * @brief Binary to start testcase plugins | ||
25 | * | ||
26 | * @author t3sserakt | ||
27 | */ | ||
28 | |||
29 | #include "platform.h" | ||
30 | #include "gnunet_util_lib.h" | ||
31 | #include "gnunet_testing_lib.h" | ||
32 | #include "gnunet_testing_plugin.h" | ||
33 | |||
34 | /** | ||
35 | * Generic logging shortcut | ||
36 | */ | ||
37 | #define LOG(kind, ...) GNUNET_log (kind, __VA_ARGS__) | ||
38 | |||
39 | #define NODE_BASE_IP "192.168.15." | ||
40 | |||
41 | #define ROUTER_BASE_IP "92.68.150." | ||
42 | |||
43 | /** | ||
44 | * Handle for a plugin. | ||
45 | */ | ||
46 | struct Plugin | ||
47 | { | ||
48 | /** | ||
49 | * Name of the shared library. | ||
50 | */ | ||
51 | char *library_name; | ||
52 | |||
53 | /** | ||
54 | * Plugin API. | ||
55 | */ | ||
56 | struct GNUNET_TESTING_PluginFunctions *api; | ||
57 | |||
58 | char *node_ip; | ||
59 | |||
60 | char *plugin_name; | ||
61 | |||
62 | char *global_n; | ||
63 | |||
64 | char *local_m; | ||
65 | |||
66 | char *n; | ||
67 | |||
68 | char *m; | ||
69 | }; | ||
70 | |||
71 | |||
72 | /** | ||
73 | * Main function to run the test cases. | ||
74 | * | ||
75 | * @param cls plugin to use. | ||
76 | * | ||
77 | */ | ||
78 | static void | ||
79 | run (void *cls) | ||
80 | { | ||
81 | struct Plugin *plugin = cls; | ||
82 | char *router_ip; | ||
83 | char *node_ip; | ||
84 | |||
85 | router_ip = GNUNET_malloc (strlen (ROUTER_BASE_IP) + strlen (plugin->m) + 1); | ||
86 | strcpy (router_ip, ROUTER_BASE_IP); | ||
87 | strcat (router_ip, plugin->m); | ||
88 | |||
89 | node_ip = GNUNET_malloc (strlen (NODE_BASE_IP) + strlen (plugin->n) + 1); | ||
90 | strcat (node_ip, NODE_BASE_IP); | ||
91 | strcat (node_ip, plugin->n); | ||
92 | |||
93 | plugin->api->start_testcase (NULL, router_ip, node_ip, NULL, NULL, NULL); | ||
94 | |||
95 | } | ||
96 | |||
97 | |||
98 | int | ||
99 | main (int argc, char *const *argv) | ||
100 | { | ||
101 | int rv = 0; | ||
102 | struct Plugin *plugin; | ||
103 | |||
104 | GNUNET_log_setup ("gnunet-cmd", | ||
105 | "DEBUG", | ||
106 | NULL); | ||
107 | |||
108 | plugin = GNUNET_new (struct Plugin); | ||
109 | plugin->api = GNUNET_PLUGIN_load (argv[0], | ||
110 | NULL); | ||
111 | plugin->library_name = GNUNET_strdup (argv[0]); | ||
112 | |||
113 | plugin->global_n = argv[1]; | ||
114 | plugin->local_m = argv[2]; | ||
115 | plugin->n = argv[3]; | ||
116 | plugin->m = argv[4]; | ||
117 | |||
118 | GNUNET_SCHEDULER_run (&run, | ||
119 | plugin); | ||
120 | |||
121 | GNUNET_free (plugin); | ||
122 | return rv; | ||
123 | } | ||
diff --git a/src/testbed/plugin_testcmd.c b/src/testbed/plugin_testcmd.c index e08ec067d..b74b67240 100644 --- a/src/testbed/plugin_testcmd.c +++ b/src/testbed/plugin_testcmd.c | |||
@@ -45,7 +45,7 @@ all_peers_started () | |||
45 | } | 45 | } |
46 | 46 | ||
47 | static void | 47 | static void |
48 | start_testcase (TESTBED_CMD_HELPER_write_cb write_message, char *router_ip, | 48 | start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, |
49 | char *node_ip, | 49 | char *node_ip, |
50 | char *n, | 50 | char *n, |
51 | char *m, | 51 | char *m, |
diff --git a/src/testbed/test_testbed_api_cmd_netjail.c b/src/testbed/test_testbed_api_cmd_netjail.c index 8bb9e40e8..85da39f0e 100644 --- a/src/testbed/test_testbed_api_cmd_netjail.c +++ b/src/testbed/test_testbed_api_cmd_netjail.c | |||
@@ -39,18 +39,18 @@ static void | |||
39 | run (void *cls) | 39 | run (void *cls) |
40 | { | 40 | { |
41 | struct GNUNET_TESTING_Command commands[] = { | 41 | struct GNUNET_TESTING_Command commands[] = { |
42 | GNUNET_TESTBED_cmd_netjail_start ("netjail-start-1", | 42 | GNUNET_TESTING_cmd_netjail_start ("netjail-start-1", |
43 | "2", | 43 | "2", |
44 | "2"), | 44 | "2"), |
45 | GNUNET_TESTBED_cmd_netjail_start_testbed ("netjail-start-testbed-1", | 45 | GNUNET_TESTING_cmd_netjail_start_testing_system ("netjail-start-testbed-1", |
46 | "2", | 46 | "2", |
47 | "2", | 47 | "2", |
48 | "libgnunet_plugin_testcmd"), | 48 | "libgnunet_plugin_testcmd"), |
49 | GNUNET_TESTBED_cmd_stop_testbed ("stop-testbed", | 49 | GNUNET_TESTING_cmd_stop_testing_system ("stop-testbed", |
50 | "netjail-start-testbed-1", | 50 | "netjail-start-testbed-1", |
51 | "2", | 51 | "2", |
52 | "2"), | 52 | "2"), |
53 | GNUNET_TESTBED_cmd_netjail_stop ("netjail-stop-1", | 53 | GNUNET_TESTING_cmd_netjail_stop ("netjail-stop-1", |
54 | "2", | 54 | "2", |
55 | "2"), | 55 | "2"), |
56 | GNUNET_TESTING_cmd_end () | 56 | GNUNET_TESTING_cmd_end () |
diff --git a/src/testbed/testbed_api_cmd_controller.c b/src/testbed/testbed_api_cmd_controller.c deleted file mode 100644 index 794b1ccf3..000000000 --- a/src/testbed/testbed_api_cmd_controller.c +++ /dev/null | |||
@@ -1,203 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | Copyright (C) 2021 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software: you can redistribute it and/or modify it | ||
6 | under the terms of the GNU Affero General Public License as published | ||
7 | by the Free Software Foundation, either version 3 of the License, | ||
8 | or (at your option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Affero General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Affero General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | SPDX-License-Identifier: AGPL3.0-or-later | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file testbed/testbed_api_cmd_controller.c | ||
23 | * @brief Command to create a controller. | ||
24 | * @author t3sserakt | ||
25 | */ | ||
26 | #include "platform.h" | ||
27 | #include "gnunet_util_lib.h" | ||
28 | #include "gnunet_testing_ng_lib.h" | ||
29 | #include "gnunet-service-testbed.h" | ||
30 | #include "testbed_api_hosts.h" | ||
31 | #include "gnunet_testbed_ng_service.h" | ||
32 | |||
33 | |||
34 | /** | ||
35 | * Generic logging shortcut | ||
36 | */ | ||
37 | #define LOG(kind, ...) \ | ||
38 | GNUNET_log (kind, __VA_ARGS__) | ||
39 | |||
40 | |||
41 | /** | ||
42 | * | ||
43 | * | ||
44 | * @param cls closure | ||
45 | * @param cmd current CMD being cleaned up. | ||
46 | */ | ||
47 | static void | ||
48 | controller_cleanup (void *cls, | ||
49 | const struct GNUNET_TESTING_Command *cmd) | ||
50 | { | ||
51 | (void) cls; | ||
52 | } | ||
53 | |||
54 | |||
55 | /** | ||
56 | * Signature of the event handler function called by the | ||
57 | * respective event controller. | ||
58 | * | ||
59 | * @param cls closure | ||
60 | * @param event information about the event | ||
61 | */ | ||
62 | static void | ||
63 | controller_cb (void *cls, | ||
64 | const struct GNUNET_TESTBED_EventInformation *event) | ||
65 | { | ||
66 | struct ControllerState *cs = cls; | ||
67 | |||
68 | if (NULL != event->details.operation_finished.emsg) | ||
69 | { | ||
70 | LOG (GNUNET_ERROR_TYPE_ERROR, "There was an operation error: %s\n", | ||
71 | event->details.operation_finished.emsg); | ||
72 | GNUNET_TESTBED_shutdown_controller (cs); | ||
73 | } | ||
74 | else if (NULL == event->details.operation_finished.generic) | ||
75 | { | ||
76 | GNUNET_TESTBED_operation_done (event->op); | ||
77 | } | ||
78 | } | ||
79 | |||
80 | |||
81 | static void | ||
82 | controller_run (void *cls, | ||
83 | const struct GNUNET_TESTING_Command *cmd, | ||
84 | struct GNUNET_TESTING_Interpreter *is) | ||
85 | { | ||
86 | struct ControllerState *cs = cls; | ||
87 | |||
88 | cs->is = is; | ||
89 | |||
90 | cs->controller = | ||
91 | GNUNET_TESTBED_controller_connect (cs->host, cs->event_mask, &controller_cb, | ||
92 | cs); | ||
93 | |||
94 | |||
95 | } | ||
96 | |||
97 | /** | ||
98 | * | ||
99 | * | ||
100 | * @param cls closure. | ||
101 | * @param[out] ret result | ||
102 | * @param trait name of the trait. | ||
103 | * @param index index number of the object to offer. | ||
104 | * @return #GNUNET_OK on success. | ||
105 | */ | ||
106 | static int | ||
107 | controller_traits (void *cls, | ||
108 | const void **ret, | ||
109 | const char *trait, | ||
110 | unsigned int index) | ||
111 | { | ||
112 | (void) cls; | ||
113 | |||
114 | struct ControllerState *cs = cls; | ||
115 | |||
116 | |||
117 | struct GNUNET_TESTING_Trait traits[] = { | ||
118 | { | ||
119 | .index = 0, | ||
120 | .trait_name = "controller", | ||
121 | .ptr = (const void *) cs->controller, | ||
122 | }, | ||
123 | GNUNET_TESTING_trait_end () | ||
124 | }; | ||
125 | |||
126 | return GNUNET_TESTING_get_trait (traits, | ||
127 | ret, | ||
128 | trait, | ||
129 | index); | ||
130 | return GNUNET_OK; | ||
131 | } | ||
132 | |||
133 | |||
134 | /** | ||
135 | * Offer data from trait | ||
136 | * | ||
137 | * @param cmd command to extract the controller from. | ||
138 | * @param pt pointer to controller. | ||
139 | * @return #GNUNET_OK on success. | ||
140 | */ | ||
141 | int | ||
142 | GNUNET_TESTBED_get_trait_controller (const struct GNUNET_TESTING_Command *cmd, | ||
143 | struct GNUNET_TESTBED_Controller ** | ||
144 | controller) | ||
145 | { | ||
146 | return cmd->traits (cmd->cls, | ||
147 | (const void **) controller, | ||
148 | "controller", | ||
149 | (unsigned int) 0); | ||
150 | } | ||
151 | |||
152 | |||
153 | /** | ||
154 | * Shutdown nicely | ||
155 | * | ||
156 | * @param cs controller state. | ||
157 | */ | ||
158 | void | ||
159 | GNUNET_TESTBED_shutdown_controller (struct ControllerState *cs) | ||
160 | { | ||
161 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
162 | "Shutting down...\n"); | ||
163 | |||
164 | cs->controller_going_down = GNUNET_YES; | ||
165 | |||
166 | if (NULL != cs->abort_task) | ||
167 | GNUNET_SCHEDULER_cancel (cs->abort_task); | ||
168 | if (NULL != cs->reg_handle) | ||
169 | GNUNET_TESTBED_cancel_registration (cs->reg_handle); | ||
170 | if (NULL != cs->controller) | ||
171 | GNUNET_TESTBED_controller_disconnect (cs->controller); | ||
172 | if (NULL != cs->cfg) | ||
173 | GNUNET_CONFIGURATION_destroy (cs->cfg); | ||
174 | if (NULL != cs->cp) | ||
175 | GNUNET_TESTBED_controller_stop (cs->cp); | ||
176 | if (NULL != cs->host) | ||
177 | GNUNET_TESTBED_host_destroy (cs->host); | ||
178 | } | ||
179 | |||
180 | |||
181 | |||
182 | struct GNUNET_TESTING_Command | ||
183 | GNUNET_TESTBED_cmd_controller (const char *label, | ||
184 | const char *host, | ||
185 | uint64_t event_mask) | ||
186 | { | ||
187 | struct ControllerState *cs; | ||
188 | |||
189 | cs = GNUNET_new (struct ControllerState); | ||
190 | cs->event_mask = event_mask; | ||
191 | cs->hostname = host; | ||
192 | |||
193 | |||
194 | struct GNUNET_TESTING_Command cmd = { | ||
195 | .cls = cs, | ||
196 | .label = label, | ||
197 | .run = &controller_run, | ||
198 | .cleanup = &controller_cleanup, | ||
199 | .traits = &controller_traits | ||
200 | }; | ||
201 | |||
202 | return cmd; | ||
203 | } | ||
diff --git a/src/testbed/testbed_api_cmd_local_test_finished.c b/src/testbed/testbed_api_cmd_local_test_finished.c index b5f4b8b31..c02546945 100644 --- a/src/testbed/testbed_api_cmd_local_test_finished.c +++ b/src/testbed/testbed_api_cmd_local_test_finished.c | |||
@@ -35,7 +35,7 @@ | |||
35 | 35 | ||
36 | struct LocalFinishedState | 36 | struct LocalFinishedState |
37 | { | 37 | { |
38 | TESTBED_CMD_HELPER_write_cb write_message; | 38 | TESTING_CMD_HELPER_write_cb write_message; |
39 | 39 | ||
40 | struct GNUNET_CMDS_LOCAL_FINISHED *reply; | 40 | struct GNUNET_CMDS_LOCAL_FINISHED *reply; |
41 | }; | 41 | }; |
@@ -107,7 +107,7 @@ local_test_finished_finish (void *cls, | |||
107 | */ | 107 | */ |
108 | struct GNUNET_TESTING_Command | 108 | struct GNUNET_TESTING_Command |
109 | GNUNET_TESTING_cmd_local_test_finished (const char *label, | 109 | GNUNET_TESTING_cmd_local_test_finished (const char *label, |
110 | TESTBED_CMD_HELPER_write_cb | 110 | TESTING_CMD_HELPER_write_cb |
111 | write_message) | 111 | write_message) |
112 | { | 112 | { |
113 | struct LocalFinishedState *lfs; | 113 | struct LocalFinishedState *lfs; |
diff --git a/src/testbed/testbed_api_cmd_netjail_start.c b/src/testbed/testbed_api_cmd_netjail_start.c index 8edfb8b62..0cc020275 100644 --- a/src/testbed/testbed_api_cmd_netjail_start.c +++ b/src/testbed/testbed_api_cmd_netjail_start.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include "gnunet_testing_ng_lib.h" | 28 | #include "gnunet_testing_ng_lib.h" |
29 | #include "gnunet_testbed_ng_service.h" | 29 | #include "gnunet_testbed_ng_service.h" |
30 | 30 | ||
31 | #define NETJAIL_START_SCRIPT "./../testbed/netjail_start.sh" | 31 | #define NETJAIL_START_SCRIPT "./../testing/netjail_start.sh" |
32 | 32 | ||
33 | struct NetJailState | 33 | struct NetJailState |
34 | { | 34 | { |
@@ -139,9 +139,10 @@ netjail_start_run (void *cls, | |||
139 | ns->local_m, | 139 | ns->local_m, |
140 | ns->global_n, | 140 | ns->global_n, |
141 | NULL}; | 141 | NULL}; |
142 | unsigned int helper_check = GNUNET_OS_check_helper_binary (NETJAIL_START_SCRIPT, | 142 | unsigned int helper_check = GNUNET_OS_check_helper_binary ( |
143 | GNUNET_YES, | 143 | NETJAIL_START_SCRIPT, |
144 | NULL); | 144 | GNUNET_YES, |
145 | NULL); | ||
145 | 146 | ||
146 | if (GNUNET_NO == helper_check) | 147 | if (GNUNET_NO == helper_check) |
147 | { | 148 | { |
@@ -193,7 +194,7 @@ netjail_start_finish (void *cls, | |||
193 | * @return command. | 194 | * @return command. |
194 | */ | 195 | */ |
195 | struct GNUNET_TESTING_Command | 196 | struct GNUNET_TESTING_Command |
196 | GNUNET_TESTBED_cmd_netjail_start (const char *label, | 197 | GNUNET_TESTING_cmd_netjail_start (const char *label, |
197 | char *local_m, | 198 | char *local_m, |
198 | char *global_n) | 199 | char *global_n) |
199 | { | 200 | { |
diff --git a/src/testbed/testbed_api_cmd_netjail_start_testbed.c b/src/testbed/testbed_api_cmd_netjail_start_testbed.c index db9cf7508..3d1a1d893 100644 --- a/src/testbed/testbed_api_cmd_netjail_start_testbed.c +++ b/src/testbed/testbed_api_cmd_netjail_start_testbed.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include "testbed_api_hosts.h" | 30 | #include "testbed_api_hosts.h" |
31 | #include "testbed_helper.h" | 31 | #include "testbed_helper.h" |
32 | 32 | ||
33 | #define NETJAIL_EXEC_SCRIPT "./../testbed/netjail_exec.sh" | 33 | #define NETJAIL_EXEC_SCRIPT "./../testing/netjail_exec.sh" |
34 | 34 | ||
35 | struct HelperMessage; | 35 | struct HelperMessage; |
36 | 36 | ||
@@ -87,23 +87,16 @@ struct NetJailState | |||
87 | 87 | ||
88 | unsigned int n_msg; | 88 | unsigned int n_msg; |
89 | 89 | ||
90 | unsigned int number_of_testbeds_started; | 90 | unsigned int number_of_testsystems_started; |
91 | 91 | ||
92 | unsigned int number_of_peers_started; | 92 | unsigned int number_of_peers_started; |
93 | 93 | ||
94 | unsigned int number_of_local_test_finished; | 94 | unsigned int number_of_local_test_finished; |
95 | 95 | ||
96 | /** | ||
97 | * The host where the controller is running | ||
98 | */ | ||
99 | struct GNUNET_TESTBED_Host **host; | ||
100 | |||
101 | unsigned int n_host; | ||
102 | |||
103 | char *plugin_name; | 96 | char *plugin_name; |
104 | }; | 97 | }; |
105 | 98 | ||
106 | struct TestbedCount | 99 | struct TestingSystemCount |
107 | { | 100 | { |
108 | unsigned int count; | 101 | unsigned int count; |
109 | 102 | ||
@@ -168,14 +161,14 @@ netjail_exec_traits (void *cls, | |||
168 | 161 | ||
169 | 162 | ||
170 | /** | 163 | /** |
171 | * Offer handles to testbed helper from trait | 164 | * Offer handles to testing cmd helper from trait |
172 | * | 165 | * |
173 | * @param cmd command to extract the message from. | 166 | * @param cmd command to extract the message from. |
174 | * @param pt pointer to message. | 167 | * @param pt pointer to message. |
175 | * @return #GNUNET_OK on success. | 168 | * @return #GNUNET_OK on success. |
176 | */ | 169 | */ |
177 | int | 170 | int |
178 | GNUNET_TESTBED_get_trait_helper_handles (const struct | 171 | GNUNET_TESTING_get_trait_helper_handles (const struct |
179 | GNUNET_TESTING_Command *cmd, | 172 | GNUNET_TESTING_Command *cmd, |
180 | struct GNUNET_HELPER_Handle ***helper) | 173 | struct GNUNET_HELPER_Handle ***helper) |
181 | { | 174 | { |
@@ -186,14 +179,14 @@ GNUNET_TESTBED_get_trait_helper_handles (const struct | |||
186 | } | 179 | } |
187 | 180 | ||
188 | /** | 181 | /** |
189 | * Offer handles to testbed helper from trait | 182 | * Offer messages received via testing cmd helper from trait |
190 | * | 183 | * |
191 | * @param cmd command to extract the message from. | 184 | * @param cmd command to extract the message from. |
192 | * @param pt pointer to message. | 185 | * @param pt pointer to message. |
193 | * @return #GNUNET_OK on success. | 186 | * @return #GNUNET_OK on success. |
194 | */ | 187 | */ |
195 | int | 188 | int |
196 | GNUNET_TESTBED_get_trait_helper_messages (const struct | 189 | GNUNET_TESTING_get_trait_helper_messages (const struct |
197 | GNUNET_TESTING_Command *cmd, | 190 | GNUNET_TESTING_Command *cmd, |
198 | struct HelperMessage *** | 191 | struct HelperMessage *** |
199 | hp_messages_head) | 192 | hp_messages_head) |
@@ -216,7 +209,7 @@ GNUNET_TESTBED_get_trait_helper_messages (const struct | |||
216 | static void | 209 | static void |
217 | clear_msg (void *cls, int result) | 210 | clear_msg (void *cls, int result) |
218 | { | 211 | { |
219 | struct TestbedCount *tbc = cls; | 212 | struct TestingSystemCount *tbc = cls; |
220 | struct NetJailState *ns = tbc->ns; | 213 | struct NetJailState *ns = tbc->ns; |
221 | 214 | ||
222 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 215 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -244,7 +237,7 @@ clear_msg (void *cls, int result) | |||
244 | static int | 237 | static int |
245 | helper_mst (void *cls, const struct GNUNET_MessageHeader *message) | 238 | helper_mst (void *cls, const struct GNUNET_MessageHeader *message) |
246 | { | 239 | { |
247 | struct TestbedCount *tbc = cls; | 240 | struct TestingSystemCount *tbc = cls; |
248 | struct NetJailState *ns = tbc->ns; | 241 | struct NetJailState *ns = tbc->ns; |
249 | struct HelperMessage *hp_msg; | 242 | struct HelperMessage *hp_msg; |
250 | 243 | ||
@@ -253,10 +246,9 @@ helper_mst (void *cls, const struct GNUNET_MessageHeader *message) | |||
253 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 246 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
254 | "helper_mst tbc->count: %d\n", | 247 | "helper_mst tbc->count: %d\n", |
255 | tbc->count); | 248 | tbc->count); |
256 | // GNUNET_TESTBED_extract_cfg (host, message); | ||
257 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 249 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
258 | "Received message from helper.\n"); | 250 | "Received message from helper.\n"); |
259 | ns->number_of_testbeds_started++; | 251 | ns->number_of_testsystems_started++; |
260 | } | 252 | } |
261 | else if (GNUNET_MESSAGE_TYPE_CMDS_HELPER_PEER_STARTED == ntohs ( | 253 | else if (GNUNET_MESSAGE_TYPE_CMDS_HELPER_PEER_STARTED == ntohs ( |
262 | message->type)) | 254 | message->type)) |
@@ -320,57 +312,38 @@ create_helper_init_msg_ (char *m_char, | |||
320 | 312 | ||
321 | 313 | ||
322 | static void | 314 | static void |
323 | start_testbed (struct NetJailState *ns, struct | 315 | start_helper (struct NetJailState *ns, struct |
324 | GNUNET_CONFIGURATION_Handle *config, | 316 | GNUNET_CONFIGURATION_Handle *config, |
325 | char *m_char, | 317 | char *m_char, |
326 | char *n_char) | 318 | char *n_char) |
327 | { | 319 | { |
328 | // struct GNUNET_CONFIGURATION_Handle *cfg; | 320 | // struct GNUNET_CONFIGURATION_Handle *cfg; |
329 | struct GNUNET_CMDS_HelperInit *msg; | 321 | struct GNUNET_CMDS_HelperInit *msg; |
330 | struct TestbedCount *tbc; | 322 | struct TestingSystemCount *tbc; |
331 | char *const script_argv[] = {NETJAIL_EXEC_SCRIPT, | 323 | char *const script_argv[] = {NETJAIL_EXEC_SCRIPT, |
332 | m_char, | 324 | m_char, |
333 | n_char, | 325 | n_char, |
334 | GNUNET_OS_get_libexec_binary_path(HELPER_CMDS_BINARY), | 326 | GNUNET_OS_get_libexec_binary_path ( |
327 | HELPER_CMDS_BINARY), | ||
335 | ns->global_n, | 328 | ns->global_n, |
336 | ns->local_m, | 329 | ns->local_m, |
337 | NULL}; | 330 | NULL}; |
338 | unsigned int m = atoi (m_char); | 331 | unsigned int m = atoi (m_char); |
339 | unsigned int n = atoi (n_char); | 332 | unsigned int n = atoi (n_char); |
340 | unsigned int helper_check = GNUNET_OS_check_helper_binary (NETJAIL_EXEC_SCRIPT, | 333 | unsigned int helper_check = GNUNET_OS_check_helper_binary ( |
341 | GNUNET_YES, | 334 | NETJAIL_EXEC_SCRIPT, |
342 | NULL); | 335 | GNUNET_YES, |
336 | NULL); | ||
343 | 337 | ||
344 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 338 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
345 | "m: %d n: %d\n", | 339 | "m: %d n: %d\n", |
346 | m, | 340 | m, |
347 | n); | 341 | n); |
348 | 342 | ||
349 | tbc = GNUNET_new (struct TestbedCount); | 343 | tbc = GNUNET_new (struct TestingSystemCount); |
350 | tbc->ns = ns; | 344 | tbc->ns = ns; |
351 | tbc->count = (n - 1) * atoi (ns->local_m) + m; | 345 | tbc->count = (n - 1) * atoi (ns->local_m) + m; |
352 | 346 | ||
353 | // cfg = GNUNET_CONFIGURATION_dup (config); | ||
354 | |||
355 | // TODO We do not need this? | ||
356 | /*GNUNET_array_append (ns->host, ns->n_host, | ||
357 | GNUNET_TESTBED_host_create_with_id (tbc->count - 1, | ||
358 | NULL, | ||
359 | NULL, | ||
360 | cfg, | ||
361 | 0));*/ | ||
362 | |||
363 | /*if ((GNUNET_YES != GNUNET_DISK_file_test ("test_testbed_api.conf")) || | ||
364 | (GNUNET_SYSERR == GNUNET_CONFIGURATION_load (config, | ||
365 | "test_testbed_api.conf"))) | ||
366 | { | ||
367 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
368 | _ ( | ||
369 | "Unreadable or malformed configuration file `%s', exit ...\n"), | ||
370 | "test_testbed_api.conf"); | ||
371 | }*/ | ||
372 | |||
373 | |||
374 | 347 | ||
375 | if (GNUNET_NO == helper_check) | 348 | if (GNUNET_NO == helper_check) |
376 | { | 349 | { |
@@ -396,13 +369,13 @@ start_testbed (struct NetJailState *ns, struct | |||
396 | tbc)); | 369 | tbc)); |
397 | 370 | ||
398 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 371 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
399 | "First using helper %d %d\n", | 372 | "First using helper %d %d\n", |
400 | tbc->count - 1, | 373 | tbc->count - 1, |
401 | ns->n_helper); | 374 | ns->n_helper); |
402 | struct GNUNET_HELPER_Handle *helper = ns->helper[tbc->count - 1]; | 375 | struct GNUNET_HELPER_Handle *helper = ns->helper[tbc->count - 1]; |
403 | 376 | ||
404 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 377 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
405 | "First using helper %d %d %p\n", | 378 | "First using helper %d %d %p\n", |
406 | tbc->count - 1, | 379 | tbc->count - 1, |
407 | ns->n_helper, | 380 | ns->n_helper, |
408 | helper); | 381 | helper); |
@@ -456,9 +429,9 @@ netjail_exec_run (void *cls, | |||
456 | { | 429 | { |
457 | sprintf (str_n, "%d", i); | 430 | sprintf (str_n, "%d", i); |
458 | sprintf (str_m, "%d", j); | 431 | sprintf (str_m, "%d", j); |
459 | start_testbed (ns, config, | 432 | start_helper (ns, config, |
460 | str_m, | 433 | str_m, |
461 | str_n); | 434 | str_n); |
462 | } | 435 | } |
463 | } | 436 | } |
464 | } | 437 | } |
@@ -475,7 +448,7 @@ netjail_start_finish (void *cls, | |||
475 | struct GNUNET_CMDS_ALL_PEERS_STARTED *reply; | 448 | struct GNUNET_CMDS_ALL_PEERS_STARTED *reply; |
476 | size_t msg_length; | 449 | size_t msg_length; |
477 | struct GNUNET_HELPER_Handle *helper; | 450 | struct GNUNET_HELPER_Handle *helper; |
478 | struct TestbedCount *tbc; | 451 | struct TestingSystemCount *tbc; |
479 | 452 | ||
480 | if (ns->number_of_local_test_finished == total_number) | 453 | if (ns->number_of_local_test_finished == total_number) |
481 | { | 454 | { |
@@ -483,11 +456,11 @@ netjail_start_finish (void *cls, | |||
483 | cont (cont_cls); | 456 | cont (cont_cls); |
484 | } | 457 | } |
485 | 458 | ||
486 | if (ns->number_of_testbeds_started == total_number) | 459 | if (ns->number_of_testsystems_started == total_number) |
487 | { | 460 | { |
488 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 461 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
489 | "All helpers started!\n"); | 462 | "All helpers started!\n"); |
490 | ns->number_of_testbeds_started = 0; | 463 | ns->number_of_testsystems_started = 0; |
491 | } | 464 | } |
492 | 465 | ||
493 | if (ns->number_of_peers_started == total_number) | 466 | if (ns->number_of_peers_started == total_number) |
@@ -498,7 +471,7 @@ netjail_start_finish (void *cls, | |||
498 | for (int i = 1; i <= atoi (ns->global_n); i++) { | 471 | for (int i = 1; i <= atoi (ns->global_n); i++) { |
499 | for (int j = 1; j <= atoi (ns->local_m); j++) | 472 | for (int j = 1; j <= atoi (ns->local_m); j++) |
500 | { | 473 | { |
501 | tbc = GNUNET_new (struct TestbedCount); | 474 | tbc = GNUNET_new (struct TestingSystemCount); |
502 | tbc->ns = ns; | 475 | tbc->ns = ns; |
503 | // TODO This needs to be more generic. As we send more messages back and forth, we can not grow the arrays again and again, because this is to error prone. | 476 | // TODO This needs to be more generic. As we send more messages back and forth, we can not grow the arrays again and again, because this is to error prone. |
504 | tbc->count = (i - 1) * atoi (ns->local_m) + j + total_number; | 477 | tbc->count = (i - 1) * atoi (ns->local_m) + j + total_number; |
@@ -544,11 +517,11 @@ netjail_start_finish (void *cls, | |||
544 | * @return command. | 517 | * @return command. |
545 | */ | 518 | */ |
546 | struct GNUNET_TESTING_Command | 519 | struct GNUNET_TESTING_Command |
547 | GNUNET_TESTBED_cmd_netjail_start_testbed (const char *label, | 520 | GNUNET_TESTING_cmd_netjail_start_testing_system (const char *label, |
548 | char *local_m, | 521 | char *local_m, |
549 | char *global_n, | 522 | char *global_n, |
550 | char *plugin_name, | 523 | char *plugin_name, |
551 | unsigned int *rv) | 524 | unsigned int *rv) |
552 | { | 525 | { |
553 | struct NetJailState *ns; | 526 | struct NetJailState *ns; |
554 | 527 | ||
diff --git a/src/testbed/testbed_api_cmd_netjail_stop.c b/src/testbed/testbed_api_cmd_netjail_stop.c index 947384fed..f837ec08c 100644 --- a/src/testbed/testbed_api_cmd_netjail_stop.c +++ b/src/testbed/testbed_api_cmd_netjail_stop.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include "gnunet_testbed_ng_service.h" | 29 | #include "gnunet_testbed_ng_service.h" |
30 | 30 | ||
31 | 31 | ||
32 | #define NETJAIL_STOP_SCRIPT "./../testbed/netjail_stop.sh" | 32 | #define NETJAIL_STOP_SCRIPT "./../testing/netjail_stop.sh" |
33 | 33 | ||
34 | struct GNUNET_ChildWaitHandle *cwh; | 34 | struct GNUNET_ChildWaitHandle *cwh; |
35 | 35 | ||
@@ -135,9 +135,10 @@ netjail_stop_run (void *cls, | |||
135 | ns->local_m, | 135 | ns->local_m, |
136 | ns->global_n, | 136 | ns->global_n, |
137 | NULL}; | 137 | NULL}; |
138 | unsigned int helper_check = GNUNET_OS_check_helper_binary (NETJAIL_STOP_SCRIPT, | 138 | unsigned int helper_check = GNUNET_OS_check_helper_binary ( |
139 | GNUNET_YES, | 139 | NETJAIL_STOP_SCRIPT, |
140 | NULL); | 140 | GNUNET_YES, |
141 | NULL); | ||
141 | 142 | ||
142 | if (GNUNET_NO == helper_check) | 143 | if (GNUNET_NO == helper_check) |
143 | { | 144 | { |
@@ -192,7 +193,7 @@ netjail_stop_finish (void *cls, | |||
192 | * @return command. | 193 | * @return command. |
193 | */ | 194 | */ |
194 | struct GNUNET_TESTING_Command | 195 | struct GNUNET_TESTING_Command |
195 | GNUNET_TESTBED_cmd_netjail_stop (const char *label, | 196 | GNUNET_TESTING_cmd_netjail_stop (const char *label, |
196 | char *local_m, | 197 | char *local_m, |
197 | char *global_n) | 198 | char *global_n) |
198 | { | 199 | { |
diff --git a/src/testbed/testbed_api_cmd_netjail_stop_testbed.c b/src/testbed/testbed_api_cmd_netjail_stop_testbed.c index 9a9d489a7..c74c1e94f 100644 --- a/src/testbed/testbed_api_cmd_netjail_stop_testbed.c +++ b/src/testbed/testbed_api_cmd_netjail_stop_testbed.c | |||
@@ -53,8 +53,8 @@ struct StopHelperState | |||
53 | * @param cmd current CMD being cleaned up. | 53 | * @param cmd current CMD being cleaned up. |
54 | */ | 54 | */ |
55 | static void | 55 | static void |
56 | stop_testbed_cleanup (void *cls, | 56 | stop_testing_system_cleanup (void *cls, |
57 | const struct GNUNET_TESTING_Command *cmd) | 57 | const struct GNUNET_TESTING_Command *cmd) |
58 | { | 58 | { |
59 | 59 | ||
60 | } | 60 | } |
@@ -70,10 +70,10 @@ stop_testbed_cleanup (void *cls, | |||
70 | * @return #GNUNET_OK on success. | 70 | * @return #GNUNET_OK on success. |
71 | */ | 71 | */ |
72 | static int | 72 | static int |
73 | stop_testbed_traits (void *cls, | 73 | stop_testing_system_traits (void *cls, |
74 | const void **ret, | 74 | const void **ret, |
75 | const char *trait, | 75 | const char *trait, |
76 | unsigned int index) | 76 | unsigned int index) |
77 | { | 77 | { |
78 | return GNUNET_OK; | 78 | return GNUNET_OK; |
79 | } | 79 | } |
@@ -87,9 +87,9 @@ stop_testbed_traits (void *cls, | |||
87 | * @param is interpreter state. | 87 | * @param is interpreter state. |
88 | */ | 88 | */ |
89 | static void | 89 | static void |
90 | stop_testbed_run (void *cls, | 90 | stop_testing_system_run (void *cls, |
91 | const struct GNUNET_TESTING_Command *cmd, | 91 | const struct GNUNET_TESTING_Command *cmd, |
92 | struct GNUNET_TESTING_Interpreter *is) | 92 | struct GNUNET_TESTING_Interpreter *is) |
93 | { | 93 | { |
94 | struct StopHelperState *shs = cls; | 94 | struct StopHelperState *shs = cls; |
95 | struct GNUNET_HELPER_Handle **helper; | 95 | struct GNUNET_HELPER_Handle **helper; |
@@ -97,7 +97,7 @@ stop_testbed_run (void *cls, | |||
97 | 97 | ||
98 | start_helper_cmd = GNUNET_TESTING_interpreter_lookup_command ( | 98 | start_helper_cmd = GNUNET_TESTING_interpreter_lookup_command ( |
99 | shs->helper_start_label); | 99 | shs->helper_start_label); |
100 | GNUNET_TESTBED_get_trait_helper_handles (start_helper_cmd, | 100 | GNUNET_TESTING_get_trait_helper_handles (start_helper_cmd, |
101 | &helper); | 101 | &helper); |
102 | 102 | ||
103 | for (int i = 1; i <= atoi (shs->global_n); i++) { | 103 | for (int i = 1; i <= atoi (shs->global_n); i++) { |
@@ -118,11 +118,11 @@ stop_testbed_run (void *cls, | |||
118 | * @return command. | 118 | * @return command. |
119 | */ | 119 | */ |
120 | struct GNUNET_TESTING_Command | 120 | struct GNUNET_TESTING_Command |
121 | GNUNET_TESTBED_cmd_stop_testbed (const char *label, | 121 | GNUNET_TESTING_cmd_stop_testing_system (const char *label, |
122 | const char *helper_start_label, | 122 | const char *helper_start_label, |
123 | char *local_m, | 123 | char *local_m, |
124 | char *global_n | 124 | char *global_n |
125 | ) | 125 | ) |
126 | { | 126 | { |
127 | struct StopHelperState *shs; | 127 | struct StopHelperState *shs; |
128 | 128 | ||
@@ -134,9 +134,9 @@ GNUNET_TESTBED_cmd_stop_testbed (const char *label, | |||
134 | struct GNUNET_TESTING_Command cmd = { | 134 | struct GNUNET_TESTING_Command cmd = { |
135 | .cls = shs, | 135 | .cls = shs, |
136 | .label = label, | 136 | .label = label, |
137 | .run = &stop_testbed_run, | 137 | .run = &stop_testing_system_run, |
138 | .cleanup = &stop_testbed_cleanup, | 138 | .cleanup = &stop_testing_system_cleanup, |
139 | .traits = &stop_testbed_traits | 139 | .traits = &stop_testing_system_traits |
140 | }; | 140 | }; |
141 | 141 | ||
142 | return cmd; | 142 | return cmd; |
diff --git a/src/testbed/testbed_api_cmd_peer.c b/src/testbed/testbed_api_cmd_peer.c deleted file mode 100644 index 2e253e408..000000000 --- a/src/testbed/testbed_api_cmd_peer.c +++ /dev/null | |||
@@ -1,281 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | Copyright (C) 2021 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software: you can redistribute it and/or modify it | ||
6 | under the terms of the GNU Affero General Public License as published | ||
7 | by the Free Software Foundation, either version 3 of the License, | ||
8 | or (at your option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Affero General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Affero General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | SPDX-License-Identifier: AGPL3.0-or-later | ||
19 | */ | ||
20 | |||
21 | |||
22 | /** | ||
23 | * @file testbed/testbed_api_cmd_peer.c | ||
24 | * @brief Command to create a peer. | ||
25 | * @author t3sserakt | ||
26 | */ | ||
27 | #include "platform.h" | ||
28 | #include "gnunet_util_lib.h" | ||
29 | #include "gnunet_testing_ng_lib.h" | ||
30 | #include "gnunet_testbed_ng_service.h" | ||
31 | #include "gnunet-service-testbed.h" | ||
32 | #include "testbed_api_peers.h" | ||
33 | |||
34 | |||
35 | /** | ||
36 | * Generic logging shortcut | ||
37 | */ | ||
38 | #define LOG(kind, ...) \ | ||
39 | GNUNET_log (kind, __VA_ARGS__) | ||
40 | |||
41 | |||
42 | /** | ||
43 | * | ||
44 | * | ||
45 | * @param cls closure. | ||
46 | * @param[out] ret result | ||
47 | * @param trait name of the trait. | ||
48 | * @param index index number of the object to offer. | ||
49 | * @return #GNUNET_OK on success. | ||
50 | */ | ||
51 | static int | ||
52 | peer_traits (void *cls, | ||
53 | const void **ret, | ||
54 | const char *trait, | ||
55 | unsigned int index) | ||
56 | { | ||
57 | struct PeerCmdState *ps = cls; | ||
58 | |||
59 | struct GNUNET_TESTING_Trait traits[] = { | ||
60 | { | ||
61 | .index = 0, | ||
62 | .trait_name = "peer", | ||
63 | .ptr = (const void *) ps->peer, | ||
64 | }, | ||
65 | GNUNET_TESTING_trait_end () | ||
66 | }; | ||
67 | |||
68 | return GNUNET_TESTING_get_trait (traits, | ||
69 | ret, | ||
70 | trait, | ||
71 | index); | ||
72 | |||
73 | return GNUNET_OK; | ||
74 | } | ||
75 | |||
76 | /** | ||
77 | * Offer data from trait | ||
78 | * | ||
79 | * @param cmd command to extract the controller from. | ||
80 | * @param peer pointer GNUNET_TESTBED_PEER | ||
81 | * @return #GNUNET_OK on success. | ||
82 | */ | ||
83 | int | ||
84 | GNUNET_TESTBED_get_trait_peer (const struct GNUNET_TESTING_Command *cmd, | ||
85 | struct GNUNET_TESTBED_Peer ** | ||
86 | peer) | ||
87 | { | ||
88 | return cmd->traits (cmd->cls, | ||
89 | (const void **) peer, | ||
90 | "peer", | ||
91 | (unsigned int) 0); | ||
92 | } | ||
93 | |||
94 | |||
95 | /** | ||
96 | * | ||
97 | * | ||
98 | * @param cls closure | ||
99 | * @param cmd current CMD being cleaned up. | ||
100 | */ | ||
101 | static void | ||
102 | peer_cleanup (void *cls, | ||
103 | const struct GNUNET_TESTING_Command *cmd) | ||
104 | { | ||
105 | (void) cls; | ||
106 | } | ||
107 | |||
108 | |||
109 | /** | ||
110 | * abort task to run on test timed out | ||
111 | * | ||
112 | * @param cls NULL | ||
113 | * @param tc the task context | ||
114 | */ | ||
115 | static void | ||
116 | do_abort (void *cls) | ||
117 | { | ||
118 | struct PeerCmdState *ps = cls; | ||
119 | |||
120 | if (GNUNET_NO == ps->peer_ready) | ||
121 | { | ||
122 | LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n"); | ||
123 | ps->abort_task = NULL; | ||
124 | GNUNET_TESTBED_shutdown_peer (ps); | ||
125 | } | ||
126 | } | ||
127 | |||
128 | |||
129 | /** | ||
130 | * Functions of this signature are called when a peer has been successfully | ||
131 | * created | ||
132 | * | ||
133 | * @param cls the closure from GNUNET_TESTBED_peer_create() | ||
134 | * @param emsg MAY contain an error description, if starting peer failed. | ||
135 | */ | ||
136 | static void | ||
137 | peer_started_cb (void *cls, | ||
138 | const char *emsg) | ||
139 | { | ||
140 | struct PeerCmdState *ps = cls; | ||
141 | |||
142 | GNUNET_TESTBED_operation_done (ps->operation); | ||
143 | if (NULL == emsg) | ||
144 | { | ||
145 | ps->peer_ready = GNUNET_YES; | ||
146 | } | ||
147 | else | ||
148 | { | ||
149 | LOG (GNUNET_ERROR_TYPE_ERROR, "There was an error starting a peer: %s\n", | ||
150 | emsg); | ||
151 | } | ||
152 | |||
153 | } | ||
154 | |||
155 | |||
156 | /** | ||
157 | * Functions of this signature are called when a peer has been successfully | ||
158 | * created | ||
159 | * | ||
160 | * @param cls the closure from GNUNET_TESTBED_peer_create() | ||
161 | * @param peer the handle for the created peer; NULL on any error during | ||
162 | * creation | ||
163 | * @param emsg NULL if peer is not NULL; else MAY contain the error description | ||
164 | */ | ||
165 | static void | ||
166 | peer_create_cb (void *cls, | ||
167 | struct GNUNET_TESTBED_Peer *peer, | ||
168 | const char *emsg) | ||
169 | { | ||
170 | struct PeerCmdState *ps = cls; | ||
171 | |||
172 | ps->peer = peer; | ||
173 | GNUNET_TESTBED_operation_done (ps->operation); | ||
174 | ps->operation = GNUNET_TESTBED_peer_start (NULL, | ||
175 | peer, | ||
176 | &peer_started_cb, | ||
177 | ps); | ||
178 | } | ||
179 | |||
180 | |||
181 | static void | ||
182 | peer_run (void *cls, | ||
183 | const struct GNUNET_TESTING_Command *cmd, | ||
184 | struct GNUNET_TESTING_Interpreter *is) | ||
185 | { | ||
186 | struct PeerCmdState *ps = cls; | ||
187 | const struct GNUNET_TESTING_Command *controller_cmd; | ||
188 | struct GNUNET_TESTBED_Controller *controller; | ||
189 | |||
190 | ps->is = is; | ||
191 | controller_cmd = GNUNET_TESTING_interpreter_lookup_command ( | ||
192 | ps->controller_label); | ||
193 | GNUNET_TESTBED_get_trait_controller (controller_cmd, | ||
194 | &controller); | ||
195 | ps->host = GNUNET_TESTBED_host_create (ps->hostname, ps->username, ps->cfg, | ||
196 | ps->port); | ||
197 | ps->operation = | ||
198 | GNUNET_TESTBED_peer_create (controller, | ||
199 | ps->host, | ||
200 | ps->cfg, | ||
201 | &peer_create_cb, | ||
202 | ps); | ||
203 | |||
204 | ps->abort_task = | ||
205 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply | ||
206 | (GNUNET_TIME_UNIT_MINUTES, 5), | ||
207 | &do_abort, | ||
208 | ps); | ||
209 | } | ||
210 | |||
211 | |||
212 | void | ||
213 | peer_stopped_cb (void *cls, | ||
214 | const char *emsg) | ||
215 | { | ||
216 | struct PeerCmdState *ps = cls; | ||
217 | |||
218 | if (NULL != emsg) | ||
219 | { | ||
220 | LOG (GNUNET_ERROR_TYPE_ERROR, "There was an error stopping a peer: %s\n", | ||
221 | emsg); | ||
222 | } | ||
223 | GNUNET_TESTBED_operation_done (ps->operation); | ||
224 | GNUNET_TESTBED_peer_destroy (ps->peer); | ||
225 | } | ||
226 | |||
227 | |||
228 | /** | ||
229 | * Shutdown nicely | ||
230 | * | ||
231 | * @param cs controller state. | ||
232 | */ | ||
233 | void | ||
234 | GNUNET_TESTBED_shutdown_peer (struct PeerCmdState *ps) | ||
235 | { | ||
236 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
237 | "Shutting down...\n"); | ||
238 | |||
239 | ps->peer_going_down = GNUNET_YES; | ||
240 | |||
241 | if (NULL != ps->abort_task) | ||
242 | GNUNET_SCHEDULER_cancel (ps->abort_task); | ||
243 | if (NULL != ps->cfg) | ||
244 | GNUNET_CONFIGURATION_destroy (ps->cfg); | ||
245 | if (NULL != ps->host) | ||
246 | GNUNET_TESTBED_host_destroy (ps->host); | ||
247 | |||
248 | GNUNET_TESTBED_operation_done (ps->operation); | ||
249 | ps->operation = GNUNET_TESTBED_peer_stop (NULL, ps->peer, peer_stopped_cb, | ||
250 | ps); | ||
251 | |||
252 | } | ||
253 | |||
254 | |||
255 | struct GNUNET_TESTING_Command | ||
256 | GNUNET_TESTBED_cmd_peer (const char *label, | ||
257 | const char *controller_label, | ||
258 | const char *hostname, | ||
259 | const char *username, | ||
260 | uint16_t port, | ||
261 | struct GNUNET_CONFIGURATION_Handle *cfg) | ||
262 | { | ||
263 | struct PeerCmdState *ps; | ||
264 | |||
265 | ps = GNUNET_new (struct PeerCmdState); | ||
266 | ps->hostname = hostname; | ||
267 | ps->username = username; | ||
268 | ps->port = port; | ||
269 | ps->cfg = cfg; | ||
270 | ps->controller_label = controller_label; | ||
271 | |||
272 | struct GNUNET_TESTING_Command cmd = { | ||
273 | .cls = ps, | ||
274 | .label = label, | ||
275 | .run = &peer_run, | ||
276 | .cleanup = &peer_cleanup, | ||
277 | .traits = &peer_traits | ||
278 | }; | ||
279 | |||
280 | return cmd; | ||
281 | } | ||
diff --git a/src/testbed/testbed_api_cmd_peer_store.c b/src/testbed/testbed_api_cmd_peer_store.c deleted file mode 100644 index fc96f589c..000000000 --- a/src/testbed/testbed_api_cmd_peer_store.c +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | Copyright (C) 2021 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software: you can redistribute it and/or modify it | ||
6 | under the terms of the GNU Affero General Public License as published | ||
7 | by the Free Software Foundation, either version 3 of the License, | ||
8 | or (at your option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Affero General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Affero General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | SPDX-License-Identifier: AGPL3.0-or-later | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file testbed/testbed_api_cmd_peer_store.c | ||
23 | * @brief Command to start the peer store service of a peer. | ||
24 | * @author t3sserakt | ||
25 | */ | ||
26 | |||
27 | |||
28 | static void | ||
29 | service_run (void *cls, | ||
30 | const struct GNUNET_TESTING_Command *cmd, | ||
31 | struct GNUNET_TESTING_Interpreter *is) | ||
32 | { | ||
33 | struct PeerStoreState *pss = cls; | ||
34 | |||
35 | pss->psh = GNUNET_PEERSTORE_connect (pss->cfg); | ||
36 | GNUNET_TESTING_interpreter_next (ps->is); | ||
37 | } | ||
38 | |||
39 | |||
40 | struct GNUNET_TESTING_Command | ||
41 | GNUNET_TESTBED_cmd_peer_store (const char *label, | ||
42 | struct GNUNET_CONFIGURATION_Handle *cfg) | ||
43 | { | ||
44 | |||
45 | struct PeerStoreState *pss; | ||
46 | |||
47 | pss = GNUNET_new (struct PeerStoreState); | ||
48 | pss->cfg = cfg; | ||
49 | |||
50 | struct GNUNET_TESTING_Command cmd = { | ||
51 | .cls = pss, | ||
52 | .label = label, | ||
53 | .run = &peer_store_run, | ||
54 | .cleanup = &peer_store_cleanup, | ||
55 | .traits = &peer_store_traits | ||
56 | }; | ||
57 | |||
58 | return cmd; | ||
59 | |||
60 | } | ||
diff --git a/src/testbed/testbed_api_cmd_send_peer_ready.c b/src/testbed/testbed_api_cmd_send_peer_ready.c index f175a3e18..987f0853e 100644 --- a/src/testbed/testbed_api_cmd_send_peer_ready.c +++ b/src/testbed/testbed_api_cmd_send_peer_ready.c | |||
@@ -31,7 +31,7 @@ | |||
31 | 31 | ||
32 | struct SendPeerReadyState | 32 | struct SendPeerReadyState |
33 | { | 33 | { |
34 | TESTBED_CMD_HELPER_write_cb write_message; | 34 | TESTING_CMD_HELPER_write_cb write_message; |
35 | 35 | ||
36 | struct GNUNET_CMDS_PEER_STARTED *reply; | 36 | struct GNUNET_CMDS_PEER_STARTED *reply; |
37 | }; | 37 | }; |
@@ -84,7 +84,7 @@ send_peer_ready_run (void *cls, | |||
84 | */ | 84 | */ |
85 | struct GNUNET_TESTING_Command | 85 | struct GNUNET_TESTING_Command |
86 | GNUNET_TESTING_cmd_send_peer_ready (const char *label, | 86 | GNUNET_TESTING_cmd_send_peer_ready (const char *label, |
87 | TESTBED_CMD_HELPER_write_cb write_message) | 87 | TESTING_CMD_HELPER_write_cb write_message) |
88 | { | 88 | { |
89 | struct SendPeerReadyState *sprs; | 89 | struct SendPeerReadyState *sprs; |
90 | 90 | ||
diff --git a/src/testbed/testbed_api_cmd_tng_connect.c b/src/testbed/testbed_api_cmd_tng_connect.c deleted file mode 100644 index e52cd3c76..000000000 --- a/src/testbed/testbed_api_cmd_tng_connect.c +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | Copyright (C) 2021 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software: you can redistribute it and/or modify it | ||
6 | under the terms of the GNU Affero General Public License as published | ||
7 | by the Free Software Foundation, either version 3 of the License, | ||
8 | or (at your option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Affero General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Affero General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | SPDX-License-Identifier: AGPL3.0-or-later | ||
19 | */ | ||
20 | |||
21 | |||
22 | /** | ||
23 | * @file testbed/testbed_api_cmd_peer.c | ||
24 | * @brief Command to create a peer. | ||
25 | * @author t3sserakt | ||
26 | */ | ||
27 | |||
28 | |||
29 | static void | ||
30 | tng_connect_run (void *cls, | ||
31 | const struct GNUNET_TESTING_Command *cmd, | ||
32 | struct GNUNET_TESTING_Interpreter *is) | ||
33 | { | ||
34 | struct TngConnectState *tcs = cls; | ||
35 | |||
36 | tcs->ah = GNUNET_TRANSPORT_application_init (tcs->cfg); | ||
37 | } | ||
38 | |||
39 | struct GNUNET_TESTING_Command | ||
40 | GNUNET_TESTBED_cmd_tng_connect (const char *label) | ||
41 | { | ||
42 | struct TngConnectState *tcs; | ||
43 | |||
44 | ts = GNUNET_new (struct TngConnectState); | ||
45 | |||
46 | struct GNUNET_TESTING_Command cmd = { | ||
47 | .cls = tcs, | ||
48 | .label = label, | ||
49 | .run = &tng_connect_run, | ||
50 | .cleanup = &tmg_connect_cleanup, | ||
51 | .traits = &tng_connect_traits | ||
52 | }; | ||
53 | |||
54 | return cmd; | ||
55 | } | ||
diff --git a/src/testbed/testbed_api_cmd_tng_service.c b/src/testbed/testbed_api_cmd_tng_service.c deleted file mode 100644 index cce2e14e3..000000000 --- a/src/testbed/testbed_api_cmd_tng_service.c +++ /dev/null | |||
@@ -1,276 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet | ||
3 | Copyright (C) 2021 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software: you can redistribute it and/or modify it | ||
6 | under the terms of the GNU Affero General Public License as published | ||
7 | by the Free Software Foundation, either version 3 of the License, | ||
8 | or (at your option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Affero General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Affero General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | SPDX-License-Identifier: AGPL3.0-or-later | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file testbed/testbed_api_cmd_tng.c | ||
23 | * @brief Command to start the transport service of a peer. | ||
24 | * @author t3sserakt | ||
25 | */ | ||
26 | #include "platform.h" | ||
27 | #include "gnunet_util_lib.h" | ||
28 | #include "gnunet_testing_ng_lib.h" | ||
29 | #include "gnunet-service-testbed.h" | ||
30 | #include "testbed_api_hosts.h" | ||
31 | #include "gnunet_testbed_ng_service.h" | ||
32 | |||
33 | /** | ||
34 | * Generic logging shortcut | ||
35 | */ | ||
36 | #define LOG(kind, ...) \ | ||
37 | GNUNET_log (kind, __VA_ARGS__) | ||
38 | |||
39 | |||
40 | /** | ||
41 | * abort task to run on test timed out | ||
42 | * | ||
43 | * @param cls NULL | ||
44 | * @param tc the task context | ||
45 | */ | ||
46 | static void | ||
47 | do_abort (void *cls) | ||
48 | { | ||
49 | struct TngState *ts = cls; | ||
50 | |||
51 | if (GNUNET_NO == ts->service_ready) | ||
52 | { | ||
53 | LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n"); | ||
54 | ts->abort_task = NULL; | ||
55 | GNUNET_TESTBED_shutdown_service (ts); | ||
56 | } | ||
57 | } | ||
58 | |||
59 | /** | ||
60 | * | ||
61 | * | ||
62 | * @param cls closure | ||
63 | * @param cmd current CMD being cleaned up. | ||
64 | */ | ||
65 | static void | ||
66 | tng_service_cleanup (void *cls, | ||
67 | const struct GNUNET_TESTING_Command *cmd) | ||
68 | { | ||
69 | (void) cls; | ||
70 | } | ||
71 | |||
72 | /** | ||
73 | * | ||
74 | * | ||
75 | * @param cls closure. | ||
76 | * @param[out] ret result | ||
77 | * @param trait name of the trait. | ||
78 | * @param index index number of the object to offer. | ||
79 | * @return #GNUNET_OK on success. | ||
80 | */ | ||
81 | static int | ||
82 | tng_service_traits (void *cls, | ||
83 | const void **ret, | ||
84 | const char *trait, | ||
85 | unsigned int index) | ||
86 | { | ||
87 | (void) cls; | ||
88 | return GNUNET_OK; | ||
89 | } | ||
90 | |||
91 | |||
92 | static void * | ||
93 | notify_connect (void *cls, | ||
94 | const struct GNUNET_PeerIdentity *peer, | ||
95 | struct GNUNET_MQ_Handle *mq) | ||
96 | { | ||
97 | struct TngState *ts = cls; | ||
98 | |||
99 | if (NULL != emsg) | ||
100 | { | ||
101 | LOG (GNUNET_ERROR_TYPE_ERROR, | ||
102 | "There was an error starting the transport subsystem: %s\n", | ||
103 | emsg); | ||
104 | } | ||
105 | GNUNET_TESTING_interpreter_next (ps->is); | ||
106 | return ts->nc (ts->cb_cls); | ||
107 | |||
108 | } | ||
109 | |||
110 | |||
111 | static void | ||
112 | notify_disconnect (void *cls, | ||
113 | const struct GNUNET_PeerIdentity *peer, | ||
114 | void *handler_cls) | ||
115 | { | ||
116 | } | ||
117 | |||
118 | |||
119 | |||
120 | |||
121 | /** | ||
122 | * Adapter function called to establish a connection to | ||
123 | * a service. | ||
124 | * | ||
125 | * @param cls closure | ||
126 | * @param cfg configuration of the peer to connect to; will be available until | ||
127 | * GNUNET_TESTBED_operation_done() is called on the operation returned | ||
128 | * from GNUNET_TESTBED_service_connect() | ||
129 | * @return service handle to return in 'op_result', NULL on error | ||
130 | */ | ||
131 | static void * | ||
132 | connect_adapter (void *cls, | ||
133 | const struct GNUNET_CONFIGURATION_Handle *cfg) | ||
134 | { | ||
135 | struct TngState *ts = cls; | ||
136 | |||
137 | service_handle = GNUNET_TRANSPORT_core_connect (cfg, | ||
138 | ts->peer_identity, | ||
139 | ts->handlers, | ||
140 | ts, | ||
141 | ¬ify_connect, | ||
142 | ¬ify_disconnect); | ||
143 | return service_handle; | ||
144 | } | ||
145 | |||
146 | |||
147 | /** | ||
148 | * Adapter function called to destroy a connection to | ||
149 | * a service. | ||
150 | * | ||
151 | * @param cls closure | ||
152 | * @param op_result service handle returned from the connect adapter | ||
153 | */ | ||
154 | static void | ||
155 | disconnect_adapter (void *cls, | ||
156 | void *op_result) | ||
157 | { | ||
158 | } | ||
159 | |||
160 | /** | ||
161 | * Callback to be called when a service connect operation is completed | ||
162 | * | ||
163 | * @param cls the callback closure from functions generating an operation | ||
164 | * @param op the operation that has been finished | ||
165 | * @param ca_result the service handle returned from GNUNET_TESTBED_ConnectAdapter() | ||
166 | * @param emsg error message in case the operation has failed; will be NULL if | ||
167 | * operation has executed successfully. | ||
168 | */ | ||
169 | static void | ||
170 | service_connect_comp_cb (void *cls, | ||
171 | struct GNUNET_TESTBED_Operation *op, | ||
172 | void *ca_result, | ||
173 | const char *emsg) | ||
174 | { | ||
175 | struct TngState *ts = cls; | ||
176 | |||
177 | if (NULL != emsg) | ||
178 | { | ||
179 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
180 | "An error occurred connecting to service %s\n", | ||
181 | emsg); | ||
182 | GNUNET_TESTBED_operation_done (ts->operation); | ||
183 | } | ||
184 | } | ||
185 | |||
186 | |||
187 | /** | ||
188 | * Callback to be called when the requested peer information is available | ||
189 | * | ||
190 | * @param cls the closure from GNUNET_TESTBED_peer_getinformation() | ||
191 | * @param op the operation this callback corresponds to | ||
192 | * @param pinfo the result; will be NULL if the operation has failed | ||
193 | * @param emsg error message if the operation has failed; | ||
194 | * NULL if the operation is successful | ||
195 | */ | ||
196 | static void | ||
197 | pi_cb (void *cls, | ||
198 | struct GNUNET_TESTBED_Operation *op, | ||
199 | const struct GNUNET_TESTBED_PeerInformation *pinfo, | ||
200 | const char *emsg) | ||
201 | { | ||
202 | struct TngState *ts = cls; | ||
203 | |||
204 | ts->peer_identity = pinfo->id; | ||
205 | ts->operation = | ||
206 | GNUNET_TESTBED_service_connect (NULL, peer, NULL, | ||
207 | &service_connect_comp_cb, ts, | ||
208 | &connect_adapter, | ||
209 | &disconnect_adapter, | ||
210 | ts); | ||
211 | } | ||
212 | |||
213 | |||
214 | static void | ||
215 | tng_service_run (void *cls, | ||
216 | const struct GNUNET_TESTING_Command *cmd, | ||
217 | struct GNUNET_TESTING_Interpreter *is) | ||
218 | { | ||
219 | struct TngState *ts = cls; | ||
220 | struct GNUNET_TESTBED_Peer *peer; | ||
221 | const struct GNUNET_TESTING_Command *peer_cmd; | ||
222 | |||
223 | ts->is = is; | ||
224 | peer_cmd = GNUNET_TESTING_interpreter_lookup_command ( | ||
225 | ts->peer_label); | ||
226 | GNUNET_TESTBED_get_trait_peer (peer_cmd, | ||
227 | &peer); | ||
228 | |||
229 | ts->operation = GNUNET_TESTBED_peer_get_information (peer, | ||
230 | GNUNET_TESTBED_PIT_IDENTITY, | ||
231 | &pi_cb, | ||
232 | ts); | ||
233 | } | ||
234 | |||
235 | /** | ||
236 | * Shutdown nicely | ||
237 | * | ||
238 | * @param cs service state. | ||
239 | */ | ||
240 | void | ||
241 | GNUNET_TESTBED_shutdown_service (struct TngState *cs) | ||
242 | { | ||
243 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
244 | "Shutting down...\n"); | ||
245 | } | ||
246 | |||
247 | |||
248 | struct GNUNET_TESTING_Command | ||
249 | GNUNET_TESTBED_cmd_tng_service (const char *label, | ||
250 | const char *peer_label, | ||
251 | const struct GNUNET_MQ_MessageHandler *handlers, | ||
252 | GNUNET_TRANSPORT_NotifyConnect nc, | ||
253 | void *cb_cls) | ||
254 | |||
255 | { | ||
256 | struct TngState *ts; | ||
257 | |||
258 | ts = GNUNET_new (struct TngState); | ||
259 | ts->servicename = servicename; | ||
260 | ts->peer_label = peer_label; | ||
261 | ts->handlers = handlers; | ||
262 | ts->nc = nc; | ||
263 | ts->nd = nd; | ||
264 | ts->cb_cls; | ||
265 | |||
266 | |||
267 | struct GNUNET_TESTING_Command cmd = { | ||
268 | .cls = ts, | ||
269 | .label = label, | ||
270 | .run = &tng_service_run, | ||
271 | .cleanup = &tmg_service_cleanup, | ||
272 | .traits = &tng_service_traits | ||
273 | }; | ||
274 | |||
275 | return cmd; | ||
276 | } | ||
diff --git a/src/testing/netjail_exec.sh b/src/testing/netjail_exec.sh new file mode 100755 index 000000000..b76d2e444 --- /dev/null +++ b/src/testing/netjail_exec.sh | |||
@@ -0,0 +1,16 @@ | |||
1 | #!/bin/sh | ||
2 | . "./../testbed/netjail_core.sh" | ||
3 | |||
4 | set -eu | ||
5 | set -x | ||
6 | |||
7 | export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | ||
8 | |||
9 | M=$1 | ||
10 | N=$2 | ||
11 | |||
12 | NODE=$(netjail_print_name "N" $N $M) | ||
13 | |||
14 | |||
15 | |||
16 | netjail_node_exec_without_fds $NODE $3 $4 $5 $1 $2 | ||
diff --git a/src/testing/netjail_start.sh b/src/testing/netjail_start.sh new file mode 100755 index 000000000..4c1c33c83 --- /dev/null +++ b/src/testing/netjail_start.sh | |||
@@ -0,0 +1,52 @@ | |||
1 | #!/bin/sh | ||
2 | . "./../testbed/netjail_core.sh" | ||
3 | |||
4 | set -eu | ||
5 | set -x | ||
6 | |||
7 | export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | ||
8 | |||
9 | LOCAL_M=$1 | ||
10 | GLOBAL_N=$2 | ||
11 | |||
12 | # TODO: stunserver? ..and globally known peer? | ||
13 | |||
14 | shift 2 | ||
15 | |||
16 | LOCAL_GROUP="192.168.15" | ||
17 | GLOBAL_GROUP="92.68.150" | ||
18 | |||
19 | NETWORK_NET=$(netjail_print_name "n" $GLOBAL_N $LOCAL_M) | ||
20 | |||
21 | netjail_bridge $NETWORK_NET | ||
22 | |||
23 | for N in $(seq $GLOBAL_N); do | ||
24 | ROUTER=$(netjail_print_name "R" $N) | ||
25 | |||
26 | netjail_node $ROUTER | ||
27 | netjail_node_link_bridge $ROUTER $NETWORK_NET "$GLOBAL_GROUP.$N" 24 | ||
28 | |||
29 | ROUTER_NET=$(netjail_print_name "r" $N) | ||
30 | |||
31 | netjail_bridge $ROUTER_NET | ||
32 | |||
33 | for M in $(seq $LOCAL_M); do | ||
34 | NODE=$(netjail_print_name "N" $N $M) | ||
35 | |||
36 | netjail_node $NODE | ||
37 | netjail_node_link_bridge $NODE $ROUTER_NET "$LOCAL_GROUP.$M" 24 | ||
38 | done | ||
39 | |||
40 | ROUTER_ADDR="$LOCAL_GROUP.$(($LOCAL_M+1))" | ||
41 | |||
42 | netjail_node_link_bridge $ROUTER $ROUTER_NET $ROUTER_ADDR 24 | ||
43 | netjail_node_add_nat $ROUTER $ROUTER_ADDR 24 | ||
44 | |||
45 | for M in $(seq $LOCAL_M); do | ||
46 | NODE=$(netjail_print_name "N" $N $M) | ||
47 | |||
48 | netjail_node_add_default $NODE $ROUTER_ADDR | ||
49 | done | ||
50 | done | ||
51 | |||
52 | |||
diff --git a/src/testing/netjail_stop.sh b/src/testing/netjail_stop.sh new file mode 100755 index 000000000..689bf7ae9 --- /dev/null +++ b/src/testing/netjail_stop.sh | |||
@@ -0,0 +1,26 @@ | |||
1 | #!/bin/sh | ||
2 | . "./../testbed/netjail_core.sh" | ||
3 | |||
4 | set -eu | ||
5 | set -x | ||
6 | |||
7 | export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | ||
8 | |||
9 | LOCAL_M=$1 | ||
10 | GLOBAL_N=$2 | ||
11 | NETWORK_NET=$(netjail_print_name "n" $GLOBAL_N $LOCAL_M) | ||
12 | |||
13 | shift 2 | ||
14 | |||
15 | for N in $(seq $GLOBAL_N); do | ||
16 | for M in $(seq $LOCAL_M); do | ||
17 | netjail_node_clear $(netjail_print_name "N" $N $M) | ||
18 | done | ||
19 | |||
20 | netjail_bridge_clear $(netjail_print_name "r" $N) | ||
21 | netjail_node_clear $(netjail_print_name "R" $N) | ||
22 | done | ||
23 | |||
24 | netjail_bridge_clear $NETWORK_NET | ||
25 | |||
26 | echo "Done" | ||
diff --git a/src/testing/testing_api_cmd_send_peer_ready.c b/src/testing/testing_api_cmd_send_peer_ready.c index 27761c4d5..e5e004924 100644 --- a/src/testing/testing_api_cmd_send_peer_ready.c +++ b/src/testing/testing_api_cmd_send_peer_ready.c | |||
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | struct SendPeerReadyState | 33 | struct SendPeerReadyState |
34 | { | 34 | { |
35 | TESTBED_CMD_HELPER_write_cb write_message; | 35 | TESTING_CMD_HELPER_write_cb write_message; |
36 | 36 | ||
37 | struct GNUNET_CMDS_PEER_STARTED *reply; | 37 | struct GNUNET_CMDS_PEER_STARTED *reply; |
38 | }; | 38 | }; |
@@ -85,7 +85,7 @@ send_peer_ready_run (void *cls, | |||
85 | */ | 85 | */ |
86 | struct GNUNET_TESTING_Command | 86 | struct GNUNET_TESTING_Command |
87 | GNUNET_TESTING_cmd_send_peer_ready (const char *label, | 87 | GNUNET_TESTING_cmd_send_peer_ready (const char *label, |
88 | TESTBED_CMD_HELPER_write_cb write_message) | 88 | TESTING_CMD_HELPER_write_cb write_message) |
89 | { | 89 | { |
90 | struct SendPeerReadyState *sprs; | 90 | struct SendPeerReadyState *sprs; |
91 | 91 | ||
diff --git a/src/transport/plugin_cmd_simple_send.c b/src/transport/plugin_cmd_simple_send.c index 2a4a8c137..468f4e48a 100644 --- a/src/transport/plugin_cmd_simple_send.c +++ b/src/transport/plugin_cmd_simple_send.c | |||
@@ -83,7 +83,7 @@ all_peers_started () | |||
83 | } | 83 | } |
84 | 84 | ||
85 | static void | 85 | static void |
86 | start_testcase (TESTBED_CMD_HELPER_write_cb write_message, char *router_ip, | 86 | start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, |
87 | char *node_ip, | 87 | char *node_ip, |
88 | char *m, | 88 | char *m, |
89 | char *n, | 89 | char *n, |
diff --git a/src/transport/test_transport_api_cmd_simple_send.c b/src/transport/test_transport_api_cmd_simple_send.c index 26da53c47..1cc16f307 100644 --- a/src/transport/test_transport_api_cmd_simple_send.c +++ b/src/transport/test_transport_api_cmd_simple_send.c | |||
@@ -43,19 +43,19 @@ static void | |||
43 | run (void *cls) | 43 | run (void *cls) |
44 | { | 44 | { |
45 | struct GNUNET_TESTING_Command commands[] = { | 45 | struct GNUNET_TESTING_Command commands[] = { |
46 | GNUNET_TESTBED_cmd_netjail_start ("netjail-start-1", | 46 | GNUNET_TESTING_cmd_netjail_start ("netjail-start-1", |
47 | "2", | 47 | "2", |
48 | "1"), | 48 | "1"), |
49 | GNUNET_TESTBED_cmd_netjail_start_testbed ("netjail-start-testbed-1", | 49 | GNUNET_TESTING_cmd_netjail_start_testing_system ("netjail-start-testbed-1", |
50 | "2", | 50 | "2", |
51 | "1", | 51 | "1", |
52 | "libgnunet_plugin_cmd_simple_send", | 52 | "libgnunet_plugin_cmd_simple_send", |
53 | &rv), | 53 | &rv), |
54 | GNUNET_TESTBED_cmd_stop_testbed ("stop-testbed", | 54 | GNUNET_TESTING_cmd_stop_testing_system ("stop-testbed", |
55 | "netjail-start-testbed-1", | 55 | "netjail-start-testbed-1", |
56 | "2", | 56 | "2", |
57 | "1"), | 57 | "1"), |
58 | GNUNET_TESTBED_cmd_netjail_stop ("netjail-stop-1", | 58 | GNUNET_TESTING_cmd_netjail_stop ("netjail-stop-1", |
59 | "2", | 59 | "2", |
60 | "1"), | 60 | "1"), |
61 | GNUNET_TESTING_cmd_end () | 61 | GNUNET_TESTING_cmd_end () |