From 71c68d0bbdb546bfe84b4536b447899c53cb3812 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 24 Jun 2016 14:05:58 +0000 Subject: [PATCH] move testbed logger to its own directory --- configure.ac | 2 + po/POTFILES.in | 7 +- src/Makefile.am | 2 +- src/nse/Makefile.am | 4 +- src/testbed-logger/Makefile.am | 57 ++++++++ .../gnunet-service-testbed-logger.c | 2 +- .../test_testbed_logger_api.c | 2 +- .../test_testbed_logger_api.conf | 0 src/testbed-logger/testbed-logger.conf.in | 127 ++++++++++++++++++ .../testbed_logger_api.c | 2 +- src/testbed/Makefile.am | 28 +--- src/testbed/testbed.conf.in | 11 -- 12 files changed, 196 insertions(+), 48 deletions(-) create mode 100644 src/testbed-logger/Makefile.am rename src/{testbed => testbed-logger}/gnunet-service-testbed-logger.c (99%) rename src/{testbed => testbed-logger}/test_testbed_logger_api.c (99%) rename src/{testbed => testbed-logger}/test_testbed_logger_api.conf (100%) create mode 100644 src/testbed-logger/testbed-logger.conf.in rename src/{testbed => testbed-logger}/testbed_logger_api.c (99%) diff --git a/configure.ac b/configure.ac index 11e9cbf3c..e4d3fa6a1 100644 --- a/configure.ac +++ b/configure.ac @@ -1601,6 +1601,8 @@ src/statistics/statistics.conf src/template/Makefile src/testbed/Makefile src/testbed/testbed.conf +src/testbed-logger/Makefile +src/testbed-logger/testbed-logger.conf src/testing/Makefile src/topology/Makefile src/transport/Makefile diff --git a/po/POTFILES.in b/po/POTFILES.in index e854ef48a..97732d8b4 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -289,7 +289,8 @@ src/regex/gnunet-regex-simulation-profiler.c src/regex/gnunet-service-regex.c src/regex/perf-regex.c src/regex/plugin_block_regex.c -src/regex/regex_api.c +src/regex/regex_api_announce.c +src/regex/regex_api_search.c src/regex/regex_block_lib.c src/regex/regex_internal.c src/regex/regex_internal_dht.c @@ -350,12 +351,13 @@ src/testbed/gnunet-service-testbed_cache.c src/testbed/gnunet-service-testbed_connectionpool.c src/testbed/gnunet-service-testbed_cpustatus.c src/testbed/gnunet-service-testbed_links.c -src/testbed/gnunet-service-testbed-logger.c src/testbed/gnunet-service-testbed_meminfo.c src/testbed/gnunet-service-testbed_oc.c src/testbed/gnunet-service-testbed_peers.c src/testbed/gnunet_testbed_mpi_spawn.c src/testbed/gnunet-testbed-profiler.c +src/testbed-logger/gnunet-service-testbed-logger.c +src/testbed-logger/testbed_logger_api.c src/testbed/testbed_api_barriers.c src/testbed/testbed_api.c src/testbed/testbed_api_hosts.c @@ -368,7 +370,6 @@ src/testbed/testbed_api_testbed.c src/testbed/testbed_api_test.c src/testbed/testbed_api_topology.c src/testbed/testbed_api_underlay.c -src/testbed/testbed_logger_api.c src/testing/gnunet-testing.c src/testing/list-keys.c src/testing/testing.c diff --git a/src/Makefile.am b/src/Makefile.am index 24c2f583a..0ce2ac4de 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ if HAVE_TESTING TESTING = testing - TESTBED = testbed + TESTBED = testbed-logger testbed CONSENSUS = consensus SECRETSHARING = secretsharing endif diff --git a/src/nse/Makefile.am b/src/nse/Makefile.am index ebff9d251..9a163b160 100644 --- a/src/nse/Makefile.am +++ b/src/nse/Makefile.am @@ -66,7 +66,7 @@ gnunet_service_nse_LDADD = \ $(GN_LIBINTL) if ENABLE_NSE_HISTOGRAM gnunet_service_nse_LDADD += \ - $(top_builddir)/src/testbed/libgnunettestbedlogger.la + $(top_builddir)/src/testbed-logger/libgnunettestbedlogger.la endif @@ -111,5 +111,3 @@ perf_kdf_LDADD = \ EXTRA_DIST = \ test_nse.conf \ nse_profiler_test.conf - - diff --git a/src/testbed-logger/Makefile.am b/src/testbed-logger/Makefile.am new file mode 100644 index 000000000..7f372fd02 --- /dev/null +++ b/src/testbed-logger/Makefile.am @@ -0,0 +1,57 @@ +# This Makefile.am is in the public domain +AM_CPPFLAGS = -I$(top_srcdir)/src/include + +if MINGW + WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols +endif + +if USE_COVERAGE + AM_CFLAGS = --coverage -O0 + XLIB = -lgcov +endif + +libexecdir= $(pkglibdir)/libexec/ + +pkgcfgdir= $(pkgdatadir)/config.d/ + +pkgcfg_DATA = \ + testbed-logger.conf + +libexec_PROGRAMS = \ + gnunet-service-testbed-logger + +gnunet_service_testbed_logger_SOURCES = \ + gnunet-service-testbed-logger.c +gnunet_service_testbed_logger_LDADD = \ + $(top_builddir)/src/util/libgnunetutil.la + +lib_LTLIBRARIES = \ + libgnunettestbedlogger.la + +libgnunettestbedlogger_la_SOURCES = \ + testbed_logger_api.c +libgnunettestbedlogger_la_LIBADD = $(XLIB) \ + $(top_builddir)/src/util/libgnunetutil.la \ + $(LTLIBINTL) +libgnunettestbedlogger_la_LDFLAGS = \ + $(GN_LIB_LDFLAGS) \ + -version-info 0:0:0 + +check_PROGRAMS = \ + test_testbed_logger_api + +if ENABLE_TEST_RUN + AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH; + TESTS = \ + test_testbed_logger_api +endif + +test_testbed_logger_api_SOURCES = \ + test_testbed_logger_api.c +test_testbed_logger_api_LDADD = \ + $(top_builddir)/src/util/libgnunetutil.la \ + $(top_builddir)/src/testing/libgnunettesting.la \ + libgnunettestbedlogger.la + +EXTRA_DIST = \ + test_testbed_logger_api.conf diff --git a/src/testbed/gnunet-service-testbed-logger.c b/src/testbed-logger/gnunet-service-testbed-logger.c similarity index 99% rename from src/testbed/gnunet-service-testbed-logger.c rename to src/testbed-logger/gnunet-service-testbed-logger.c index 0f9fab01b..1c250b306 100644 --- a/src/testbed/gnunet-service-testbed-logger.c +++ b/src/testbed-logger/gnunet-service-testbed-logger.c @@ -19,7 +19,7 @@ */ /** - * @file testbed/gnunet-service-testbed-logger.c + * @file testbed-logger/gnunet-service-testbed-logger.c * @brief service for collecting messages and writing to a file * @author Sree Harsha Totakura */ diff --git a/src/testbed/test_testbed_logger_api.c b/src/testbed-logger/test_testbed_logger_api.c similarity index 99% rename from src/testbed/test_testbed_logger_api.c rename to src/testbed-logger/test_testbed_logger_api.c index a25c0c5f0..8f7391f22 100644 --- a/src/testbed/test_testbed_logger_api.c +++ b/src/testbed-logger/test_testbed_logger_api.c @@ -18,7 +18,7 @@ Boston, MA 02110-1301, USA. */ /** - * @file testbed/test_testbed_logger_api.c + * @file testbed-logger/test_testbed_logger_api.c * @brief testcases for the testbed logger api * @author Sree Harsha Totakura */ diff --git a/src/testbed/test_testbed_logger_api.conf b/src/testbed-logger/test_testbed_logger_api.conf similarity index 100% rename from src/testbed/test_testbed_logger_api.conf rename to src/testbed-logger/test_testbed_logger_api.conf diff --git a/src/testbed-logger/testbed-logger.conf.in b/src/testbed-logger/testbed-logger.conf.in new file mode 100644 index 000000000..094328c7b --- /dev/null +++ b/src/testbed-logger/testbed-logger.conf.in @@ -0,0 +1,127 @@ +[testbed] +AUTOSTART = NO +@JAVAPORT@ PORT = 2101 +HOSTNAME = localhost +BINARY = gnunet-service-testbed + +# How long should operations wait? +OPERATION_TIMEOUT = 30 s + +# Set this to the path where the testbed helper is installed. By default the +# helper binary is searched in @prefix@/lib/gnunet/libexec/ +# HELPER_BINARY_PATH = @prefix@/lib/gnunet/libexec/gnunet-helper-testbed + +# Add your local network address here. For example, if you want to run +# testbed on a group of hosts connected to network 192.168.1.0/24, then set +# ACCEPT_FROM = 127.0.0.1; 192.168.1.0/24; +# Multiple network addresses can be given. They should be separated by `;' +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; + +UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-testbed.sock +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +# How many maximum number of operations can be run in parallel. This number +# should be decreased if the system is getting overloaded and to reduce the load +# exerted by the emulation. +MAX_PARALLEL_OPERATIONS = 1000 +MAX_PARALLEL_TOPOLOGY_CONFIG_OPERATIONS = 1 + +# What topology should be generated by the helper functions GNUNET_TESTBED_run() +# and GNUNET_TESTBED_test_run(). This option has no effect if testbed is +# initialized with other functions. Valid values can be found at: +# https://gnunet.org/supported-topologies +OVERLAY_TOPOLOGY = NONE + +# Number of random links to be included to the generate the above topology. +# Note that not all topologies require this option and ignore it. Topologies +# requiring this option are RANDOM, SMALL_WORLD and SMALL_WORLD ring. +# OVERLAY_RANDOM_LINKS = + +# This option is required if the OVERLAY_TOPOLOGY is set to FROM_FILE. It is +# ignored for all other topologies. This option should contain the path to +# the file containing the topology information. The format of the file is +# presented at: https://gnunet.org/topology-file-format +# OVERLAY_TOPOLOGY_FILE = /path/to/topology-file + +# The following options are required if the OVERLAY_TOPOLOGY is set to +# SCALE_FREE. They are ignored in all other cases. +# The number of maximum peers which can connect to a peer +SCALE_FREE_TOPOLOGY_CAP = 70 +# The minimum number of peers which a peer has to connect +SCALE_FREE_TOPOLOGY_M = 5 + +# How many maximum number of handles to peers' services should be kept open at +# any time. This number also keeps a check on the number of open descriptors as +# opening a service connection results in opening a file descriptor. +MAX_PARALLEL_SERVICE_CONNECTIONS = 256 + +# Size of the internal testbed cache. It is used to cache handles to peers +# while trying to connect them. +CACHE_SIZE = 30 + +# Maximum number of file descriptors a testbed controller is permitted to keep +# open. +MAX_OPEN_FDS = 512 + +# How long should we wait for testbed to setup while using helper functions +# GNUNET_TESTBED_test_run() and GNUNET_TESTBED_run() +SETUP_TIMEOUT = 5 m + +# Where should testbed write load statistics data +# STATS_DIR = /tmp/load + +# What services should be shared among peers. +# Format is "[] [] ...". The shared services are +# started standalone without any other peer services or a hostkey. For this +# reason, only services which doesn't depend on other services can only be +# shared. Example: To share peerinfo among every 10 peers. The following spec +# will start 5 peerinfo services when 50 peers are started: +# +# SHARED_SERVICES = peerinfo:10 +# +# To share multiple services +# +# SHARED_SERVICES = service1:n_share1 service2:n_share2 ... +# +# Default is to share no services +SHARED_SERVICES = + + +[testbed-logger] +AUTOSTART = NO +@UNIXONLY@ PORT = 2102 +HOSTNAME = localhost +BINARY = gnunet-service-testbed-logger +UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-gnunet-testbed-logger.sock +DIR = /tmp +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + + +[testbed-barrier] +AUTOSTART = NO +@UNIXONLY@ PORT = 2103 +HOSTNAME = localhost +UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-testbed-barrier.sock +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + + +# This section is related to configuring underlay restrictions to simulate +# connectivity restrictions of NAT boxes +[testbed-underlay] +AUTOSTART = NO +NOARMBIND = YES +BINARY = gnunet-daemon-testbed-underlay +# The sqlite3 database file containing information about what underlay +# restrictions to apply +# DBFILE = + +[latency-logger] +AUTOSTART = NO +NOARMBIND = YES +BINARY = gnunet-daemon-latency-logger +# The sqlite3 database file where the latency values are to be stored +# DBFILE = \ No newline at end of file diff --git a/src/testbed/testbed_logger_api.c b/src/testbed-logger/testbed_logger_api.c similarity index 99% rename from src/testbed/testbed_logger_api.c rename to src/testbed-logger/testbed_logger_api.c index aa182e21c..aaf18cd33 100644 --- a/src/testbed/testbed_logger_api.c +++ b/src/testbed-logger/testbed_logger_api.c @@ -19,7 +19,7 @@ */ /** - * @file testbed/testbed_logger_api.c + * @file testbed-logger/testbed_logger_api.c * @brief Client-side routines for communicating with the tesbted logger service * @author Sree Harsha Totakura */ diff --git a/src/testbed/Makefile.am b/src/testbed/Makefile.am index 8b5d7457a..b5a7758f0 100644 --- a/src/testbed/Makefile.am +++ b/src/testbed/Makefile.am @@ -27,7 +27,6 @@ endif libexec_PROGRAMS = \ gnunet-service-testbed \ gnunet-helper-testbed \ - gnunet-service-testbed-logger \ gnunet-daemon-testbed-blacklist \ $(underlay_daemon) \ $(latency_logger) @@ -59,11 +58,6 @@ gnunet_service_testbed_LDADD = $(XLIB) \ $(top_builddir)/src/arm/libgnunetarm.la \ $(LTLIBINTL) $(Z_LIBS) -gnunet_service_testbed_logger_SOURCES = \ - gnunet-service-testbed-logger.c -gnunet_service_testbed_logger_LDADD = \ - $(top_builddir)/src/util/libgnunetutil.la - gnunet_testbed_profiler_SOURCES = \ gnunet-testbed-profiler.c gnunet_testbed_profiler_LDADD = $(XLIB) \ @@ -97,8 +91,7 @@ gnunet_daemon_latency_logger_LDADD = $(XLIB) \ $(LTLIBINTL) -lsqlite3 lib_LTLIBRARIES = \ - libgnunettestbed.la \ - libgnunettestbedlogger.la + libgnunettestbed.la libgnunettestbed_la_SOURCES = \ testbed_api.c testbed_api.h testbed.h \ @@ -125,15 +118,6 @@ libgnunettestbed_la_LDFLAGS = \ $(GN_LIB_LDFLAGS) \ -version-info 0:0:0 -libgnunettestbedlogger_la_SOURCES = \ - testbed_logger_api.c -libgnunettestbedlogger_la_LIBADD = $(XLIB) \ - $(top_builddir)/src/util/libgnunetutil.la \ - $(LTLIBINTL) -libgnunettestbedlogger_la_LDFLAGS = \ - $(GN_LIB_LDFLAGS) \ - -version-info 0:0:0 - generate_underlay_topology_SOURCES = generate-underlay-topology.c generate_underlay_topology_LDADD = $(XLIB) \ $(top_builddir)/src/util/libgnunetutil.la \ @@ -142,7 +126,6 @@ generate_underlay_topology_LDADD = $(XLIB) \ check_PROGRAMS = \ test_testbed_api_hosts \ - test_testbed_logger_api \ test_gnunet_helper_testbed \ test_testbed_api_controllerlink \ test_testbed_api_2peers_1controller \ @@ -176,7 +159,6 @@ if ENABLE_TEST_RUN AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH; TESTS = \ test_testbed_api \ - test_testbed_logger_api \ test_testbed_api_sd \ test_testbed_api_operations \ test_testbed_api_hosts \ @@ -219,13 +201,6 @@ test_testbed_api_LDADD = \ $(top_builddir)/src/arm/libgnunetarm.la \ libgnunettestbed.la -test_testbed_logger_api_SOURCES = \ - test_testbed_logger_api.c -test_testbed_logger_api_LDADD = \ - $(top_builddir)/src/util/libgnunetutil.la \ - $(top_builddir)/src/testing/libgnunettesting.la \ - libgnunettestbedlogger.la - test_testbed_api_sd_SOURCES = \ test_testbed_api_sd.c test_testbed_api_sd_LDADD = \ @@ -398,7 +373,6 @@ EXTRA_DIST = \ test_testbed_api_statistics.conf \ test_testbed_api_test_timeout.conf \ test_testbed_api_template.conf \ - test_testbed_logger_api.conf \ test_testbed_api_testbed_run_topologyring.conf \ test_testbed_api_testbed_run_topologyclique.conf \ test_testbed_api_testbed_run_topologyline.conf \ diff --git a/src/testbed/testbed.conf.in b/src/testbed/testbed.conf.in index 094328c7b..86044fbfb 100644 --- a/src/testbed/testbed.conf.in +++ b/src/testbed/testbed.conf.in @@ -89,17 +89,6 @@ SETUP_TIMEOUT = 5 m SHARED_SERVICES = -[testbed-logger] -AUTOSTART = NO -@UNIXONLY@ PORT = 2102 -HOSTNAME = localhost -BINARY = gnunet-service-testbed-logger -UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-gnunet-testbed-logger.sock -DIR = /tmp -UNIX_MATCH_UID = YES -UNIX_MATCH_GID = YES - - [testbed-barrier] AUTOSTART = NO @UNIXONLY@ PORT = 2103 -- 2.25.1