aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/test_testbed_api_topology.c
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2012-10-18 14:26:30 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2012-10-18 14:26:30 +0000
commit7360be56a1334394337d279676d1785ec69aa26f (patch)
tree4cf0328edf327ea8302f051d066721fa1a370694 /src/testbed/test_testbed_api_topology.c
parentaadda4ec9d989fd49eea186420d4ea86b769dddd (diff)
downloadgnunet-7360be56a1334394337d279676d1785ec69aa26f.tar.gz
gnunet-7360be56a1334394337d279676d1785ec69aa26f.zip
-topology test case relaxed to accommodated overlay timeouts
-bounded overlay connects -topology API to retry on timeouts -test case configuration to include bounds on topology -cleanup of occs during shutdown
Diffstat (limited to 'src/testbed/test_testbed_api_topology.c')
-rw-r--r--src/testbed/test_testbed_api_topology.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/testbed/test_testbed_api_topology.c b/src/testbed/test_testbed_api_topology.c
index 91a9f4bde..8e673d293 100644
--- a/src/testbed/test_testbed_api_topology.c
+++ b/src/testbed/test_testbed_api_topology.c
@@ -44,6 +44,11 @@ static struct GNUNET_TESTBED_Peer **peers;
44static struct GNUNET_TESTBED_Operation *op; 44static struct GNUNET_TESTBED_Operation *op;
45 45
46/** 46/**
47 * Shutdown task
48 */
49static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
50
51/**
47 * Testing result 52 * Testing result
48 */ 53 */
49static int result; 54static int result;
@@ -63,6 +68,7 @@ static unsigned int overlay_connects;
63static void 68static void
64do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 69do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
65{ 70{
71 shutdown_task = GNUNET_SCHEDULER_NO_TASK;
66 if (NULL != op) 72 if (NULL != op)
67 { 73 {
68 GNUNET_TESTBED_operation_done (op); 74 GNUNET_TESTBED_operation_done (op);
@@ -91,6 +97,9 @@ controller_event_cb (void *cls,
91 GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); 97 GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
92 } 98 }
93 break; 99 break;
100 case GNUNET_TESTBED_ET_OPERATION_FINISHED:
101 GNUNET_assert (NULL != event->details.operation_finished.emsg);
102 break;
94 default: 103 default:
95 GNUNET_break (0); 104 GNUNET_break (0);
96 if ((GNUNET_TESTBED_ET_OPERATION_FINISHED == event->type) && 105 if ((GNUNET_TESTBED_ET_OPERATION_FINISHED == event->type) &&
@@ -99,7 +108,8 @@ controller_event_cb (void *cls,
99 "An operation failed with error: %s\n", 108 "An operation failed with error: %s\n",
100 event->details.operation_finished.emsg); 109 event->details.operation_finished.emsg);
101 result = GNUNET_SYSERR; 110 result = GNUNET_SYSERR;
102 GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); 111 GNUNET_SCHEDULER_cancel (shutdown_task);
112 shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
103 } 113 }
104} 114}
105 115
@@ -128,6 +138,9 @@ test_master (void *cls, unsigned int num_peers,
128 GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI, 138 GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI,
129 NUM_PEERS); 139 NUM_PEERS);
130 GNUNET_assert (NULL != op); 140 GNUNET_assert (NULL != op);
141 shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
142 (GNUNET_TIME_UNIT_SECONDS, 120),
143 do_shutdown, NULL);
131} 144}
132 145
133 146