Ejemplo n.º 1
0
int
main (int argc,
      char *argv1[])
{
  char *const argv[] = {
    "test-core-api",
    "-c",
    "test_core_api_data.conf",
    NULL
  };
  struct GNUNET_GETOPT_CommandLineOption options[] = {
    GNUNET_GETOPT_OPTION_END
  };
  ok = 1;
  GNUNET_log_setup ("test-core-api",
                    "WARNING",
                    NULL);
  GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
		      argv,
                      "test-core-api",
		      "nohelp",
		      options,
		      &run,
		      &ok);
  stop_arm (&p1);
  stop_arm (&p2);
  GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-1");
  GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-2");

  return ok;
}
Ejemplo n.º 2
0
int
main (int argc, char *argv[])
{
  char cfg_name[128];
  char *const xargv[] = {
    "test-plugin-psycstore",
    "-c", cfg_name,
    "-L", LOG_LEVEL,
    NULL
  };
  struct GNUNET_GETOPT_CommandLineOption options[] = {
    GNUNET_GETOPT_OPTION_END
  };
  GNUNET_DISK_directory_remove ("/tmp/gnunet-test-plugin-psycstore-sqlite");
  GNUNET_log_setup ("test-plugin-psycstore", LOG_LEVEL, NULL);
  plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]);
  GNUNET_snprintf (cfg_name, sizeof (cfg_name), "test_plugin_psycstore_%s.conf",
                   plugin_name);
  GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, xargv,
                      "test-plugin-psycstore", "nohelp", options, &run, NULL);

  if ( (0 != ok) &&
       (77 != ok) )
    FPRINTF (stderr, "Missed some testcases: %d\n", ok);

#if ! DEBUG_PSYCSTORE
  GNUNET_DISK_directory_remove ("/tmp/gnunet-test-plugin-psycstore-sqlite");
#endif

  return ok;
}
Ejemplo n.º 3
0
int
main (int argc, char *argv[])
{
  char *const argvx[] = {
    "test-fs-unindex",
    "-c",
    "test_fs_unindex_data.conf",
#if VERBOSE
    "-L", "DEBUG",
#endif
    NULL
  };
  struct GNUNET_GETOPT_CommandLineOption options[] = {
    GNUNET_GETOPT_OPTION_END
  };

  GNUNET_log_setup ("test_fs_unindex",
#if VERBOSE
                    "DEBUG",
#else
                    "WARNING",
#endif
                    NULL);
  GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, argvx,
                      "test-fs-unindex", "nohelp", options, &run, NULL);
  stop_arm (&p1);
  GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-unindex/");
  if (NULL != fn)
  {
    GNUNET_DISK_directory_remove (fn);
    GNUNET_free (fn);
  }
  return 0;
}
int
main (int argc, char *argv[])
{
  int ret;

  char *pos;
  char dir_name[128];

  sleep (1);
  /* determine name of plugin to use */
  plugin_name = argv[0];
  while (NULL != (pos = strstr (plugin_name, "_")))
    plugin_name = pos + 1;
  if (NULL != (pos = strstr (plugin_name, ".")))
    pos[0] = 0;
  else
    pos = (char *) plugin_name;

  GNUNET_snprintf (dir_name, sizeof (dir_name), "/tmp/test-gnunet-datastore-%s",
                   plugin_name);
  GNUNET_DISK_directory_remove (dir_name);
  GNUNET_log_setup ("test-datastore-api-management",
#if VERBOSE
                    "DEBUG",
#else
                    "WARNING",
#endif
                    NULL);
  ret = check ();
  if (pos != plugin_name)
    pos[0] = '.';
  GNUNET_DISK_directory_remove (dir_name);
  return ret;
}
int
main (int argc, char *argv[])
{
  int ret;

  GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1");
  GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2");
  GNUNET_log_setup ("test-gnunet-daemon-hostlist",
                    "WARNING",
                    NULL);
#if !WINDOWS
  system ("gnunet-peerinfo -s -c test_learning_adv_peer.conf > /dev/null");
  system ("gnunet-peerinfo -s -c test_learning_learn_peer.conf > /dev/null");
#else
  system ("gnunet-peerinfo -s -c test_learning_adv_peer.conf > NUL");
  system ("gnunet-peerinfo -s -c test_learning_learn_peer.conf > NUL");
#endif
  ret = check ();
  GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1");
  GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2");
  if (GNUNET_YES == GNUNET_DISK_file_test ("hostlists_learn_peer.file"))
  {
    if (0 == UNLINK ("hostlists_learn_peer.file"))
      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                  "Hostlist file hostlists_learn_peer.file was removed\n");
  }
  return ret;
}
Ejemplo n.º 6
0
/**
 * read the pseudonym infomation from a file
 * @param cfg configuration to use
 * @param nsid hash code of a pseudonym
 * @param meta meta data to be read from a file
 * @param ranking ranking of a pseudonym
 * @param ns_name name of a pseudonym
 */
