aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing_group.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-05-06 17:59:35 +0000
committerChristian Grothoff <christian@grothoff.org>2012-05-06 17:59:35 +0000
commit98ebd9b7431b176365a8cd7352b43ad306d3e1ad (patch)
treefa6144bdf0a4c702e808e94abbcc8d2ec6dd4012 /src/testing/testing_group.c
parentb2e7a0706c2810c62282d6f4c9233da7ab1c283e (diff)
downloadgnunet-98ebd9b7431b176365a8cd7352b43ad306d3e1ad.tar.gz
gnunet-98ebd9b7431b176365a8cd7352b43ad306d3e1ad.zip
-removing bogus/legacy debug statements, not passing -L DEBUG to arm anymore
Diffstat (limited to 'src/testing/testing_group.c')
-rw-r--r--src/testing/testing_group.c261
1 files changed, 58 insertions, 203 deletions
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c
index 49c0c1a33..607d455b6 100644
--- a/src/testing/testing_group.c
+++ b/src/testing/testing_group.c
@@ -30,12 +30,6 @@
30#include "gnunet_testing_lib.h" 30#include "gnunet_testing_lib.h"
31#include "gnunet_core_service.h" 31#include "gnunet_core_service.h"
32 32
33#define VERBOSE_TESTING GNUNET_NO
34
35#define VERBOSE_TOPOLOGY GNUNET_NO
36
37#define DEBUG_CHURN GNUNET_EXTRA_LOGGING
38
39#define USE_START_HELPER GNUNET_YES 33#define USE_START_HELPER GNUNET_YES
40 34
41#define OLD 1 35#define OLD 1
@@ -1835,17 +1829,13 @@ create_scale_free (struct GNUNET_TESTING_PeerGroup *pg,
1835 ((double) 1829 ((double)
1836 GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, 1830 GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
1837 UINT64_MAX)) / ((double) UINT64_MAX); 1831 UINT64_MAX)) / ((double) UINT64_MAX);
1838#if VERBOSE_TESTING
1839 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1832 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1840 "Considering connecting peer %d to peer %d\n", outer_count, 1833 "Considering connecting peer %d to peer %d\n", outer_count,
1841 i); 1834 i);
1842#endif
1843 if (random < probability) 1835 if (random < probability)
1844 { 1836 {
1845#if VERBOSE_TESTING
1846 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting peer %d to peer %d\n", 1837 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting peer %d to peer %d\n",
1847 outer_count, i); 1838 outer_count, i);
1848#endif
1849 total_connections += proc (pg, outer_count, i, list, GNUNET_YES); 1839 total_connections += proc (pg, outer_count, i, list, GNUNET_YES);
1850 } 1840 }
1851 } 1841 }
@@ -1929,7 +1919,7 @@ create_small_world_ring (struct GNUNET_TESTING_PeerGroup *pg,
1929 if (connsPerPeer % 2 == 1) 1919 if (connsPerPeer % 2 == 1)
1930 connsPerPeer += 1; 1920 connsPerPeer += 1;
1931 1921
1932 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Target is %d connections per peer."), 1922 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Target is %d connections per peer.",
1933 connsPerPeer); 1923 connsPerPeer);
1934 1924
1935 smallWorldConnections = 0; 1925 smallWorldConnections = 0;
@@ -2033,10 +2023,8 @@ create_nated_internet (struct GNUNET_TESTING_PeerGroup *pg,
2033 { 2023 {
2034 if ((outer_count > cutoff) || (inner_count > cutoff)) 2024 if ((outer_count > cutoff) || (inner_count > cutoff))
2035 { 2025 {
2036#if VERBOSE_TESTING
2037 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting peer %d to peer %d\n", 2026 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting peer %d to peer %d\n",
2038 outer_count, inner_count); 2027 outer_count, inner_count);
2039#endif
2040 connect_attempts += 2028 connect_attempts +=
2041 proc (pg, outer_count, inner_count, list, GNUNET_YES); 2029 proc (pg, outer_count, inner_count, list, GNUNET_YES);
2042 } 2030 }
@@ -2104,10 +2092,8 @@ create_nated_internet_copy (struct GNUNET_TESTING_PeerGroup *pg,
2104 { 2092 {
2105 if ((outer_count > cutoff) || (inner_count > cutoff)) 2093 if ((outer_count > cutoff) || (inner_count > cutoff))
2106 { 2094 {
2107#if VERBOSE_TESTING
2108 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting peer %d to peer %d\n", 2095 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting peer %d to peer %d\n",
2109 outer_count, inner_count); 2096 outer_count, inner_count);
2110#endif
2111 connect_attempts += 2097 connect_attempts +=
2112 proc (pg, outer_count, inner_count, list, GNUNET_YES); 2098 proc (pg, outer_count, inner_count, list, GNUNET_YES);
2113 add_connections (pg, outer_count, inner_count, ALLOWED, GNUNET_NO); 2099 add_connections (pg, outer_count, inner_count, ALLOWED, GNUNET_NO);
@@ -2204,12 +2190,9 @@ create_small_world (struct GNUNET_TESTING_PeerGroup *pg,
2204 toggle++; 2190 toggle++;
2205 } 2191 }
2206 } 2192 }
2207#if VERBOSE_TESTING
2208 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2193 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2209 _("Connecting nodes in 2d torus topology: %u rows %u columns\n"), 2194 "Connecting nodes in 2d torus topology: %u rows %u columns\n",
2210 rows, cols); 2195 rows, cols);
2211#endif
2212
2213 connect_attempts = 0; 2196 connect_attempts = 0;
2214 /* Rows and columns are all sorted out, now iterate over all nodes and connect each 2197 /* Rows and columns are all sorted out, now iterate over all nodes and connect each
2215 * to the node to its right and above. Once this is over, we'll have our torus! 2198 * to the node to its right and above. Once this is over, we'll have our torus!
@@ -2241,13 +2224,11 @@ create_small_world (struct GNUNET_TESTING_PeerGroup *pg,
2241 connect_attempts += proc (pg, i, nodeToConnect, list, GNUNET_YES); 2224 connect_attempts += proc (pg, i, nodeToConnect, list, GNUNET_YES);
2242 } 2225 }
2243 natLog = log (pg->total); 2226 natLog = log (pg->total);
2244#if VERBOSE_TESTING > 2
2245 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2227 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2246 _("natural log of %d is %d, will run %d iterations\n"), pg->total, 2228 "natural log of %d is %d, will run %d iterations\n", pg->total,
2247 natLog, (int) (natLog * percentage)); 2229 natLog, (int) (natLog * percentage));
2248 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2230 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2249 _("Total connections added thus far: %u!\n"), connect_attempts); 2231 "Total connections added thus far: %u!\n", connect_attempts);
2250#endif
2251 smallWorldConnections = 0; 2232 smallWorldConnections = 0;
2252 small_world_it = (unsigned int) (natLog * percentage); 2233 small_world_it = (unsigned int) (natLog * percentage);
2253 if (small_world_it < 1) 2234 if (small_world_it < 1)
@@ -2285,11 +2266,9 @@ create_small_world (struct GNUNET_TESTING_PeerGroup *pg,
2285 } 2266 }
2286 } 2267 }
2287 connect_attempts += smallWorldConnections; 2268 connect_attempts += smallWorldConnections;
2288#if VERBOSE_TESTING > 2
2289 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2269 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2290 _("Total connections added for small world: %d!\n"), 2270 "Total connections added for small world: %d!\n",
2291 smallWorldConnections); 2271 smallWorldConnections);
2292#endif
2293 return connect_attempts; 2272 return connect_attempts;
2294} 2273}
2295 2274
@@ -2338,10 +2317,8 @@ create_erdos_renyi (struct GNUNET_TESTING_PeerGroup *pg,
2338 ((double) 2317 ((double)
2339 GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, 2318 GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
2340 UINT64_MAX)) / ((double) UINT64_MAX); 2319 UINT64_MAX)) / ((double) UINT64_MAX);
2341#if VERBOSE_TESTING 2320 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "rand is %f probability is %f\n",
2342 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("rand is %f probability is %f\n"),
2343 temp_rand, probability); 2321 temp_rand, probability);
2344#endif
2345 if (temp_rand < probability) 2322 if (temp_rand < probability)
2346 { 2323 {
2347 connect_attempts += 2324 connect_attempts +=
@@ -2397,11 +2374,9 @@ create_2d_torus (struct GNUNET_TESTING_PeerGroup *pg,
2397 toggle++; 2374 toggle++;
2398 } 2375 }
2399 } 2376 }
2400#if VERBOSE_TESTING
2401 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2377 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2402 _("Connecting nodes in 2d torus topology: %u rows %u columns\n"), 2378 "Connecting nodes in 2d torus topology: %u rows %u columns\n",
2403 rows, cols); 2379 rows, cols);
2404#endif
2405 /* Rows and columns are all sorted out, now iterate over all nodes and connect each 2380 /* Rows and columns are all sorted out, now iterate over all nodes and connect each
2406 * to the node to its right and above. Once this is over, we'll have our torus! 2381 * to the node to its right and above. Once this is over, we'll have our torus!
2407 * Special case for the last node (if the rows and columns are not equal), connect 2382 * Special case for the last node (if the rows and columns are not equal), connect
@@ -2416,10 +2391,8 @@ create_2d_torus (struct GNUNET_TESTING_PeerGroup *pg,
2416 nodeToConnect = rows * cols - cols; 2391 nodeToConnect = rows * cols - cols;
2417 else 2392 else
2418 nodeToConnect = i - cols + 1; 2393 nodeToConnect = i - cols + 1;
2419#if VERBOSE_TESTING
2420 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting peer %d to peer %d\n", i, 2394 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting peer %d to peer %d\n", i,
2421 nodeToConnect); 2395 nodeToConnect);
2422#endif
2423 connect_attempts += proc (pg, i, nodeToConnect, list, GNUNET_YES); 2396 connect_attempts += proc (pg, i, nodeToConnect, list, GNUNET_YES);
2424 2397
2425 /* Second connect to the node immediately above */ 2398 /* Second connect to the node immediately above */
@@ -2434,10 +2407,8 @@ create_2d_torus (struct GNUNET_TESTING_PeerGroup *pg,
2434 2407
2435 if (nodeToConnect < pg->total) 2408 if (nodeToConnect < pg->total)
2436 { 2409 {
2437#if VERBOSE_TESTING
2438 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting peer %d to peer %d\n", i, 2410 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting peer %d to peer %d\n", i,
2439 nodeToConnect); 2411 nodeToConnect);
2440#endif
2441 connect_attempts += proc (pg, i, nodeToConnect, list, GNUNET_YES); 2412 connect_attempts += proc (pg, i, nodeToConnect, list, GNUNET_YES);
2442 } 2413 }
2443 2414
@@ -2479,10 +2450,8 @@ create_clique (struct GNUNET_TESTING_PeerGroup *pg,
2479 { 2450 {
2480 for (inner_count = outer_count + 1; inner_count < pg->total; inner_count++) 2451 for (inner_count = outer_count + 1; inner_count < pg->total; inner_count++)
2481 { 2452 {
2482#if VERBOSE_TESTING
2483 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting peer %d to peer %d\n", 2453 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting peer %d to peer %d\n",
2484 outer_count, inner_count); 2454 outer_count, inner_count);
2485#endif
2486 connect_attempts += proc (pg, outer_count, inner_count, list, check); 2455 connect_attempts += proc (pg, outer_count, inner_count, list, check);
2487 update_meter (conn_meter); 2456 update_meter (conn_meter);
2488 } 2457 }
@@ -2590,10 +2559,8 @@ create_line (struct GNUNET_TESTING_PeerGroup *pg,
2590 /* Connect each peer to the next highest numbered peer */ 2559 /* Connect each peer to the next highest numbered peer */
2591 for (count = 0; count < pg->total - 1; count++) 2560 for (count = 0; count < pg->total - 1; count++)
2592 { 2561 {
2593#if VERBOSE_TESTING
2594 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting peer %d to peer %d\n", 2562 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting peer %d to peer %d\n",
2595 count, count + 1); 2563 count, count + 1);
2596#endif
2597 connect_attempts += proc (pg, count, count + 1, list, GNUNET_YES); 2564 connect_attempts += proc (pg, count, count + 1, list, GNUNET_YES);
2598 } 2565 }
2599 2566
@@ -2675,10 +2642,8 @@ create_from_file (struct GNUNET_TESTING_PeerGroup *pg, char *filename,
2675 GNUNET_free (data); 2642 GNUNET_free (data);
2676 return connect_attempts; 2643 return connect_attempts;
2677 } 2644 }
2678#if DEBUG_TESTING
2679 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found %u total peers in topology\n", 2645 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found %u total peers in topology\n",
2680 total_peers); 2646 total_peers);
2681#endif
2682 GNUNET_assert (total_peers == pg->total); 2647 GNUNET_assert (total_peers == pg->total);
2683 curr_state = PEER_INDEX; 2648 curr_state = PEER_INDEX;
2684 while ((buf[count] != '\n') && (count < frstat.st_size - 1)) 2649 while ((buf[count] != '\n') && (count < frstat.st_size - 1))
@@ -2769,10 +2734,8 @@ create_ring (struct GNUNET_TESTING_PeerGroup *pg,
2769 /* Connect each peer to the next highest numbered peer */ 2734 /* Connect each peer to the next highest numbered peer */
2770 for (count = 0; count < pg->total - 1; count++) 2735 for (count = 0; count < pg->total - 1; count++)
2771 { 2736 {
2772#if VERBOSE_TESTING
2773 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting peer %d to peer %d\n", 2737 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting peer %d to peer %d\n",
2774 count, count + 1); 2738 count, count + 1);
2775#endif
2776 connect_attempts += proc (pg, count, count + 1, list, GNUNET_YES); 2739 connect_attempts += proc (pg, count, count + 1, list, GNUNET_YES);
2777 } 2740 }
2778 2741
@@ -2927,10 +2890,8 @@ create_and_copy_friend_files (struct GNUNET_TESTING_PeerGroup *pg)
2927 if (pg->peers[pg_iter].daemon->hostname == NULL) /* Local, just copy the file */ 2890 if (pg->peers[pg_iter].daemon->hostname == NULL) /* Local, just copy the file */
2928 { 2891 {
2929 GNUNET_asprintf (&arg, "%s/friends", temp_service_path); 2892 GNUNET_asprintf (&arg, "%s/friends", temp_service_path);
2930#if VERBOSE_TESTING
2931 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2893 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2932 "Copying file with RENAME(%s,%s)\n", mytemp, arg); 2894 "Copying file with RENAME(%s,%s)\n", mytemp, arg);
2933#endif
2934 RENAME (mytemp, arg); 2895 RENAME (mytemp, arg);
2935 procarr[pg_iter] = NULL; 2896 procarr[pg_iter] = NULL;
2936 GNUNET_free (arg); 2897 GNUNET_free (arg);
@@ -2961,10 +2922,8 @@ create_and_copy_friend_files (struct GNUNET_TESTING_PeerGroup *pg)
2961 return ret; 2922 return ret;
2962 } 2923 }
2963 procarr[pg_iter] = NULL; 2924 procarr[pg_iter] = NULL;
2964#if VERBOSE_TESTING
2965 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2925 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2966 "Copying file with command scp %s %s\n", mytemp, arg); 2926 "Copying file with command scp %s %s\n", mytemp, arg);
2967#endif
2968 GNUNET_free (arg); 2927 GNUNET_free (arg);
2969 } 2928 }
2970 GNUNET_free (temp_service_path); 2929 GNUNET_free (temp_service_path);
@@ -2979,10 +2938,8 @@ create_and_copy_friend_files (struct GNUNET_TESTING_PeerGroup *pg)
2979 ret = GNUNET_OK; 2938 ret = GNUNET_OK;
2980 for (pg_iter = 0; pg_iter < pg->total; pg_iter++) 2939 for (pg_iter = 0; pg_iter < pg->total; pg_iter++)
2981 { 2940 {
2982#if VERBOSE_TESTING
2983 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Checking copy status of file %d\n", 2941 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Checking copy status of file %d\n",
2984 pg_iter); 2942 pg_iter);
2985#endif
2986 if (procarr[pg_iter] != NULL) /* Check for already completed! */ 2943 if (procarr[pg_iter] != NULL) /* Check for already completed! */
2987 { 2944 {
2988 if (GNUNET_OS_process_status (procarr[pg_iter], &type, &return_code) != 2945 if (GNUNET_OS_process_status (procarr[pg_iter], &type, &return_code) !=
@@ -2998,9 +2955,7 @@ create_and_copy_friend_files (struct GNUNET_TESTING_PeerGroup *pg)
2998 { 2955 {
2999 GNUNET_OS_process_close (procarr[pg_iter]); 2956 GNUNET_OS_process_close (procarr[pg_iter]);
3000 procarr[pg_iter] = NULL; 2957 procarr[pg_iter] = NULL;
3001#if VERBOSE_TESTING
3002 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "File %d copied\n", pg_iter); 2958 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "File %d copied\n", pg_iter);
3003#endif
3004 } 2959 }
3005 } 2960 }
3006 } 2961 }
@@ -3012,10 +2967,8 @@ create_and_copy_friend_files (struct GNUNET_TESTING_PeerGroup *pg)
3012 } 2967 }
3013 } 2968 }
3014 2969
3015#if VERBOSE_TESTING
3016 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2970 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3017 _("Finished copying all friend files!\n")); 2971 "Finished copying all friend files!\n");
3018#endif
3019#endif 2972#endif
3020 GNUNET_free (procarr); 2973 GNUNET_free (procarr);
3021 return ret; 2974 return ret;
@@ -3125,11 +3078,8 @@ create_and_copy_blacklist_files (struct GNUNET_TESTING_PeerGroup *pg,
3125 GNUNET_asprintf (&arg, "%s/blacklist", temp_service_path); 3078 GNUNET_asprintf (&arg, "%s/blacklist", temp_service_path);
3126 RENAME (mytemp, arg); 3079 RENAME (mytemp, arg);
3127 procarr[pg_iter] = NULL; 3080 procarr[pg_iter] = NULL;
3128#if VERBOSE_TESTING
3129 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3081 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3130 _("Copying file with RENAME (%s,%s)\n"), mytemp, arg); 3082 "Copying file with RENAME (%s,%s)\n", mytemp, arg);
3131#endif
3132
3133 GNUNET_free (arg); 3083 GNUNET_free (arg);
3134 } 3084 }
3135 else /* Remote, scp the file to the correct place */ 3085 else /* Remote, scp the file to the correct place */
@@ -3148,10 +3098,8 @@ create_and_copy_blacklist_files (struct GNUNET_TESTING_PeerGroup *pg,
3148 GNUNET_assert (procarr[pg_iter] != NULL); 3098 GNUNET_assert (procarr[pg_iter] != NULL);
3149 GNUNET_OS_process_wait (procarr[pg_iter]); /* FIXME: add scheduled blacklist file copy that parallelizes file copying! */ 3099 GNUNET_OS_process_wait (procarr[pg_iter]); /* FIXME: add scheduled blacklist file copy that parallelizes file copying! */
3150 3100
3151#if VERBOSE_TESTING
3152 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3101 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3153 _("Copying file with command scp %s %s\n"), mytemp, arg); 3102 "Copying file with command scp %s %s\n", mytemp, arg);
3154#endif
3155 GNUNET_free (arg); 3103 GNUNET_free (arg);
3156 } 3104 }
3157 GNUNET_free (temp_service_path); 3105 GNUNET_free (temp_service_path);
@@ -3165,10 +3113,8 @@ create_and_copy_blacklist_files (struct GNUNET_TESTING_PeerGroup *pg,
3165 ret = GNUNET_OK; 3113 ret = GNUNET_OK;
3166 for (pg_iter = 0; pg_iter < pg->total; pg_iter++) 3114 for (pg_iter = 0; pg_iter < pg->total; pg_iter++)
3167 { 3115 {
3168#if VERBOSE_TESTING
3169 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3116 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3170 _("Checking copy status of file %d\n"), pg_iter); 3117 "Checking copy status of file %d\n", pg_iter);
3171#endif
3172 if (procarr[pg_iter] != NULL) /* Check for already completed! */ 3118 if (procarr[pg_iter] != NULL) /* Check for already completed! */
3173 { 3119 {
3174 if (GNUNET_OS_process_status (procarr[pg_iter], &type, &return_code) != 3120 if (GNUNET_OS_process_status (procarr[pg_iter], &type, &return_code) !=
@@ -3184,9 +3130,7 @@ create_and_copy_blacklist_files (struct GNUNET_TESTING_PeerGroup *pg,
3184 { 3130 {
3185 GNUNET_OS_process_close (procarr[pg_iter]); 3131 GNUNET_OS_process_close (procarr[pg_iter]);
3186 procarr[pg_iter] = NULL; 3132 procarr[pg_iter] = NULL;
3187#if VERBOSE_TESTING 3133 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "File %d copied\n", pg_iter);
3188 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("File %d copied\n"), pg_iter);
3189#endif
3190 } 3134 }
3191 } 3135 }
3192 } 3136 }
@@ -3198,10 +3142,8 @@ create_and_copy_blacklist_files (struct GNUNET_TESTING_PeerGroup *pg,
3198 } 3142 }
3199 } 3143 }
3200 3144
3201#if VERBOSE_TESTING
3202 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3145 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3203 _("Finished copying all blacklist files!\n")); 3146 "Finished copying all blacklist files!\n");
3204#endif
3205 GNUNET_free (procarr); 3147 GNUNET_free (procarr);
3206 return ret; 3148 return ret;
3207} 3149}
@@ -3398,11 +3340,8 @@ core_connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
3398#if BAD 3340#if BAD
3399 struct PeerData *other_peer; 3341 struct PeerData *other_peer;
3400#endif 3342#endif
3401#if DEBUG_TESTING
3402 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected peer %s to peer %s\n", 3343 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected peer %s to peer %s\n",
3403 ctx->d1->shortname, GNUNET_i2s (peer)); 3344 ctx->d1->shortname, GNUNET_i2s (peer));
3404#endif
3405
3406 if (0 == 3345 if (0 ==
3407 memcmp (&send_hello_context->peer->daemon->id, peer, 3346 memcmp (&send_hello_context->peer->daemon->id, peer,
3408 sizeof (struct GNUNET_PeerIdentity))) 3347 sizeof (struct GNUNET_PeerIdentity)))
@@ -3520,16 +3459,12 @@ hello_sent_callback (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
3520 } 3459 }
3521 3460
3522 send_hello_context->pg->remaining_hellos--; 3461 send_hello_context->pg->remaining_hellos--;
3523#if DEBUG_TESTING
3524 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sent HELLO, have %d remaining!\n", 3462 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sent HELLO, have %d remaining!\n",
3525 send_hello_context->pg->remaining_hellos); 3463 send_hello_context->pg->remaining_hellos);
3526#endif
3527 if (send_hello_context->peer_pos == NULL) /* All HELLOs (for this peer!) have been transmitted! */ 3464 if (send_hello_context->peer_pos == NULL) /* All HELLOs (for this peer!) have been transmitted! */
3528 { 3465 {
3529#if DEBUG_TESTING
3530 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3466 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3531 "All hellos for this peer sent, disconnecting transport!\n"); 3467 "All hellos for this peer sent, disconnecting transport!\n");
3532#endif
3533 GNUNET_assert (send_hello_context->peer->daemon->th != NULL); 3468 GNUNET_assert (send_hello_context->peer->daemon->th != NULL);
3534 GNUNET_TRANSPORT_disconnect (send_hello_context->peer->daemon->th); 3469 GNUNET_TRANSPORT_disconnect (send_hello_context->peer->daemon->th);
3535 send_hello_context->peer->daemon->th = NULL; 3470 send_hello_context->peer->daemon->th = NULL;
@@ -3577,22 +3512,17 @@ schedule_send_hellos (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
3577 (pg->outstanding_connects > pg->max_outstanding_connections)) || 3512 (pg->outstanding_connects > pg->max_outstanding_connections)) ||
3578 (pg->stop_connects == GNUNET_YES)) 3513 (pg->stop_connects == GNUNET_YES))
3579 { 3514 {
3580#if VERBOSE_TESTING > 2
3581 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3515 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3582 _ 3516 "Delaying connect, we have too many outstanding connections!\n");
3583 ("Delaying connect, we have too many outstanding connections!\n"));
3584#endif
3585 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply 3517 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
3586 (GNUNET_TIME_UNIT_MILLISECONDS, 100), 3518 (GNUNET_TIME_UNIT_MILLISECONDS, 100),
3587 &schedule_send_hellos, send_hello_context); 3519 &schedule_send_hellos, send_hello_context);
3588 } 3520 }
3589 else 3521 else
3590 { 3522 {
3591#if VERBOSE_TESTING > 2
3592 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3523 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3593 _("Creating connection, outstanding_connections is %d\n"), 3524 "Creating connection, outstanding_connections is %d\n",
3594 outstanding_connects); 3525 outstanding_connects);
3595#endif
3596 if (send_hello_context->peer->daemon->th == NULL) 3526 if (send_hello_context->peer->daemon->th == NULL)
3597 { 3527 {
3598 pg->outstanding_connects++; /* Actual TRANSPORT, CORE connections! */ 3528 pg->outstanding_connects++; /* Actual TRANSPORT, CORE connections! */
@@ -3600,13 +3530,11 @@ schedule_send_hellos (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
3600 GNUNET_TRANSPORT_connect (send_hello_context->peer->cfg, NULL, 3530 GNUNET_TRANSPORT_connect (send_hello_context->peer->cfg, NULL,
3601 send_hello_context, NULL, NULL, NULL); 3531 send_hello_context, NULL, NULL, NULL);
3602 } 3532 }
3603#if DEBUG_TESTING
3604 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3533 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3605 _("Offering HELLO of peer %s to peer %s\n"), 3534 "Offering HELLO of peer %s to peer %s\n",
3606 send_hello_context->peer->daemon->shortname, 3535 send_hello_context->peer->daemon->shortname,
3607 pg->peers[send_hello_context->peer_pos->index]. 3536 pg->peers[send_hello_context->peer_pos->index].
3608 daemon->shortname); 3537 daemon->shortname);
3609#endif
3610 GNUNET_TRANSPORT_offer_hello (send_hello_context->peer->daemon->th, 3538 GNUNET_TRANSPORT_offer_hello (send_hello_context->peer->daemon->th,
3611 (const struct GNUNET_MessageHeader *) 3539 (const struct GNUNET_MessageHeader *)
3612 pg->peers[send_hello_context->peer_pos-> 3540 pg->peers[send_hello_context->peer_pos->
@@ -3714,23 +3642,17 @@ schedule_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
3714 if ((pg->outstanding_connects > pg->max_outstanding_connections) || 3642 if ((pg->outstanding_connects > pg->max_outstanding_connections) ||
3715 (pg->stop_connects == GNUNET_YES)) 3643 (pg->stop_connects == GNUNET_YES))
3716 { 3644 {
3717#if VERBOSE_TESTING
3718 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3645 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3719 _ 3646 "Delaying connect, we have too many outstanding connections!\n");
3720 ("Delaying connect, we have too many outstanding connections!\n"));
3721#endif
3722 connect_context->task = 3647 connect_context->task =
3723 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply 3648 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
3724 (GNUNET_TIME_UNIT_MILLISECONDS, 100), 3649 (GNUNET_TIME_UNIT_MILLISECONDS, 100),
3725 &schedule_connect, connect_context); 3650 &schedule_connect, connect_context);
3726 return; 3651 return;
3727 } 3652 }
3728#if VERBOSE_TESTING
3729 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3653 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3730 _ 3654 "Creating connection, outstanding_connections is %d (max %d)\n",
3731 ("Creating connection, outstanding_connections is %d (max %d)\n"),
3732 pg->outstanding_connects, pg->max_outstanding_connections); 3655 pg->outstanding_connects, pg->max_outstanding_connections);
3733#endif
3734 pg->outstanding_connects++; 3656 pg->outstanding_connects++;
3735 pg->total_connects_scheduled++; 3657 pg->total_connects_scheduled++;
3736 GNUNET_assert (NULL == connect_context->cc); 3658 GNUNET_assert (NULL == connect_context->cc);
@@ -3982,46 +3904,46 @@ GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg,
3982 switch (topology) 3904 switch (topology)
3983 { 3905 {
3984 case GNUNET_TESTING_TOPOLOGY_CLIQUE: 3906 case GNUNET_TESTING_TOPOLOGY_CLIQUE:
3985 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Creating clique topology\n")); 3907 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating clique topology\n");
3986 num_connections = create_clique (pg, &add_connections, ALLOWED, GNUNET_NO); 3908 num_connections = create_clique (pg, &add_connections, ALLOWED, GNUNET_NO);
3987 break; 3909 break;
3988 case GNUNET_TESTING_TOPOLOGY_SMALL_WORLD_RING: 3910 case GNUNET_TESTING_TOPOLOGY_SMALL_WORLD_RING:
3989 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3911 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3990 _("Creating small world (ring) topology\n")); 3912 "Creating small world (ring) topology\n");
3991 num_connections = create_small_world_ring (pg, &add_connections, ALLOWED); 3913 num_connections = create_small_world_ring (pg, &add_connections, ALLOWED);
3992 break; 3914 break;
3993 case GNUNET_TESTING_TOPOLOGY_SMALL_WORLD: 3915 case GNUNET_TESTING_TOPOLOGY_SMALL_WORLD:
3994 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3916 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3995 _("Creating small world (2d-torus) topology\n")); 3917 "Creating small world (2d-torus) topology\n");
3996 num_connections = create_small_world (pg, &add_connections, ALLOWED); 3918 num_connections = create_small_world (pg, &add_connections, ALLOWED);
3997 break; 3919 break;
3998 case GNUNET_TESTING_TOPOLOGY_RING: 3920 case GNUNET_TESTING_TOPOLOGY_RING:
3999 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Creating ring topology\n")); 3921 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating ring topology\n");
4000 num_connections = create_ring (pg, &add_connections, ALLOWED); 3922 num_connections = create_ring (pg, &add_connections, ALLOWED);
4001 break; 3923 break;
4002 case GNUNET_TESTING_TOPOLOGY_2D_TORUS: 3924 case GNUNET_TESTING_TOPOLOGY_2D_TORUS:
4003 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Creating 2d torus topology\n")); 3925 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating 2d torus topology\n");
4004 num_connections = create_2d_torus (pg, &add_connections, ALLOWED); 3926 num_connections = create_2d_torus (pg, &add_connections, ALLOWED);
4005 break; 3927 break;
4006 case GNUNET_TESTING_TOPOLOGY_ERDOS_RENYI: 3928 case GNUNET_TESTING_TOPOLOGY_ERDOS_RENYI:
4007 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Creating Erdos-Renyi topology\n")); 3929 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating Erdos-Renyi topology\n");
4008 num_connections = create_erdos_renyi (pg, &add_connections, ALLOWED); 3930 num_connections = create_erdos_renyi (pg, &add_connections, ALLOWED);
4009 break; 3931 break;
4010 case GNUNET_TESTING_TOPOLOGY_INTERNAT: 3932 case GNUNET_TESTING_TOPOLOGY_INTERNAT:
4011 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Creating InterNAT topology\n")); 3933 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating InterNAT topology\n");
4012 num_connections = create_nated_internet (pg, &add_connections, ALLOWED); 3934 num_connections = create_nated_internet (pg, &add_connections, ALLOWED);
4013 break; 3935 break;
4014 case GNUNET_TESTING_TOPOLOGY_SCALE_FREE: 3936 case GNUNET_TESTING_TOPOLOGY_SCALE_FREE:
4015 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Creating Scale Free topology\n")); 3937 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating Scale Free topology\n");
4016 num_connections = create_scale_free (pg, &add_connections, ALLOWED); 3938 num_connections = create_scale_free (pg, &add_connections, ALLOWED);
4017 break; 3939 break;
4018 case GNUNET_TESTING_TOPOLOGY_LINE: 3940 case GNUNET_TESTING_TOPOLOGY_LINE:
4019 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3941 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4020 _("Creating straight line topology\n")); 3942 "Creating straight line topology\n");
4021 num_connections = create_line (pg, &add_connections, ALLOWED); 3943 num_connections = create_line (pg, &add_connections, ALLOWED);
4022 break; 3944 break;
4023 case GNUNET_TESTING_TOPOLOGY_FROM_FILE: 3945 case GNUNET_TESTING_TOPOLOGY_FROM_FILE:
4024 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Creating topology from file!\n")); 3946 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating topology from file!\n");
4025 if (GNUNET_OK == 3947 if (GNUNET_OK ==
4026 GNUNET_CONFIGURATION_get_value_string (pg->cfg, "testing", 3948 GNUNET_CONFIGURATION_get_value_string (pg->cfg, "testing",
4027 "topology_file", &filename)) 3949 "topology_file", &filename))
@@ -4052,13 +3974,13 @@ GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg,
4052 if (ret != GNUNET_OK) 3974 if (ret != GNUNET_OK)
4053 { 3975 {
4054 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3976 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4055 _("Failed during friend file copying!\n")); 3977 "Failed during friend file copying!\n");
4056 return GNUNET_SYSERR; 3978 return GNUNET_SYSERR;
4057 } 3979 }
4058 else 3980 else
4059 { 3981 {
4060 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3982 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4061 _("Friend files created/copied successfully!\n")); 3983 "Friend files created/copied successfully!\n");
4062 } 3984 }
4063 } 3985 }
4064 3986
@@ -4075,43 +3997,43 @@ GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg,
4075 { 3997 {
4076 case GNUNET_TESTING_TOPOLOGY_CLIQUE: 3998 case GNUNET_TESTING_TOPOLOGY_CLIQUE:
4077 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3999 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4078 _("Blacklisting all but clique topology\n")); 4000 "Blacklisting all but clique topology\n");
4079 unblacklisted_connections = 4001 unblacklisted_connections =
4080 create_clique (pg, &remove_connections, BLACKLIST, GNUNET_NO); 4002 create_clique (pg, &remove_connections, BLACKLIST, GNUNET_NO);
4081 break; 4003 break;
4082 case GNUNET_TESTING_TOPOLOGY_SMALL_WORLD_RING: 4004 case GNUNET_TESTING_TOPOLOGY_SMALL_WORLD_RING:
4083 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 4005 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4084 _("Blacklisting all but small world (ring) topology\n")); 4006 "Blacklisting all but small world (ring) topology\n");
4085 unblacklisted_connections = 4007 unblacklisted_connections =
4086 create_small_world_ring (pg, &remove_connections, BLACKLIST); 4008 create_small_world_ring (pg, &remove_connections, BLACKLIST);
4087 break; 4009 break;
4088 case GNUNET_TESTING_TOPOLOGY_SMALL_WORLD: 4010 case GNUNET_TESTING_TOPOLOGY_SMALL_WORLD:
4089 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 4011 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4090 _("Blacklisting all but small world (2d-torus) topology\n")); 4012 "Blacklisting all but small world (2d-torus) topology\n");
4091 unblacklisted_connections = 4013 unblacklisted_connections =
4092 create_small_world (pg, &remove_connections, BLACKLIST); 4014 create_small_world (pg, &remove_connections, BLACKLIST);
4093 break; 4015 break;
4094 case GNUNET_TESTING_TOPOLOGY_RING: 4016 case GNUNET_TESTING_TOPOLOGY_RING:
4095 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 4017 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4096 _("Blacklisting all but ring topology\n")); 4018 "Blacklisting all but ring topology\n");
4097 unblacklisted_connections = 4019 unblacklisted_connections =
4098 create_ring (pg, &remove_connections, BLACKLIST); 4020 create_ring (pg, &remove_connections, BLACKLIST);
4099 break; 4021 break;
4100 case GNUNET_TESTING_TOPOLOGY_2D_TORUS: 4022 case GNUNET_TESTING_TOPOLOGY_2D_TORUS:
4101 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 4023 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4102 _("Blacklisting all but 2d torus topology\n")); 4024 "Blacklisting all but 2d torus topology\n");
4103 unblacklisted_connections = 4025 unblacklisted_connections =
4104 create_2d_torus (pg, &remove_connections, BLACKLIST); 4026 create_2d_torus (pg, &remove_connections, BLACKLIST);
4105 break; 4027 break;
4106 case GNUNET_TESTING_TOPOLOGY_ERDOS_RENYI: 4028 case GNUNET_TESTING_TOPOLOGY_ERDOS_RENYI:
4107 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 4029 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4108 _("Blacklisting all but Erdos-Renyi topology\n")); 4030 "Blacklisting all but Erdos-Renyi topology\n");
4109 unblacklisted_connections = 4031 unblacklisted_connections =
4110 create_erdos_renyi (pg, &remove_connections, BLACKLIST); 4032 create_erdos_renyi (pg, &remove_connections, BLACKLIST);
4111 break; 4033 break;
4112 case GNUNET_TESTING_TOPOLOGY_INTERNAT: 4034 case GNUNET_TESTING_TOPOLOGY_INTERNAT:
4113 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 4035 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4114 _("Blacklisting all but InterNAT topology\n")); 4036 "Blacklisting all but InterNAT topology\n");
4115 4037
4116#if TOPOLOGY_HACK 4038#if TOPOLOGY_HACK
4117 for (off = 0; off < pg->total; off++) 4039 for (off = 0; off < pg->total; off++)
@@ -4146,13 +4068,13 @@ GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg,
4146 break; 4068 break;
4147 case GNUNET_TESTING_TOPOLOGY_SCALE_FREE: 4069 case GNUNET_TESTING_TOPOLOGY_SCALE_FREE:
4148 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 4070 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4149 _("Blacklisting all but Scale Free topology\n")); 4071 "Blacklisting all but Scale Free topology\n");
4150 unblacklisted_connections = 4072 unblacklisted_connections =
4151 create_scale_free (pg, &remove_connections, BLACKLIST); 4073 create_scale_free (pg, &remove_connections, BLACKLIST);
4152 break; 4074 break;
4153 case GNUNET_TESTING_TOPOLOGY_LINE: 4075 case GNUNET_TESTING_TOPOLOGY_LINE:
4154 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 4076 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4155 _("Blacklisting all but straight line topology\n")); 4077 "Blacklisting all but straight line topology\n");
4156 unblacklisted_connections = 4078 unblacklisted_connections =
4157 create_line (pg, &remove_connections, BLACKLIST); 4079 create_line (pg, &remove_connections, BLACKLIST);
4158 default: 4080 default:
@@ -4167,13 +4089,13 @@ GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg,
4167 if (ret != GNUNET_OK) 4089 if (ret != GNUNET_OK)
4168 { 4090 {
4169 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 4091 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4170 _("Failed during blacklist file copying!\n")); 4092 "Failed during blacklist file copying!\n");
4171 return 0; 4093 return 0;
4172 } 4094 }
4173 else 4095 else
4174 { 4096 {
4175 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 4097 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4176 _("Blacklist files created/copied successfully!\n")); 4098 "Blacklist files created/copied successfully!\n");
4177 } 4099 }
4178 } 4100 }
4179 return num_connections; 4101 return num_connections;
@@ -4875,22 +4797,14 @@ schedule_get_topology (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
4875 if (topology_context->connected > 4797 if (topology_context->connected >
4876 topology_context->pg->max_outstanding_connections) 4798 topology_context->pg->max_outstanding_connections)
4877 { 4799 {
4878#if VERBOSE_TESTING > 2
4879 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 4800 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4880 _ 4801 "Delaying connect, we have too many outstanding connections!\n");
4881 ("Delaying connect, we have too many outstanding connections!\n"));
4882#endif
4883 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply 4802 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
4884 (GNUNET_TIME_UNIT_MILLISECONDS, 100), 4803 (GNUNET_TIME_UNIT_MILLISECONDS, 100),
4885 &schedule_get_topology, core_context); 4804 &schedule_get_topology, core_context);
4886 } 4805 }
4887 else 4806 else
4888 { 4807 {
4889#if VERBOSE_TESTING > 2
4890 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
4891 _("Creating connection, outstanding_connections is %d\n"),
4892 outstanding_connects);
4893#endif
4894 topology_context->connected++; 4808 topology_context->connected++;
4895 4809
4896 if (GNUNET_OK != 4810 if (GNUNET_OK !=
@@ -5016,23 +4930,14 @@ schedule_get_statistics (void *cls,
5016 4930
5017 if (stats_context->connected > stats_context->pg->max_outstanding_connections) 4931 if (stats_context->connected > stats_context->pg->max_outstanding_connections)
5018 { 4932 {
5019#if VERBOSE_TESTING > 2
5020 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 4933 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5021 _ 4934 "Delaying connect, we have too many outstanding connections!\n");
5022 ("Delaying connect, we have too many outstanding connections!\n"));
5023#endif
5024 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply 4935 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
5025 (GNUNET_TIME_UNIT_MILLISECONDS, 100), 4936 (GNUNET_TIME_UNIT_MILLISECONDS, 100),
5026 &schedule_get_statistics, core_context); 4937 &schedule_get_statistics, core_context);
5027 } 4938 }
5028 else 4939 else
5029 { 4940 {
5030#if VERBOSE_TESTING > 2
5031 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5032 _("Creating connection, outstanding_connections is %d\n"),
5033 outstanding_connects);
5034#endif
5035
5036 stats_context->connected++; 4941 stats_context->connected++;
5037 core_context->stats_handle = 4942 core_context->stats_handle =
5038 GNUNET_STATISTICS_create ("testing", core_context->daemon->cfg); 4943 GNUNET_STATISTICS_create ("testing", core_context->daemon->cfg);
@@ -5255,71 +5160,51 @@ GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg,
5255 switch (topology) 5160 switch (topology)
5256 { 5161 {
5257 case GNUNET_TESTING_TOPOLOGY_CLIQUE: 5162 case GNUNET_TESTING_TOPOLOGY_CLIQUE:
5258#if VERBOSE_TOPOLOGY
5259 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5163 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5260 _("Creating clique CONNECT topology\n")); 5164 "Creating clique CONNECT topology\n");
5261#endif
5262 create_clique (pg, &add_connections, CONNECT, GNUNET_NO); 5165 create_clique (pg, &add_connections, CONNECT, GNUNET_NO);
5263 break; 5166 break;
5264 case GNUNET_TESTING_TOPOLOGY_SMALL_WORLD_RING: 5167 case GNUNET_TESTING_TOPOLOGY_SMALL_WORLD_RING:
5265#if VERBOSE_TOPOLOGY
5266 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5168 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5267 _("Creating small world (ring) CONNECT topology\n")); 5169 "Creating small world (ring) CONNECT topology\n");
5268#endif
5269 create_small_world_ring (pg, &add_connections, CONNECT); 5170 create_small_world_ring (pg, &add_connections, CONNECT);
5270 break; 5171 break;
5271 case GNUNET_TESTING_TOPOLOGY_SMALL_WORLD: 5172 case GNUNET_TESTING_TOPOLOGY_SMALL_WORLD:
5272#if VERBOSE_TOPOLOGY
5273 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5173 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5274 _("Creating small world (2d-torus) CONNECT topology\n")); 5174 "Creating small world (2d-torus) CONNECT topology\n");
5275#endif
5276 create_small_world (pg, &add_connections, CONNECT); 5175 create_small_world (pg, &add_connections, CONNECT);
5277 break; 5176 break;
5278 case GNUNET_TESTING_TOPOLOGY_RING: 5177 case GNUNET_TESTING_TOPOLOGY_RING:
5279#if VERBOSE_TOPOLOGY 5178 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating ring CONNECT topology\n");
5280 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Creating ring CONNECT topology\n"));
5281#endif
5282 create_ring (pg, &add_connections, CONNECT); 5179 create_ring (pg, &add_connections, CONNECT);
5283 break; 5180 break;
5284 case GNUNET_TESTING_TOPOLOGY_2D_TORUS: 5181 case GNUNET_TESTING_TOPOLOGY_2D_TORUS:
5285#if VERBOSE_TOPOLOGY
5286 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5182 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5287 _("Creating 2d torus CONNECT topology\n")); 5183 "Creating 2d torus CONNECT topology\n");
5288#endif
5289 create_2d_torus (pg, &add_connections, CONNECT); 5184 create_2d_torus (pg, &add_connections, CONNECT);
5290 break; 5185 break;
5291 case GNUNET_TESTING_TOPOLOGY_ERDOS_RENYI: 5186 case GNUNET_TESTING_TOPOLOGY_ERDOS_RENYI:
5292#if VERBOSE_TOPOLOGY
5293 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5187 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5294 _("Creating Erdos-Renyi CONNECT topology\n")); 5188 "Creating Erdos-Renyi CONNECT topology\n");
5295#endif
5296 create_erdos_renyi (pg, &add_connections, CONNECT); 5189 create_erdos_renyi (pg, &add_connections, CONNECT);
5297 break; 5190 break;
5298 case GNUNET_TESTING_TOPOLOGY_INTERNAT: 5191 case GNUNET_TESTING_TOPOLOGY_INTERNAT:
5299#if VERBOSE_TOPOLOGY
5300 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5192 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5301 _("Creating InterNAT CONNECT topology\n")); 5193 "Creating InterNAT CONNECT topology\n");
5302#endif
5303 create_nated_internet (pg, &add_connections, CONNECT); 5194 create_nated_internet (pg, &add_connections, CONNECT);
5304 break; 5195 break;
5305 case GNUNET_TESTING_TOPOLOGY_SCALE_FREE: 5196 case GNUNET_TESTING_TOPOLOGY_SCALE_FREE:
5306#if VERBOSE_TOPOLOGY
5307 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5197 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5308 _("Creating Scale Free CONNECT topology\n")); 5198 "Creating Scale Free CONNECT topology\n");
5309#endif
5310 create_scale_free (pg, &add_connections, CONNECT); 5199 create_scale_free (pg, &add_connections, CONNECT);
5311 break; 5200 break;
5312 case GNUNET_TESTING_TOPOLOGY_LINE: 5201 case GNUNET_TESTING_TOPOLOGY_LINE:
5313#if VERBOSE_TOPOLOGY
5314 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5202 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5315 _("Creating straight line CONNECT topology\n")); 5203 "Creating straight line CONNECT topology\n");
5316#endif
5317 create_line (pg, &add_connections, CONNECT); 5204 create_line (pg, &add_connections, CONNECT);
5318 break; 5205 break;
5319 case GNUNET_TESTING_TOPOLOGY_NONE: 5206 case GNUNET_TESTING_TOPOLOGY_NONE:
5320#if VERBOSE_TOPOLOGY 5207 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating no CONNECT topology\n");
5321 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Creating no CONNECT topology\n"));
5322#endif
5323 copy_allowed_topology (pg); 5208 copy_allowed_topology (pg);
5324 break; 5209 break;
5325 default: 5210 default:
@@ -5331,39 +5216,29 @@ GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg,
5331 switch (options) 5216 switch (options)
5332 { 5217 {
5333 case GNUNET_TESTING_TOPOLOGY_OPTION_RANDOM: 5218 case GNUNET_TESTING_TOPOLOGY_OPTION_RANDOM:
5334#if VERBOSE_TOPOLOGY
5335 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5219 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5336 _ 5220 "Connecting random subset (%'.2f percent) of possible peers\n",
5337 ("Connecting random subset (%'.2f percent) of possible peers\n"),
5338 100 * option_modifier); 5221 100 * option_modifier);
5339#endif
5340 choose_random_connections (pg, option_modifier); 5222 choose_random_connections (pg, option_modifier);
5341 break; 5223 break;
5342 case GNUNET_TESTING_TOPOLOGY_OPTION_MINIMUM: 5224 case GNUNET_TESTING_TOPOLOGY_OPTION_MINIMUM:
5343#if VERBOSE_TOPOLOGY
5344 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5225 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5345 _("Connecting a minimum of %u peers each (if possible)\n"), 5226 "Connecting a minimum of %u peers each (if possible)\n",
5346 (unsigned int) option_modifier); 5227 (unsigned int) option_modifier);
5347#endif
5348 choose_minimum (pg, (unsigned int) option_modifier); 5228 choose_minimum (pg, (unsigned int) option_modifier);
5349 break; 5229 break;
5350 case GNUNET_TESTING_TOPOLOGY_OPTION_DFS: 5230 case GNUNET_TESTING_TOPOLOGY_OPTION_DFS:
5351#if VERBOSE_TOPOLOGY
5352 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5231 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5353 _ 5232 "Using DFS to connect a minimum of %u peers each (if possible)\n",
5354 ("Using DFS to connect a minimum of %u peers each (if possible)\n"),
5355 (unsigned int) option_modifier); 5233 (unsigned int) option_modifier);
5356#endif
5357#if FIXME 5234#if FIXME
5358 perform_dfs (pg, (int) option_modifier); 5235 perform_dfs (pg, (int) option_modifier);
5359#endif 5236#endif
5360 break; 5237 break;
5361 case GNUNET_TESTING_TOPOLOGY_OPTION_ADD_CLOSEST: 5238 case GNUNET_TESTING_TOPOLOGY_OPTION_ADD_CLOSEST:
5362#if VERBOSE_TOPOLOGY 5239 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5363 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 5240 "Finding additional %u closest peers each (if possible)\n",
5364 _("Finding additional %u closest peers each (if possible)\n"),
5365 (unsigned int) option_modifier); 5241 (unsigned int) option_modifier);
5366#endif
5367#if FIXME 5242#if FIXME
5368 add_closest (pg, (unsigned int) option_modifier, &add_connections, CONNECT); 5243 add_closest (pg, (unsigned int) option_modifier, &add_connections, CONNECT);
5369#endif 5244#endif
@@ -5806,10 +5681,8 @@ start_peer_helper (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
5806 GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh", arg, 5681 GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh", arg,
5807 "peerStartHelper.pl", tempdir, NULL); 5682 "peerStartHelper.pl", tempdir, NULL);
5808 GNUNET_assert (helper->proc != NULL); 5683 GNUNET_assert (helper->proc != NULL);
5809#if DEBUG_TESTING
5810 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "starting peers with cmd ssh %s %s %s\n", 5684 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "starting peers with cmd ssh %s %s %s\n",
5811 arg, "peerStartHelper.pl", tempdir); 5685 arg, "peerStartHelper.pl", tempdir);
5812#endif
5813 GNUNET_SCHEDULER_add_now (&check_peers_started, helper); 5686 GNUNET_SCHEDULER_add_now (&check_peers_started, helper);
5814 GNUNET_free (tempdir); 5687 GNUNET_free (tempdir);
5815 GNUNET_free (baseservicehome); 5688 GNUNET_free (baseservicehome);
@@ -6029,9 +5902,7 @@ GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
6029 GNUNET_asprintf (&ssh_port_str, "%d", pg->hosts[i].sshport); 5902 GNUNET_asprintf (&ssh_port_str, "%d", pg->hosts[i].sshport);
6030 proc = 5903 proc =
6031 GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh", "-P", ssh_port_str, 5904 GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "ssh", "ssh", "-P", ssh_port_str,
6032#if !DEBUG_TESTING
6033 "-q", 5905 "-q",
6034#endif
6035 arg, "mkdir -p", tmpdir, NULL); 5906 arg, "mkdir -p", tmpdir, NULL);
6036 } 5907 }
6037 else 5908 else
@@ -6080,10 +5951,8 @@ GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
6080 5951
6081 if (GNUNET_OK != GNUNET_DISK_file_size (hostkeys_file, &fs, GNUNET_YES, GNUNET_YES)) 5952 if (GNUNET_OK != GNUNET_DISK_file_size (hostkeys_file, &fs, GNUNET_YES, GNUNET_YES))
6082 fs = 0; 5953 fs = 0;
6083#if DEBUG_TESTING
6084 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5954 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
6085 "Found file size %llu for hostkeys\n", fs); 5955 "Found file size %llu for hostkeys\n", fs);
6086#endif
6087 if (0 != (fs % HOSTKEYFILESIZE)) 5956 if (0 != (fs % HOSTKEYFILESIZE))
6088 { 5957 {
6089 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 5958 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -6226,10 +6095,8 @@ GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
6226 GNUNET_CONFIGURATION_get_value_string (cfg, "PATHS", "SERVICEHOME", 6095 GNUNET_CONFIGURATION_get_value_string (cfg, "PATHS", "SERVICEHOME",
6227 &baseservicehome)) 6096 &baseservicehome))
6228 { 6097 {
6229#if DEBUG_TESTING
6230 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "baseservice home is %s\n", 6098 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "baseservice home is %s\n",
6231 baseservicehome); 6099 baseservicehome);
6232#endif
6233 if (hostname != NULL) 6100 if (hostname != NULL)
6234 GNUNET_asprintf (&newservicehome, "%s/%s/", baseservicehome, 6101 GNUNET_asprintf (&newservicehome, "%s/%s/", baseservicehome,
6235 hostname); 6102 hostname);
@@ -6261,11 +6128,9 @@ GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
6261 proc = 6128 proc =
6262 GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "rsync", "rsync", "-r", 6129 GNUNET_OS_start_process (GNUNET_NO, NULL, NULL, "rsync", "rsync", "-r",
6263 newservicehome, arg, NULL); 6130 newservicehome, arg, NULL);
6264#if DEBUG_TESTING
6265 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 6131 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
6266 "copying directory with command rsync -r %s %s\n", 6132 "copying directory with command rsync -r %s %s\n",
6267 newservicehome, arg); 6133 newservicehome, arg);
6268#endif
6269 GNUNET_free (newservicehome); 6134 GNUNET_free (newservicehome);
6270 GNUNET_free (arg); 6135 GNUNET_free (arg);
6271 if (NULL == proc) 6136 if (NULL == proc)
@@ -6681,10 +6546,8 @@ GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg,
6681 6546
6682 for (i = 0; i < voff; i++) 6547 for (i = 0; i < voff; i++)
6683 { 6548 {
6684#if DEBUG_CHURN
6685 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peer %d!\n", 6549 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peer %d!\n",
6686 running_arr[running_permute[i]]); 6550 running_arr[running_permute[i]]);
6687#endif
6688 GNUNET_assert (running_arr != NULL); 6551 GNUNET_assert (running_arr != NULL);
6689 peer_shutdown_ctx = GNUNET_malloc (sizeof (struct PeerShutdownContext)); 6552 peer_shutdown_ctx = GNUNET_malloc (sizeof (struct PeerShutdownContext));
6690 peer_shutdown_ctx->daemon = 6553 peer_shutdown_ctx->daemon =
@@ -6703,10 +6566,8 @@ GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg,
6703 } 6566 }
6704 for (i = 0; i < von; i++) 6567 for (i = 0; i < von; i++)
6705 { 6568 {
6706#if DEBUG_CHURN
6707 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting up peer %d!\n", 6569 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting up peer %d!\n",
6708 stopped_arr[stopped_permute[i]]); 6570 stopped_arr[stopped_permute[i]]);
6709#endif
6710 GNUNET_assert (stopped_arr != NULL); 6571 GNUNET_assert (stopped_arr != NULL);
6711 peer_restart_ctx = GNUNET_malloc (sizeof (struct PeerRestartContext)); 6572 peer_restart_ctx = GNUNET_malloc (sizeof (struct PeerRestartContext));
6712 peer_restart_ctx->churn_restart_ctx = churn_startup_ctx; 6573 peer_restart_ctx->churn_restart_ctx = churn_startup_ctx;
@@ -6755,10 +6616,6 @@ GNUNET_TESTING_daemons_start_service (struct GNUNET_TESTING_PeerGroup *pg,
6755 6616
6756 for (i = 0; i < pg->total; i++) 6617 for (i = 0; i < pg->total; i++)
6757 { 6618 {
6758#if DEBUG_START
6759 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting up service %s on peer %d!\n",
6760 service, stopped_arr[stopped_permute[i]]);
6761#endif
6762 peer_start_ctx = GNUNET_malloc (sizeof (struct PeerServiceStartContext)); 6619 peer_start_ctx = GNUNET_malloc (sizeof (struct PeerServiceStartContext));
6763 peer_start_ctx->start_ctx = start_ctx; 6620 peer_start_ctx->start_ctx = start_ctx;
6764 peer_start_ctx->daemon = pg->peers[i].daemon; 6621 peer_start_ctx->daemon = pg->peers[i].daemon;
@@ -6880,10 +6737,8 @@ internal_shutdown_callback (void *cls, const char *emsg)
6880 } 6737 }
6881 else 6738 else
6882 { 6739 {
6883#if VERBOSE_TESTING
6884 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "internal_shutdown_callback", 6740 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "internal_shutdown_callback",
6885 "Failed to stop a peer: %s\n", emsg); 6741 "Failed to stop a peer: %s\n", emsg);
6886#endif
6887 shutdown_ctx->peers_failed++; 6742 shutdown_ctx->peers_failed++;
6888 } 6743 }
6889 6744