aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dht/test_dht_2dtorus.c23
-rw-r--r--src/dht/test_dht_2dtorus.conf2
-rw-r--r--src/mesh/test_mesh_small.c23
-rw-r--r--src/mesh/test_mesh_small.conf2
-rw-r--r--src/mesh/test_mesh_small_unicast_far.c24
-rw-r--r--src/nse/gnunet-nse-profiler.c29
-rw-r--r--src/nse/nse_profiler_test.conf2
7 files changed, 43 insertions, 62 deletions
diff --git a/src/dht/test_dht_2dtorus.c b/src/dht/test_dht_2dtorus.c
index cc2520580..1cc0e7980 100644
--- a/src/dht/test_dht_2dtorus.c
+++ b/src/dht/test_dht_2dtorus.c
@@ -103,8 +103,6 @@ static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle;
103 103
104static char *topology_file; 104static char *topology_file;
105 105
106static char *data_filename;
107
108struct GNUNET_TESTING_Daemon *d1; 106struct GNUNET_TESTING_Daemon *d1;
109 107
110struct GNUNET_TESTING_Daemon *d2; 108struct GNUNET_TESTING_Daemon *d2;
@@ -472,6 +470,7 @@ run (void *cls, char *const *args, const char *cfgfile,
472{ 470{
473 char *temp_str; 471 char *temp_str;
474 struct GNUNET_TESTING_Host *hosts; 472 struct GNUNET_TESTING_Host *hosts;
473 char *data_filename;
475 474
476 ok = 1; 475 ok = 1;
477 testing_cfg = GNUNET_CONFIGURATION_dup (cfg); 476 testing_cfg = GNUNET_CONFIGURATION_dup (cfg);
@@ -509,27 +508,23 @@ run (void *cls, char *const *args, const char *cfgfile,
509 return; 508 return;
510 } 509 }
511 510
512 if (GNUNET_OK != 511 if (GNUNET_OK ==
513 GNUNET_CONFIGURATION_get_value_string (testing_cfg, "test_dht_2dtorus", 512 GNUNET_CONFIGURATION_get_value_string (testing_cfg, "test_dht_2dtorus",
514 "data_output_file", 513 "data_output_file",
515 &data_filename)) 514 &data_filename))
516 { 515 {
517 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 516 data_file =
518 "Option test_dht_2d:data_output_file is required!\n");
519 return;
520 }
521
522 data_file =
523 GNUNET_DISK_file_open (data_filename, 517 GNUNET_DISK_file_open (data_filename,
524 GNUNET_DISK_OPEN_READWRITE | 518 GNUNET_DISK_OPEN_READWRITE |
525 GNUNET_DISK_OPEN_CREATE, 519 GNUNET_DISK_OPEN_CREATE,
526 GNUNET_DISK_PERM_USER_READ | 520 GNUNET_DISK_PERM_USER_READ |
527 GNUNET_DISK_PERM_USER_WRITE); 521 GNUNET_DISK_PERM_USER_WRITE);
528 if (data_file == NULL) 522 if (data_file == NULL)
529 { 523 {
530 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n", 524 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
531 data_filename); 525 data_filename);
532 GNUNET_free (data_filename); 526 GNUNET_free (data_filename);
527 }
533 } 528 }
534 529
535 if (GNUNET_YES == 530 if (GNUNET_YES ==
diff --git a/src/dht/test_dht_2dtorus.conf b/src/dht/test_dht_2dtorus.conf
index e49810569..20ca30e3f 100644
--- a/src/dht/test_dht_2dtorus.conf
+++ b/src/dht/test_dht_2dtorus.conf
@@ -75,4 +75,4 @@ DELETE_FILES = YES
75 75
76[test_dht_2dtorus] 76[test_dht_2dtorus]
77CONNECTION_LIMIT = 16 77CONNECTION_LIMIT = 16
78DATA_OUTPUT_FILE=data_output 78#DATA_OUTPUT_FILE=data_output
diff --git a/src/mesh/test_mesh_small.c b/src/mesh/test_mesh_small.c
index f100a40e4..0888c1e00 100644
--- a/src/mesh/test_mesh_small.c
+++ b/src/mesh/test_mesh_small.c
@@ -140,8 +140,6 @@ static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle;
140 140
141static char *topology_file; 141static char *topology_file;
142 142
143static char *data_filename;
144
145static struct GNUNET_TESTING_Daemon *d1; 143static struct GNUNET_TESTING_Daemon *d1;
146 144
147static GNUNET_PEER_Id pid1; 145static GNUNET_PEER_Id pid1;
@@ -753,6 +751,7 @@ run (void *cls, char *const *args, const char *cfgfile,
753 char *temp_str; 751 char *temp_str;
754 unsigned long long temp_wait; 752 unsigned long long temp_wait;
755 struct GNUNET_TESTING_Host *hosts; 753 struct GNUNET_TESTING_Host *hosts;
754 char *data_filename;
756 755
757 ok = 0; 756 ok = 0;
758 testing_cfg = GNUNET_CONFIGURATION_dup (cfg); 757 testing_cfg = GNUNET_CONFIGURATION_dup (cfg);
@@ -801,27 +800,23 @@ run (void *cls, char *const *args, const char *cfgfile,
801 return; 800 return;
802 } 801 }
803 802
804 if (GNUNET_OK != 803 if (GNUNET_OK ==
805 GNUNET_CONFIGURATION_get_value_string (testing_cfg, "test_mesh_small", 804 GNUNET_CONFIGURATION_get_value_string (testing_cfg, "test_mesh_small",
806 "data_output_file", 805 "data_output_file",
807 &data_filename)) 806 &data_filename))
808 { 807 {
809 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 808 data_file =
810 "Option test_mesh_small:data_output_file is required!\n");
811 return;
812 }
813
814 data_file =
815 GNUNET_DISK_file_open (data_filename, 809 GNUNET_DISK_file_open (data_filename,
816 GNUNET_DISK_OPEN_READWRITE | 810 GNUNET_DISK_OPEN_READWRITE |
817 GNUNET_DISK_OPEN_CREATE, 811 GNUNET_DISK_OPEN_CREATE,
818 GNUNET_DISK_PERM_USER_READ | 812 GNUNET_DISK_PERM_USER_READ |
819 GNUNET_DISK_PERM_USER_WRITE); 813 GNUNET_DISK_PERM_USER_WRITE);
820 if (data_file == NULL) 814 if (data_file == NULL)
821 { 815 {
822 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n", 816 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
823 data_filename); 817 data_filename);
824 GNUNET_free (data_filename); 818 GNUNET_free (data_filename);
819 }
825 } 820 }
826 821
827 wait_time = 822 wait_time =
diff --git a/src/mesh/test_mesh_small.conf b/src/mesh/test_mesh_small.conf
index f98dca7dc..9e340aacb 100644
--- a/src/mesh/test_mesh_small.conf
+++ b/src/mesh/test_mesh_small.conf
@@ -87,4 +87,4 @@ DELETE_FILES = YES
87[test_mesh_small] 87[test_mesh_small]
88WAIT_TIME = 300 88WAIT_TIME = 300
89CONNECTION_LIMIT = 16 89CONNECTION_LIMIT = 16
90DATA_OUTPUT_FILE=data_output 90#DATA_OUTPUT_FILE=data_output
diff --git a/src/mesh/test_mesh_small_unicast_far.c b/src/mesh/test_mesh_small_unicast_far.c
index d5a768f98..f5bab6fb4 100644
--- a/src/mesh/test_mesh_small_unicast_far.c
+++ b/src/mesh/test_mesh_small_unicast_far.c
@@ -120,8 +120,6 @@ static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle;
120 120
121static char *topology_file; 121static char *topology_file;
122 122
123static char *data_filename;
124
125static struct GNUNET_TESTING_Daemon *d1; 123static struct GNUNET_TESTING_Daemon *d1;
126 124
127static struct GNUNET_TESTING_Daemon *d2; 125static struct GNUNET_TESTING_Daemon *d2;
@@ -460,6 +458,8 @@ run (void *cls, char *const *args, const char *cfgfile,
460 char *temp_str; 458 char *temp_str;
461 unsigned long long temp_wait; 459 unsigned long long temp_wait;
462 struct GNUNET_TESTING_Host *hosts; 460 struct GNUNET_TESTING_Host *hosts;
461 char *data_filename;
462
463 463
464 ok = 1; 464 ok = 1;
465 testing_cfg = GNUNET_CONFIGURATION_dup (cfg); 465 testing_cfg = GNUNET_CONFIGURATION_dup (cfg);
@@ -516,27 +516,23 @@ run (void *cls, char *const *args, const char *cfgfile,
516 return; 516 return;
517 } 517 }
518 518
519 if (GNUNET_OK != 519 if (GNUNET_OK ==
520 GNUNET_CONFIGURATION_get_value_string (testing_cfg, "test_mesh_small", 520 GNUNET_CONFIGURATION_get_value_string (testing_cfg, "test_mesh_small",
521 "data_output_file", 521 "data_output_file",
522 &data_filename)) 522 &data_filename))
523 { 523 {
524 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 524 data_file =
525 "Option test_mesh_small:data_output_file is required!\n");
526 return;
527 }
528
529 data_file =
530 GNUNET_DISK_file_open (data_filename, 525 GNUNET_DISK_file_open (data_filename,
531 GNUNET_DISK_OPEN_READWRITE | 526 GNUNET_DISK_OPEN_READWRITE |
532 GNUNET_DISK_OPEN_CREATE, 527 GNUNET_DISK_OPEN_CREATE,
533 GNUNET_DISK_PERM_USER_READ | 528 GNUNET_DISK_PERM_USER_READ |
534 GNUNET_DISK_PERM_USER_WRITE); 529 GNUNET_DISK_PERM_USER_WRITE);
535 if (data_file == NULL) 530 if (data_file == NULL)
536 { 531 {
537 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n", 532 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
538 data_filename); 533 data_filename);
539 GNUNET_free (data_filename); 534 GNUNET_free (data_filename);
535 }
540 } 536 }
541 537
542 wait_time = 538 wait_time =
diff --git a/src/nse/gnunet-nse-profiler.c b/src/nse/gnunet-nse-profiler.c
index a18a13fbd..ecd594e86 100644
--- a/src/nse/gnunet-nse-profiler.c
+++ b/src/nse/gnunet-nse-profiler.c
@@ -137,8 +137,6 @@ static GNUNET_SCHEDULER_TaskIdentifier churn_task;
137 137
138static char *topology_file; 138static char *topology_file;
139 139
140static char *data_filename;
141
142static uint64_t clock_skew; 140static uint64_t clock_skew;
143 141
144/** 142/**
@@ -540,6 +538,7 @@ run (void *cls, char *const *args, const char *cfgfile,
540 char *temp_str; 538 char *temp_str;
541 unsigned long long temp_wait; 539 unsigned long long temp_wait;
542 struct GNUNET_TESTING_Host *hosts; 540 struct GNUNET_TESTING_Host *hosts;
541 char *data_filename;
543 542
544 ok = 1; 543 ok = 1;
545 testing_cfg = GNUNET_CONFIGURATION_create (); 544 testing_cfg = GNUNET_CONFIGURATION_create ();
@@ -584,14 +583,21 @@ run (void *cls, char *const *args, const char *cfgfile,
584 return; 583 return;
585 } 584 }
586 585
587 if (GNUNET_OK != 586 if (GNUNET_OK ==
588 GNUNET_CONFIGURATION_get_value_string (testing_cfg, "nse-profiler", 587 GNUNET_CONFIGURATION_get_value_string (testing_cfg, "nse-profiler",
589 "data_output_file", 588 "data_output_file",
590 &data_filename)) 589 &data_filename))
591 { 590 {
592 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 591 data_file =
593 "Option nse-profiler:data_output_file is required!\n"); 592 GNUNET_DISK_file_open (data_filename,
594 return; 593 GNUNET_DISK_OPEN_READWRITE |
594 GNUNET_DISK_OPEN_CREATE,
595 GNUNET_DISK_PERM_USER_READ |
596 GNUNET_DISK_PERM_USER_WRITE);
597 if (data_file == NULL)
598 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
599 data_filename);
600 GNUNET_free (data_filename);
595 } 601 }
596 602
597 if (GNUNET_YES == 603 if (GNUNET_YES ==
@@ -605,17 +611,6 @@ run (void *cls, char *const *args, const char *cfgfile,
605 } 611 }
606 612
607 613
608 data_file =
609 GNUNET_DISK_file_open (data_filename,
610 GNUNET_DISK_OPEN_READWRITE |
611 GNUNET_DISK_OPEN_CREATE,
612 GNUNET_DISK_PERM_USER_READ |
613 GNUNET_DISK_PERM_USER_WRITE);
614 if (data_file == NULL)
615 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
616 data_filename);
617 GNUNET_free (data_filename);
618
619 wait_time = 614 wait_time =
620 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, temp_wait); 615 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, temp_wait);
621 616
diff --git a/src/nse/nse_profiler_test.conf b/src/nse/nse_profiler_test.conf
index ad113b24f..411bad9f0 100644
--- a/src/nse/nse_profiler_test.conf
+++ b/src/nse/nse_profiler_test.conf
@@ -98,7 +98,7 @@ DELETE_FILES = NO
98[nse-profiler] 98[nse-profiler]
99#OUTPUT_FILE = nse_output_100_peers.dat 99#OUTPUT_FILE = nse_output_100_peers.dat
100TOPOLOGY_OUTPUT_FILE = nse_topo_100_peers 100TOPOLOGY_OUTPUT_FILE = nse_topo_100_peers
101DATA_OUTPUT_FILE = nse_topo_100_peers_stats 101#DATA_OUTPUT_FILE = nse_topo_100_peers_stats
102#ROUND0 = 90 102#ROUND0 = 90
103#ROUND1 = 100 103#ROUND1 = 100
104#ROUND2 = 50 104#ROUND2 = 50