diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-09-09 13:28:48 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-09-09 13:28:48 +0000 |
commit | 9d732bb204de9177aad6ae70c910cbf2615d81a3 (patch) | |
tree | 44ddd6e9e1dad749db51003acfa46d7835593dc6 /src/fs/fs_test_lib.h | |
parent | a1d7926951beb7466a1462e43b9933530e5825f7 (diff) | |
download | gnunet-9d732bb204de9177aad6ae70c910cbf2615d81a3.tar.gz gnunet-9d732bb204de9177aad6ae70c910cbf2615d81a3.zip |
make fs tests build against new testbed library -- they do not pass yet
Diffstat (limited to 'src/fs/fs_test_lib.h')
-rw-r--r-- | src/fs/fs_test_lib.h | 106 |
1 files changed, 8 insertions, 98 deletions
diff --git a/src/fs/fs_test_lib.h b/src/fs/fs_test_lib.h index 81125cafc..d00c21b1e 100644 --- a/src/fs/fs_test_lib.h +++ b/src/fs/fs_test_lib.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2010 Christian Grothoff (and other contributing authors) | 3 | (C) 2010, 2012 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -20,8 +20,8 @@ | |||
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file fs/fs_test_lib.h | 22 | * @file fs/fs_test_lib.h |
23 | * @brief library routines for testing FS publishing and downloading | 23 | * @brief library routines for testing FS publishing and downloading; |
24 | * with multiple peers; this code is limited to flat files | 24 | * this code is limited to flat files |
25 | * and no keywords (those functions can be tested with | 25 | * and no keywords (those functions can be tested with |
26 | * single-peer setups; this is for testing routing). | 26 | * single-peer setups; this is for testing routing). |
27 | * @author Christian Grothoff | 27 | * @author Christian Grothoff |
@@ -31,97 +31,7 @@ | |||
31 | 31 | ||
32 | #include "gnunet_util_lib.h" | 32 | #include "gnunet_util_lib.h" |
33 | #include "gnunet_fs_service.h" | 33 | #include "gnunet_fs_service.h" |
34 | 34 | #include "gnunet_testbed_service.h" | |
35 | /** | ||
36 | * Handle for a daemon started for testing FS. | ||
37 | */ | ||
38 | struct GNUNET_FS_TestDaemon; | ||
39 | |||
40 | |||
41 | /** | ||
42 | * Start daemons for testing. | ||
43 | * | ||
44 | * @param template_cfg_file configuration template to use | ||
45 | * @param timeout if this operation cannot be completed within the | ||
46 | * given period, call the continuation with an error code | ||
47 | * @param total number of daemons to start | ||
48 | * @param daemons array of 'total' entries to be initialized | ||
49 | * (array must already be allocated, will be filled) | ||
50 | * @param cont function to call when done; note that if 'cont' | ||
51 | * is called with reason "TIMEOUT", then starting the | ||
52 | * daemons has failed and the client MUST NOT call | ||
53 | * 'GNUNET_FS_TEST_daemons_stop'! | ||
54 | * @param cont_cls closure for cont | ||
55 | */ | ||
56 | void | ||
57 | GNUNET_FS_TEST_daemons_start (const char *template_cfg_file, | ||
58 | struct GNUNET_TIME_Relative timeout, | ||
59 | unsigned int total, | ||
60 | struct GNUNET_FS_TestDaemon **daemons, | ||
61 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | ||
62 | |||
63 | |||
64 | struct GNUNET_FS_TEST_ConnectContext; | ||
65 | |||
66 | |||
67 | /** | ||
68 | * Connect two daemons for testing. | ||
69 | * | ||
70 | * @param daemon1 first daemon to connect | ||
71 | * @param daemon2 second first daemon to connect | ||
72 | * @param timeout if this operation cannot be completed within the | ||
73 | * given period, call the continuation with an error code | ||
74 | * @param cont function to call when done | ||
75 | * @param cont_cls closure for cont | ||
76 | */ | ||
77 | struct GNUNET_FS_TEST_ConnectContext * | ||
78 | GNUNET_FS_TEST_daemons_connect (struct GNUNET_FS_TestDaemon *daemon1, | ||
79 | struct GNUNET_FS_TestDaemon *daemon2, | ||
80 | struct GNUNET_TIME_Relative timeout, | ||
81 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | ||
82 | |||
83 | |||
84 | /** | ||
85 | * Cancel connect operation. | ||
86 | * | ||
87 | * @param cc operation to cancel | ||
88 | */ | ||
89 | void | ||
90 | GNUNET_FS_TEST_daemons_connect_cancel (struct GNUNET_FS_TEST_ConnectContext | ||
91 | *cc); | ||
92 | |||
93 | |||
94 | /** | ||
95 | * Obtain peer group used for testing. | ||
96 | * | ||
97 | * @param daemons array with the daemons (must contain at least one) | ||
98 | * @return peer group | ||
99 | */ | ||
100 | struct GNUNET_TESTING_PeerGroup * | ||
101 | GNUNET_FS_TEST_get_group (struct GNUNET_FS_TestDaemon **daemons); | ||
102 | |||
103 | |||
104 | |||
105 | /** | ||
106 | * Obtain peer configuration used for testing. | ||
107 | * | ||
108 | * @param daemons array with the daemons | ||
109 | * @param off which configuration to get | ||
110 | * @return peer configuration | ||
111 | */ | ||
112 | const struct GNUNET_CONFIGURATION_Handle * | ||
113 | GNUNET_FS_TEST_get_configuration (struct GNUNET_FS_TestDaemon **daemons, | ||
114 | unsigned int off); | ||
115 | |||
116 | /** | ||
117 | * Stop daemons used for testing. | ||
118 | * | ||
119 | * @param total number of daemons to stop | ||
120 | * @param daemons array with the daemons (values will be clobbered) | ||
121 | */ | ||
122 | void | ||
123 | GNUNET_FS_TEST_daemons_stop (unsigned int total, | ||
124 | struct GNUNET_FS_TestDaemon **daemons); | ||
125 | 35 | ||
126 | 36 | ||
127 | /** | 37 | /** |
@@ -138,7 +48,7 @@ typedef void (*GNUNET_FS_TEST_UriContinuation) (void *cls, | |||
138 | /** | 48 | /** |
139 | * Publish a file at the given daemon. | 49 | * Publish a file at the given daemon. |
140 | * | 50 | * |
141 | * @param daemon where to publish | 51 | * @param peer where to publish |
142 | * @param timeout if this operation cannot be completed within the | 52 | * @param timeout if this operation cannot be completed within the |
143 | * given period, call the continuation with an error code | 53 | * given period, call the continuation with an error code |
144 | * @param anonymity option for publication | 54 | * @param anonymity option for publication |
@@ -151,7 +61,7 @@ typedef void (*GNUNET_FS_TEST_UriContinuation) (void *cls, | |||
151 | * @param cont_cls closure for cont | 61 | * @param cont_cls closure for cont |
152 | */ | 62 | */ |
153 | void | 63 | void |
154 | GNUNET_FS_TEST_publish (struct GNUNET_FS_TestDaemon *daemon, | 64 | GNUNET_FS_TEST_publish (struct GNUNET_TESTBED_Peer *peer, |
155 | struct GNUNET_TIME_Relative timeout, uint32_t anonymity, | 65 | struct GNUNET_TIME_Relative timeout, uint32_t anonymity, |
156 | int do_index, uint64_t size, uint32_t seed, | 66 | int do_index, uint64_t size, uint32_t seed, |
157 | unsigned int verbose, | 67 | unsigned int verbose, |
@@ -161,7 +71,7 @@ GNUNET_FS_TEST_publish (struct GNUNET_FS_TestDaemon *daemon, | |||
161 | /** | 71 | /** |
162 | * Perform test download. | 72 | * Perform test download. |
163 | * | 73 | * |
164 | * @param daemon which peer to download from | 74 | * @param peer which peer to download from |
165 | * @param timeout if this operation cannot be completed within the | 75 | * @param timeout if this operation cannot be completed within the |
166 | * given period, call the continuation with an error code | 76 | * given period, call the continuation with an error code |
167 | * @param anonymity option for download | 77 | * @param anonymity option for download |
@@ -172,7 +82,7 @@ GNUNET_FS_TEST_publish (struct GNUNET_FS_TestDaemon *daemon, | |||
172 | * @param cont_cls closure for cont | 82 | * @param cont_cls closure for cont |
173 | */ | 83 | */ |
174 | void | 84 | void |
175 | GNUNET_FS_TEST_download (struct GNUNET_FS_TestDaemon *daemon, | 85 | GNUNET_FS_TEST_download (struct GNUNET_TESTBED_Peer *peer, |
176 | struct GNUNET_TIME_Relative timeout, | 86 | struct GNUNET_TIME_Relative timeout, |
177 | uint32_t anonymity, uint32_t seed, | 87 | uint32_t anonymity, uint32_t seed, |
178 | const struct GNUNET_FS_Uri *uri, unsigned int verbose, | 88 | const struct GNUNET_FS_Uri *uri, unsigned int verbose, |