diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-06-16 14:29:53 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-06-16 14:29:53 +0000 |
commit | 81d3fe28ab2acc5b9aa32abd74faa18a02d02927 (patch) | |
tree | cc79e940a6c6e48151fdd7919923eedbda7f7243 /src/transport/test_plugin_transport_https.c | |
parent | e6711956202906f06041af26590ce9e5bfa63352 (diff) | |
download | gnunet-81d3fe28ab2acc5b9aa32abd74faa18a02d02927.tar.gz gnunet-81d3fe28ab2acc5b9aa32abd74faa18a02d02927.zip |
changes to tests
Diffstat (limited to 'src/transport/test_plugin_transport_https.c')
-rw-r--r-- | src/transport/test_plugin_transport_https.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/transport/test_plugin_transport_https.c b/src/transport/test_plugin_transport_https.c index 12371a162..809bc9cb8 100644 --- a/src/transport/test_plugin_transport_https.c +++ b/src/transport/test_plugin_transport_https.c | |||
@@ -389,6 +389,8 @@ static GNUNET_SCHEDULER_TaskIdentifier http_task_send; | |||
389 | static char * key_file; | 389 | static char * key_file; |
390 | static char * cert_file; | 390 | static char * cert_file; |
391 | 391 | ||
392 | static char * servicehome; | ||
393 | |||
392 | /** | 394 | /** |
393 | * Shutdown testcase | 395 | * Shutdown testcase |
394 | */ | 396 | */ |
@@ -486,6 +488,13 @@ shutdown_clean () | |||
486 | GNUNET_free (cert_file); | 488 | GNUNET_free (cert_file); |
487 | 489 | ||
488 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Exiting testcase\n"); | 490 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Exiting testcase\n"); |
491 | |||
492 | if (servicehome != NULL) | ||
493 | { | ||
494 | GNUNET_DISK_directory_remove (servicehome); | ||
495 | GNUNET_free (servicehome); | ||
496 | } | ||
497 | |||
489 | exit(fail); | 498 | exit(fail); |
490 | return; | 499 | return; |
491 | } | 500 | } |
@@ -1167,6 +1176,10 @@ run (void *cls, | |||
1167 | addr_head = NULL; | 1176 | addr_head = NULL; |
1168 | count_str_addr = 0; | 1177 | count_str_addr = 0; |
1169 | /* parse configuration */ | 1178 | /* parse configuration */ |
1179 | if (GNUNET_CONFIGURATION_have_value (c,"PATHS", "SERVICEHOME")) | ||
1180 | GNUNET_CONFIGURATION_get_value_string (c, "PATHS", "SERVICEHOME", &servicehome); | ||
1181 | |||
1182 | |||
1170 | if ((GNUNET_OK != | 1183 | if ((GNUNET_OK != |
1171 | GNUNET_CONFIGURATION_get_value_number (c, | 1184 | GNUNET_CONFIGURATION_get_value_number (c, |
1172 | "TRANSPORT", | 1185 | "TRANSPORT", |
@@ -1388,13 +1401,27 @@ main (int argc, char *const *argv) | |||
1388 | #endif | 1401 | #endif |
1389 | NULL); | 1402 | NULL); |
1390 | 1403 | ||
1404 | struct GNUNET_CONFIGURATION_Handle *cfg; | ||
1405 | cfg = GNUNET_CONFIGURATION_create (); | ||
1406 | |||
1407 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (cfg, "test_plugin_transport_data_http.conf")); | ||
1408 | if (GNUNET_CONFIGURATION_have_value (cfg,"PATHS", "SERVICEHOME")) | ||
1409 | GNUNET_CONFIGURATION_get_value_string (cfg, "PATHS", "SERVICEHOME", &servicehome); | ||
1410 | GNUNET_DISK_directory_remove (servicehome); | ||
1411 | GNUNET_CONFIGURATION_destroy (cfg); | ||
1412 | |||
1391 | ret = (GNUNET_OK == | 1413 | ret = (GNUNET_OK == |
1392 | GNUNET_PROGRAM_run (5, | 1414 | GNUNET_PROGRAM_run (5, |
1393 | argv_prog, | 1415 | argv_prog, |
1394 | "test_gnunet_transport_plugin.https", | 1416 | "test_gnunet_transport_plugin.https", |
1395 | "testcase", options, &run, NULL)) ? GNUNET_NO : GNUNET_YES; | 1417 | "testcase", options, &run, NULL)) ? GNUNET_NO : GNUNET_YES; |
1396 | 1418 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("\ndelete\n\n")); | |
1397 | GNUNET_DISK_directory_remove ("/tmp/test_gnunet_transport_plugin.https"); | 1419 | if (servicehome != NULL) |
1420 | { | ||
1421 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("\ndelete\n\n")); | ||
1422 | GNUNET_DISK_directory_remove (servicehome); | ||
1423 | GNUNET_free (servicehome); | ||
1424 | } | ||
1398 | if (GNUNET_OK != ret) | 1425 | if (GNUNET_OK != ret) |
1399 | return 1; | 1426 | return 1; |
1400 | return fail; | 1427 | return fail; |