aboutsummaryrefslogtreecommitdiff
path: root/src/testing
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
parentec2d856c3d790a042f6edf7ad0487bc4024d15c4 (diff)
downloadgnunet-76aac1b58af3a2c8488875d0f3d0e994563d80ca.tar.gz
gnunet-76aac1b58af3a2c8488875d0f3d0e994563d80ca.zip
added dv twice and dht never?
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/test_testing_data_topology_clique.conf2
-rw-r--r--src/testing/test_testing_data_topology_none.conf21
-rw-r--r--src/testing/test_testing_topology.c50
3 files changed, 54 insertions, 19 deletions
diff --git a/src/testing/test_testing_data_topology_clique.conf b/src/testing/test_testing_data_topology_clique.conf
index 114364da2..abe6f586a 100644
--- a/src/testing/test_testing_data_topology_clique.conf
+++ b/src/testing/test_testing_data_topology_clique.conf
@@ -41,7 +41,7 @@ PORT = 2570
41#DEBUG = YES 41#DEBUG = YES
42 42
43[testing] 43[testing]
44NUM_PEERS = 4 44NUM_PEERS = 10
45WEAKRANDOM = YES 45WEAKRANDOM = YES
46TOPOLOGY = CLIQUE 46TOPOLOGY = CLIQUE
47F2F = YES 47F2F = YES
diff --git a/src/testing/test_testing_data_topology_none.conf b/src/testing/test_testing_data_topology_none.conf
index 9ff8ca390..f03633d56 100644
--- a/src/testing/test_testing_data_topology_none.conf
+++ b/src/testing/test_testing_data_topology_none.conf
@@ -3,16 +3,14 @@ SERVICEHOME = /tmp/test-gnunet-testing/
3DEFAULTCONFIG = test_testing_data_topology_clique.conf 3DEFAULTCONFIG = test_testing_data_topology_clique.conf
4 4
5[resolver] 5[resolver]
6AUTOSTART = NO
6PORT = 0 7PORT = 0
7 8
8[transport] 9[transport]
9PORT = 0 10PORT = 0
10PLUGINS = tcp 11PLUGINS = tcp
11#PREFIX = xterm -e xterm -T transport -e gdb --args
12#BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport 12#BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport
13#PREFIX = valgrind --tool=memcheck --log-file=logs%p 13#PREFIX = valgrind --tool=massif
14#PREFIX = valgrind --tool=callgrind --log-file=callgrind.%p
15#DEBUG = YES
16 14
17[topology] 15[topology]
18PORT = 0 16PORT = 0
@@ -22,23 +20,18 @@ PORT = 0
22DEFAULTSERVICES = 20DEFAULTSERVICES =
23 21
24[statistics] 22[statistics]
23AUTOSTART = NO
25PORT = 0 24PORT = 0
26 25
27[transport-tcp] 26[transport-tcp]
28PORT = 2568 27PORT = 2568
28BINDTO = 127.0.0.1
29 29
30[peerinfo] 30[peerinfo]
31PORT = 0 31PORT = 0
32#DEBUG = YES
33#PREFIX = xterm -e xterm -T peerinfo -e gdb --args
34#BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/peerinfo/.libs/gnunet-service-peerinfo
35#PREFIX = valgrind --tool=memcheck --log-file=peerinfo%p
36 32
37[core] 33[core]
38PORT = 0 34PORT = 0
39#PREFIX = xterm -e xterm -T CORE -e gdb --args
40#PREFIX = valgrind --tool=memcheck --log-file=logs%p
41#DEBUG = YES
42 35
43[hostlist] 36[hostlist]
44PORT = 0 37PORT = 0
@@ -47,10 +40,14 @@ PORT = 0
47PORT = 0 40PORT = 0
48 41
49[testing] 42[testing]
50NUM_PEERS = 200 43NUM_PEERS = 50
51WEAKRANDOM = YES 44WEAKRANDOM = YES
52TOPOLOGY = NONE 45TOPOLOGY = NONE
53F2F = NO 46F2F = NO
54BLACKLIST_TOPOLOGY = NONE 47BLACKLIST_TOPOLOGY = NONE
55CONNECT_TOPOLOGY = RING 48CONNECT_TOPOLOGY = RING
49#CONNECT_TOPOLOGY = 2D_TORUS
50#CONNECT_TOPOLOGY = CLIQUE
51#CONNECT_TOPOLOGY_OPTION = CONNECT_DFS
52#CONNECT_TOPOLOGY_OPTION_MODIFIER = 20
56#DEBUG = YES 53#DEBUG = YES
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),