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.
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/>.
19 * @file dht/dht_test_lib.h
20 * @author Christian Grothoff
21 * @brief library for writing DHT tests
23 #ifndef DHT_TEST_LIB_H
24 #define DHT_TEST_LIB_H
29 #if 0 /* keep Emacsens' auto-indent happy */
34 #include "gnunet_testbed_service.h"
35 #include "gnunet_dht_service.h"
38 * Test context for a DHT Test.
40 struct GNUNET_DHT_TEST_Context;
44 * Main function of a DHT test.
47 * @param ctx argument to give to GNUNET_DHT_TEST_cleanup on test end
48 * @param num_peers number of peers that are running
49 * @param peers array of peers
50 * @param dhts handle to each of the DHTs of the peers
52 typedef void (*GNUNET_DHT_TEST_AppMain) (void *cls,
53 struct GNUNET_DHT_TEST_Context *ctx,
54 unsigned int num_peers,
55 struct GNUNET_TESTBED_Peer **peers,
56 struct GNUNET_DHT_Handle **dhts);
60 * Run a test using the given name, configuration file and number of
63 * @param testname name of the test (for logging)
64 * @param cfgname name of the configuration file
65 * @param num_peers number of peers to start
66 * @param tmain main function to run once the testbed is ready
67 * @param tmain_cls closure for 'tmain'
70 GNUNET_DHT_TEST_run (const char *testname,
72 unsigned int num_peers,
73 GNUNET_DHT_TEST_AppMain tmain,
78 * Clean up the testbed.
80 * @param ctx handle for the testbed
83 GNUNET_DHT_TEST_cleanup (struct GNUNET_DHT_TEST_Context *ctx);
85 #if 0 /* keep Emacsens' auto-indent happy */
92 /* ifndef DHT_TEST_LIB_H */