*
* TODO:
* - need to enable user to specify topology options
- * - need minor fix with "***"-host argument change in TESTBED (TBD there)
* - need to check for leaks (especially FD leaks)
* - need to TEST
*/
/**
* List of hosts we use for the testbed.
*/
-static struct GNUNET_TESTBED_Host *hosts;
+static struct GNUNET_TESTBED_Host **hosts;
/**
* Size of the 'hosts' array.
*/
static struct GNUNET_TESTBED_ControllerProc *copro;
-/**
- * Testbed handle.
- */
-static struct GNUNET_TESTBED_Testbed *testbed;
+/* /\** */
+/* * Testbed handle. */
+/* *\/ */
+/* static struct GNUNET_TESTBED_Testbed *testbed; */
/**
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending test.\n");
close_monitor_connections ();
- if (NULL != testbed)
- GNUNET_TESTBED_destroy (testbed);
+ /* if (NULL != testbed) */
+ /* GNUNET_TESTBED_destroy (testbed); */
if (NULL != controller)
GNUNET_TESTBED_controller_disconnect (controller);
if (NULL != copro)
GNUNET_TESTBED_controller_stop (copro);
- while (0 > num_hosts)
+ while (0 < num_hosts)
GNUNET_TESTBED_host_destroy (hosts[--num_hosts]);
// FIXME: what about closing other files!?
if (NULL != data_file)
GNUNET_DISK_file_close (data_file);
+ if (NULL != testing_cfg)
+ GNUNET_CONFIGURATION_destroy (testing_cfg);
+ testing_cfg = NULL;
}
/**
* Task run to connect to the NSE and statistics services to a subset of
* all of the running peers.
- *
- * @param cls handle the peer
- * @param tc ignored
*/
static void
connect_nse_service ()
* last round, terminates the run.
*
* @param cls struct StatsContext
- * @param success GNUNET_OK if statistics were
- * successfully obtained, GNUNET_SYSERR if not.
+ * @param op operation handle
+ * @param emsg error message, NULL on success
*/
static void
stats_finished_callback (void *cls,
/* start peers if we have too few */
for (i=peers_running;i<num_peers_in_round[current_round];i++)
- GNUNET_TESTBED_peer_start (daemons[i], NULL, NULL);
+ GNUNET_TESTBED_peer_start (NULL, daemons[i], NULL, NULL);
/* stop peers if we have too many */
for (i=num_peers_in_round[current_round];i<peers_running;i++)
break;
case GNUNET_TESTBED_ET_CONNECT:
total_connections++;
+ break;
case GNUNET_TESTBED_ET_DISCONNECT:
total_connections--;
+ break;
default:
break;
}
return;
}
num_hosts = GNUNET_TESTBED_hosts_load_from_file (hosts_file,
+ testing_cfg,
&hosts);
if (0 == num_hosts)
{
NULL,
0 /* mask */,
&master_controller_cb, NULL);
- testbed = GNUNET_TESTBED_create (controller,
- num_hosts, hosts,
- num_peers,
- cfg,
- 0 /* FIXME: topology */,
- NULL /* FIXME: topology options */);
+
+ /* testbed = GNUNET_TESTBED_create (controller, */
+ /* num_hosts, hosts, */
+ /* num_peers, */
+ /* cfg, */
+ /* 0 /\* FIXME: topology *\/, */
+ /* NULL /\* FIXME: topology options *\/); */
}