aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_quota_compliance.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-06-16 14:29:53 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-06-16 14:29:53 +0000
commit81d3fe28ab2acc5b9aa32abd74faa18a02d02927 (patch)
treecc79e940a6c6e48151fdd7919923eedbda7f7243 /src/transport/test_quota_compliance.c
parente6711956202906f06041af26590ce9e5bfa63352 (diff)
downloadgnunet-81d3fe28ab2acc5b9aa32abd74faa18a02d02927.tar.gz
gnunet-81d3fe28ab2acc5b9aa32abd74faa18a02d02927.zip
changes to tests
Diffstat (limited to 'src/transport/test_quota_compliance.c')
-rw-r--r--src/transport/test_quota_compliance.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c
index 48a78f19d..ef4f999be 100644
--- a/src/transport/test_quota_compliance.c
+++ b/src/transport/test_quota_compliance.c
@@ -33,6 +33,7 @@
33#include "gnunet_server_lib.h" 33#include "gnunet_server_lib.h"
34#include "gnunet_transport_service.h" 34#include "gnunet_transport_service.h"
35#include "transport.h" 35#include "transport.h"
36#include "transport-testing.h"
36 37
37#define VERBOSE GNUNET_NO 38#define VERBOSE GNUNET_NO
38 39
@@ -59,16 +60,6 @@
59 60
60#define MTYPE 11111 61#define MTYPE 11111
61 62
62struct PeerContext
63{
64 struct GNUNET_CONFIGURATION_Handle *cfg;
65 struct GNUNET_TRANSPORT_Handle *th;
66 struct GNUNET_PeerIdentity id;
67#if START_ARM
68 struct GNUNET_OS_Process *arm_proc;
69#endif
70};
71
72/** 63/**
73 * Handle for a transmission-ready request. 64 * Handle for a transmission-ready request.
74 */ 65 */
@@ -655,6 +646,11 @@ static void
655setup_peer (struct PeerContext *p, const char *cfgname) 646setup_peer (struct PeerContext *p, const char *cfgname)
656{ 647{
657 p->cfg = GNUNET_CONFIGURATION_create (); 648 p->cfg = GNUNET_CONFIGURATION_create ();
649 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
650 if (GNUNET_CONFIGURATION_have_value (p->cfg,"PATHS", "SERVICEHOME"))
651 GNUNET_CONFIGURATION_get_value_string (p->cfg, "PATHS", "SERVICEHOME", &p->servicehome);
652 GNUNET_DISK_directory_remove (p->servicehome);
653
658#if START_ARM 654#if START_ARM
659 p->arm_proc = GNUNET_OS_start_process (NULL, NULL, 655 p->arm_proc = GNUNET_OS_start_process (NULL, NULL,
660 "gnunet-service-arm", 656 "gnunet-service-arm",
@@ -665,7 +661,6 @@ setup_peer (struct PeerContext *p, const char *cfgname)
665 "-c", cfgname, NULL); 661 "-c", cfgname, NULL);
666#endif 662#endif
667 663
668 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
669 p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL, 664 p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL,
670 p, 665 p,
671 &notify_receive_new, 666 &notify_receive_new,
@@ -897,9 +892,6 @@ main (int argc, char *argv[])
897 GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","noplugin","none"); 892 GNUNET_asprintf(&logger, "test-quota-compliance-%s-%s","noplugin","none");
898 } 893 }
899 894
900 GNUNET_DISK_directory_remove ("/tmp/test_quota_compliance_peer1");
901 GNUNET_DISK_directory_remove ("/tmp/test_quota_compliance_peer2");
902
903 fprintf(stderr, "Running `%s'\n", logger); 895 fprintf(stderr, "Running `%s'\n", logger);
904 GNUNET_log_setup ("test-quota-compliance", 896 GNUNET_log_setup ("test-quota-compliance",
905#if VERBOSE 897#if VERBOSE
@@ -926,9 +918,17 @@ main (int argc, char *argv[])
926 ret = ok; 918 ret = ok;
927 stop_arm (&p1); 919 stop_arm (&p1);
928 stop_arm (&p2); 920 stop_arm (&p2);
921
922 if ((p1.servicehome != NULL) && (p2.servicehome != NULL))
923 {
924 GNUNET_DISK_directory_remove (p1.servicehome);
925 GNUNET_DISK_directory_remove (p2.servicehome);
926 GNUNET_free(p1.servicehome);
927 GNUNET_free(p2.servicehome);
928 }
929
929 GNUNET_free(logger); 930 GNUNET_free(logger);
930 GNUNET_DISK_directory_remove ("/tmp/test_quota_compliance_peer1"); 931
931 GNUNET_DISK_directory_remove ("/tmp/test_quota_compliance_peer2");
932 return ret; 932 return ret;
933} 933}
934 934