2 #include "gnunet_util_lib.h"
3 #include "gnunet_dht_service.h"
4 #include "gnunet_mesh_service_new.h"
6 static struct GNUNET_MESH_MessageHandler handlers[] = {
13 const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) {
14 struct GNUNET_OS_Process *arm_pid;
15 struct GNUNET_MESH_Handle *mesh;
16 struct GNUNET_DHT_Handle *dht;
17 // struct GNUNET_MESH_Tunnel *t;
20 arm_pid = GNUNET_OS_start_process (NULL, NULL,
24 "-c", "test_dht_api_data.conf",
27 // printf("%d\n", fopen( "test_mesh.conf", "r"));
28 // GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (cfg, "test_mesh.conf"));
29 //printf("%d\n", GNUNET_CONFIGURATION_load (cfg, NULL));
30 // printf("%d\n", GNUNET_CONFIGURATION_load (cfg, "test_dht_api_data.conf"));
31 dht = GNUNET_DHT_connect(cfg, 100);
33 // fprintf(stderr, "Couldn't connect to dht :(\n");
34 // return 1; // succeed anyway
36 // fprintf(stderr, "YAY! CONNECTED TO DHT :D\n");
38 // mesh = GNUNET_MESH_connect(cfg, NULL, NULL, handlers, NULL);
40 // fprintf(stderr, "Couldn't connect to mesh :(\n");
41 // return 1; // succeed anyway
43 // fprintf(stderr, "YAY! CONNECTED TO MESH :D\n");
45 // mesh = realloc(mesh, 0); // don't complain about *mesh
46 // printf("MESH TEST\n");
47 // t = GNUNET_MESH_tunnel_create(mesh, );
49 /* do real test work here */
50 if (0 != GNUNET_OS_process_kill (arm_pid, SIGTERM))
51 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
52 GNUNET_assert (GNUNET_OK == GNUNET_OS_process_wait (arm_pid));
53 GNUNET_OS_process_close (arm_pid);
62 char *const argv[] = {"test-mesh-api",
64 "test_dht_api_data.conf",
70 struct GNUNET_GETOPT_CommandLineOption options[] = {
71 GNUNET_GETOPT_OPTION_END
73 ret = GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
74 argv, "test-mesh-api", "nohelp",
78 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "test-mesh-api': Failed with error code %d\n", ret);
83 int main (int argc, char *argv[]) {
84 if(GNUNET_OK == check())