diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-09-25 09:24:05 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-09-25 09:24:05 +0000 |
commit | ade9098f026f851b7eea0b0d67c5a2e20c0c4501 (patch) | |
tree | 557c9bbc8df7ef2fd937d1f5eaf63cb56b0b4bee /src/dv | |
parent | fc37b9ce9d9b78a5dc4e1b8cc36361738604ef03 (diff) | |
download | gnunet-ade9098f026f851b7eea0b0d67c5a2e20c0c4501.tar.gz gnunet-ade9098f026f851b7eea0b0d67c5a2e20c0c4501.zip |
updated test
Diffstat (limited to 'src/dv')
-rw-r--r-- | src/dv/template_dv.conf | 1 | ||||
-rw-r--r-- | src/dv/test_transport_dv.c | 54 |
2 files changed, 43 insertions, 12 deletions
diff --git a/src/dv/template_dv.conf b/src/dv/template_dv.conf index 812b6975c..69f5ca4f2 100644 --- a/src/dv/template_dv.conf +++ b/src/dv/template_dv.conf | |||
@@ -21,6 +21,7 @@ | |||
21 | OVERLAY_TOPOLOGY = CLIQUE | 21 | OVERLAY_TOPOLOGY = CLIQUE |
22 | SETUP_TIMEOUT = 1 m | 22 | SETUP_TIMEOUT = 1 m |
23 | OPERATION_TIMEOUT = 5 s | 23 | OPERATION_TIMEOUT = 5 s |
24 | CACHE_SIZE = 0 | ||
24 | 25 | ||
25 | [transport-blacklist-OF84RAOAU2B1SOSEHJH6350MA0F7C98U55RI76LGIQOM7O33TFHPNUFB47CDBSCOLIINMVJ2U82445ABOBQRIVREG20L31KVDV5HG60] | 26 | [transport-blacklist-OF84RAOAU2B1SOSEHJH6350MA0F7C98U55RI76LGIQOM7O33TFHPNUFB47CDBSCOLIINMVJ2U82445ABOBQRIVREG20L31KVDV5HG60] |
26 | 548J7M14O4I0F8I84U0UFARVJ97DB6QOT3MCA8O8SNAIT5JJ8TR95LUVAP3N5L7DN33IB49SNMF3Q3C0VPLTGP9ASCULA9S2OIMHHH8 = tcp | 27 | 548J7M14O4I0F8I84U0UFARVJ97DB6QOT3MCA8O8SNAIT5JJ8TR95LUVAP3N5L7DN33IB49SNMF3Q3C0VPLTGP9ASCULA9S2OIMHHH8 = tcp |
diff --git a/src/dv/test_transport_dv.c b/src/dv/test_transport_dv.c index 0b021e92e..898ea7fd5 100644 --- a/src/dv/test_transport_dv.c +++ b/src/dv/test_transport_dv.c | |||
@@ -30,6 +30,28 @@ | |||
30 | */ | 30 | */ |
31 | static int ok; | 31 | static int ok; |
32 | 32 | ||
33 | struct GNUNET_TESTBED_Operation *topology_op; | ||
34 | |||
35 | static void topology_completed (void *cls, | ||
36 | unsigned int nsuccess, | ||
37 | unsigned int nfailures) | ||
38 | { | ||
39 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Links successful %u / %u failed\n", nsuccess, nfailures); | ||
40 | GNUNET_TESTBED_operation_done (topology_op); | ||
41 | topology_op = NULL; | ||
42 | |||
43 | if (nfailures > 0) | ||
44 | { | ||
45 | fprintf (stderr, "Error: links successful %u but %u failed\n", nsuccess, nfailures); | ||
46 | ok = 1; | ||
47 | } | ||
48 | else | ||
49 | ok = 0; | ||
50 | |||
51 | GNUNET_SCHEDULER_shutdown (); | ||
52 | } | ||
53 | |||
54 | |||
33 | static void | 55 | static void |
34 | test_connection (void *cls, | 56 | test_connection (void *cls, |
35 | struct GNUNET_TESTBED_RunHandle *h, | 57 | struct GNUNET_TESTBED_RunHandle *h, |
@@ -38,22 +60,29 @@ test_connection (void *cls, | |||
38 | unsigned int links_succeeded, | 60 | unsigned int links_succeeded, |
39 | unsigned int links_failed) | 61 | unsigned int links_failed) |
40 | { | 62 | { |
41 | int c; | 63 | if (4 != num_peers) |
42 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Links successful %u / %u failed\n", links_succeeded, links_failed); | ||
43 | |||
44 | if ( (4 != num_peers) || (0 != links_failed) ) | ||
45 | { | 64 | { |
46 | fprintf (stderr, "Testbed failed to connect peers\n"); | 65 | ok = 1; |
47 | GNUNET_SCHEDULER_shutdown (); | 66 | fprintf (stderr, "Only %u out of 4 peers were started ...\n", |
48 | return; | 67 | num_peers); |
49 | } | 68 | } |
50 | ok = 0; | 69 | |
51 | if (1) | 70 | if (0 != links_failed) |
52 | { | 71 | { |
53 | GNUNET_SCHEDULER_shutdown (); | 72 | /* All peers except DV peers are connected */ |
73 | fprintf (stderr, "Testbed failed to connect peers,\n"); | ||
74 | |||
75 | topology_op = GNUNET_TESTBED_overlay_configure_topology(NULL, num_peers, peers, NULL, | ||
76 | &topology_completed, NULL, | ||
77 | GNUNET_TESTBED_TOPOLOGY_CLIQUE, | ||
78 | GNUNET_TESTBED_TOPOLOGY_OPTION_END); | ||
79 | return; | ||
54 | } | 80 | } |
55 | else | 81 | |
56 | fprintf (stderr, "Test passed, press CTRL-C to shut down\n"); | 82 | ok = 1; |
83 | fprintf (stderr, "Testbed connected peers, should not happen...\n"); | ||
84 | GNUNET_SCHEDULER_shutdown (); | ||
85 | |||
57 | } | 86 | } |
58 | 87 | ||
59 | 88 | ||
@@ -61,6 +90,7 @@ int | |||
61 | main (int argc, char *argv[]) | 90 | main (int argc, char *argv[]) |
62 | { | 91 | { |
63 | ok = 1; | 92 | ok = 1; |
93 | /* Connecting initial topology */ | ||
64 | (void) GNUNET_TESTBED_test_run ("test-transport-dv", | 94 | (void) GNUNET_TESTBED_test_run ("test-transport-dv", |
65 | "test_transport_dv_data.conf", | 95 | "test_transport_dv_data.conf", |
66 | 4, | 96 | 4, |