static int
read_info (const struct GNUNET_CONFIGURATION_Handle *cfg,
           const struct GNUNET_HashCode * nsid,
           struct GNUNET_CONTAINER_MetaData **meta, int32_t * ranking,
           char **ns_name)
{
  char *fn;
  char *emsg;
  struct GNUNET_BIO_ReadHandle *fileR;

  fn = get_data_filename (cfg, PS_METADATA_DIR, nsid);
  GNUNET_assert (fn != NULL);
  if (GNUNET_YES !=
      GNUNET_DISK_file_test (fn))
  {
    GNUNET_free (fn);
    return GNUNET_SYSERR;
  }
  fileR = GNUNET_BIO_read_open (fn);
  if (fileR == NULL)
  {
    GNUNET_free (fn);
    return GNUNET_SYSERR;
  }
  emsg = NULL;
  *ns_name = NULL;
  if ((GNUNET_OK != GNUNET_BIO_read_int32 (fileR, ranking)) ||
      (GNUNET_OK !=
       GNUNET_BIO_read_string (fileR, "Read string error!", ns_name, 200)) ||
      (GNUNET_OK !=
       GNUNET_BIO_read_meta_data (fileR, "Read meta data error!", meta)))
  {
    (void) GNUNET_BIO_read_close (fileR, &emsg);
    GNUNET_free_non_null (emsg);
    GNUNET_free_non_null (*ns_name);
    *ns_name = NULL;
    GNUNET_break (GNUNET_OK == GNUNET_DISK_directory_remove (fn));
    GNUNET_free (fn);
    return GNUNET_SYSERR;
  }
  if (GNUNET_OK != GNUNET_BIO_read_close (fileR, &emsg))
  {
    LOG (GNUNET_ERROR_TYPE_WARNING,
         _("Failed to parse metadata about pseudonym from file `%s': %s\n"), fn,
         emsg);
    GNUNET_break (GNUNET_OK == GNUNET_DISK_directory_remove (fn));
    GNUNET_CONTAINER_meta_data_destroy (*meta);
    *meta = NULL;
    GNUNET_free_non_null (*ns_name);
    *ns_name = NULL;
    GNUNET_free_non_null (emsg);
    GNUNET_free (fn);
    return GNUNET_SYSERR;
  }
  GNUNET_free (fn);
  return GNUNET_OK;
}
Ejemplo n.º 7
0
/**
 * Main function that initializes the testbed.
 *
 * @param argc ignored
 * @param argv ignored
 * @return 0 on success
 */
