2 This file is part of GNUnet.
3 Copyright (C) 2012 GNUnet e.V.
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.
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.
16 * @file dht/dht_test_lib.h
17 * @author Christian Grothoff
18 * @brief library for writing DHT tests
20 #ifndef DHT_TEST_LIB_H
21 #define DHT_TEST_LIB_H
26 #if 0 /* keep Emacsens' auto-indent happy */
31 #include "gnunet_testbed_service.h"
32 #include "gnunet_dht_service.h"
35 * Test context for a DHT Test.
37 struct GNUNET_DHT_TEST_Context;
41 * Main function of a DHT test.
44 * @param ctx argument to give to GNUNET_DHT_TEST_cleanup on test end
45 * @param num_peers number of peers that are running
46 * @param peers array of peers
47 * @param dhts handle to each of the DHTs of the peers
49 typedef void (*GNUNET_DHT_TEST_AppMain) (void *cls,
50 struct GNUNET_DHT_TEST_Context *ctx,
51 unsigned int num_peers,
52 struct GNUNET_TESTBED_Peer **peers,
53 struct GNUNET_DHT_Handle **dhts);
57 * Run a test using the given name, configuration file and number of
60 * @param testname name of the test (for logging)
61 * @param cfgname name of the configuration file
62 * @param num_peers number of peers to start
63 * @param tmain main function to run once the testbed is ready
64 * @param tmain_cls closure for 'tmain'
67 GNUNET_DHT_TEST_run (const char *testname,
69 unsigned int num_peers,
70 GNUNET_DHT_TEST_AppMain tmain,
75 * Clean up the testbed.
77 * @param ctx handle for the testbed
80 GNUNET_DHT_TEST_cleanup (struct GNUNET_DHT_TEST_Context *ctx);
82 #if 0 /* keep Emacsens' auto-indent happy */
89 /* ifndef DHT_TEST_LIB_H */