From: Julius Bünger Date: Fri, 1 Jul 2016 23:38:39 +0000 (+0000) Subject: -rps test _peers: disable storage of valid peers X-Git-Tag: initial-import-from-subversion-38251~633 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=14659eaa11e9af2f096425559a038e842089ca16;p=oweals%2Fgnunet.git -rps test _peers: disable storage of valid peers --- diff --git a/src/rps/test_rps.conf b/src/rps/test_rps.conf index a629451e4..fdca2a8ed 100644 --- a/src/rps/test_rps.conf +++ b/src/rps/test_rps.conf @@ -1,3 +1,6 @@ +[PATHS] +GNUNET_TEST_HOME = /tmp/rps-test/ + [rps] #PREFIX = valgrind --leak-check=full --show-leak-kinds=all --log-file=/tmp/rps/valgrind!gnunet-service-rps!%p #BINARY = gnunet-service-rps @@ -12,7 +15,7 @@ NOARMBIND = YES # This is the timeinterval between the rounds ROUNDINTERVAL = 2 s -FILENAME_VALID_PEERS = $GNUNET_DATA_HOME/rps/valid_peers.txt +FILENAME_VALID_PEERS = $GNUNET_TEST_HOME/rps/valid_peers.txt # This is the 'estimate' in the beginning. # This determines the size of the peers we keep in memory @@ -55,9 +58,6 @@ DISABLE_TRY_CONNECT = YES DISABLE_TRY_CONNECT = YES #OPTIONS=-l /tmp/rps_profiler_logs/cadet-[]-%Y-%m-%d.log -[PATHS] -GNUNET_TEST_HOME = /tmp/rps-test/ - #[arm] #GLOBAL_POSTFIX=-l /tmp/rps_profiler_logs/other-[]-%Y-%m-%d.log diff --git a/src/rps/test_service_rps_peers.c b/src/rps/test_service_rps_peers.c index ede3d05a5..37ed1974c 100644 --- a/src/rps/test_service_rps_peers.c +++ b/src/rps/test_service_rps_peers.c @@ -27,6 +27,7 @@ #define ABORT() { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); Peers_terminate (); return 1; } #define CHECK(c) { if (! (c)) ABORT(); } +#define FN_VALID_PEERS "DISABLE" /** * @brief Dummy implementation of #PeerOp (Operation on peer) @@ -48,7 +49,6 @@ void peer_op (void *cls, const struct GNUNET_PeerIdentity *peer) void peer_op (void *cls, const struct GNUNET_PeerIdentity *peer); - static int check () { @@ -59,25 +59,25 @@ check () memset (&own_id, 1, sizeof (own_id)); /* Do nothing */ - Peers_initialise ("", NULL, &own_id); + Peers_initialise (FN_VALID_PEERS, NULL, &own_id); Peers_terminate (); /* Create peer */ - Peers_initialise ("", NULL, &own_id); + Peers_initialise (FN_VALID_PEERS, NULL, &own_id); CHECK (GNUNET_YES == Peers_insert_peer (&k1)); Peers_terminate (); /* Create peer */ - Peers_initialise ("", NULL, &own_id); + Peers_initialise (FN_VALID_PEERS, NULL, &own_id); CHECK (GNUNET_YES == Peers_insert_peer (&k1)); CHECK (GNUNET_YES == Peers_remove_peer (&k1)); Peers_terminate (); /* Insertion and Removal */ - Peers_initialise ("", NULL, &own_id); + Peers_initialise (FN_VALID_PEERS, NULL, &own_id); CHECK (GNUNET_NO == Peers_check_peer_known (&k1)); CHECK (GNUNET_YES == Peers_insert_peer (&k1));