int
main (int argc, char *argv[])
{
  GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/");
  (void) GNUNET_TESTBED_test_run ("test_fs_test_lib",
                                  "fs_test_lib_data.conf",
                                  NUM_DAEMONS,
                                  0, NULL, NULL,
                                  &run, NULL);
  GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/");
  return ret;
}
Ejemplo n.º 8
0
static void
abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
  GNUNET_FS_publish_stop (publish);
  publish = NULL;
  GNUNET_DISK_directory_remove (fn1);
  GNUNET_free (fn1);
  fn1 = NULL;
  GNUNET_DISK_directory_remove (fn2);
  GNUNET_free (fn2);
  fn2 = NULL;
}
int
main (int argc, char *argv[])
{
  int ret;

  GNUNET_log_setup ("test-core-api-start-only",
                    "WARNING",
                    NULL);
  ret = check ();
  GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-1");
  GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-2");
  return ret;
}
static void
cleanup ()
{
  GNUNET_SCHEDULER_shutdown ();
  if (NULL != fn1)
  {
    GNUNET_DISK_directory_remove (fn1);
    GNUNET_free (fn1);
  }
  if (NULL != fn2)
  {
    GNUNET_DISK_directory_remove (fn2);
    GNUNET_free (fn2);
  }
}
Ejemplo n.º 11
0
int
main (int argc, char *const *argv)
{

  if (GNUNET_SYSERR == GNUNET_OS_check_helper_binary ("gnunet-gns-proxy"))
  {
    fprintf (stderr, "Proxy binary not in PATH... skipping!\n");
    return 0;
  }

  if (GNUNET_YES != GNUNET_OS_check_helper_binary ("gnunet-helper-dns"))
  {
    fprintf (stderr, "DNS helper binary has wrong permissions... skipping!\n");
    return 0;
  }

  GNUNET_CRYPTO_rsa_setup_hostkey ("test_gns_proxy.conf");
  
  if (0 != curl_global_init (CURL_GLOBAL_WIN32))
  {
    fprintf (stderr, "failed to initialize curl\n");
    return 2;
  }
  if (0 != GNUNET_TESTING_peer_run ("test-gnunet-gns-proxy",
				    "test_gns_proxy.conf",
				    &run, NULL))
    return 1;
  GNUNET_DISK_directory_remove ("/tmp/gnunet-test-gns-proxy");
  return global_ret;
}
Ejemplo n.º 12
0
static int
test_bigstring_rw ()
{
  char *msg;
  char *readResultString;
  struct GNUNET_BIO_WriteHandle *fileW;
  struct GNUNET_BIO_ReadHandle *fileR;
  char *fileName = GNUNET_DISK_mktemp ("gnunet_bio");

  fileW = GNUNET_BIO_write_open (fileName);
  GNUNET_assert (NULL != fileW);
  GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_string (fileW, TESTSTRING));
  GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_close (fileW));

  fileR = GNUNET_BIO_read_open (fileName);
  GNUNET_assert (NULL != fileR);
  readResultString = NULL;
  GNUNET_assert (GNUNET_SYSERR ==
                 GNUNET_BIO_read_string (fileR, "Read string error",
                                         &readResultString, 1));
  GNUNET_assert (NULL == readResultString);
  msg = NULL;
  GNUNET_BIO_read_close (fileR, &msg);
  GNUNET_free (msg);
  GNUNET_assert (GNUNET_OK == GNUNET_DISK_directory_remove (fileName));
  GNUNET_free (fileName);
  return 0;
}
Ejemplo n.º 13
0
static int
test_bigmeta_rw ()
{
  char *msg;
  static char meta[1024 * 1024 * 10];
  struct GNUNET_BIO_WriteHandle *fileW;
  struct GNUNET_BIO_ReadHandle *fileR;
  char *fileName = GNUNET_DISK_mktemp ("gnunet_bio");
  struct GNUNET_CONTAINER_MetaData *metaDataR;

  memset (meta, 'b', sizeof (meta));
  meta[sizeof (meta) - 1] = '\0';
  fileW = GNUNET_BIO_write_open (fileName);
  GNUNET_assert (NULL != fileW);
  GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_int32 (fileW, sizeof (meta)));
  GNUNET_assert (GNUNET_OK == GNUNET_BIO_write (fileW, meta, sizeof (meta)));
  GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_close (fileW));

  fileR = GNUNET_BIO_read_open (fileName);
  GNUNET_assert (NULL != fileR);
  metaDataR = NULL;
  GNUNET_assert (GNUNET_SYSERR ==
                 GNUNET_BIO_read_meta_data (fileR, "Read meta error",
                                            &metaDataR));
  msg = NULL;
  GNUNET_BIO_read_close (fileR, &msg);
  GNUNET_free (msg);
  GNUNET_assert (GNUNET_OK == GNUNET_DISK_directory_remove (fileName));
  GNUNET_assert (NULL == metaDataR);
  GNUNET_free (fileName);
  return 0;
}
Ejemplo n.º 14
0
static int
test_fakestring_rw ()
{
  char *msg;
  int32_t tmpInt = 2;
  char *readResult;
  struct GNUNET_BIO_WriteHandle *fileW;
  struct GNUNET_BIO_ReadHandle *fileR;
  char *fileName = GNUNET_DISK_mktemp ("gnunet_bio");

  fileW = GNUNET_BIO_write_open (fileName);
  GNUNET_assert (NULL != fileW);
  GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_int32 (fileW, tmpInt));
  GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_close (fileW));

  fileR = GNUNET_BIO_read_open (fileName);
  GNUNET_assert (NULL != fileR);
  GNUNET_assert (GNUNET_SYSERR ==
                 GNUNET_BIO_read_string (fileR, "Read string error",
                                         &readResult, 200));
  msg = NULL;
  GNUNET_BIO_read_close (fileR, &msg);
  GNUNET_free (msg);
  GNUNET_assert (GNUNET_OK == GNUNET_DISK_directory_remove (fileName));
  GNUNET_free (fileName);
  return 0;
}
Ejemplo n.º 15
0
static void
do_stop (void *cls,
         const struct GNUNET_SCHEDULER_TaskContext *tc)
{
  char *fn = cls;

  if (0 ==
      GNUNET_TIME_absolute_get_remaining (GNUNET_TIME_absolute_add (start_time,
                                                                    TIMEOUT)).rel_value_us)
  {
    GNUNET_break (0);
    ret = 1;
  }
  else
  {
    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                "Finished download, shutting down\n",
                (unsigned long long) FILESIZE);
  }
  if (NULL != fn)
  {
    GNUNET_DISK_directory_remove (fn);
    GNUNET_free (fn);
  }
  GNUNET_SCHEDULER_shutdown ();
}
Ejemplo n.º 16
0
static int
test_fakebigmeta_rw ()
{
  char *msg;
  int32_t tmpInt = 1024 * 1024 * 10;
  struct GNUNET_BIO_WriteHandle *fileW;
  struct GNUNET_BIO_ReadHandle *fileR;
  char *fileName = GNUNET_DISK_mktemp ("gnunet_bio");
  struct GNUNET_CONTAINER_MetaData *metaDataR;

  fileW = GNUNET_BIO_write_open (fileName);
  GNUNET_assert (NULL != fileW);
  GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_int32 (fileW, tmpInt));
  GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_close (fileW));

  fileR = GNUNET_BIO_read_open (fileName);
  GNUNET_assert (NULL != fileR);
  metaDataR = NULL;
  GNUNET_assert (GNUNET_SYSERR ==
                 GNUNET_BIO_read_meta_data (fileR, "Read meta error",
                                            &metaDataR));
  msg = NULL;
  GNUNET_BIO_read_close (fileR, &msg);
  GNUNET_free (msg);
  GNUNET_assert (GNUNET_OK == GNUNET_DISK_directory_remove (fileName));
  GNUNET_assert (NULL == metaDataR);
  GNUNET_free (fileName);
  return 0;
}
Ejemplo n.º 17
0
static int
test_nullstring_rw ()
{
  char *msg;
  char *readResultString = (char *) "not null";
  struct GNUNET_BIO_WriteHandle *fileW;
  struct GNUNET_BIO_ReadHandle *fileR;
  char *fileName = GNUNET_DISK_mktemp ("gnunet_bio");

  fileW = GNUNET_BIO_write_open (fileName);
  GNUNET_assert (NULL != fileW);
  GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_string (fileW, NULL));
  GNUNET_assert (GNUNET_OK == GNUNET_BIO_write_close (fileW));

  fileR = GNUNET_BIO_read_open (fileName);
  GNUNET_assert (NULL != fileR);
  GNUNET_assert (GNUNET_OK ==
                 GNUNET_BIO_read_string (fileR, "Read string error",
                                         &readResultString, 200));
  GNUNET_assert (NULL == readResultString);
  GNUNET_BIO_read_close (fileR, &msg);
  GNUNET_assert (GNUNET_OK == GNUNET_DISK_directory_remove (fileName));
  GNUNET_free (fileName);

  return 0;
}
static void
do_download (void *cls,
	     const char *emsg)
{
  struct DownloadContext *dc = cls;
  struct GNUNET_FS_Uri *uri = dc->uri;

  GNUNET_TESTBED_operation_done (op);
  op = NULL;
  if (NULL != dc->fn)
  {
    GNUNET_DISK_directory_remove (dc->fn);
    GNUNET_free (dc->fn);
  }
  GNUNET_free (dc);
  if (NULL != emsg)
  {
    GNUNET_SCHEDULER_shutdown ();
    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Failed to stop source daemon: %s\n",
                emsg);
    GNUNET_FS_uri_destroy (uri);
    ok = 1;
    return;
  }
  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Downloading %llu bytes\n",
              (unsigned long long) FILESIZE);
  start_time = GNUNET_TIME_absolute_get ();
  GNUNET_FS_TEST_download (daemons[0], TIMEOUT, 1, SEED, uri, VERBOSE, &do_stop,
                           NULL);
  GNUNET_FS_uri_destroy (uri);
}
int
main (int argc, char *argv[])
{
  int ret;

  GNUNET_log_setup ("test_testing_topology_churn",
                    "WARNING",
                    NULL);
  ret = check ();

  /**
   * Need to remove base directory, subdirectories taken care
   * of by the testing framework.
   */
  if (test_directory != NULL)
  {
    if (GNUNET_DISK_directory_remove (test_directory) != GNUNET_OK)
    {
      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                  "Failed to remove testing directory %s\n", test_directory);
    }
  }

  return ret;
}
Ejemplo n.º 20
0
/**
 * Main: start test
 */
