aboutsummaryrefslogtreecommitdiff
path: root/src/testing/test_testing_topology.c
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-07-02 13:49:05 +0000
committerNathan S. Evans <evans@in.tum.de>2010-07-02 13:49:05 +0000
commit76aac1b58af3a2c8488875d0f3d0e994563d80ca (patch)
treed912c773ff03732e5e1717aeb9df63cd10ac70ea /src/testing/test_testing_topology.c
parentec2d856c3d790a042f6edf7ad0487bc4024d15c4 (diff)
downloadgnunet-76aac1b58af3a2c8488875d0f3d0e994563d80ca.tar.gz
gnunet-76aac1b58af3a2c8488875d0f3d0e994563d80ca.zip
added dv twice and dht never?
Diffstat (limited to 'src/testing/test_testing_topology.c')
-rw-r--r--src/testing/test_testing_topology.c50
1 files changed, 44 insertions, 6 deletions
diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c
index eb13c8eef..23cb3716a 100644
--- a/src/testing/test_testing_topology.c
+++ b/src/testing/test_testing_topology.c
@@ -24,9 +24,12 @@
24#include "platform.h" 24#include "platform.h"
25#include "gnunet_testing_lib.h" 25#include "gnunet_testing_lib.h"
26#include "gnunet_core_service.h" 26#include "gnunet_core_service.h"
27#include "gnunet_os_lib.h"
27 28
28#define VERBOSE GNUNET_YES 29#define VERBOSE GNUNET_YES
29 30
31#define DELAY_FOR_LOGGING GNUNET_YES
32
30/** 33/**
31 * How long until we fail the whole testcase? 34 * How long until we fail the whole testcase?
32 */ 35 */
@@ -167,6 +170,20 @@ void shutdown_callback (void *cls,
167 } 170 }
168} 171}
169 172
173#if DELAY_FOR_LOGGING
174static void gather_log_data ()
175{
176 char *peer_number;
177 char *connect_number;
178 pid_t mem_process;
179 GNUNET_asprintf(&peer_number, "%llu", num_peers);
180 GNUNET_asprintf(&connect_number, "%llu", expected_connections);
181 mem_process = GNUNET_OS_start_process (NULL, NULL, "./memsize.pl",
182 "memsize.pl", "totals.txt", peer_number, connect_number, NULL);
183 GNUNET_OS_process_wait(mem_process);
184}
185
186#endif
170static void 187static void
171finish_testing () 188finish_testing ()
172{ 189{
@@ -177,6 +194,7 @@ finish_testing ()
177 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 194 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
178 "Called finish testing, stopping daemons.\n"); 195 "Called finish testing, stopping daemons.\n");
179#endif 196#endif
197
180 int count; 198 int count;
181 count = 0; 199 count = 0;
182 pos = test_messages; 200 pos = test_messages;
@@ -558,12 +576,22 @@ topology_callback (void *cls,
558#endif 576#endif
559 modnum = expected_messages / 4; 577 modnum = expected_messages / 4;
560 dotnum = (expected_messages / 50) + 1; 578 dotnum = (expected_messages / 50) + 1;
561#if VERBOSE
562 fprintf(stdout, "Test message progress: [");
563#endif
564 GNUNET_SCHEDULER_cancel (sched, die_task); 579 GNUNET_SCHEDULER_cancel (sched, die_task);
565 die_task = GNUNET_SCHEDULER_NO_TASK; 580 die_task = GNUNET_SCHEDULER_NO_TASK;
581#if DELAY_FOR_LOGGING
582 fprintf(stdout, "Sending test messages in 10 seconds.\n");
583 GNUNET_SCHEDULER_add_delayed (sched,
584 GNUNET_TIME_relative_multiply
585 (GNUNET_TIME_UNIT_SECONDS, 10),
586 &send_test_messages, test_messages);
587 gather_log_data();
588#else
566 GNUNET_SCHEDULER_add_now (sched, &send_test_messages, test_messages); 589 GNUNET_SCHEDULER_add_now (sched, &send_test_messages, test_messages);
590#endif
591#if VERBOSE
592 fprintf(stdout, "Test message progress: [");
593#endif
594
567 } 595 }
568 else if (total_connections + failed_connections == expected_connections) 596 else if (total_connections + failed_connections == expected_connections)
569 { 597 {
@@ -629,8 +657,8 @@ create_topology ()
629#if VERBOSE 657#if VERBOSE
630 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 658 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
631 "Topology set up, now starting peers!\n"); 659 "Topology set up, now starting peers!\n");
632#endif
633 fprintf(stdout, "Daemon start progress ["); 660 fprintf(stdout, "Daemon start progress [");
661#endif
634 GNUNET_TESTING_daemons_continue_startup(pg); 662 GNUNET_TESTING_daemons_continue_startup(pg);
635 } 663 }
636 else 664 else
@@ -696,10 +724,18 @@ peers_started_callback (void *cls,
696 * within a reasonable amount of time */ 724 * within a reasonable amount of time */
697 die_task = GNUNET_SCHEDULER_add_delayed (sched, 725 die_task = GNUNET_SCHEDULER_add_delayed (sched,
698 GNUNET_TIME_relative_multiply 726 GNUNET_TIME_relative_multiply
699 (GNUNET_TIME_UNIT_MINUTES, 5), 727 (GNUNET_TIME_UNIT_MINUTES, 8),
700 &end_badly, "from peers_started_callback"); 728 &end_badly, "from peers_started_callback");
701 729#if DELAY_FOR_LOGGING
730 fprintf(stdout, "Connecting topology in 10 seconds\n");
731 gather_log_data();
732 GNUNET_SCHEDULER_add_delayed (sched,
733 GNUNET_TIME_relative_multiply
734 (GNUNET_TIME_UNIT_SECONDS, 10),
735 &connect_topology, NULL);
736#else
702 connect_topology (); 737 connect_topology ();
738#endif
703 ok = 0; 739 ok = 0;
704 } 740 }
705} 741}
@@ -861,7 +897,9 @@ run (void *cls,
861 peers_left = num_peers; 897 peers_left = num_peers;
862 modnum = num_peers / 4; 898 modnum = num_peers / 4;
863 dotnum = (num_peers / 50) + 1; 899 dotnum = (num_peers / 50) + 1;
900#if VERBOSE
864 fprintf (stdout, "Hostkey generation progress: \["); 901 fprintf (stdout, "Hostkey generation progress: \[");
902#endif
865 /* Set up a task to end testing if peer start fails */ 903 /* Set up a task to end testing if peer start fails */
866 die_task = GNUNET_SCHEDULER_add_delayed (sched, 904 die_task = GNUNET_SCHEDULER_add_delayed (sched,
867 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, SECONDS_PER_PEER_START * num_peers), 905 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, SECONDS_PER_PEER_START * num_peers),