diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-12-17 12:46:15 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-12-17 12:46:15 +0000 |
commit | a1ad2810d54f878ae54f220fc69532093ffd613e (patch) | |
tree | 80ed2dda272198101ee23e088eba62de3d37e2e0 | |
parent | d2a8eb93d0083b824a10ae9bf26438dfb56b8013 (diff) | |
download | gnunet-a1ad2810d54f878ae54f220fc69532093ffd613e.tar.gz gnunet-a1ad2810d54f878ae54f220fc69532093ffd613e.zip |
- rename TOPOLOGY_FILE to OVERLAY_TOPOLOGY_FILE and remove GNUNET_TESTBED_create() and its friends
-rw-r--r-- | src/dht/test_dht_multipeer.conf | 2 | ||||
-rw-r--r-- | src/include/gnunet_testbed_service.h | 70 | ||||
-rw-r--r-- | src/testbed/test_testbed_api_testbed_run_topologyfromfile.conf | 2 | ||||
-rw-r--r-- | src/testbed/testbed_api_testbed.c | 126 |
4 files changed, 4 insertions, 196 deletions
diff --git a/src/dht/test_dht_multipeer.conf b/src/dht/test_dht_multipeer.conf index 8aff89188..1408f05b9 100644 --- a/src/dht/test_dht_multipeer.conf +++ b/src/dht/test_dht_multipeer.conf | |||
@@ -26,7 +26,7 @@ WEAKRANDOM = YES | |||
26 | 26 | ||
27 | [testbed] | 27 | [testbed] |
28 | OVERLAY_TOPOLOGY = FROM_FILE | 28 | OVERLAY_TOPOLOGY = FROM_FILE |
29 | TOPOLOGY_FILE = test_dht_multipeer_topology.dat | 29 | OVERLAY_TOPOLOGY_FILE = test_dht_multipeer_topology.dat |
30 | 30 | ||
31 | [gnunetd] | 31 | [gnunetd] |
32 | HOSTKEY = $SERVICEHOME/.hostkey | 32 | HOSTKEY = $SERVICEHOME/.hostkey |
diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h index 8c20e2556..39c10b46d 100644 --- a/src/include/gnunet_testbed_service.h +++ b/src/include/gnunet_testbed_service.h | |||
@@ -69,11 +69,6 @@ struct GNUNET_TESTBED_Operation; | |||
69 | */ | 69 | */ |
70 | struct GNUNET_TESTBED_Controller; | 70 | struct GNUNET_TESTBED_Controller; |
71 | 71 | ||
72 | /** | ||
73 | * Handle to a large-scale testbed that is managed at a high level. | ||
74 | */ | ||
75 | struct GNUNET_TESTBED_Testbed; | ||
76 | |||
77 | 72 | ||
78 | /** | 73 | /** |
79 | * Create a host to run peers and controllers on. | 74 | * Create a host to run peers and controllers on. |
@@ -1260,71 +1255,6 @@ GNUNET_TESTBED_operation_done (struct GNUNET_TESTBED_Operation *operation); | |||
1260 | 1255 | ||
1261 | 1256 | ||
1262 | /** | 1257 | /** |
1263 | * Configure and run a testbed using the given | ||
1264 | * master controller on 'num_hosts' starting | ||
1265 | * 'num_peers' using the given peer configuration. | ||
1266 | * | ||
1267 | * @param controller master controller for the testbed | ||
1268 | * (must not be destroyed until after the | ||
1269 | * testbed is destroyed). | ||
1270 | * @param num_hosts number of hosts in 'hosts', 0 to only | ||
1271 | * use 'localhost' | ||
1272 | * @param hosts list of hosts to use for the testbed | ||
1273 | * @param num_peers number of peers to start | ||
1274 | * @param cfg the configuration to use as a template for peers and also for | ||
1275 | * checking the value of testbed helper binary | ||
1276 | * @param underlay_topology underlay topology to create | ||
1277 | * @param va topology-specific options | ||
1278 | * @return handle to the testbed | ||
1279 | */ | ||
1280 | struct GNUNET_TESTBED_Testbed * | ||
1281 | GNUNET_TESTBED_create_va (struct GNUNET_TESTBED_Controller *controller, | ||
1282 | unsigned int num_hosts, | ||
1283 | struct GNUNET_TESTBED_Host **hosts, | ||
1284 | unsigned int num_peers, | ||
1285 | const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
1286 | enum GNUNET_TESTBED_TopologyOption underlay_topology, | ||
1287 | va_list va); | ||
1288 | |||
1289 | |||
1290 | /** | ||
1291 | * Configure and run a testbed using the given | ||
1292 | * master controller on 'num_hosts' starting | ||
1293 | * 'num_peers' using the given peer configuration. | ||
1294 | * | ||
1295 | * @param controller master controller for the testbed | ||
1296 | * (must not be destroyed until after the | ||
1297 | * testbed is destroyed). | ||
1298 | * @param num_hosts number of hosts in 'hosts', 0 to only | ||
1299 | * use 'localhost' | ||
1300 | * @param hosts list of hosts to use for the testbed | ||
1301 | * @param num_peers number of peers to start | ||
1302 | * @param cfg the configuration to use as a template for peers and also for | ||
1303 | * checking the value of testbed helper binary | ||
1304 | * @param underlay_topology underlay topology to create | ||
1305 | * @param ... topology-specific options | ||
1306 | */ | ||
1307 | struct GNUNET_TESTBED_Testbed * | ||
1308 | GNUNET_TESTBED_create (struct GNUNET_TESTBED_Controller *controller, | ||
1309 | unsigned int num_hosts, | ||
1310 | struct GNUNET_TESTBED_Host **hosts, | ||
1311 | unsigned int num_peers, | ||
1312 | const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
1313 | enum GNUNET_TESTBED_TopologyOption underlay_topology, | ||
1314 | ...); | ||
1315 | |||
1316 | |||
1317 | /** | ||
1318 | * Destroy a testbed. Stops all running peers and then | ||
1319 | * destroys all peers. Does NOT destroy the master controller. | ||
1320 | * | ||
1321 | * @param testbed testbed to destroy | ||
1322 | */ | ||
1323 | void | ||
1324 | GNUNET_TESTBED_destroy (struct GNUNET_TESTBED_Testbed *testbed); | ||
1325 | |||
1326 | |||
1327 | /** | ||
1328 | * Callback function to process statistic values from all peers. | 1258 | * Callback function to process statistic values from all peers. |
1329 | * | 1259 | * |
1330 | * @param cls closure | 1260 | * @param cls closure |
diff --git a/src/testbed/test_testbed_api_testbed_run_topologyfromfile.conf b/src/testbed/test_testbed_api_testbed_run_topologyfromfile.conf index 9d91b7193..b96df09b9 100644 --- a/src/testbed/test_testbed_api_testbed_run_topologyfromfile.conf +++ b/src/testbed/test_testbed_api_testbed_run_topologyfromfile.conf | |||
@@ -5,7 +5,7 @@ ACCEPT_FROM = 127.0.0.1; | |||
5 | HOSTNAME = localhost | 5 | HOSTNAME = localhost |
6 | NEIGHBOUR_LIMIT = 100 | 6 | NEIGHBOUR_LIMIT = 100 |
7 | OVERLAY_TOPOLOGY = FROM_FILE | 7 | OVERLAY_TOPOLOGY = FROM_FILE |
8 | TOPOLOGY_FILE = overlay_topology.txt | 8 | OVERLAY_TOPOLOGY_FILE = overlay_topology.txt |
9 | PARALLEL_OVERLAY_CONNECT_THRESHOLD = 2 | 9 | PARALLEL_OVERLAY_CONNECT_THRESHOLD = 2 |
10 | #PREFIX = xterm -geometry 100x85 -T peer1 -e libtool --mode=execute gdb --args | 10 | #PREFIX = xterm -geometry 100x85 -T peer1 -e libtool --mode=execute gdb --args |
11 | 11 | ||
diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c index e1ec50386..3bc92bc2b 100644 --- a/src/testbed/testbed_api_testbed.c +++ b/src/testbed/testbed_api_testbed.c | |||
@@ -37,27 +37,6 @@ | |||
37 | #define LOG(kind,...) \ | 37 | #define LOG(kind,...) \ |
38 | GNUNET_log_from (kind, "testbed-api-testbed", __VA_ARGS__) | 38 | GNUNET_log_from (kind, "testbed-api-testbed", __VA_ARGS__) |
39 | 39 | ||
40 | /** | ||
41 | * Opaque handle to an abstract operation to be executed by the testing framework. | ||
42 | */ | ||
43 | struct GNUNET_TESTBED_Testbed | ||
44 | { | ||
45 | /** | ||
46 | * The array of hosts | ||
47 | */ | ||
48 | struct GNUNET_TESTBED_Host **hosts; | ||
49 | |||
50 | /** | ||
51 | * The number of hosts in the hosts array | ||
52 | */ | ||
53 | unsigned int num_hosts; | ||
54 | |||
55 | /** | ||
56 | * The controller handle | ||
57 | */ | ||
58 | struct GNUNET_TESTBED_Controller *c; | ||
59 | }; | ||
60 | |||
61 | 40 | ||
62 | /** | 41 | /** |
63 | * DLL of operations | 42 | * DLL of operations |
@@ -1012,11 +991,11 @@ GNUNET_TESTBED_run (const char *host_filename, | |||
1012 | break; | 991 | break; |
1013 | case GNUNET_TESTBED_TOPOLOGY_FROM_FILE: | 992 | case GNUNET_TESTBED_TOPOLOGY_FROM_FILE: |
1014 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (rc->cfg, "testbed", | 993 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (rc->cfg, "testbed", |
1015 | "TOPOLOGY_FILE", | 994 | "OVERLAY_TOPOLOGY_FILE", |
1016 | &rc->topo_file)) | 995 | &rc->topo_file)) |
1017 | { | 996 | { |
1018 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, | 997 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, |
1019 | "testbed", "TOPOLOGY_FILE"); | 998 | "testbed", "OVERLAY_TOPOLOGY_FILE"); |
1020 | goto error_cleanup; | 999 | goto error_cleanup; |
1021 | } | 1000 | } |
1022 | break; | 1001 | break; |
@@ -1069,105 +1048,4 @@ GNUNET_TESTBED_run (const char *host_filename, | |||
1069 | } | 1048 | } |
1070 | 1049 | ||
1071 | 1050 | ||
1072 | /** | ||
1073 | * Configure and run a testbed using the given | ||
1074 | * master controller on 'num_hosts' starting | ||
1075 | * 'num_peers' using the given peer configuration. | ||
1076 | * | ||
1077 | * @param controller master controller for the testbed | ||
1078 | * (must not be destroyed until after the | ||
1079 | * testbed is destroyed). | ||
1080 | * @param num_hosts number of hosts in 'hosts', 0 to only | ||
1081 | * use 'localhost' | ||
1082 | * @param hosts list of hosts to use for the testbed | ||
1083 | * @param num_peers number of peers to start | ||
1084 | * @param cfg the configuration to use as a template for peers and also for | ||
1085 | * checking the value of testbed helper binary | ||
1086 | * @param underlay_topology underlay topology to create | ||
1087 | * @param va topology-specific options | ||
1088 | * @return handle to the testbed; NULL upon error (error messaage will be printed) | ||
1089 | */ | ||
1090 | struct GNUNET_TESTBED_Testbed * | ||
1091 | GNUNET_TESTBED_create_va (struct GNUNET_TESTBED_Controller *controller, | ||
1092 | unsigned int num_hosts, | ||
1093 | struct GNUNET_TESTBED_Host **hosts, | ||
1094 | unsigned int num_peers, | ||
1095 | const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
1096 | enum GNUNET_TESTBED_TopologyOption underlay_topology, | ||
1097 | va_list va) | ||
1098 | { | ||
1099 | /* unsigned int nhost; */ | ||
1100 | |||
1101 | /* GNUNET_assert (underlay_topology < GNUNET_TESTBED_TOPOLOGY_NONE); */ | ||
1102 | /* if (num_hosts != 0) */ | ||
1103 | /* { */ | ||
1104 | /* for (nhost = 0; nhost < num_hosts; nhost++) */ | ||
1105 | /* { */ | ||
1106 | /* if (GNUNET_YES != GNUNET_TESTBED_is_host_habitable (hosts[nhost], cfg)) */ | ||
1107 | /* { */ | ||
1108 | /* LOG (GNUNET_ERROR_TYPE_ERROR, _("Host %s cannot start testbed\n"), */ | ||
1109 | /* GNUNET_TESTBED_host_get_hostname_ (hosts[nhost])); */ | ||
1110 | /* break; */ | ||
1111 | /* } */ | ||
1112 | /* } */ | ||
1113 | /* if (num_hosts != nhost) */ | ||
1114 | /* return NULL; */ | ||
1115 | /* } */ | ||
1116 | /* We need controller callback here to get operation done events while | ||
1117 | linking hosts */ | ||
1118 | GNUNET_break (0); | ||
1119 | return NULL; | ||
1120 | } | ||
1121 | |||
1122 | |||
1123 | /** | ||
1124 | * Configure and run a testbed using the given | ||
1125 | * master controller on 'num_hosts' starting | ||
1126 | * 'num_peers' using the given peer configuration. | ||
1127 | * | ||
1128 | * @param controller master controller for the testbed | ||
1129 | * (must not be destroyed until after the | ||
1130 | * testbed is destroyed). | ||
1131 | * @param num_hosts number of hosts in 'hosts', 0 to only | ||
1132 | * use 'localhost' | ||
1133 | * @param hosts list of hosts to use for the testbed | ||
1134 | * @param num_peers number of peers to start | ||
1135 | * @param cfg the configuration to use as a template for peers and also for | ||
1136 | * checking the value of testbed helper binary | ||
1137 | * @param underlay_topology underlay topology to create | ||
1138 | * @param ... topology-specific options | ||
1139 | */ | ||
1140 | struct GNUNET_TESTBED_Testbed * | ||
1141 | GNUNET_TESTBED_create (struct GNUNET_TESTBED_Controller *controller, | ||
1142 | unsigned int num_hosts, | ||
1143 | struct GNUNET_TESTBED_Host **hosts, | ||
1144 | unsigned int num_peers, | ||
1145 | const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
1146 | enum GNUNET_TESTBED_TopologyOption underlay_topology, | ||
1147 | ...) | ||
1148 | { | ||
1149 | struct GNUNET_TESTBED_Testbed *testbed; | ||
1150 | va_list vargs; | ||
1151 | |||
1152 | va_start (vargs, underlay_topology); | ||
1153 | testbed = GNUNET_TESTBED_create_va (controller, num_hosts, hosts, num_peers, | ||
1154 | cfg, underlay_topology, vargs); | ||
1155 | va_end (vargs); | ||
1156 | return testbed; | ||
1157 | } | ||
1158 | |||
1159 | |||
1160 | /** | ||
1161 | * Destroy a testbed. Stops all running peers and then | ||
1162 | * destroys all peers. Does NOT destroy the master controller. | ||
1163 | * | ||
1164 | * @param testbed testbed to destroy | ||
1165 | */ | ||
1166 | void | ||
1167 | GNUNET_TESTBED_destroy (struct GNUNET_TESTBED_Testbed *testbed) | ||
1168 | { | ||
1169 | GNUNET_break (0); | ||
1170 | } | ||
1171 | |||
1172 | |||
1173 | /* end of testbed_api_testbed.c */ | 1051 | /* end of testbed_api_testbed.c */ |