aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-05-24 14:44:20 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-05-24 14:44:20 +0000
commit21abf49607496fcce4b977b225cc44870fb1137f (patch)
treece0183ee79249201c1e2a55f5060f65d08266357
parent7a020f36fdf5005d2b3ddb30c48bd41bab405dff (diff)
downloadgnunet-21abf49607496fcce4b977b225cc44870fb1137f.tar.gz
gnunet-21abf49607496fcce4b977b225cc44870fb1137f.zip
extended test
-rw-r--r--src/experimentation/gnunet-daemon-experimentation_experiments.c4
-rw-r--r--src/experimentation/test_experimentation_clique.c42
-rw-r--r--src/experimentation/test_experimentation_clique.conf1
3 files changed, 40 insertions, 7 deletions
diff --git a/src/experimentation/gnunet-daemon-experimentation_experiments.c b/src/experimentation/gnunet-daemon-experimentation_experiments.c
index eb8fae4f4..f172d7660 100644
--- a/src/experimentation/gnunet-daemon-experimentation_experiments.c
+++ b/src/experimentation/gnunet-daemon-experimentation_experiments.c
@@ -199,9 +199,9 @@ void exp_file_iterator (void *cls,
199 GNUNET_free_non_null (e->description); 199 GNUNET_free_non_null (e->description);
200 return; 200 return;
201 } 201 }
202 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Adding experiment `%s'\n"), e->name); 202 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Adding experiment `%s'\n"), e->name);
203 GNUNET_CONTAINER_multihashmap_put (experiments, &e->issuer.hashPubKey, e, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); 203 GNUNET_CONTAINER_multihashmap_put (experiments, &e->issuer.hashPubKey, e, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
204 GNUNET_STATISTICS_set (GSE_stats, "# expeeriments", GNUNET_CONTAINER_multihashmap_size (experiments), GNUNET_NO); 204 GNUNET_STATISTICS_set (GSE_stats, "# experiments", GNUNET_CONTAINER_multihashmap_size (experiments), GNUNET_NO);
205} 205}
206 206
207/** 207/**
diff --git a/src/experimentation/test_experimentation_clique.c b/src/experimentation/test_experimentation_clique.c
index f4a195fb0..eee4cc072 100644
--- a/src/experimentation/test_experimentation_clique.c
+++ b/src/experimentation/test_experimentation_clique.c
@@ -35,6 +35,10 @@
35 */ 35 */
36#define NUM_PEERS 10 36#define NUM_PEERS 10
37 37
38#define NUM_ISSUER 1
39
40#define NUM_EXPERIMENTS 2
41
38#define TEST_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, (5 * NUM_PEERS) + 20) 42#define TEST_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, (5 * NUM_PEERS) + 20)
39 43
40/** 44/**
@@ -86,6 +90,7 @@ struct ExperimentationPeer
86 unsigned int requested_nodes; 90 unsigned int requested_nodes;
87 unsigned int inactive_nodes; 91 unsigned int inactive_nodes;
88 unsigned int issuer; 92 unsigned int issuer;
93 unsigned int experiments;
89}; 94};
90 95
91 96
@@ -156,28 +161,42 @@ controller_event_cb (void *cls,
156static void 161static void
157check_end () 162check_end ()
158{ 163{
159 static int last_value = 0; 164 static int last_active_value = 0;
165 static int last_issuer_value = 0;
166 static int last_experiments_value = 0;
160 unsigned int peer; 167 unsigned int peer;
161 unsigned int total_active = 0; 168 unsigned int total_active = 0;
162 unsigned int total_inactive = 0; 169 unsigned int total_inactive = 0;
163 unsigned int total_requested = 0; 170 unsigned int total_requested = 0;
164 unsigned int issuer = 0; 171 unsigned int issuer = 0;
172 unsigned int experiments = 0;
165 173
166 for (peer = 0; peer < NUM_PEERS; peer++) 174 for (peer = 0; peer < NUM_PEERS; peer++)
167 { 175 {
168 total_active += ph[peer].active_nodes; 176 total_active += ph[peer].active_nodes;
169 total_requested += ph[peer].requested_nodes; 177 total_requested += ph[peer].requested_nodes;
170 total_inactive += ph[peer].inactive_nodes; 178 total_inactive += ph[peer].inactive_nodes;
171 if (1 == ph[peer].issuer) 179 if (NUM_ISSUER == ph[peer].issuer)
172 issuer ++; 180 issuer ++;
173 181 if (NUM_EXPERIMENTS == ph[peer].experiments)
182 experiments ++;
174 } 183 }
175 if (last_value < total_active) 184 if ((last_issuer_value < issuer) && (issuer == NUM_PEERS))
185 fprintf (stderr, "I");
186 last_issuer_value = issuer;
187
188 if ((last_experiments_value < experiments) && (experiments == NUM_PEERS))
189 fprintf (stderr, "E");
190 last_experiments_value = experiments;
191
192 if (last_active_value < total_active)
176 fprintf (stderr, "."); 193 fprintf (stderr, ".");
194 last_active_value = total_active;
195
177 196
178 if ((total_active == (NUM_PEERS * (NUM_PEERS -1))) && 197 if ((total_active == (NUM_PEERS * (NUM_PEERS -1))) &&
179 (total_requested == 0) && (total_inactive == 0) && 198 (total_requested == 0) && (total_inactive == 0) &&
180 (issuer == NUM_PEERS)) 199 (issuer == NUM_PEERS) && (experiments == NUM_PEERS))
181 { 200 {
182 fprintf (stderr, "\n"); 201 fprintf (stderr, "\n");
183 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "All %u peers active in a clique\n", NUM_PEERS); 202 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "All %u peers active in a clique\n", NUM_PEERS);
@@ -219,6 +238,10 @@ stat_iterator (void *cls, const char *subsystem, const char *name,
219 { 238 {
220 peer->issuer = value; 239 peer->issuer = value;
221 } 240 }
241 if (0 == strcmp (name, "# experiments"))
242 {
243 peer->experiments = value;
244 }
222 245
223 check_end (); 246 check_end ();
224 247
@@ -260,6 +283,9 @@ stat_comp_cb (void *cls, struct GNUNET_TESTBED_Operation *op,
260 GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch 283 GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch
261 (sh, "experimentation", "# issuer", 284 (sh, "experimentation", "# issuer",
262 stat_iterator, peer)); 285 stat_iterator, peer));
286 GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch
287 (sh, "experimentation", "# experiments",
288 stat_iterator, peer));
263} 289}
264 290
265/** 291/**
@@ -303,6 +329,12 @@ stat_disconnect_adapter (void *cls, void *op_result)
303 GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch_cancel 329 GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch_cancel
304 (peer->sh, "experimentation", "# nodes requested", 330 (peer->sh, "experimentation", "# nodes requested",
305 stat_iterator, peer)); 331 stat_iterator, peer));
332 GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch_cancel
333 (peer->sh, "experimentation", "# issuer",
334 stat_iterator, peer));
335 GNUNET_break (GNUNET_OK == GNUNET_STATISTICS_watch_cancel
336 (peer->sh, "experimentation", "# experiments",
337 stat_iterator, peer));
306 GNUNET_STATISTICS_destroy (op_result, GNUNET_NO); 338 GNUNET_STATISTICS_destroy (op_result, GNUNET_NO);
307 peer->sh = NULL; 339 peer->sh = NULL;
308} 340}
diff --git a/src/experimentation/test_experimentation_clique.conf b/src/experimentation/test_experimentation_clique.conf
index 8380a31f8..fb3d3b99e 100644
--- a/src/experimentation/test_experimentation_clique.conf
+++ b/src/experimentation/test_experimentation_clique.conf
@@ -38,6 +38,7 @@ PORT = 12365
38[experimentation] 38[experimentation]
39#PREFIX = valgrind --leak-check=full 39#PREFIX = valgrind --leak-check=full
40ISSUERS = TFRM29O2RQNKLVBQIGODJ6GD58LSQ2NM9TNFBC6N48BRJHQO38Q73N2OM3V4CLKDM6CILQV4CU8PMJDRG0FNB0PDI057DBRANMLPLRG 40ISSUERS = TFRM29O2RQNKLVBQIGODJ6GD58LSQ2NM9TNFBC6N48BRJHQO38Q73N2OM3V4CLKDM6CILQV4CU8PMJDRG0FNB0PDI057DBRANMLPLRG
41EXPERIMENTS = test_experiments.exp
41 42
42[ats] 43[ats]
43WAN_QUOTA_OUT = 3932160 44WAN_QUOTA_OUT = 3932160