int
main (int argc, char *argv[])
{
  char *const argv2[] = {
    argv[0],
    "-c",
    "test_testing_2dtorus.conf",
#if VERBOSE
    "-L",
    "DEBUG",
#endif
    NULL
  };

  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Start\n");


  GNUNET_PROGRAM_run ((sizeof (argv2) / sizeof (char *)) - 1, argv2,
                      "test_testing_2dtorus",
                      gettext_noop ("Test testing 2d torus."), options, &run,
                      NULL);
#if REMOVE_DIR
  GNUNET_DISK_directory_remove ("/tmp/test_testing_2dtorus");
#endif
  if (GNUNET_OK != ok)
  {
    GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "test: FAILED!\n");
    return 1;
  }
  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: success\n");
  return 0;
}
static void
run (void *cls,
     const struct GNUNET_CONFIGURATION_Handle *cfg,
     struct GNUNET_TESTING_Peer *peer)
{
  directory = NULL;
  GNUNET_assert (GNUNET_OK ==
                 GNUNET_CONFIGURATION_get_value_string (cfg,
                                                        "PATHS",
                                                        "GNUNET_TEST_HOME",
                                                        &directory));
  GNUNET_DISK_directory_remove (directory);

  endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT, &endbadly, NULL);
  nsh = GNUNET_NAMESTORE_connect (cfg);
  GNUNET_break (NULL != nsh);

  /* first, iterate over empty namestore */
  zi = GNUNET_NAMESTORE_zone_iteration_start(nsh,
					     NULL,
                                             &fail_cb,
                                             NULL,
                                             &empty_zone_proc,
                                             nsh,
                                             &empty_zone_end,
                                             nsh);
  if (NULL == zi)
  {
    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                "Failed to create zone iterator\n");
    GNUNET_break (0);
    GNUNET_SCHEDULER_cancel (endbadly_task);
    endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
  }
}
Ejemplo n.º 22
0
int
main (int argc, char *const *argv)
{
  char *binary;

  if (GNUNET_SYSERR == GNUNET_OS_check_helper_binary ("gnunet-gns-proxy", GNUNET_NO, NULL))
  {
    fprintf (stderr, "Proxy binary not in PATH... skipping!\n");
    return 0;
  }
  binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-dns");
  if (GNUNET_YES != GNUNET_OS_check_helper_binary (binary, GNUNET_YES, NULL)) // TODO: once we have a windows-testcase, add test parameters here
  {
    fprintf (stderr, "DNS helper binary has wrong permissions... skipping!\n");
    GNUNET_free (binary);
    return 0;
  }
    GNUNET_free (binary);

  if (0 != curl_global_init (CURL_GLOBAL_WIN32))
  {
    fprintf (stderr, "failed to initialize curl\n");
    return 2;
  }
  if (0 != GNUNET_TESTING_peer_run ("test-gnunet-gns-proxy",
				    "test_gns_proxy.conf",
				    &run, NULL))
    return 1;
  GNUNET_DISK_directory_remove ("/tmp/gnunet-test-gns-proxy");
  return global_ret;
}
Ejemplo n.º 23
0
static int
testDirScan ()
{
  if (GNUNET_OK !=
      GNUNET_DISK_directory_create ("test" DIR_SEPARATOR_STR "entry"))
  {
    GNUNET_break (0);
    return 1;
  }
  if (GNUNET_OK !=
      GNUNET_DISK_directory_create ("test" DIR_SEPARATOR_STR "entry_more"))
  {
    GNUNET_break (0);
    return 1;
  }
  GNUNET_DISK_directory_scan ("test", &scan_callback,
                              "test" DIR_SEPARATOR_STR "entry");
  if (GNUNET_OK != GNUNET_DISK_directory_remove ("test"))
  {
    GNUNET_break (0);
    return 1;
  }
  if (ok < 2)
  {
    GNUNET_break (0);
    return 1;
  }
  return 0;
}
Ejemplo n.º 24
0
static void
abort_unindex_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
  GNUNET_FS_unindex_stop (unindex);
  unindex = NULL;
  GNUNET_DISK_directory_remove (fn);
  GNUNET_free (fn);
  fn = NULL;
}
Ejemplo n.º 25
0
static void
abort_publish_task (void *cls)
{
  GNUNET_FS_publish_stop (publish);
  publish = NULL;
  GNUNET_DISK_directory_remove (fn1);
  GNUNET_free (fn1);
  fn1 = NULL;
  GNUNET_DISK_directory_remove (fn2);
  GNUNET_free (fn2);
  fn2 = NULL;
  GNUNET_FS_stop (fs);
  fs = NULL;
  if (NULL != rtask)
  {
    GNUNET_SCHEDULER_cancel (rtask);
    rtask = NULL;
  }
}
static void
abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
  GNUNET_FS_publish_stop (publish);
  publish = NULL;
  GNUNET_DISK_directory_remove (fn1);
  GNUNET_free (fn1);
  fn1 = NULL;
  GNUNET_DISK_directory_remove (fn2);
  GNUNET_free (fn2);
  fn2 = NULL;
  GNUNET_FS_stop (fs);
  fs = NULL;
  if (GNUNET_SCHEDULER_NO_TASK != rtask)
  {
    GNUNET_SCHEDULER_cancel (rtask);
    rtask = GNUNET_SCHEDULER_NO_TASK;
  }
}
Ejemplo n.º 27
0
int
main (int argc, char *argv[])
{
  GNUNET_TRANSPORT_TESTING_get_test_name (argv[0], &test_name);

  GNUNET_log_setup (test_name,
                    "WARNING",
                    NULL);

  GNUNET_TRANSPORT_TESTING_get_test_source_name (__FILE__, &test_source);
  GNUNET_TRANSPORT_TESTING_get_test_plugin_name (argv[0], test_source,
                                                 &test_plugin);

  tth = GNUNET_TRANSPORT_TESTING_init ();

  GNUNET_TRANSPORT_TESTING_get_config_name (argv[0], &cfg_file_p1, 1);
  GNUNET_TRANSPORT_TESTING_get_config_name (argv[0], &cfg_file_p2, 2);

  check ();

  GNUNET_free (cfg_file_p1);
  GNUNET_free (cfg_file_p2);

  if (GNUNET_YES == GNUNET_DISK_file_test (gen_cfg_p1))
  {
    GNUNET_DISK_directory_remove (gen_cfg_p1);
    GNUNET_free (gen_cfg_p1);
  }

  if (GNUNET_YES == GNUNET_DISK_file_test (gen_cfg_p2))
  {
    GNUNET_DISK_directory_remove (gen_cfg_p2);
    GNUNET_free (gen_cfg_p2);
  }

  GNUNET_free (test_source);
  GNUNET_free (test_plugin);
  GNUNET_free (test_name);

  GNUNET_TRANSPORT_TESTING_done (tth);

  return test_failed;
}
int
main (int argc, char *argv[])
{
  GNUNET_TESTBED_test_run ("test-gnunet-daemon-topology",
			   "test_gnunet_daemon_topology_data.conf",
			   NUM_PEERS,
			   0, NULL, NULL,
			   &do_connect, NULL);
  GNUNET_DISK_directory_remove ("/tmp/test-gnunet-topology");
  return ok;
}
int
main (int argc, char *argv[])
{
  ok = 1;
  GNUNET_log_setup ("test-gns-simple-srv-lookup",
                    "WARNING",
                    NULL);
  GNUNET_TESTING_peer_run ("test-gns-simple-srv-lookup", "test_gns_simple_lookup.conf", &do_check, NULL);
  GNUNET_DISK_directory_remove ("test-gns-simple-srv-lookup");
  return ok;
}
int
main (int argc, char *argv[])
{
  (void) GNUNET_TESTBED_test_run ("test-gnunet-service-fs-migration",
                                  "fs_test_lib_data.conf",
                                  2,
                                  0, NULL, NULL,
                                  &do_publish,
                                  NULL);
  GNUNET_DISK_directory_remove ("/tmp/test-gnunet-service-fs-migration/");
  return ok;
}