diff options
author | Bertrand Marc <beberking@gmail.com> | 2012-06-06 20:47:48 +0200 |
---|---|---|
committer | Bertrand Marc <beberking@gmail.com> | 2012-06-06 20:47:48 +0200 |
commit | 740b30688bd745a527f96f9116c19acb3480971a (patch) | |
tree | 2709a3f4dba11c174aa9e1ba3612e30c578e76a9 /src/integration-tests | |
parent | 2b81464a43485fcc8ce079fafdee7b7a171835f4 (diff) |
Imported Upstream version 0.9.3upstream/0.9.3
Diffstat (limited to 'src/integration-tests')
28 files changed, 4782 insertions, 118 deletions
diff --git a/src/integration-tests/Makefile.am b/src/integration-tests/Makefile.am index d948b3d..fb69e28 100644 --- a/src/integration-tests/Makefile.am +++ b/src/integration-tests/Makefile.am @@ -9,13 +9,17 @@ if USE_COVERAGE XLIB = -lgcov endif -bin_PROGRAMS = +#bin_PROGRAMS = \ +# connection_watchdog -check_PROGRAMS = +noinst_PROGRAMS = connection_watchdog noinst_SCRIPTS = \ gnunet_testing.py \ - gnunet_pyexpect.py + gnunet_pyexpect.py \ + test_integration_connection_values_tcp.py \ + test_integration_connection_values_tcp_udp.py \ + test_integration_connection_values_tcp_udp_http.py if HAVE_PYTHON_PEXPECT check_SCRIPTS = \ @@ -24,16 +28,28 @@ check_SCRIPTS = \ test_integration_bootstrap_and_connect_and_disconnect_nat.py \ test_integration_restart.py \ test_integration_clique.py \ - test_integration_clique_nat.py + test_integration_clique_nat.py \ + test_integration_connect_on_restart.py endif # test_integration_disconnect.py +check_PROGRAMS = \ + test_connection_stability + if ENABLE_TEST_RUN TESTS = \ $(check_SCRIPTS) endif +connection_watchdog_SOURCE = \ + connection_watchdog.c +connection_watchdog_LDADD = \ + $(top_builddir)/src/statistics/libgnunetstatistics.la \ + $(top_builddir)/src/core/libgnunetcore.la \ + $(top_builddir)/src/transport/libgnunettransport.la \ + $(top_builddir)/src/util/libgnunetutil.la + do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g' %.py: %.py.in Makefile @@ -81,13 +97,39 @@ test_integration_clique_nat.py: test_integration_clique_nat.py.in Makefile $(do_subst) < $(srcdir)/test_integration_clique_nat.py.in > test_integration_clique_nat.py chmod +x test_integration_clique_nat.py +test_integration_connect_on_restart.py: test_integration_connect_on_restart.py.in Makefile + $(do_subst) < $(srcdir)/test_integration_connect_on_restart.py.in > test_integration_connect_on_restart.py + chmod +x test_integration_connect_on_restart.py + +test_integration_connection_values_tcp.py: test_integration_connection_values_tcp.py.in Makefile + $(do_subst) < $(srcdir)/test_integration_connection_values_tcp.py.in > test_integration_connection_values_tcp.py + chmod +x test_integration_connection_values_tcp.py + +test_integration_connection_values_tcp_udp.py: test_integration_connection_values_tcp_udp.py.in Makefile + $(do_subst) < $(srcdir)/test_integration_connection_values_tcp_udp.py.in > test_integration_connection_values_tcp_udp.py + chmod +x test_integration_connection_values_tcp_udp.py + +test_integration_connection_values_tcp_udp_http.py: test_integration_connection_values_tcp_udp_http.py.in Makefile + $(do_subst) < $(srcdir)/test_integration_connection_values_tcp_udp_http.py.in > test_integration_connection_values_tcp_udp_http.py + chmod +x test_integration_connection_values_tcp_udp_http.py + +test_connection_stability_SOURCES = \ + test_connection_stability.c +test_connection_stability_LDADD = \ + $(top_builddir)/src/testing/libgnunettesting.la \ + $(top_builddir)/src/util/libgnunetutil.la + EXTRA_DIST = \ gnunet_testing.py.in \ gnunet_pyexpect.py.in \ + test_integration_connection_values_tcp.py.in \ + test_integration_connection_values_tcp_udp.py.in \ + test_integration_connection_values_tcp_udp_http.py.in \ test_integration_bootstrap_and_connect.py.in \ test_integration_bootstrap_and_connect_and_disconnect.py.in \ test_integration_bootstrap_and_connect_and_disconnect_nat.py.in \ + test_integration_connect_on_restart.py.in \ test_integration_disconnect.py.in \ test_integration_restart.py.in \ test_integration_clique.py.in \ @@ -96,6 +138,16 @@ EXTRA_DIST = \ confs/c_nat_client.conf \ confs/c_no_nat_client_2.conf \ confs/c_no_nat_client.conf \ + confs/c_normal_client_tcp.conf \ + confs/c_normal_client_tcp_udp.conf \ + confs/c_normal_client_tcp_udp_http.conf \ + confs/c_no_nat_client_http.conf \ + confs/c_no_nat_client_http_2.conf\ + confs/c_no_nat_client_http.conf \ + confs/c_no_nat_client_http_2.conf \ + confs/c_no_nat_client_unix.conf \ + confs/c_no_nat_client_unix_2.conf \ + test_connection_stability.conf \ hostkeys/0000-hostkey \ hostkeys/0001-hostkey \ hostkeys/0002-hostkey \ diff --git a/src/integration-tests/Makefile.in b/src/integration-tests/Makefile.in index 20b13d6..3e5e7dc 100644 --- a/src/integration-tests/Makefile.in +++ b/src/integration-tests/Makefile.in @@ -36,8 +36,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -bin_PROGRAMS = -check_PROGRAMS = +noinst_PROGRAMS = connection_watchdog$(EXEEXT) +check_PROGRAMS = test_connection_stability$(EXEEXT) subdir = src/integration-tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -59,17 +59,56 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/gnunet_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" -PROGRAMS = $(bin_PROGRAMS) +PROGRAMS = $(noinst_PROGRAMS) +connection_watchdog_SOURCES = connection_watchdog.c +connection_watchdog_OBJECTS = connection_watchdog.$(OBJEXT) +connection_watchdog_DEPENDENCIES = \ + $(top_builddir)/src/statistics/libgnunetstatistics.la \ + $(top_builddir)/src/core/libgnunetcore.la \ + $(top_builddir)/src/transport/libgnunettransport.la \ + $(top_builddir)/src/util/libgnunetutil.la +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +am_test_connection_stability_OBJECTS = \ + test_connection_stability.$(OBJEXT) +test_connection_stability_OBJECTS = \ + $(am_test_connection_stability_OBJECTS) +test_connection_stability_DEPENDENCIES = \ + $(top_builddir)/src/testing/libgnunettesting.la \ + $(top_builddir)/src/util/libgnunetutil.la SCRIPTS = $(noinst_SCRIPTS) -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_$(V)) am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ -SOURCES = -DIST_SOURCES = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = connection_watchdog.c $(test_connection_stability_SOURCES) +DIST_SOURCES = connection_watchdog.c \ + $(test_connection_stability_SOURCES) +ETAGS = etags +CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -128,6 +167,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +JAVAPORT = @JAVAPORT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ @@ -161,6 +201,7 @@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +MONKEYPREFIX = @MONKEYPREFIX@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ @@ -283,7 +324,10 @@ INCLUDES = -I$(top_srcdir)/src/include @USE_COVERAGE_TRUE@XLIB = -lgcov noinst_SCRIPTS = \ gnunet_testing.py \ - gnunet_pyexpect.py + gnunet_pyexpect.py \ + test_integration_connection_values_tcp.py \ + test_integration_connection_values_tcp_udp.py \ + test_integration_connection_values_tcp_udp_http.py @HAVE_PYTHON_PEXPECT_TRUE@check_SCRIPTS = \ @HAVE_PYTHON_PEXPECT_TRUE@ test_integration_bootstrap_and_connect.py \ @@ -291,19 +335,39 @@ noinst_SCRIPTS = \ @HAVE_PYTHON_PEXPECT_TRUE@ test_integration_bootstrap_and_connect_and_disconnect_nat.py \ @HAVE_PYTHON_PEXPECT_TRUE@ test_integration_restart.py \ @HAVE_PYTHON_PEXPECT_TRUE@ test_integration_clique.py \ -@HAVE_PYTHON_PEXPECT_TRUE@ test_integration_clique_nat.py +@HAVE_PYTHON_PEXPECT_TRUE@ test_integration_clique_nat.py \ +@HAVE_PYTHON_PEXPECT_TRUE@ test_integration_connect_on_restart.py -# test_integration_disconnect.py @ENABLE_TEST_RUN_TRUE@TESTS = \ @ENABLE_TEST_RUN_TRUE@ $(check_SCRIPTS) +connection_watchdog_SOURCE = \ + connection_watchdog.c + +connection_watchdog_LDADD = \ + $(top_builddir)/src/statistics/libgnunetstatistics.la \ + $(top_builddir)/src/core/libgnunetcore.la \ + $(top_builddir)/src/transport/libgnunettransport.la \ + $(top_builddir)/src/util/libgnunetutil.la + do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g' +test_connection_stability_SOURCES = \ + test_connection_stability.c + +test_connection_stability_LDADD = \ + $(top_builddir)/src/testing/libgnunettesting.la \ + $(top_builddir)/src/util/libgnunetutil.la + EXTRA_DIST = \ gnunet_testing.py.in \ gnunet_pyexpect.py.in \ + test_integration_connection_values_tcp.py.in \ + test_integration_connection_values_tcp_udp.py.in \ + test_integration_connection_values_tcp_udp_http.py.in \ test_integration_bootstrap_and_connect.py.in \ test_integration_bootstrap_and_connect_and_disconnect.py.in \ test_integration_bootstrap_and_connect_and_disconnect_nat.py.in \ + test_integration_connect_on_restart.py.in \ test_integration_disconnect.py.in \ test_integration_restart.py.in \ test_integration_clique.py.in \ @@ -312,6 +376,16 @@ EXTRA_DIST = \ confs/c_nat_client.conf \ confs/c_no_nat_client_2.conf \ confs/c_no_nat_client.conf \ + confs/c_normal_client_tcp.conf \ + confs/c_normal_client_tcp_udp.conf \ + confs/c_normal_client_tcp_udp_http.conf \ + confs/c_no_nat_client_http.conf \ + confs/c_no_nat_client_http_2.conf\ + confs/c_no_nat_client_http.conf \ + confs/c_no_nat_client_http_2.conf \ + confs/c_no_nat_client_unix.conf \ + confs/c_no_nat_client_unix_2.conf \ + test_connection_stability.conf \ hostkeys/0000-hostkey \ hostkeys/0001-hostkey \ hostkeys/0002-hostkey \ @@ -331,6 +405,7 @@ CLEANFILES = \ all: all-am .SUFFIXES: +.SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -361,43 +436,9 @@ $(top_srcdir)/configure: $(am__configure_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p || test -f $$p1; \ - then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ @@ -405,26 +446,111 @@ clean-binPROGRAMS: echo " rm -f" $$list; \ rm -f $$list -clean-checkPROGRAMS: - @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list +connection_watchdog$(EXEEXT): $(connection_watchdog_OBJECTS) $(connection_watchdog_DEPENDENCIES) + @rm -f connection_watchdog$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(connection_watchdog_OBJECTS) $(connection_watchdog_LDADD) $(LIBS) +test_connection_stability$(EXEEXT): $(test_connection_stability_OBJECTS) $(test_connection_stability_DEPENDENCIES) + @rm -f test_connection_stability$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_connection_stability_OBJECTS) $(test_connection_stability_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection_watchdog.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_connection_stability.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique tags: TAGS -TAGS: +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi ctags: CTAGS -CTAGS: - +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ @@ -554,9 +680,6 @@ check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(SCRIPTS) installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -585,12 +708,14 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ - clean-libtool mostlyclean-am +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile -distclean-am: clean-am distclean-generic +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags dvi: dvi-am @@ -610,7 +735,7 @@ install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-binPROGRAMS +install-exec-am: install-html: install-html-am @@ -633,12 +758,14 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am -mostlyclean-am: mostlyclean-generic mostlyclean-libtool +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf: pdf-am @@ -648,22 +775,23 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binPROGRAMS +uninstall-am: .MAKE: check-am install-am install-strip -.PHONY: all all-am check check-TESTS check-am clean clean-binPROGRAMS \ - clean-checkPROGRAMS clean-generic clean-libtool distclean \ - distclean-generic distclean-libtool distdir dvi dvi-am html \ - html-am info info-am install install-am install-binPROGRAMS \ +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstPROGRAMS ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-binPROGRAMS + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am %.py: %.py.in Makefile @@ -710,6 +838,22 @@ test_integration_clique_nat.py: test_integration_clique_nat.py.in Makefile $(do_subst) < $(srcdir)/test_integration_clique_nat.py.in > test_integration_clique_nat.py chmod +x test_integration_clique_nat.py +test_integration_connect_on_restart.py: test_integration_connect_on_restart.py.in Makefile + $(do_subst) < $(srcdir)/test_integration_connect_on_restart.py.in > test_integration_connect_on_restart.py + chmod +x test_integration_connect_on_restart.py + +test_integration_connection_values_tcp.py: test_integration_connection_values_tcp.py.in Makefile + $(do_subst) < $(srcdir)/test_integration_connection_values_tcp.py.in > test_integration_connection_values_tcp.py + chmod +x test_integration_connection_values_tcp.py + +test_integration_connection_values_tcp_udp.py: test_integration_connection_values_tcp_udp.py.in Makefile + $(do_subst) < $(srcdir)/test_integration_connection_values_tcp_udp.py.in > test_integration_connection_values_tcp_udp.py + chmod +x test_integration_connection_values_tcp_udp.py + +test_integration_connection_values_tcp_udp_http.py: test_integration_connection_values_tcp_udp_http.py.in Makefile + $(do_subst) < $(srcdir)/test_integration_connection_values_tcp_udp_http.py.in > test_integration_connection_values_tcp_udp_http.py + chmod +x test_integration_connection_values_tcp_udp_http.py + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/src/integration-tests/confs/c_bootstrap_server.conf b/src/integration-tests/confs/c_bootstrap_server.conf index 0b919f9..7235fca 100644 --- a/src/integration-tests/confs/c_bootstrap_server.conf +++ b/src/integration-tests/confs/c_bootstrap_server.conf @@ -353,3 +353,11 @@ UNIX_MATCH_GID = YES DATABASE = sqlite QUOTA = 1 MB +[gns] +AUTOSTART = NO + +[namestore] +AUTOSTART = NO + +[lockmanager] +AUTOSTART = NO
\ No newline at end of file diff --git a/src/integration-tests/confs/c_nat_client.conf b/src/integration-tests/confs/c_nat_client.conf index 59fa0f7..4f6c578 100644 --- a/src/integration-tests/confs/c_nat_client.conf +++ b/src/integration-tests/confs/c_nat_client.conf @@ -8,6 +8,12 @@ HOSTKEY = hostkeys/0002-hostkey [client] HOME = $SERVICEHOME +[gns] +AUTOSTART = NO + +[namestore] +AUTOSTART = NO + [vpn] AUTOSTART = YES PORT = 0 @@ -351,4 +357,7 @@ UNIX_MATCH_GID = YES [dhtcache] DATABASE = sqlite -QUOTA = 1 MB
\ No newline at end of file +QUOTA = 1 MB + +[lockmanager] +AUTOSTART = NO
\ No newline at end of file diff --git a/src/integration-tests/confs/c_no_nat_client.conf b/src/integration-tests/confs/c_no_nat_client.conf index 4ec077c..0a24b5a 100644 --- a/src/integration-tests/confs/c_no_nat_client.conf +++ b/src/integration-tests/confs/c_no_nat_client.conf @@ -6,6 +6,12 @@ DEFAULTCONFIG = confs/c_no_nat_client.conf #HOSTKEY = $SERVICEHOME/.hostkey HOSTKEY = hostkeys/0001-hostkey +[gns] +AUTOSTART = NO + +[namestore] +AUTOSTART = NO + [vpn] AUTOSTART = YES PORT = 0 @@ -354,3 +360,5 @@ UNIX_MATCH_GID = YES DATABASE = sqlite QUOTA = 1 MB +[lockmanager] +AUTOSTART = NO diff --git a/src/integration-tests/confs/c_no_nat_client_2.conf b/src/integration-tests/confs/c_no_nat_client_2.conf index bd675d7..61a6a3b 100644 --- a/src/integration-tests/confs/c_no_nat_client_2.conf +++ b/src/integration-tests/confs/c_no_nat_client_2.conf @@ -342,3 +342,10 @@ UNIX_MATCH_GID = YES DATABASE = sqlite QUOTA = 1 MB +[gns] +AUTOSTART = NO + +[namestore] +AUTOSTART = NO + + diff --git a/src/integration-tests/confs/c_no_nat_client_http.conf b/src/integration-tests/confs/c_no_nat_client_http.conf new file mode 100644 index 0000000..718794e --- /dev/null +++ b/src/integration-tests/confs/c_no_nat_client_http.conf @@ -0,0 +1,363 @@ +[PATHS] +SERVICEHOME = /tmp/c_no_nat_client/ +DEFAULTCONFIG = confs/c_no_nat_client_http.conf + +[gnunetd] +#HOSTKEY = $SERVICEHOME/.hostkey +HOSTKEY = hostkeys/0001-hostkey + +[gns] +AUTOSTART = NO + +[namestore] +AUTOSTART = NO + +[vpn] +AUTOSTART = YES +PORT = 0 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-dns +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/gnunet-service-vpn-29 + +[resolver] +AUTOSTART = YES +PORT = 20035 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-resolver +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-resolver-28 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = NO + +[mesh] +AUTOSTART = YES +PORT = 20034 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-mesh +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-mesh-27 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[nse] +AUTOSTART = YES +PORT = 20033 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-nse +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-nse-26 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +PROOFFILE = $SERVICEHOME/.nse-proof +HISTOGRAM = $SERVICEHOME/nse-history.log +WORKDELAY = 5 ms +INTERVAL = 1 h +WORKBITS = 26 + +[topology] +MINIMUM-FRIENDS = 0 +FRIENDS-ONLY = NO +AUTOCONNECT = YES +TARGET-CONNECTION-COUNT = 16 +FRIENDS = $SERVICEHOME/friends +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-topology + +[datastore] +AUTOSTART = YES +UNIXPATH = /tmp/test-service-datastore-25 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +PORT = 20032 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-datastore +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +QUOTA = 100 MB +BLOOMFILTER = $SERVICEHOME/fs/bloomfilter +DATABASE = sqlite + +[datastore-sqlite] +FILENAME = $SERVICEHOME/datastore/sqlite.db + +[datastore-postgres] +CONFIG = connect_timeout=10; dbname=gnunet + +[datastore-mysql] +DATABASE = gnunet +CONFIG = ~/.my.cnf + +[peerinfo] +AUTOSTART = YES +PORT = 20031 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-peerinfo +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-peerinfo-24 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES +HOSTS = $SERVICEHOME/data/hosts/ + +[client] +HOME = $SERVICEHOME + +[TESTING] +WEAKRANDOM = NO +CONNECT_TIMEOUT = 30 s +CONNECT_ATTEMPTS = 3 +MAX_OUTSTANDING_CONNECTIONS = 50 +DELETE_FILES = YES + +[ats] +AUTOSTART = YES +PORT = 20030 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-ats +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-ats-23 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +WAN_QUOTA_IN = 65536 +WAN_QUOTA_OUT = 65536 +DUMP_MLP = NO +DUMP_SOLUTION = NO +DUMP_OVERWRITE = NO +DUMP_MIN_PEERS = 0 +DUMP_MIN_ADDRS = 0 +ATS_MIN_INTERVAL = 15000 +ATS_EXEC_INTERVAL = 30000 + +[transport] +PREFIX = valgrind --leak-check=full +#DEBUG = YES +AUTOSTART = YES +PORT = 20029 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-transport +NEIGHBOUR_LIMIT = 50 +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +PLUGINS = http +UNIXPATH = /tmp/test-service-transport-22 +BLACKLIST_FILE = $SERVICEHOME/blacklist +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[transport-tcp] +USE_LOCALADDR = YES +PORT = 20028 +ADVERTISED_PORT = 20028 +MAX_CONNECTIONS = 128 +TIMEOUT = 5 s + +[transport-udp] +USE_LOCALADDR = YES +PORT = 20027 +BROADCAST = YES +BROADCAST_INTERVAL = 30000 +MAX_BPS = 1000000 + +[transport-http] +PORT = 20026 +MAX_CONNECTIONS = 128 + +[transport-https] +PORT = 20025 +CRYPTO_INIT = NORMAL +KEY_FILE = https.key +CERT_FILE = https.cert +MAX_CONNECTIONS = 128 + +[transport-wlan] +INTERFACE = mon0 +TESTMODE = 0 + +[datacache-mysql] +DATABASE = gnunet +CONFIG = ~/.my.cnf + +[datacache-postgres] +CONFIG = connect_timeout=10; dbname=gnunet + +[template] +AUTOSTART = NO +PORT = 20024 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-template +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-template-21 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[fs] +AUTOSTART = YES +INDEXDB = $SERVICEHOME/idxinfo.lst +TRUST = $SERVICEHOME/data/credit/ +IDENTITY_DIR = $SERVICEHOME/identities/ +STATE_DIR = $SERVICEHOME/persistence/ +UPDATE_DIR = $SERVICEHOME/updates/ +PORT = 20023 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-fs +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +DELAY = YES +CONTENT_CACHING = YES +CONTENT_PUSHING = YES +UNIXPATH = /tmp/test-service-fs-20 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES +MAX_PENDING_REQUESTS = 65536 +MIN_MIGRATION_DELAY = 100 ms +EXPECTED_NEIGHBOUR_COUNT = 128 + +[vpn] +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-vpn +IPV6ADDR = 1234::1 +IPV6PREFIX = 32 +IPV4ADDR = 10.11.10.1 +IPV4MASK = 255.255.0.0 +VIRTDNS = 10.11.10.2 +VIRTDNS6 = 1234::17 +IFNAME = vpn-gnunet + +[exit] +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-exit +IPV6ADDR = 1234:1::1 +IPV6PREFIX = 32 +IPV4ADDR = 10.10.1.1 +IPV4MASK = 255.255.0.0 +IFNAME = exit-gnunet +ENABLE_UDP = NO +ENABLE_TCP = NO + +[dns] +AUTOSTART = YES +PORT = 0 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-dns +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-dns-19 +PROVIDE_EXIT = NO + +[arm] +PORT = 20022 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-arm +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +DEFAULTSERVICES = topology hostlist fs core +UNIXPATH = /tmp/test-service-arm-18 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[hostlist] +HTTPPORT = 8080 +HOME = $SERVICEHOME +HOSTLISTFILE = $SERVICEHOME/hostlist/learned.data +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-hostlist +OPTIONS = -b +SERVERS = http://localhost:8080/ +HTTP-PROXY = + +[core] +AUTOSTART = YES +PORT = 20021 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-core +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-core-17 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[nat] +EXTERNAL_ADDRESS = 127.0.0.1 +INTERNAL_ADDRESS = 127.0.0.1 +BINDTO = 127.0.0.1 +BEHIND_NAT = NO +PUNCHED_NAT = NO +ENABLE_UPNP = NO +USE_LOCALADDR = YES +USE_HOSTNAME = NO +ENABLE_ICMP_CLIENT = NO +ENABLE_ICMP_SERVER = NO +DISABLEV6 = YES +RETURN_LOCAL_ADDRESSES = NO +HOSTNAME_DNS_FREQUENCY = 1200000 +IFC_SCAN_FREQUENCY = 3000000 +DYNDNS_FREQUENCY = 140000 + +[gnunet-nat-server] +HOSTNAME = gnunet.org +PORT = 20020 + +[statistics] +AUTOSTART = YES +PORT = 20019 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-statistics +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-statistics-16 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES + +[dht] +AUTOSTART = YES +PORT = 20018 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-dht +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +BUCKET_SIZE = 4 +UNIXPATH = /tmp/test-service-dht-15 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[dhtcache] +DATABASE = sqlite +QUOTA = 1 MB + diff --git a/src/integration-tests/confs/c_no_nat_client_http_2.conf b/src/integration-tests/confs/c_no_nat_client_http_2.conf new file mode 100644 index 0000000..3acb6b1 --- /dev/null +++ b/src/integration-tests/confs/c_no_nat_client_http_2.conf @@ -0,0 +1,352 @@ +[PATHS] +SERVICEHOME = /tmp/c_no_nat_client_2/ +DEFAULTCONFIG = confs/c_no_nat_client_http_2.conf + +[gnunetd] +#HOSTKEY = $SERVICEHOME/.hostkey +HOSTKEY = hostkeys/0002-hostkey + +[gns] +AUTOSTART = NO + +[namestore] +AUTOSTART = NO + +[resolver] +AUTOSTART = YES +PORT = 20053 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-resolver +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-resolver-42 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = NO + +[mesh] +AUTOSTART = YES +PORT = 20052 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-mesh +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-mesh-41 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[nse] +AUTOSTART = YES +PORT = 20051 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-nse +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-nse-40 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +PROOFFILE = $SERVICEHOME/.nse-proof +HISTOGRAM = $SERVICEHOME/nse-history.log +WORKDELAY = 5 ms +INTERVAL = 1 h +WORKBITS = 26 + +[topology] +MINIMUM-FRIENDS = 0 +FRIENDS-ONLY = NO +AUTOCONNECT = YES +TARGET-CONNECTION-COUNT = 16 +FRIENDS = $SERVICEHOME/friends +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-topology + +[datastore] +AUTOSTART = YES +UNIXPATH = /tmp/test-service-datastore-39 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +PORT = 20050 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-datastore +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +QUOTA = 100 MB +BLOOMFILTER = $SERVICEHOME/fs/bloomfilter +DATABASE = sqlite + +[datastore-sqlite] +FILENAME = $SERVICEHOME/datastore/sqlite.db + +[datastore-postgres] +CONFIG = connect_timeout=10; dbname=gnunet + +[datastore-mysql] +DATABASE = gnunet +CONFIG = ~/.my.cnf + +[peerinfo] +AUTOSTART = YES +PORT = 20049 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-peerinfo +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-peerinfo-38 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES +HOSTS = $SERVICEHOME/data/hosts/ + +[client] +HOME = $SERVICEHOME + +[TESTING] +WEAKRANDOM = NO +CONNECT_TIMEOUT = 30 s +CONNECT_ATTEMPTS = 3 +MAX_OUTSTANDING_CONNECTIONS = 50 +DELETE_FILES = YES + +[ats] +AUTOSTART = YES +PORT = 20048 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-ats +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-ats-37 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +WAN_QUOTA_IN = 65536 +WAN_QUOTA_OUT = 65536 +DUMP_MLP = NO +DUMP_SOLUTION = NO +DUMP_OVERWRITE = NO +DUMP_MIN_PEERS = 0 +DUMP_MIN_ADDRS = 0 +ATS_MIN_INTERVAL = 15000 +ATS_EXEC_INTERVAL = 30000 + +[transport] +PREFIX = valgrind --leak-check=full +#PREFIX = gdb --args +AUTOSTART = YES +PORT = 20047 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-transport +NEIGHBOUR_LIMIT = 50 +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +PLUGINS = http +UNIXPATH = /tmp/test-service-transport-36 +BLACKLIST_FILE = $SERVICEHOME/blacklist +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[transport-tcp] +PORT = 20046 +ADVERTISED_PORT = 20046 +MAX_CONNECTIONS = 128 +TIMEOUT = 5 s +USE_LOCALADDR = YES + +[transport-udp] +PORT = 20045 +BROADCAST = YES +BROADCAST_INTERVAL = 30000 +MAX_BPS = 1000000 +USE_LOCALADDR = YES + +[transport-http] +PORT = 20044 +MAX_CONNECTIONS = 128 + +[transport-https] +PORT = 20043 +CRYPTO_INIT = NORMAL +KEY_FILE = https.key +CERT_FILE = https.cert +MAX_CONNECTIONS = 128 + +[transport-wlan] +INTERFACE = mon0 +TESTMODE = 0 + +[datacache-mysql] +DATABASE = gnunet +CONFIG = ~/.my.cnf + +[datacache-postgres] +CONFIG = connect_timeout=10; dbname=gnunet + +[template] +AUTOSTART = NO +PORT = 20042 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-template +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-template-35 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[fs] +AUTOSTART = YES +INDEXDB = $SERVICEHOME/idxinfo.lst +TRUST = $SERVICEHOME/data/credit/ +IDENTITY_DIR = $SERVICEHOME/identities/ +STATE_DIR = $SERVICEHOME/persistence/ +UPDATE_DIR = $SERVICEHOME/updates/ +PORT = 20041 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-fs +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +DELAY = YES +CONTENT_CACHING = YES +CONTENT_PUSHING = YES +UNIXPATH = /tmp/test-service-fs-34 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES +MAX_PENDING_REQUESTS = 65536 +MIN_MIGRATION_DELAY = 100 ms +EXPECTED_NEIGHBOUR_COUNT = 128 + +[vpn] +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-vpn +IPV6ADDR = 1234::1 +IPV6PREFIX = 32 +IPV4ADDR = 10.11.10.1 +IPV4MASK = 255.255.0.0 +VIRTDNS = 10.11.10.2 +VIRTDNS6 = 1234::17 +IFNAME = vpn-gnunet + +[exit] +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-exit +IPV6ADDR = 1234:1::1 +IPV6PREFIX = 32 +IPV4ADDR = 10.10.1.1 +IPV4MASK = 255.255.0.0 +IFNAME = exit-gnunet +ENABLE_UDP = NO +ENABLE_TCP = NO + +[dns] +AUTOSTART = YES +PORT = 0 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-dns +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-dns-33 +PROVIDE_EXIT = NO + +[arm] +PORT = 20040 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-arm +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +DEFAULTSERVICES = topology hostlist fs core +UNIXPATH = /tmp/test-service-arm-32 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[hostlist] +HTTPPORT = 8080 +HOME = $SERVICEHOME +HOSTLISTFILE = $SERVICEHOME/hostlist/learned.data +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-hostlist +OPTIONS = -b +SERVERS = http://localhost:8080/ +HTTP-PROXY = + +[core] +AUTOSTART = YES +PORT = 20039 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-core +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-core-31 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[nat] +BEHIND_NAT = NO +PUNCHED_NAT = NO +ENABLE_UPNP = NO +USE_LOCALADDR = YES +USE_HOSTNAME = NO +ENABLE_ICMP_CLIENT = NO +ENABLE_ICMP_SERVER = NO +DISABLEV6 = YES +RETURN_LOCAL_ADDRESSES = NO +HOSTNAME_DNS_FREQUENCY = 1200000 +IFC_SCAN_FREQUENCY = 3000000 +DYNDNS_FREQUENCY = 140000 +EXTERNAL_ADDRESS = 127.0.0.1 +INTERNAL_ADDRESS = 127.0.0.1 +BINDTO = 127.0.0.1 + +[gnunet-nat-server] +HOSTNAME = gnunet.org +PORT = 20038 + +[statistics] +AUTOSTART = YES +PORT = 20037 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-statistics +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-statistics-30 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES + +[dht] +AUTOSTART = YES +PORT = 20036 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-dht +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +BUCKET_SIZE = 4 +UNIXPATH = /tmp/test-service-dht-29 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[dhtcache] +DATABASE = sqlite +QUOTA = 1 MB + diff --git a/src/integration-tests/confs/c_no_nat_client_unix.conf b/src/integration-tests/confs/c_no_nat_client_unix.conf new file mode 100644 index 0000000..37c5ad6 --- /dev/null +++ b/src/integration-tests/confs/c_no_nat_client_unix.conf @@ -0,0 +1,366 @@ +[PATHS] +SERVICEHOME = /tmp/c_no_nat_client/ +DEFAULTCONFIG = confs/c_no_nat_client_unix.conf + +[gnunetd] +#HOSTKEY = $SERVICEHOME/.hostkey +HOSTKEY = hostkeys/0001-hostkey + +[gns] +AUTOSTART = NO + +[namestore] +AUTOSTART = NO + +[vpn] +AUTOSTART = YES +PORT = 0 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-dns +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/gnunet-service-vpn-29 + +[resolver] +AUTOSTART = YES +PORT = 20035 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-resolver +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-resolver-28 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = NO + +[mesh] +AUTOSTART = YES +PORT = 20034 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-mesh +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-mesh-27 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[nse] +AUTOSTART = YES +PORT = 20033 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-nse +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-nse-26 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +PROOFFILE = $SERVICEHOME/.nse-proof +HISTOGRAM = $SERVICEHOME/nse-history.log +WORKDELAY = 5 ms +INTERVAL = 1 h +WORKBITS = 26 + +[topology] +MINIMUM-FRIENDS = 0 +FRIENDS-ONLY = NO +AUTOCONNECT = YES +TARGET-CONNECTION-COUNT = 16 +FRIENDS = $SERVICEHOME/friends +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-topology + +[datastore] +AUTOSTART = YES +UNIXPATH = /tmp/test-service-datastore-25 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +PORT = 20032 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-datastore +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +QUOTA = 100 MB +BLOOMFILTER = $SERVICEHOME/fs/bloomfilter +DATABASE = sqlite + +[datastore-sqlite] +FILENAME = $SERVICEHOME/datastore/sqlite.db + +[datastore-postgres] +CONFIG = connect_timeout=10; dbname=gnunet + +[datastore-mysql] +DATABASE = gnunet +CONFIG = ~/.my.cnf + +[peerinfo] +AUTOSTART = YES +PORT = 20031 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-peerinfo +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-peerinfo-24 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES +HOSTS = $SERVICEHOME/data/hosts/ + +[client] +HOME = $SERVICEHOME + +[TESTING] +WEAKRANDOM = NO +CONNECT_TIMEOUT = 30 s +CONNECT_ATTEMPTS = 3 +MAX_OUTSTANDING_CONNECTIONS = 50 +DELETE_FILES = YES + +[ats] +AUTOSTART = YES +PORT = 20030 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-ats +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-ats-23 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +WAN_QUOTA_IN = 65536 +WAN_QUOTA_OUT = 65536 +DUMP_MLP = NO +DUMP_SOLUTION = NO +DUMP_OVERWRITE = NO +DUMP_MIN_PEERS = 0 +DUMP_MIN_ADDRS = 0 +ATS_MIN_INTERVAL = 15000 +ATS_EXEC_INTERVAL = 30000 + +[transport] +PREFIX = valgrind --leak-check=full +#DEBUG = YES +AUTOSTART = YES +PORT = 20029 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-transport +NEIGHBOUR_LIMIT = 50 +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +PLUGINS = unix tcp udp http +UNIXPATH = /tmp/test-service-transport-22 +BLACKLIST_FILE = $SERVICEHOME/blacklist +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[transport-unix] +PORT = 22087 + +[transport-tcp] +USE_LOCALADDR = YES +PORT = 20028 +ADVERTISED_PORT = 20028 +MAX_CONNECTIONS = 128 +TIMEOUT = 5 s + +[transport-udp] +USE_LOCALADDR = YES +PORT = 20027 +BROADCAST = YES +BROADCAST_INTERVAL = 30000 +MAX_BPS = 1000000 + +[transport-http] +PORT = 0 +MAX_CONNECTIONS = 128 + +[transport-https] +PORT = 20025 +CRYPTO_INIT = NORMAL +KEY_FILE = https.key +CERT_FILE = https.cert +MAX_CONNECTIONS = 128 + +[transport-wlan] +INTERFACE = mon0 +TESTMODE = 0 + +[datacache-mysql] +DATABASE = gnunet +CONFIG = ~/.my.cnf + +[datacache-postgres] +CONFIG = connect_timeout=10; dbname=gnunet + +[template] +AUTOSTART = NO +PORT = 20024 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-template +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-template-21 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[fs] +AUTOSTART = YES +INDEXDB = $SERVICEHOME/idxinfo.lst +TRUST = $SERVICEHOME/data/credit/ +IDENTITY_DIR = $SERVICEHOME/identities/ +STATE_DIR = $SERVICEHOME/persistence/ +UPDATE_DIR = $SERVICEHOME/updates/ +PORT = 20023 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-fs +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +DELAY = YES +CONTENT_CACHING = YES +CONTENT_PUSHING = YES +UNIXPATH = /tmp/test-service-fs-20 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES +MAX_PENDING_REQUESTS = 65536 +MIN_MIGRATION_DELAY = 100 ms +EXPECTED_NEIGHBOUR_COUNT = 128 + +[vpn] +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-vpn +IPV6ADDR = 1234::1 +IPV6PREFIX = 32 +IPV4ADDR = 10.11.10.1 +IPV4MASK = 255.255.0.0 +VIRTDNS = 10.11.10.2 +VIRTDNS6 = 1234::17 +IFNAME = vpn-gnunet + +[exit] +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-exit +IPV6ADDR = 1234:1::1 +IPV6PREFIX = 32 +IPV4ADDR = 10.10.1.1 +IPV4MASK = 255.255.0.0 +IFNAME = exit-gnunet +ENABLE_UDP = NO +ENABLE_TCP = NO + +[dns] +AUTOSTART = YES +PORT = 0 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-dns +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-dns-19 +PROVIDE_EXIT = NO + +[arm] +PORT = 20022 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-arm +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +DEFAULTSERVICES = topology hostlist fs core +UNIXPATH = /tmp/test-service-arm-18 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[hostlist] +HTTPPORT = 8080 +HOME = $SERVICEHOME +HOSTLISTFILE = $SERVICEHOME/hostlist/learned.data +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-hostlist +OPTIONS = -b +SERVERS = http://localhost:8080/ +HTTP-PROXY = + +[core] +AUTOSTART = YES +PORT = 20021 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-core +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-core-17 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[nat] +EXTERNAL_ADDRESS = 127.0.0.1 +INTERNAL_ADDRESS = 127.0.0.1 +BINDTO = 127.0.0.1 +BEHIND_NAT = NO +PUNCHED_NAT = NO +ENABLE_UPNP = NO +USE_LOCALADDR = YES +USE_HOSTNAME = NO +ENABLE_ICMP_CLIENT = NO +ENABLE_ICMP_SERVER = NO +DISABLEV6 = YES +RETURN_LOCAL_ADDRESSES = NO +HOSTNAME_DNS_FREQUENCY = 1200000 +IFC_SCAN_FREQUENCY = 3000000 +DYNDNS_FREQUENCY = 140000 + +[gnunet-nat-server] +HOSTNAME = gnunet.org +PORT = 20020 + +[statistics] +AUTOSTART = YES +PORT = 20019 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-statistics +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-statistics-16 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES + +[dht] +AUTOSTART = YES +PORT = 20018 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-dht +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +BUCKET_SIZE = 4 +UNIXPATH = /tmp/test-service-dht-15 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[dhtcache] +DATABASE = sqlite +QUOTA = 1 MB + diff --git a/src/integration-tests/confs/c_no_nat_client_unix_2.conf b/src/integration-tests/confs/c_no_nat_client_unix_2.conf new file mode 100644 index 0000000..6bf8e8b --- /dev/null +++ b/src/integration-tests/confs/c_no_nat_client_unix_2.conf @@ -0,0 +1,355 @@ +[PATHS] +SERVICEHOME = /tmp/c_no_nat_client_2/ +DEFAULTCONFIG = confs/c_no_nat_client_unix_2.conf + +[gnunetd] +#HOSTKEY = $SERVICEHOME/.hostkey +HOSTKEY = hostkeys/0002-hostkey + +[gns] +AUTOSTART = NO + +[namestore] +AUTOSTART = NO + +[resolver] +AUTOSTART = YES +PORT = 20053 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-resolver +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-resolver-42 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = NO + +[mesh] +AUTOSTART = YES +PORT = 20052 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-mesh +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-mesh-41 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[nse] +AUTOSTART = YES +PORT = 20051 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-nse +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-nse-40 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +PROOFFILE = $SERVICEHOME/.nse-proof +HISTOGRAM = $SERVICEHOME/nse-history.log +WORKDELAY = 5 ms +INTERVAL = 1 h +WORKBITS = 26 + +[topology] +MINIMUM-FRIENDS = 0 +FRIENDS-ONLY = NO +AUTOCONNECT = YES +TARGET-CONNECTION-COUNT = 16 +FRIENDS = $SERVICEHOME/friends +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-topology + +[datastore] +AUTOSTART = YES +UNIXPATH = /tmp/test-service-datastore-39 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +PORT = 20050 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-datastore +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +QUOTA = 100 MB +BLOOMFILTER = $SERVICEHOME/fs/bloomfilter +DATABASE = sqlite + +[datastore-sqlite] +FILENAME = $SERVICEHOME/datastore/sqlite.db + +[datastore-postgres] +CONFIG = connect_timeout=10; dbname=gnunet + +[datastore-mysql] +DATABASE = gnunet +CONFIG = ~/.my.cnf + +[peerinfo] +AUTOSTART = YES +PORT = 20049 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-peerinfo +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-peerinfo-38 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES +HOSTS = $SERVICEHOME/data/hosts/ + +[client] +HOME = $SERVICEHOME + +[TESTING] +WEAKRANDOM = NO +CONNECT_TIMEOUT = 30 s +CONNECT_ATTEMPTS = 3 +MAX_OUTSTANDING_CONNECTIONS = 50 +DELETE_FILES = YES + +[ats] +AUTOSTART = YES +PORT = 20048 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-ats +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-ats-37 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +WAN_QUOTA_IN = 65536 +WAN_QUOTA_OUT = 65536 +DUMP_MLP = NO +DUMP_SOLUTION = NO +DUMP_OVERWRITE = NO +DUMP_MIN_PEERS = 0 +DUMP_MIN_ADDRS = 0 +ATS_MIN_INTERVAL = 15000 +ATS_EXEC_INTERVAL = 30000 + +[transport] +PREFIX = valgrind --leak-check=full +#PREFIX = gdb --args +AUTOSTART = YES +PORT = 20047 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-transport +NEIGHBOUR_LIMIT = 50 +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +PLUGINS = unix tcp udp http +UNIXPATH = /tmp/test-service-transport-36 +BLACKLIST_FILE = $SERVICEHOME/blacklist +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[transport-unix] +PORT = 22086 + +[transport-tcp] +PORT = 20046 +ADVERTISED_PORT = 20046 +MAX_CONNECTIONS = 128 +TIMEOUT = 5 s +USE_LOCALADDR = YES + +[transport-udp] +PORT = 20045 +BROADCAST = YES +BROADCAST_INTERVAL = 30000 +MAX_BPS = 1000000 +USE_LOCALADDR = YES + +[transport-http] +PORT = 20044 +MAX_CONNECTIONS = 128 + +[transport-https] +PORT = 20043 +CRYPTO_INIT = NORMAL +KEY_FILE = https.key +CERT_FILE = https.cert +MAX_CONNECTIONS = 128 + +[transport-wlan] +INTERFACE = mon0 +TESTMODE = 0 + +[datacache-mysql] +DATABASE = gnunet +CONFIG = ~/.my.cnf + +[datacache-postgres] +CONFIG = connect_timeout=10; dbname=gnunet + +[template] +AUTOSTART = NO +PORT = 20042 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-template +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-template-35 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[fs] +AUTOSTART = YES +INDEXDB = $SERVICEHOME/idxinfo.lst +TRUST = $SERVICEHOME/data/credit/ +IDENTITY_DIR = $SERVICEHOME/identities/ +STATE_DIR = $SERVICEHOME/persistence/ +UPDATE_DIR = $SERVICEHOME/updates/ +PORT = 20041 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-fs +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +DELAY = YES +CONTENT_CACHING = YES +CONTENT_PUSHING = YES +UNIXPATH = /tmp/test-service-fs-34 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES +MAX_PENDING_REQUESTS = 65536 +MIN_MIGRATION_DELAY = 100 ms +EXPECTED_NEIGHBOUR_COUNT = 128 + +[vpn] +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-vpn +IPV6ADDR = 1234::1 +IPV6PREFIX = 32 +IPV4ADDR = 10.11.10.1 +IPV4MASK = 255.255.0.0 +VIRTDNS = 10.11.10.2 +VIRTDNS6 = 1234::17 +IFNAME = vpn-gnunet + +[exit] +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-exit +IPV6ADDR = 1234:1::1 +IPV6PREFIX = 32 +IPV4ADDR = 10.10.1.1 +IPV4MASK = 255.255.0.0 +IFNAME = exit-gnunet +ENABLE_UDP = NO +ENABLE_TCP = NO + +[dns] +AUTOSTART = YES +PORT = 0 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-dns +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-dns-33 +PROVIDE_EXIT = NO + +[arm] +PORT = 20040 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-arm +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +DEFAULTSERVICES = topology hostlist fs core +UNIXPATH = /tmp/test-service-arm-32 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[hostlist] +HTTPPORT = 8080 +HOME = $SERVICEHOME +HOSTLISTFILE = $SERVICEHOME/hostlist/learned.data +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-hostlist +OPTIONS = -b +SERVERS = http://localhost:8080/ +HTTP-PROXY = + +[core] +AUTOSTART = YES +PORT = 20039 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-core +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-core-31 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[nat] +BEHIND_NAT = NO +PUNCHED_NAT = NO +ENABLE_UPNP = NO +USE_LOCALADDR = YES +USE_HOSTNAME = NO +ENABLE_ICMP_CLIENT = NO +ENABLE_ICMP_SERVER = NO +DISABLEV6 = YES +RETURN_LOCAL_ADDRESSES = NO +HOSTNAME_DNS_FREQUENCY = 1200000 +IFC_SCAN_FREQUENCY = 3000000 +DYNDNS_FREQUENCY = 140000 +EXTERNAL_ADDRESS = 127.0.0.1 +INTERNAL_ADDRESS = 127.0.0.1 +BINDTO = 127.0.0.1 + +[gnunet-nat-server] +HOSTNAME = gnunet.org +PORT = 20038 + +[statistics] +AUTOSTART = YES +PORT = 20037 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-statistics +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-statistics-30 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES + +[dht] +AUTOSTART = YES +PORT = 20036 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-dht +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +BUCKET_SIZE = 4 +UNIXPATH = /tmp/test-service-dht-29 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[dhtcache] +DATABASE = sqlite +QUOTA = 1 MB + diff --git a/src/integration-tests/confs/c_normal_client_tcp.conf b/src/integration-tests/confs/c_normal_client_tcp.conf new file mode 100644 index 0000000..45acdaf --- /dev/null +++ b/src/integration-tests/confs/c_normal_client_tcp.conf @@ -0,0 +1,360 @@ +[PATHS] +SERVICEHOME = /tmp/c_normal_client +DEFAULTCONFIG = confs/c_normal_client_tcp.conf + +[gnunetd] +HOSTKEY = hostkeys/0002-hostkey + +[client] +HOME = $SERVICEHOME + +[gns] +AUTOSTART = NO + +[namestore] +AUTOSTART = NO + +[vpn] +AUTOSTART = YES +PORT = 0 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-dns +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/gnunet-service-vpn-57 + + +[resolver] +AUTOSTART = YES +PORT = 20071 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-resolver +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-resolver-56 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = NO + +[mesh] +AUTOSTART = YES +PORT = 20070 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-mesh +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-mesh-55 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[nse] +AUTOSTART = YES +PORT = 20069 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-nse +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-nse-54 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +PROOFFILE = $SERVICEHOME/.nse-proof +HISTOGRAM = $SERVICEHOME/nse-history.log +WORKDELAY = 5 ms +INTERVAL = 1 h +WORKBITS = 26 + +[topology] +MINIMUM-FRIENDS = 0 +FRIENDS-ONLY = NO +AUTOCONNECT = YES +TARGET-CONNECTION-COUNT = 16 +FRIENDS = $SERVICEHOME/friends +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-topology + +[datastore] +AUTOSTART = YES +UNIXPATH = /tmp/test-service-datastore-53 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +PORT = 20068 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-datastore +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +QUOTA = 100 MB +BLOOMFILTER = $SERVICEHOME/fs/bloomfilter +DATABASE = sqlite + +[datastore-sqlite] +FILENAME = $SERVICEHOME/datastore/sqlite.db + +[datastore-postgres] +CONFIG = connect_timeout=10; dbname=gnunet + +[datastore-mysql] +DATABASE = gnunet +CONFIG = ~/.my.cnf + +[peerinfo] +AUTOSTART = YES +PORT = 20067 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-peerinfo +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-peerinfo-52 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES +HOSTS = $SERVICEHOME/data/hosts/ + +[TESTING] +WEAKRANDOM = NO +CONNECT_TIMEOUT = 30 s +CONNECT_ATTEMPTS = 3 +MAX_OUTSTANDING_CONNECTIONS = 50 +DELETE_FILES = YES + +[ats] +AUTOSTART = YES +PORT = 20066 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-ats +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-ats-51 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +WAN_QUOTA_IN = 65536 +WAN_QUOTA_OUT = 65536 +DUMP_MLP = NO +DUMP_SOLUTION = NO +DUMP_OVERWRITE = NO +DUMP_MIN_PEERS = 0 +DUMP_MIN_ADDRS = 0 +ATS_MIN_INTERVAL = 15000 +ATS_EXEC_INTERVAL = 30000 + +[transport] +AUTOSTART = YES +PORT = 20065 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-transport +NEIGHBOUR_LIMIT = 50 +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +PLUGINS = tcp +UNIXPATH = /tmp/test-service-transport-50 +BLACKLIST_FILE = $SERVICEHOME/blacklist +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[transport-tcp] +PORT = 0 +ADVERTISED_PORT = 20064 +MAX_CONNECTIONS = 128 +TIMEOUT = 5 s +USE_LOCALADDR = YES + +[transport-udp] +PORT = 0 +BROADCAST = YES +BROADCAST_INTERVAL = 30000 +MAX_BPS = 1000000 +USE_LOCALADDR = YES + +[transport-http] +PORT = 0 +MAX_CONNECTIONS = 128 + +[transport-https] +PORT = 0 +CRYPTO_INIT = NORMAL +KEY_FILE = https.key +CERT_FILE = https.cert +MAX_CONNECTIONS = 128 + +[transport-wlan] +INTERFACE = mon0 +TESTMODE = 0 + +[datacache-mysql] +DATABASE = gnunet +CONFIG = ~/.my.cnf + +[datacache-postgres] +CONFIG = connect_timeout=10; dbname=gnunet + +[template] +AUTOSTART = NO +PORT = 20060 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-template +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-template-49 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[fs] +AUTOSTART = YES +INDEXDB = $SERVICEHOME/idxinfo.lst +TRUST = $SERVICEHOME/data/credit/ +IDENTITY_DIR = $SERVICEHOME/identities/ +STATE_DIR = $SERVICEHOME/persistence/ +UPDATE_DIR = $SERVICEHOME/updates/ +PORT = 20059 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-fs +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +DELAY = YES +CONTENT_CACHING = YES +CONTENT_PUSHING = YES +UNIXPATH = /tmp/test-service-fs-48 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES +MAX_PENDING_REQUESTS = 65536 +MIN_MIGRATION_DELAY = 100 ms +EXPECTED_NEIGHBOUR_COUNT = 128 + +[vpn] +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-vpn +IPV6ADDR = 1234::1 +IPV6PREFIX = 32 +IPV4ADDR = 10.11.10.1 +IPV4MASK = 255.255.0.0 +VIRTDNS = 10.11.10.2 +VIRTDNS6 = 1234::17 +IFNAME = vpn-gnunet + +[exit] +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-exit +IPV6ADDR = 1234:1::1 +IPV6PREFIX = 32 +IPV4ADDR = 10.10.1.1 +IPV4MASK = 255.255.0.0 +IFNAME = exit-gnunet +ENABLE_UDP = NO +ENABLE_TCP = NO + +[dns] +AUTOSTART = YES +PORT = 0 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-dns +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-dns-47 +PROVIDE_EXIT = NO + +[arm] +PORT = 20058 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-arm +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +DEFAULTSERVICES = topology hostlist fs +UNIXPATH = /tmp/test-service-arm-46 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[hostlist] +HTTPPORT = 8080 +HOME = $SERVICEHOME +HOSTLISTFILE = $SERVICEHOME/hostlist/learned.data +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-hostlist +OPTIONS = -b +SERVERS = http://v9.gnunet.org/hostlist http://ioerror.gnunet.org:65535/ +HTTP-PROXY = + +[core] +AUTOSTART = YES +PORT = 20057 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-core +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-core-45 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[nat] +BEHIND_NAT = YES +PUNCHED_NAT = NO +ENABLE_UPNP = NO +USE_LOCALADDR = YES +USE_HOSTNAME = NO +ENABLE_ICMP_CLIENT = NO +ENABLE_ICMP_SERVER = NO +DISABLEV6 = YES +RETURN_LOCAL_ADDRESSES = NO +HOSTNAME_DNS_FREQUENCY = 1200000 +IFC_SCAN_FREQUENCY = 3000000 +DYNDNS_FREQUENCY = 140000 +EXTERNAL_ADDRESS = 127.0.0.1 +INTERNAL_ADDRESS = 127.0.0.1 +BINDTO = 127.0.0.1 + +[gnunet-nat-server] +HOSTNAME = gnunet.org +PORT = 20056 + +[statistics] +AUTOSTART = YES +PORT = 20055 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-statistics +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-statistics-44 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES + +[dht] +AUTOSTART = YES +PORT = 20054 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-dht +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +BUCKET_SIZE = 4 +UNIXPATH = /tmp/test-service-dht-43 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[dhtcache] +DATABASE = sqlite +QUOTA = 1 MB
\ No newline at end of file diff --git a/src/integration-tests/confs/c_normal_client_tcp_udp.conf b/src/integration-tests/confs/c_normal_client_tcp_udp.conf new file mode 100644 index 0000000..e568f12 --- /dev/null +++ b/src/integration-tests/confs/c_normal_client_tcp_udp.conf @@ -0,0 +1,360 @@ +[PATHS] +SERVICEHOME = /tmp/c_normal_client +DEFAULTCONFIG = confs/c_normal_client_tcp_udp.conf + +[gnunetd] +HOSTKEY = hostkeys/0002-hostkey + +[client] +HOME = $SERVICEHOME + +[gns] +AUTOSTART = NO + +[namestore] +AUTOSTART = NO + +[vpn] +AUTOSTART = YES +PORT = 0 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-dns +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/gnunet-service-vpn-57 + + +[resolver] +AUTOSTART = YES +PORT = 20071 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-resolver +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-resolver-56 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = NO + +[mesh] +AUTOSTART = YES +PORT = 20070 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-mesh +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-mesh-55 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[nse] +AUTOSTART = YES +PORT = 20069 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-nse +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-nse-54 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +PROOFFILE = $SERVICEHOME/.nse-proof +HISTOGRAM = $SERVICEHOME/nse-history.log +WORKDELAY = 5 ms +INTERVAL = 1 h +WORKBITS = 26 + +[topology] +MINIMUM-FRIENDS = 0 +FRIENDS-ONLY = NO +AUTOCONNECT = YES +TARGET-CONNECTION-COUNT = 16 +FRIENDS = $SERVICEHOME/friends +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-topology + +[datastore] +AUTOSTART = YES +UNIXPATH = /tmp/test-service-datastore-53 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +PORT = 20068 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-datastore +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +QUOTA = 100 MB +BLOOMFILTER = $SERVICEHOME/fs/bloomfilter +DATABASE = sqlite + +[datastore-sqlite] +FILENAME = $SERVICEHOME/datastore/sqlite.db + +[datastore-postgres] +CONFIG = connect_timeout=10; dbname=gnunet + +[datastore-mysql] +DATABASE = gnunet +CONFIG = ~/.my.cnf + +[peerinfo] +AUTOSTART = YES +PORT = 20067 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-peerinfo +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-peerinfo-52 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES +HOSTS = $SERVICEHOME/data/hosts/ + +[TESTING] +WEAKRANDOM = NO +CONNECT_TIMEOUT = 30 s +CONNECT_ATTEMPTS = 3 +MAX_OUTSTANDING_CONNECTIONS = 50 +DELETE_FILES = YES + +[ats] +AUTOSTART = YES +PORT = 20066 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-ats +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-ats-51 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +WAN_QUOTA_IN = 65536 +WAN_QUOTA_OUT = 65536 +DUMP_MLP = NO +DUMP_SOLUTION = NO +DUMP_OVERWRITE = NO +DUMP_MIN_PEERS = 0 +DUMP_MIN_ADDRS = 0 +ATS_MIN_INTERVAL = 15000 +ATS_EXEC_INTERVAL = 30000 + +[transport] +AUTOSTART = YES +PORT = 20065 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-transport +NEIGHBOUR_LIMIT = 50 +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +PLUGINS = tcp udp +UNIXPATH = /tmp/test-service-transport-50 +BLACKLIST_FILE = $SERVICEHOME/blacklist +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[transport-tcp] +PORT = 0 +ADVERTISED_PORT = 20064 +MAX_CONNECTIONS = 128 +TIMEOUT = 5 s +USE_LOCALADDR = YES + +[transport-udp] +PORT = 0 +BROADCAST = YES +BROADCAST_INTERVAL = 30000 +MAX_BPS = 1000000 +USE_LOCALADDR = YES + +[transport-http] +PORT = 0 +MAX_CONNECTIONS = 128 + +[transport-https] +PORT = 0 +CRYPTO_INIT = NORMAL +KEY_FILE = https.key +CERT_FILE = https.cert +MAX_CONNECTIONS = 128 + +[transport-wlan] +INTERFACE = mon0 +TESTMODE = 0 + +[datacache-mysql] +DATABASE = gnunet +CONFIG = ~/.my.cnf + +[datacache-postgres] +CONFIG = connect_timeout=10; dbname=gnunet + +[template] +AUTOSTART = NO +PORT = 20060 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-template +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-template-49 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[fs] +AUTOSTART = YES +INDEXDB = $SERVICEHOME/idxinfo.lst +TRUST = $SERVICEHOME/data/credit/ +IDENTITY_DIR = $SERVICEHOME/identities/ +STATE_DIR = $SERVICEHOME/persistence/ +UPDATE_DIR = $SERVICEHOME/updates/ +PORT = 20059 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-fs +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +DELAY = YES +CONTENT_CACHING = YES +CONTENT_PUSHING = YES +UNIXPATH = /tmp/test-service-fs-48 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES +MAX_PENDING_REQUESTS = 65536 +MIN_MIGRATION_DELAY = 100 ms +EXPECTED_NEIGHBOUR_COUNT = 128 + +[vpn] +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-vpn +IPV6ADDR = 1234::1 +IPV6PREFIX = 32 +IPV4ADDR = 10.11.10.1 +IPV4MASK = 255.255.0.0 +VIRTDNS = 10.11.10.2 +VIRTDNS6 = 1234::17 +IFNAME = vpn-gnunet + +[exit] +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-exit +IPV6ADDR = 1234:1::1 +IPV6PREFIX = 32 +IPV4ADDR = 10.10.1.1 +IPV4MASK = 255.255.0.0 +IFNAME = exit-gnunet +ENABLE_UDP = NO +ENABLE_TCP = NO + +[dns] +AUTOSTART = YES +PORT = 0 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-dns +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-dns-47 +PROVIDE_EXIT = NO + +[arm] +PORT = 20058 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-arm +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +DEFAULTSERVICES = topology hostlist fs +UNIXPATH = /tmp/test-service-arm-46 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[hostlist] +HTTPPORT = 8080 +HOME = $SERVICEHOME +HOSTLISTFILE = $SERVICEHOME/hostlist/learned.data +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-hostlist +OPTIONS = -b +SERVERS = http://v9.gnunet.org/hostlist http://ioerror.gnunet.org:65535/ +HTTP-PROXY = + +[core] +AUTOSTART = YES +PORT = 20057 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-core +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-core-45 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[nat] +BEHIND_NAT = YES +PUNCHED_NAT = NO +ENABLE_UPNP = NO +USE_LOCALADDR = YES +USE_HOSTNAME = NO +ENABLE_ICMP_CLIENT = NO +ENABLE_ICMP_SERVER = NO +DISABLEV6 = YES +RETURN_LOCAL_ADDRESSES = NO +HOSTNAME_DNS_FREQUENCY = 1200000 +IFC_SCAN_FREQUENCY = 3000000 +DYNDNS_FREQUENCY = 140000 +EXTERNAL_ADDRESS = 127.0.0.1 +INTERNAL_ADDRESS = 127.0.0.1 +BINDTO = 127.0.0.1 + +[gnunet-nat-server] +HOSTNAME = gnunet.org +PORT = 20056 + +[statistics] +AUTOSTART = YES +PORT = 20055 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-statistics +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-statistics-44 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES + +[dht] +AUTOSTART = YES +PORT = 20054 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-dht +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +BUCKET_SIZE = 4 +UNIXPATH = /tmp/test-service-dht-43 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[dhtcache] +DATABASE = sqlite +QUOTA = 1 MB
\ No newline at end of file diff --git a/src/integration-tests/confs/c_normal_client_tcp_udp_http.conf b/src/integration-tests/confs/c_normal_client_tcp_udp_http.conf new file mode 100644 index 0000000..93275bf --- /dev/null +++ b/src/integration-tests/confs/c_normal_client_tcp_udp_http.conf @@ -0,0 +1,360 @@ +[PATHS] +SERVICEHOME = /tmp/c_normal_client +DEFAULTCONFIG = confs/c_normal_client_tcp_udp_http.conf + +[gnunetd] +HOSTKEY = hostkeys/0002-hostkey + +[client] +HOME = $SERVICEHOME + +[gns] +AUTOSTART = NO + +[namestore] +AUTOSTART = NO + +[vpn] +AUTOSTART = YES +PORT = 0 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-dns +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/gnunet-service-vpn-57 + + +[resolver] +AUTOSTART = YES +PORT = 20071 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-resolver +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-resolver-56 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = NO + +[mesh] +AUTOSTART = YES +PORT = 20070 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-mesh +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-mesh-55 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[nse] +AUTOSTART = YES +PORT = 20069 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-nse +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-nse-54 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +PROOFFILE = $SERVICEHOME/.nse-proof +HISTOGRAM = $SERVICEHOME/nse-history.log +WORKDELAY = 5 ms +INTERVAL = 1 h +WORKBITS = 26 + +[topology] +MINIMUM-FRIENDS = 0 +FRIENDS-ONLY = NO +AUTOCONNECT = YES +TARGET-CONNECTION-COUNT = 16 +FRIENDS = $SERVICEHOME/friends +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-topology + +[datastore] +AUTOSTART = YES +UNIXPATH = /tmp/test-service-datastore-53 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +PORT = 20068 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-datastore +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +QUOTA = 100 MB +BLOOMFILTER = $SERVICEHOME/fs/bloomfilter +DATABASE = sqlite + +[datastore-sqlite] +FILENAME = $SERVICEHOME/datastore/sqlite.db + +[datastore-postgres] +CONFIG = connect_timeout=10; dbname=gnunet + +[datastore-mysql] +DATABASE = gnunet +CONFIG = ~/.my.cnf + +[peerinfo] +AUTOSTART = YES +PORT = 20067 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-peerinfo +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-peerinfo-52 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES +HOSTS = $SERVICEHOME/data/hosts/ + +[TESTING] +WEAKRANDOM = NO +CONNECT_TIMEOUT = 30 s +CONNECT_ATTEMPTS = 3 +MAX_OUTSTANDING_CONNECTIONS = 50 +DELETE_FILES = YES + +[ats] +AUTOSTART = YES +PORT = 20066 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-ats +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-ats-51 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES +WAN_QUOTA_IN = 65536 +WAN_QUOTA_OUT = 65536 +DUMP_MLP = NO +DUMP_SOLUTION = NO +DUMP_OVERWRITE = NO +DUMP_MIN_PEERS = 0 +DUMP_MIN_ADDRS = 0 +ATS_MIN_INTERVAL = 15000 +ATS_EXEC_INTERVAL = 30000 + +[transport] +AUTOSTART = YES +PORT = 20065 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-transport +NEIGHBOUR_LIMIT = 50 +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +PLUGINS = tcp udp http +UNIXPATH = /tmp/test-service-transport-50 +BLACKLIST_FILE = $SERVICEHOME/blacklist +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[transport-tcp] +PORT = 0 +ADVERTISED_PORT = 20064 +MAX_CONNECTIONS = 128 +TIMEOUT = 5 s +USE_LOCALADDR = YES + +[transport-udp] +PORT = 0 +BROADCAST = YES +BROADCAST_INTERVAL = 30000 +MAX_BPS = 1000000 +USE_LOCALADDR = YES + +[transport-http] +PORT = 0 +MAX_CONNECTIONS = 128 + +[transport-https] +PORT = 0 +CRYPTO_INIT = NORMAL +KEY_FILE = https.key +CERT_FILE = https.cert +MAX_CONNECTIONS = 128 + +[transport-wlan] +INTERFACE = mon0 +TESTMODE = 0 + +[datacache-mysql] +DATABASE = gnunet +CONFIG = ~/.my.cnf + +[datacache-postgres] +CONFIG = connect_timeout=10; dbname=gnunet + +[template] +AUTOSTART = NO +PORT = 20060 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-template +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-template-49 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[fs] +AUTOSTART = YES +INDEXDB = $SERVICEHOME/idxinfo.lst +TRUST = $SERVICEHOME/data/credit/ +IDENTITY_DIR = $SERVICEHOME/identities/ +STATE_DIR = $SERVICEHOME/persistence/ +UPDATE_DIR = $SERVICEHOME/updates/ +PORT = 20059 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-fs +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +DELAY = YES +CONTENT_CACHING = YES +CONTENT_PUSHING = YES +UNIXPATH = /tmp/test-service-fs-48 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES +MAX_PENDING_REQUESTS = 65536 +MIN_MIGRATION_DELAY = 100 ms +EXPECTED_NEIGHBOUR_COUNT = 128 + +[vpn] +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-vpn +IPV6ADDR = 1234::1 +IPV6PREFIX = 32 +IPV4ADDR = 10.11.10.1 +IPV4MASK = 255.255.0.0 +VIRTDNS = 10.11.10.2 +VIRTDNS6 = 1234::17 +IFNAME = vpn-gnunet + +[exit] +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-exit +IPV6ADDR = 1234:1::1 +IPV6PREFIX = 32 +IPV4ADDR = 10.10.1.1 +IPV4MASK = 255.255.0.0 +IFNAME = exit-gnunet +ENABLE_UDP = NO +ENABLE_TCP = NO + +[dns] +AUTOSTART = YES +PORT = 0 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-dns +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-dns-47 +PROVIDE_EXIT = NO + +[arm] +PORT = 20058 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-arm +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +DEFAULTSERVICES = topology hostlist fs +UNIXPATH = /tmp/test-service-arm-46 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[hostlist] +HTTPPORT = 8080 +HOME = $SERVICEHOME +HOSTLISTFILE = $SERVICEHOME/hostlist/learned.data +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-daemon-hostlist +OPTIONS = -b +SERVERS = http://v9.gnunet.org/hostlist http://ioerror.gnunet.org:65535/ +HTTP-PROXY = + +[core] +AUTOSTART = YES +PORT = 20057 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-core +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-core-45 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[nat] +BEHIND_NAT = YES +PUNCHED_NAT = NO +ENABLE_UPNP = NO +USE_LOCALADDR = YES +USE_HOSTNAME = NO +ENABLE_ICMP_CLIENT = NO +ENABLE_ICMP_SERVER = NO +DISABLEV6 = YES +RETURN_LOCAL_ADDRESSES = NO +HOSTNAME_DNS_FREQUENCY = 1200000 +IFC_SCAN_FREQUENCY = 3000000 +DYNDNS_FREQUENCY = 140000 +EXTERNAL_ADDRESS = 127.0.0.1 +INTERNAL_ADDRESS = 127.0.0.1 +BINDTO = 127.0.0.1 + +[gnunet-nat-server] +HOSTNAME = gnunet.org +PORT = 20056 + +[statistics] +AUTOSTART = YES +PORT = 20055 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-statistics +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +UNIXPATH = /tmp/test-service-statistics-44 +UNIX_MATCH_UID = NO +UNIX_MATCH_GID = YES + +[dht] +AUTOSTART = YES +PORT = 20054 +HOSTNAME = localhost +HOME = $SERVICEHOME +CONFIG = $DEFAULTCONFIG +BINARY = gnunet-service-dht +ACCEPT_FROM = 127.0.0.1; +ACCEPT_FROM6 = ::1; +BUCKET_SIZE = 4 +UNIXPATH = /tmp/test-service-dht-43 +UNIX_MATCH_UID = YES +UNIX_MATCH_GID = YES + +[dhtcache] +DATABASE = sqlite +QUOTA = 1 MB
\ No newline at end of file diff --git a/src/integration-tests/connection_watchdog.c b/src/integration-tests/connection_watchdog.c new file mode 100644 index 0000000..ac19338 --- /dev/null +++ b/src/integration-tests/connection_watchdog.c @@ -0,0 +1,1099 @@ +/* + This file is part of GNUnet. + (C) 2009, 2010 Christian Grothoff (and other contributing authors) + + GNUnet is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3, or (at your + option) any later version. + + GNUnet is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNUnet; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ +/** + * @file integration-tests/connection_watchdog.c + * @brief tool to monitor core and transport connections for consistency + * @author Matthias Wachs + */ +#include "platform.h" +#include "gnunet_common.h" +#include "gnunet_constants.h" +#include "gnunet_arm_service.h" +#include "gnunet_core_service.h" +#include "gnunet_getopt_lib.h" +#include "gnunet_os_lib.h" +#include "gnunet_program_lib.h" +#include "gnunet_scheduler_lib.h" +#include "gnunet_transport_service.h" +#include "gnunet_statistics_service.h" + + +#define CHECK_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) +#define STATS_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) +#define REPEATED_STATS_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) +#define STATS_VALUES 4 + +/** + * Final status code. + */ +static int ret; +static int ping; + +static int have_tcp; +static int have_udp; +static int have_http; +static int have_https; +static int have_unix; + +static struct GNUNET_TRANSPORT_Handle *th; +static struct GNUNET_CORE_Handle *ch; +static struct GNUNET_PeerIdentity my_peer_id; +static const struct GNUNET_CONFIGURATION_Handle *mycfg; +static struct GNUNET_STATISTICS_Handle *stats; + + +static unsigned int transport_connections; +static unsigned int core_connections; + +static GNUNET_SCHEDULER_TaskIdentifier check_task; +static GNUNET_SCHEDULER_TaskIdentifier statistics_task; + +static uint64_t statistics_transport_connections; +static uint64_t statistics_transport_tcp_connections; +static uint64_t statistics_core_neighbour_entries; +static uint64_t statistics_core_entries_session_map; + +int stat_check_running; + +static struct GNUNET_CONTAINER_MultiHashMap *peers; + +struct PeerContainer +{ + struct GNUNET_PeerIdentity id; + int transport_connected; + int core_connected; + struct GNUNET_TRANSPORT_TransmitHandle *th_ping; + struct GNUNET_CORE_TransmitHandle *ch_ping; + + struct GNUNET_TRANSPORT_TransmitHandle *th_pong; + struct GNUNET_CORE_TransmitHandle *ch_pong; +}; + + +enum protocol +{ + tcp, + udp, + unixdomain +}; + +struct TransportPlugin +{ + /** + * This is a doubly-linked list. + */ + struct TransportPlugin *next; + + /** + * This is a doubly-linked list. + */ + struct TransportPlugin *prev; + + /** + * Short name for the plugin (i.e. "tcp"). + */ + char *short_name; + + int port; + + int protocol; +}; + +struct TransportPlugin *phead; +struct TransportPlugin *ptail; + +static int +map_check_it (void *cls, + const GNUNET_HashCode * key, + void *value) +{ + int *fail = cls; + struct PeerContainer *pc = value; + if (pc->core_connected != pc->transport_connected) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Inconsistent peer `%s': TRANSPORT %s <-> CORE %s\n", + GNUNET_i2s (&pc->id), + (GNUNET_YES == pc->transport_connected) ? "YES" : "NO", + (GNUNET_YES == pc->core_connected) ? "YES" : "NO"); + (*fail) ++; + } + + return GNUNET_OK; +} + + +static int +map_cleanup_it (void *cls, + const GNUNET_HashCode * key, + void *value) +{ + struct PeerContainer *pc = value; + GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multihashmap_remove(peers, key, value)); + if (NULL != pc->th_ping) + { + GNUNET_TRANSPORT_notify_transmit_ready_cancel(pc->th_ping); + pc->th_ping = NULL; + } + if (NULL != pc->th_pong) + { + GNUNET_TRANSPORT_notify_transmit_ready_cancel(pc->th_pong); + pc->th_pong = NULL; + } + if (NULL != pc->ch_ping) + { + GNUNET_CORE_notify_transmit_ready_cancel (pc->ch_ping); + pc->ch_ping = NULL; + } + if (NULL != pc->ch_pong) + { + GNUNET_CORE_notify_transmit_ready_cancel(pc->ch_pong); + pc->ch_pong = NULL; + } + GNUNET_free (pc); + return GNUNET_OK; +} + +static void +map_cleanup (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) +{ + GNUNET_CONTAINER_multihashmap_iterate (peers, &map_cleanup_it, NULL); + GNUNET_CONTAINER_multihashmap_destroy(peers); +} + +static void +map_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) +{ + int fail = 0; + check_task = GNUNET_SCHEDULER_NO_TASK; + GNUNET_CONTAINER_multihashmap_iterate (peers, &map_check_it, &fail); + if (0 > fail) + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Inconsistent peers after connection consistency check: %u\n", fail); + else + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Inconsistent peers after connection consistency check: %u\n", fail); + + + if (NULL != cls) + { + GNUNET_SCHEDULER_add_now (cls, NULL); + } +} + + +static void +stats_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); + +static int +check_lowlevel_connections (int port, int protocol) +{ + FILE *f; + char * cmdline; + char * proto; + char line[1024]; + int count = -1; +#ifdef MINGW + /* not supported */ + return count; +#else + + switch (protocol) { + case tcp: + proto = "-t"; + break; + case udp: + proto = "-u"; + break; + case unixdomain: + proto = "-x"; + break; + default: + proto = ""; + break; + } + + /* Use netstat to get a numeric list of all connections on port 'port' in state 'ESTABLISHED' */ + GNUNET_asprintf(&cmdline, "netstat -n %s | grep %u | grep ESTABLISHED", proto, port); + + if (system ("netstat -n > /dev/null 2> /dev/null")) + if (system ("netstat -n > /dev/null 2> /dev/null") == 0) + f = popen (cmdline, "r"); + else + f = NULL; + else + f = popen (cmdline, "r"); + if (!f) + { + GNUNET_log_strerror(GNUNET_ERROR_TYPE_ERROR, "ss"); + GNUNET_free (cmdline); + return -1; + } + + count = 0; + while (NULL != fgets (line, sizeof (line), f)) + { + /* read */ + //printf ("%s", line); + count ++; + } + + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%i TCP connections established with port %u\n", + count, port); + + pclose (f); + GNUNET_free (cmdline); + return count; +#endif +} + + +static struct TransportPlugin * +find_plugin (char * name) +{ + struct TransportPlugin *cur = NULL; + + for (cur = phead; cur != NULL; cur = cur->next) + { + if (0 == strcmp(name, cur->short_name)) + return cur; + } + return cur; +} + +static int +stats_check_cb (void *cls, const char *subsystem, + const char *name, uint64_t value, + int is_persistent) +{ + static int counter; + + uint64_t *val = cls; + + if (NULL != val) + (*val) = value; + + counter ++; + if ((STATS_VALUES == counter) || ((GNUNET_NO == have_tcp) && (STATS_VALUES - 1 == counter))) + { + int fail = GNUNET_NO; + + + + int low_level_connections_udp = check_lowlevel_connections (2086, udp); + + if (transport_connections != core_connections) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "%u transport notifications <-> %u core notifications\n", + transport_connections, core_connections); + fail = GNUNET_YES; + } + + if (transport_connections != statistics_transport_connections) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "%u transport notifications <-> %u in statistics (peers connected)\n", + transport_connections, statistics_transport_connections); + fail = GNUNET_YES; + } + + if (core_connections != statistics_core_entries_session_map) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "%u core notifications <-> %u in statistics (entries session map)\n", + core_connections, statistics_core_entries_session_map); + fail = GNUNET_YES; + } + + if (core_connections != statistics_core_neighbour_entries) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "%u core notifications <-> %u in statistics (neighbour entries allocated)\n", + core_connections, statistics_core_neighbour_entries); + fail = GNUNET_YES; + } + + if (GNUNET_NO == fail) + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Check successful : (%u transport / %u core) connections established\n", transport_connections, core_connections); + + /* TCP plugin specific checks */ + if (GNUNET_YES == have_tcp) + { + struct TransportPlugin * p = find_plugin ("tcp"); + int low_level_connections_tcp = check_lowlevel_connections (p->port, p->protocol); + + if (low_level_connections_tcp != -1) + { + if (statistics_transport_tcp_connections > low_level_connections_tcp) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "%u transport tcp sessions <-> %i established tcp connections\n", + statistics_transport_tcp_connections, low_level_connections_tcp); + fail = GNUNET_YES; + } + else if (low_level_connections_tcp != -1) + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "%u TCP connections, %u UDP connections \n", + low_level_connections_tcp, low_level_connections_udp); + } + } + if (transport_connections > statistics_transport_tcp_connections) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "%u transport notifications <-> %u in statistics (statistics_transport_tcp_connections)\n", + transport_connections, statistics_transport_tcp_connections); + fail = GNUNET_YES; + } + else + { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + " %u transport notifications <-> %u in statistics (statistics_transport_tcp_connections)\n", + transport_connections, statistics_transport_tcp_connections); + } + } + + if (GNUNET_SCHEDULER_NO_TASK == statistics_task) + statistics_task = GNUNET_SCHEDULER_add_delayed(REPEATED_STATS_DELAY, &stats_check, NULL); + + stat_check_running = GNUNET_NO; + counter = 0; + } + + return GNUNET_OK; +} + +GNUNET_NETWORK_STRUCT_BEGIN + +struct PING +{ + struct GNUNET_MessageHeader header; + + uint16_t src; +}; + +struct PONG +{ + struct GNUNET_MessageHeader header; + + uint16_t src; +}; +GNUNET_NETWORK_STRUCT_END + + +static size_t +send_transport_ping_cb (void *cls, size_t size, void *buf) +{ + struct PeerContainer * pc = cls; + struct PING ping; + size_t mlen = sizeof (struct PING); + + if (size < mlen) + { + GNUNET_break (0); + return 0; + } + + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Sending transport ping to `%s'\n", GNUNET_i2s (&pc->id)); + ping.header.size = htons (mlen); + ping.header.type = htons (1234); + ping.src = htons (0); + + pc->th_ping = NULL; + + memcpy (buf, &ping, mlen); + return mlen; +} + +size_t send_core_ping_cb (void *cls, size_t size, void *buf) +{ +struct PeerContainer * pc = cls; +struct PING ping; +size_t mlen = sizeof (struct PING); + +if (size < mlen) +{ + GNUNET_break (0); + return 0; +} + +GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Sending core ping to `%s'\n", GNUNET_i2s (&pc->id)); +ping.header.size = htons (mlen); +ping.header.type = htons (1234); +ping.src = htons (1); + +pc->ch_ping = NULL; + +memcpy (buf, &ping, mlen); +return mlen; +} + + +int map_ping_it (void *cls, + const GNUNET_HashCode * key, + void *value) +{ + struct PeerContainer *pc = value; + + if (ping == GNUNET_YES) + { + if ((GNUNET_YES == pc->transport_connected) && (NULL == pc->th_ping)) + pc->th_ping = GNUNET_TRANSPORT_notify_transmit_ready(th, &pc->id, + sizeof (struct PING), UINT_MAX, + GNUNET_TIME_UNIT_FOREVER_REL, &send_transport_ping_cb, pc); + else + GNUNET_break(0); + + if ((GNUNET_YES == pc->core_connected) && (NULL == pc->ch_ping)) + pc->ch_ping = GNUNET_CORE_notify_transmit_ready(ch, + GNUNET_NO, UINT_MAX, + GNUNET_TIME_UNIT_FOREVER_REL, + &pc->id, + sizeof (struct PING), + send_core_ping_cb, pc); + else + GNUNET_break (0); + } + return GNUNET_OK; +} + + +static void +stats_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) +{ + statistics_task = GNUNET_SCHEDULER_NO_TASK; + + if (GNUNET_YES == stat_check_running) + { + statistics_task = GNUNET_SCHEDULER_add_delayed(STATS_DELAY, &stats_check, NULL); + } + + GNUNET_CONTAINER_multihashmap_iterate (peers, &map_ping_it, NULL); + + stat_check_running = GNUNET_YES; + + statistics_transport_connections = 0 ; + statistics_core_entries_session_map = 0; + statistics_core_neighbour_entries = 0; + + GNUNET_STATISTICS_get (stats, "transport", "# peers connected", GNUNET_TIME_UNIT_MINUTES, NULL, &stats_check_cb, &statistics_transport_connections); + GNUNET_STATISTICS_get (stats, "core", "# neighbour entries allocated", GNUNET_TIME_UNIT_MINUTES, NULL, &stats_check_cb, &statistics_core_neighbour_entries); + GNUNET_STATISTICS_get (stats, "core", "# peers connected", GNUNET_TIME_UNIT_MINUTES, NULL, &stats_check_cb, &statistics_core_entries_session_map); + + /* TCP plugin specific checks */ + if (GNUNET_YES == have_tcp) + GNUNET_STATISTICS_get (stats, "transport", "# TCP sessions active", GNUNET_TIME_UNIT_MINUTES, NULL, &stats_check_cb, &statistics_transport_tcp_connections); +} + + + +size_t send_transport_pong_cb (void *cls, size_t size, void *buf) +{ + struct PeerContainer * pc = cls; + struct PING ping; + size_t mlen = sizeof (struct PING); + + if (size < mlen) + { + GNUNET_break (0); + return 0; + } + + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Sending transport pong to `%s'\n", GNUNET_i2s (&pc->id)); + ping.header.size = htons (mlen); + ping.header.type = htons (4321); + ping.src = htons (0); + + pc->th_pong = NULL; + + memcpy (buf, &ping, mlen); + return mlen; +} + +static size_t +send_core_pong_cb (void *cls, size_t size, void *buf) +{ +struct PeerContainer * pc = cls; +struct PING ping; +size_t mlen = sizeof (struct PING); + +if (size < mlen) +{ + GNUNET_break (0); + return 0; +} + +GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Sending core pong to `%s'\n", GNUNET_i2s (&pc->id)); +ping.header.size = htons (mlen); +ping.header.type = htons (4321); +ping.src = htons (1); + +pc->ch_pong = NULL; + +memcpy (buf, &ping, mlen); +return mlen; +} + + +static void +map_connect (const struct GNUNET_PeerIdentity *peer, void * source) +{ + struct PeerContainer * pc; + if (GNUNET_NO == GNUNET_CONTAINER_multihashmap_contains(peers, &peer->hashPubKey)) + { + pc = GNUNET_malloc (sizeof (struct PeerContainer)); + pc->id = *peer; + pc->core_connected = GNUNET_NO; + pc->transport_connected = GNUNET_NO; + GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multihashmap_put(peers, &peer->hashPubKey, pc, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); + } + + pc = GNUNET_CONTAINER_multihashmap_get(peers, &peer->hashPubKey); + if (source == th) + { + if (GNUNET_NO == pc->transport_connected) + { + pc->transport_connected = GNUNET_YES; + if (GNUNET_YES == ping) + { + if (NULL == pc->th_ping) + pc->th_ping = GNUNET_TRANSPORT_notify_transmit_ready(th, peer, sizeof (struct PING), UINT_MAX, GNUNET_TIME_UNIT_FOREVER_REL, &send_transport_ping_cb, pc); + else + GNUNET_break(0); + } + } + else + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "%s notified multiple times about for peers `%s' (%s : %s)\n", + "TRANSPORT", + GNUNET_i2s (&pc->id), + "CORE", (pc->core_connected == GNUNET_YES) ? "yes" : "no"); + GNUNET_break (0); + } + } + if (source == ch) + { + if (GNUNET_NO == pc->core_connected) + { + pc->core_connected = GNUNET_YES; + if (GNUNET_YES == ping) + { + if (NULL == pc->ch_ping) + pc->ch_ping = GNUNET_CORE_notify_transmit_ready(ch, + GNUNET_NO, UINT_MAX, + GNUNET_TIME_UNIT_FOREVER_REL, + peer, + sizeof (struct PING), + send_core_ping_cb, pc); + else + GNUNET_break (0); + } + } + else + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "%s notified multiple times about for peers `%s' (%s : %s)\n", + "CORE", + GNUNET_i2s (&pc->id), + "TRANSPORT", (pc->transport_connected == GNUNET_YES) ? "yes" : "no"); + GNUNET_break (0); + } + } + if (GNUNET_SCHEDULER_NO_TASK != check_task) + GNUNET_SCHEDULER_cancel(check_task); + check_task = GNUNET_SCHEDULER_add_delayed(CHECK_DELAY, &map_check, NULL); + + if (GNUNET_SCHEDULER_NO_TASK != statistics_task) + GNUNET_SCHEDULER_cancel(statistics_task); + statistics_task = GNUNET_SCHEDULER_add_delayed(STATS_DELAY, &stats_check, NULL); +} + + +static void +map_disconnect (const struct GNUNET_PeerIdentity * peer, void * source) +{ + + struct PeerContainer * pc; + if (GNUNET_NO == GNUNET_CONTAINER_multihashmap_contains(peers, &peer->hashPubKey)) + { + if (source == th) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "%s disconnect notification for unknown peer `%s'\n", + "TRANSPORT", GNUNET_i2s (peer)); + GNUNET_break (0); + return; + } + if (source == ch) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "%s disconnect notification for unknown peer `%s'\n", + "CORE", GNUNET_i2s (peer)); + return; + } + } + + pc = GNUNET_CONTAINER_multihashmap_get(peers, &peer->hashPubKey); + if (source == th) + { + if (NULL != pc->th_ping) + { + GNUNET_TRANSPORT_notify_transmit_ready_cancel(pc->th_ping); + pc->th_ping = NULL; + } + if (NULL != pc->th_pong) + { + GNUNET_TRANSPORT_notify_transmit_ready_cancel(pc->th_pong); + pc->th_pong = NULL; + } + + if (GNUNET_YES == pc->transport_connected) + { + pc->transport_connected = GNUNET_NO; + } + else + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "%s notified for not connected peer `%s' (%s : %s)\n", + "TRANSPORT", + GNUNET_i2s (&pc->id), + "CORE", (pc->core_connected == GNUNET_YES) ? "yes" : "no"); + GNUNET_break (0); + } + } + if (source == ch) + { + if (NULL != pc->ch_ping) + { + GNUNET_CORE_notify_transmit_ready_cancel (pc->ch_ping); + pc->ch_ping = NULL; + } + if (NULL != pc->ch_pong) + { + GNUNET_CORE_notify_transmit_ready_cancel (pc->ch_pong); + pc->ch_pong = NULL; + } + + if (GNUNET_YES == pc->core_connected) + { + pc->core_connected = GNUNET_NO; + } + else + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "%s notified for not connected peer `%s' (%s : %s)\n", + "CORE", + GNUNET_i2s (&pc->id), + "TRANSPORT", (pc->transport_connected == GNUNET_YES) ? "yes" : "no"); + GNUNET_break (0); + } + } + + if ((GNUNET_NO == pc->core_connected) && (GNUNET_NO == pc->transport_connected)) + { + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Removing peer `%s'\n", GNUNET_i2s (&pc->id)); + GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multihashmap_remove (peers, &peer->hashPubKey, pc)); + + + GNUNET_free (pc); + } + + if (GNUNET_SCHEDULER_NO_TASK != check_task) + GNUNET_SCHEDULER_cancel(check_task); + check_task = GNUNET_SCHEDULER_add_delayed(CHECK_DELAY, &map_check, NULL); + + if (GNUNET_SCHEDULER_NO_TASK != statistics_task) + GNUNET_SCHEDULER_cancel(statistics_task); + statistics_task = GNUNET_SCHEDULER_add_delayed(STATS_DELAY, &stats_check, NULL); +} + + +static void +cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) +{ + struct TransportPlugin * cur = phead; + + if (NULL != th) + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Disconnecting from transport service\n"); + GNUNET_TRANSPORT_disconnect (th); + th = NULL; + } + + + if (NULL != ch) + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Disconnecting from core service\n"); + GNUNET_CORE_disconnect (ch); + ch = NULL; + } + + if (GNUNET_SCHEDULER_NO_TASK != statistics_task) + { + GNUNET_SCHEDULER_cancel(statistics_task); + statistics_task = GNUNET_SCHEDULER_NO_TASK; + } + + if (GNUNET_SCHEDULER_NO_TASK != check_task) + { + GNUNET_SCHEDULER_cancel(check_task); + check_task = GNUNET_SCHEDULER_NO_TASK; + } + + for (cur = phead; cur != NULL; cur = phead) + { + GNUNET_CONTAINER_DLL_remove(phead, ptail, cur); + GNUNET_free (cur->short_name); + GNUNET_free (cur); + } + + check_task = GNUNET_SCHEDULER_add_now (&map_check, &map_cleanup); +} + +static void +transport_notify_connect_cb (void *cls, + const struct GNUNET_PeerIdentity + * peer, + const struct + GNUNET_ATS_Information * ats, + uint32_t ats_count) +{ + transport_connections ++; + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "TRANSPORT connect for peer `%s' (%u total)\n", + GNUNET_i2s (peer), transport_connections); + map_connect (peer, th); +} + +/** + * Function called to notify transport users that another + * peer disconnected from us. + * + * @param cls closure + * @param peer the peer that disconnected + */ +static void +transport_notify_disconnect_cb (void *cls, + const struct + GNUNET_PeerIdentity * peer) +{ + GNUNET_assert (transport_connections > 0); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "TRANSPORT disconnect for peer `%s' (%u total)\n", + GNUNET_i2s (peer), transport_connections) ; + map_disconnect (peer, th); + transport_connections --; + +} + +static void +transport_notify_receive_cb (void *cls, + const struct + GNUNET_PeerIdentity * peer, + const struct + GNUNET_MessageHeader * + message, + const struct + GNUNET_ATS_Information * ats, + uint32_t ats_count) +{ + + + struct PeerContainer *pc = NULL; + + pc = GNUNET_CONTAINER_multihashmap_get(peers, &peer->hashPubKey); + + if (NULL == pc) + { + GNUNET_break (0); + return; + } + + if ((message->size == ntohs (sizeof (struct PING))) && (message->type == ntohs (1234))) + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Received %s %s from peer `%s'\n", + "TRANSPORT", + "PING", + GNUNET_i2s (peer)) ; + if (GNUNET_YES == ping) + { + if (NULL == pc->th_pong) + pc->th_pong = GNUNET_TRANSPORT_notify_transmit_ready(th, + peer, sizeof (struct PONG), + UINT_MAX, GNUNET_TIME_UNIT_FOREVER_REL, + &send_transport_pong_cb, pc); + else + GNUNET_break (0); + } + + } + if ((message->size == ntohs (sizeof (struct PONG))) && (message->type == ntohs (4321))) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Received %s %s from peer `%s'\n", + "TRANSPORT", + "PONG", + GNUNET_i2s (peer)); + } +} + +static int +core_notify_receive_cb (void *cls, + const struct GNUNET_PeerIdentity * peer, + const struct GNUNET_MessageHeader * message, + const struct GNUNET_ATS_Information* atsi, + unsigned int atsi_count) +{ + struct PeerContainer *pc = NULL; + + pc = GNUNET_CONTAINER_multihashmap_get(peers, &peer->hashPubKey); + + if (NULL == pc) + { + if (0 == memcmp (peer, &my_peer_id, sizeof (my_peer_id))) + return GNUNET_OK; + + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Received unexpected message type %u from unknown peer `%s'\n", + ntohs (message->type), + GNUNET_i2s (peer)); + + GNUNET_break (0); + return GNUNET_OK; + } + + if ((message->size == ntohs (sizeof (struct PING))) && (message->type == ntohs (1234))) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Received %s %s from peer `%s'\n", + "CORE", + "PING", + GNUNET_i2s (peer)); + if (GNUNET_YES == ping) + { + if (NULL == pc->ch_pong) + pc->ch_pong = GNUNET_CORE_notify_transmit_ready(ch, + GNUNET_NO, UINT_MAX, + GNUNET_TIME_UNIT_FOREVER_REL, + peer, + sizeof (struct PONG), + send_core_pong_cb, pc); + else + GNUNET_break (0); + } + } + + if ((message->size == ntohs (sizeof (struct PONG))) && (message->type == ntohs (4321))) + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Received %s %s from peer `%s'\n", + "CORE", + "PONG", + GNUNET_i2s (peer)); + + } + + return GNUNET_OK; +} + +static void +core_connect_cb (void *cls, const struct GNUNET_PeerIdentity *peer, + const struct GNUNET_ATS_Information *atsi, + unsigned int atsi_count) +{ + if (0 != memcmp (peer, &my_peer_id, sizeof (struct GNUNET_PeerIdentity))) + { + core_connections ++; + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "CORE connect for peer `%s' (%u total)\n", + GNUNET_i2s (peer), core_connections); + map_connect (peer, ch); + } + else + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "CORE connect for myself `%s' (%u total)\n", + GNUNET_i2s (peer), core_connections); + } +} + +static void +core_disconnect_cb (void *cls, + const struct + GNUNET_PeerIdentity * peer) +{ + if (0 != memcmp (peer, &my_peer_id, sizeof (struct GNUNET_PeerIdentity))) + { + GNUNET_assert (core_connections > 0); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "CORE disconnect for peer `%s' (%u total)\n", + GNUNET_i2s (peer), core_connections); + map_disconnect (peer, ch); + core_connections --; + } + else + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "CORE disconnect for myself `%s' (%u total)\n", + GNUNET_i2s (peer), core_connections); + } + +} + +static void +core_init_cb (void *cls, struct GNUNET_CORE_Handle *server, + const struct GNUNET_PeerIdentity *my_identity) +{ + my_peer_id = *my_identity; + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Connected to core service\n"); +} + + +static void +init () +{ + struct TransportPlugin * cur; + char *plugs; + char *pos; + char *secname; + int counter; + unsigned long long port; + + have_tcp = GNUNET_NO; + have_udp = GNUNET_NO; + have_http = GNUNET_NO; + have_https = GNUNET_NO; + have_unix = GNUNET_NO; + + if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (mycfg, "TRANSPORT", "PLUGINS", &plugs)) + return; + counter = 0; + for (pos = strtok (plugs, " "); pos != NULL; pos = strtok (NULL, " ")) + { + counter++; + + GNUNET_asprintf(&secname, "transport-%s", pos); + + if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (mycfg, secname, "PORT", &port)) + { + GNUNET_free (secname); + continue; + } + + GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Transport plugin: `%s' port %llu\n"), pos, port); + cur = GNUNET_malloc(sizeof (struct TransportPlugin)); + cur->short_name = GNUNET_strdup (pos); + cur->port = port; + if (0 == strcmp("tcp", pos)) + { + have_tcp = GNUNET_YES; + cur->protocol = tcp; + } + if (0 == strcmp("udp", pos)) + { + have_udp = GNUNET_YES; + cur->protocol = udp; + } + if (0 == strcmp("http", pos)) + { + have_http = GNUNET_YES; + cur->protocol = tcp; + } + if (0 == strcmp("https", pos)) + { + have_https = GNUNET_YES; + cur->protocol = tcp; + } + if (0 == strcmp("unix", pos)) + { + have_unix = GNUNET_YES; + cur->protocol = unixdomain; + } + + GNUNET_CONTAINER_DLL_insert(phead, ptail, cur); + GNUNET_free (secname); + } + GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Found %u transport plugins: `%s'\n"), + counter, plugs); + + GNUNET_free (plugs); +} + +/** + * Main function that will be run by the scheduler. + * + * @param cls closure + * @param args remaining command-line arguments + * @param cfgfile name of the configuration file used (for saving, can be NULL!) + * @param cfg configuration + */ +static void +run (void *cls, char *const *args, const char *cfgfile, + const struct GNUNET_CONFIGURATION_Handle *cfg) +{ + transport_connections = 0; + core_connections = 0; + mycfg = cfg; + + init(); + + stats = GNUNET_STATISTICS_create ("watchdog", cfg); + peers = GNUNET_CONTAINER_multihashmap_create (20); + + th = GNUNET_TRANSPORT_connect(cfg, NULL, NULL, + &transport_notify_receive_cb, + &transport_notify_connect_cb, + &transport_notify_disconnect_cb); + GNUNET_assert (th != NULL); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Connected to transport service\n"); + ch = GNUNET_CORE_connect (cfg, 1, NULL, + &core_init_cb, + &core_connect_cb, + &core_disconnect_cb, + &core_notify_receive_cb, GNUNET_NO, + NULL, GNUNET_NO, + NULL); + GNUNET_assert (ch != NULL); + + GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup_task, NULL); + +} + + +/** + * The main function. + * + * @param argc number of arguments from the command line + * @param argv command line arguments + * @return 0 ok, 1 on error + */ +int +main (int argc, char *const *argv) +{ + ping = GNUNET_NO; + static const struct GNUNET_GETOPT_CommandLineOption options[] = { + {'p', "ping", NULL, gettext_noop ("Send ping messages to test connectivity (default == NO)"), + GNUNET_NO, &GNUNET_GETOPT_set_one, &ping}, + GNUNET_GETOPT_OPTION_END + }; + return (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "cn", + gettext_noop ("help text"), options, &run, + NULL)) ? ret : 1; +} + +/* end of connection_watchdog.c */ diff --git a/src/integration-tests/gnunet_testing.py.in b/src/integration-tests/gnunet_testing.py.in index 79cbfe9..41e709f 100644 --- a/src/integration-tests/gnunet_testing.py.in +++ b/src/integration-tests/gnunet_testing.py.in @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!@PYTHON@ # This file is part of GNUnet. # (C) 2010 Christian Grothoff (and other contributing authors) # @@ -42,7 +42,6 @@ class Check: neg += 1 else: pos += 1 - self.test.p (str(pos) +' out of '+ str (pos+neg) + ' conditions fulfilled') return fulfilled def run_blocking (self, timeout, pos_cont, neg_cont): execs = 0; @@ -51,10 +50,23 @@ class Check: res = self.run() time.sleep(1) execs += 1 - if (res == False): - neg_cont (self) + if ((False == res) and (execs >= timeout)): + print ('Check had timeout after ' +str(timeout)+ ' seconds') + neg_cont (self) + elif ((False == res) and (execs >= timeout)): + neg_cont (self) else: pos_cont (self) + return res + def run_once (self, pos_cont, neg_cont): + execs = 0; + res = False + res = self.run() + if ((res == False) and (neg_cont != None)): + neg_cont (self) + if ((res == True) and (pos_cont != None)): + pos_cont (self) + return res def evaluate (self, failed_only): pos = 0 neg = 0 @@ -65,6 +77,10 @@ class Check: pos += 1 print (str(pos) +' out of '+ str (pos+neg) + ' conditions fulfilled') return self.fulfilled + def reset (self): + self.fulfilled = False + for c in self.conditions: + c.fulfilled = False class Condition: def __init__(self): @@ -115,7 +131,7 @@ class StatisticsCondition (Condition): self.result = -1; def check(self): if (self.fulfilled == False): - self.result = self.peer.get_statistics_value (self.subsystem, self.name); + self.result = self.peer.get_statistics_value (self.subsystem, self.name) if (str(self.result) == str(self.value)): self.fulfilled = True return True @@ -134,11 +150,52 @@ class StatisticsCondition (Condition): else: fail = "" op = " == " - if ((self.fulfilled == False) and (failed_only == True)): + if (((self.fulfilled == False) and (failed_only == True)) or (failed_only == False)): print self.peer.id[:4] + " " +self.peer.cfg + " " + str(self.type) + ' condition in subsystem "' + self.subsystem.ljust(12) +'" : "' + self.name.ljust(30) +'" : (expected/real value) ' + str(self.value) + op + res + fail - elif (failed_only == False): - print self.peer.id[:4] + " " +self.peer.cfg + " " + str(self.type) + ' condition in subsystem "' + self.subsystem.ljust(12) +'" : "' + self.name.ljust(30) +'" : (expected/real value) ' + str(self.value) + op + res + fail return self.fulfilled + +# Specify two statistic values and check if they are equal +class EqualStatisticsCondition (Condition): + def __init__(self, peer, subsystem, name, peer2, subsystem2, name2): + self.fulfilled = False + self.type = 'equalstatistics' + self.peer = peer; + self.subsystem = subsystem; + self.name = name; + self.result = -1; + self.peer2 = peer2; + self.subsystem2 = subsystem2; + self.name2 = name2; + self.result2 = -1; + def check(self): + if (self.fulfilled == False): + self.result = self.peer.get_statistics_value (self.subsystem, self.name); + self.result2 = self.peer2.get_statistics_value (self.subsystem2, self.name2); + if (str(self.result) == str(self.result2)): + self.fulfilled = True + return True + else: + return False + else: + return True + def evaluate (self, failed_only): + if (self.result == -1): + res = 'NaN' + else: + res = str(self.result) + if (self.result2 == -1): + res2 = 'NaN' + else: + res2 = str(self.result2) + if (self.fulfilled == False): + fail = " FAIL!" + op = " != " + else: + fail = "" + op = " == " + if (((self.fulfilled == False) and (failed_only == True)) or (failed_only == False)): + print self.peer.id[:4] + ' "' + self.subsystem.ljust(12) + '" "' + self.name.ljust(30) + '" == ' + str(self.result) +" " + self.peer2.id[:4] + ' "' + self.subsystem2.ljust(12) + '" '+ self.name2.ljust(30) + '" ' + str(self.result2) + return self.fulfilled class Test: def __init__(self, testname, verbose): @@ -224,7 +281,11 @@ class Peer: server.spawn (None, [self.test.gnunetstatistics, '-c', self.cfg ,'-q','-n', name, '-s', subsystem ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) #server.expect ("stdout", re.compile (r"")) test = server.read("stdout", 10240) - tests = test.partition('\n')[0] + tests = test.partition('\n') + # On W32 GNUnet outputs with \r\n, rather than \n + if os.name == 'nt' and tests[1] == '\n' and tests[0][-1] == '\r': + tests = (tests[0][:-1], tests[1], tests[2]) + tests = tests[0] if (tests.isdigit() == True): return tests else: diff --git a/src/integration-tests/test_connection_stability.c b/src/integration-tests/test_connection_stability.c new file mode 100644 index 0000000..ce6568b --- /dev/null +++ b/src/integration-tests/test_connection_stability.c @@ -0,0 +1,126 @@ +/* + This file is part of GNUnet. + (C) 2009 Christian Grothoff (and other contributing authors) + + GNUnet is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3, or (at your + option) any later version. + + GNUnet is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNUnet; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ +/** + * @file integretion-tests/test_connection_stability.c + * @brief testcase for connection stability + */ +#include "platform.h" +#include "gnunet_testing_lib.h" + +#define VERBOSE GNUNET_YES + +#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 300) + +static int ok; + +static void +end_cb (void *cls, const char *emsg) +{ + if (emsg != NULL) + { + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Ending with error: %s\n", emsg); + ok = 1; + } + else + { +#if VERBOSE + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Daemon terminated, will now exit.\n"); +#endif + ok = 0; + } +} + + + +void +do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) +{ + struct GNUNET_TESTING_Daemon *d = cls; + + GNUNET_TESTING_daemon_stop (d, TIMEOUT, &end_cb, NULL, GNUNET_YES, GNUNET_NO); +} + + +static void +my_cb (void *cls, const struct GNUNET_PeerIdentity *id, + const struct GNUNET_CONFIGURATION_Handle *cfg, + struct GNUNET_TESTING_Daemon *d, const char *emsg) +{ + GNUNET_assert (id != NULL); +#if VERBOSE + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Daemon `%s' started, will now stop it.\n", GNUNET_i2s (id)); +#endif + GNUNET_SCHEDULER_add_now (&do_shutdown, d); +} + + +static void +run (void *cls, char *const *args, const char *cfgfile, + const struct GNUNET_CONFIGURATION_Handle *cfg) +{ + struct GNUNET_TESTING_Daemon *d; + + ok = 1; +#if VERBOSE + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting daemon.\n"); +#endif + d = GNUNET_TESTING_daemon_start (cfg, TIMEOUT, GNUNET_NO, NULL, NULL, 0, NULL, + NULL, NULL, &my_cb, NULL); + GNUNET_assert (d != NULL); +} + +static int +check () +{ + char *const argv[] = { "test_connection_stability", + "-c", + "test_connection_stability.conf", +#if VERBOSE + "-L", "DEBUG", +#endif + NULL + }; + struct GNUNET_GETOPT_CommandLineOption options[] = { + GNUNET_GETOPT_OPTION_END + }; + GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, + "test-testing", "nohelp", options, &run, &ok); + return ok; +} + +int +main (int argc, char *argv[]) +{ + int ret; + + GNUNET_log_setup ("test_connection_stability", +#if VERBOSE + "DEBUG", +#else + "WARNING", +#endif + NULL); + ret = check (); + + return ret; +} + +/* end of test_connection_stability.c */ diff --git a/src/integration-tests/test_connection_stability.conf b/src/integration-tests/test_connection_stability.conf new file mode 100644 index 0000000..ba2ae05 --- /dev/null +++ b/src/integration-tests/test_connection_stability.conf @@ -0,0 +1,82 @@ +[PATHS] +SERVICEHOME = /tmp/test_connection_stability/ +DEFAULTCONFIG = test_connection_stability.conf + +[resolver] +PORT = 2564 + +[transport] +PORT = 2565 +PLUGINS = tcp + +[arm] +PORT = 2566 +DEFAULTSERVICES = + +[statistics] +PORT = 2567 + +[transport-tcp] +PORT = 2568 +BINDTO = 127.0.0.1 + +[peerinfo] +PORT = 2569 + +[core] +PORT = 2570 + +[testing] +NUM_PEERS = 5 +WEAKRANDOM = YES +F2F = YES +HOSTKEYSFILE = ../../contrib/testing_hostkeys.dat + +[dht] +AUTOSTART = NO + +[nat] +DISABLEV6 = YES +ENABLE_UPNP = NO +BEHIND_NAT = NO +ALLOW_NAT = NO +INTERNAL_ADDRESS = 127.0.0.1 +EXTERNAL_ADDRESS = 127.0.0.1 +USE_LOCALADDR = NO + +[dns] +AUTOSTART = NO + +[nse] +AUTOSTART = NO + +[mesh] +AUTOSTART = NO + +[datastore] +AUTOSTART = NO + +[fs] +AUTOSTART = NO + +[dv] +AUTOSTART = NO + +[chat] +AUTOSTART = NO + +[vpn] +AUTOSTART = NO + +[gns] +AUTOSTART = NO + +[namestore] +AUTOSTART = NO + +[lockmanager] +AUTOSTART = NO + +[arm] +DEFAULTSERVICES = core + diff --git a/src/integration-tests/test_integration_bootstrap_and_connect.py.in b/src/integration-tests/test_integration_bootstrap_and_connect.py.in index 32995d2..1e71488 100755 --- a/src/integration-tests/test_integration_bootstrap_and_connect.py.in +++ b/src/integration-tests/test_integration_bootstrap_and_connect.py.in @@ -50,7 +50,7 @@ from gnunet_testing import * testname = "test_integration_bootstrap_and_connect" verbose = True -check_timeout = 30 +check_timeout = 180 def cleanup (): @@ -74,14 +74,14 @@ def check (): check = Check (test) check.add (StatisticsCondition (client, 'transport', '# peers connected',1)) check.add (StatisticsCondition (client, 'core', '# neighbour entries allocated',1)) - check.add (StatisticsCondition (client, 'core', '# entries in session map',1)) + check.add (StatisticsCondition (client, 'core', '# peers connected',1)) check.add (StatisticsCondition (client, 'topology', '# peers connected',1)) check.add (StatisticsCondition (client, 'fs', '# peers connected',1)) check.add (StatisticsCondition (server, 'transport', '# peers connected',1)) check.add (StatisticsCondition (server, 'core', '# neighbour entries allocated',1)) - check.add (StatisticsCondition (server, 'core', '# entries in session map',1)) + check.add (StatisticsCondition (server, 'core', '# peers connected',1)) check.add (StatisticsCondition (server, 'topology', '# peers connected',1)) check.add (StatisticsCondition (server, 'fs', '# peers connected',1)) diff --git a/src/integration-tests/test_integration_bootstrap_and_connect_and_disconnect.py.in b/src/integration-tests/test_integration_bootstrap_and_connect_and_disconnect.py.in index b426182..aefb9cd 100755 --- a/src/integration-tests/test_integration_bootstrap_and_connect_and_disconnect.py.in +++ b/src/integration-tests/test_integration_bootstrap_and_connect_and_disconnect.py.in @@ -50,7 +50,7 @@ from gnunet_testing import * testname = "test_integration_bootstrap_and_connect" verbose = True -check_timeout = 30 +check_timeout = 180 def cleanup (): @@ -71,7 +71,7 @@ def success_cont (check): check = Check (test) check.add (StatisticsCondition (client, 'transport', '# peers connected',0)) check.add (StatisticsCondition (client, 'core', '# neighbour entries allocated',0)) - check.add (StatisticsCondition (client, 'core', '# entries in session map',0)) + check.add (StatisticsCondition (client, 'core', '# peers connected',0)) check.add (StatisticsCondition (client, 'topology', '# peers connected',0)) check.add (StatisticsCondition (client, 'fs', '# peers connected',0)) @@ -86,14 +86,14 @@ def check (): check = Check (test) check.add (StatisticsCondition (client, 'transport', '# peers connected',1)) check.add (StatisticsCondition (client, 'core', '# neighbour entries allocated',1)) - check.add (StatisticsCondition (client, 'core', '# entries in session map',1)) + check.add (StatisticsCondition (client, 'core', '# peers connected',1)) check.add (StatisticsCondition (client, 'topology', '# peers connected',1)) check.add (StatisticsCondition (client, 'fs', '# peers connected',1)) check.add (StatisticsCondition (server, 'transport', '# peers connected',1)) check.add (StatisticsCondition (server, 'core', '# neighbour entries allocated',1)) - check.add (StatisticsCondition (server, 'core', '# entries in session map',1)) + check.add (StatisticsCondition (server, 'core', '# peers connected',1)) check.add (StatisticsCondition (server, 'topology', '# peers connected',1)) check.add (StatisticsCondition (server, 'fs', '# peers connected',1)) diff --git a/src/integration-tests/test_integration_bootstrap_and_connect_and_disconnect_nat.py.in b/src/integration-tests/test_integration_bootstrap_and_connect_and_disconnect_nat.py.in index f055e79..88327bf 100755 --- a/src/integration-tests/test_integration_bootstrap_and_connect_and_disconnect_nat.py.in +++ b/src/integration-tests/test_integration_bootstrap_and_connect_and_disconnect_nat.py.in @@ -50,7 +50,7 @@ from gnunet_testing import * testname = "test_integration_bootstrap_and_connect" verbose = True -check_timeout = 30 +check_timeout = 180 def cleanup (): @@ -71,7 +71,7 @@ def success_cont (check): check = Check (test) check.add (StatisticsCondition (client, 'transport', '# peers connected',0)) check.add (StatisticsCondition (client, 'core', '# neighbour entries allocated',0)) - check.add (StatisticsCondition (client, 'core', '# entries in session map',0)) + check.add (StatisticsCondition (client, 'core', '# peers connected',0)) check.add (StatisticsCondition (client, 'topology', '# peers connected',0)) check.add (StatisticsCondition (client, 'fs', '# peers connected',0)) @@ -86,14 +86,14 @@ def check (): check = Check (test) check.add (StatisticsCondition (client, 'transport', '# peers connected',1)) check.add (StatisticsCondition (client, 'core', '# neighbour entries allocated',1)) - check.add (StatisticsCondition (client, 'core', '# entries in session map',1)) + check.add (StatisticsCondition (client, 'core', '# peers connected',1)) check.add (StatisticsCondition (client, 'topology', '# peers connected',1)) check.add (StatisticsCondition (client, 'fs', '# peers connected',1)) check.add (StatisticsCondition (server, 'transport', '# peers connected',1)) check.add (StatisticsCondition (server, 'core', '# neighbour entries allocated',1)) - check.add (StatisticsCondition (server, 'core', '# entries in session map',1)) + check.add (StatisticsCondition (server, 'core', '# peers connected',1)) check.add (StatisticsCondition (server, 'topology', '# peers connected',1)) check.add (StatisticsCondition (server, 'fs', '# peers connected',1)) diff --git a/src/integration-tests/test_integration_clique.py.in b/src/integration-tests/test_integration_clique.py.in index 49a2c59..65c9341 100755 --- a/src/integration-tests/test_integration_clique.py.in +++ b/src/integration-tests/test_integration_clique.py.in @@ -42,7 +42,7 @@ from gnunet_testing import * testname = "test_integration_clique" verbose = True -check_timeout = 30 +check_timeout = 180 def cleanup (): @@ -73,7 +73,7 @@ def check_disconnect_client (): check.add (StatisticsCondition (client2, 'transport', '# peers connected',0)) check.add (StatisticsCondition (client2, 'core', '# neighbour entries allocated',0)) - check.add (StatisticsCondition (client2, 'core', '# entries in session map',0)) + check.add (StatisticsCondition (client2, 'core', '# peers connected',0)) check.add (StatisticsCondition (client2, 'topology', '# peers connected',0)) check.add (StatisticsCondition (client2, 'fs', '# peers connected',0)) @@ -96,13 +96,13 @@ def check_disconnect_server (): check = Check (test) check.add (StatisticsCondition (client, 'transport', '# peers connected',1)) check.add (StatisticsCondition (client, 'core', '# neighbour entries allocated',1)) - check.add (StatisticsCondition (client, 'core', '# entries in session map',1)) + check.add (StatisticsCondition (client, 'core', '# peers connected',1)) check.add (StatisticsCondition (client, 'topology', '# peers connected',1)) check.add (StatisticsCondition (client, 'fs', '# peers connected',1)) check.add (StatisticsCondition (client2, 'transport', '# peers connected',1)) check.add (StatisticsCondition (client2, 'core', '# neighbour entries allocated',1)) - check.add (StatisticsCondition (client2, 'core', '# entries in session map',1)) + check.add (StatisticsCondition (client2, 'core', '# peers connected',1)) check.add (StatisticsCondition (client2, 'topology', '# peers connected',1)) check.add (StatisticsCondition (client2, 'fs', '# peers connected',1)) @@ -123,19 +123,19 @@ def check_connect (): check = Check (test) check.add (StatisticsCondition (client, 'transport', '# peers connected',2)) check.add (StatisticsCondition (client, 'core', '# neighbour entries allocated',2)) - check.add (StatisticsCondition (client, 'core', '# entries in session map',2)) + check.add (StatisticsCondition (client, 'core', '# peers connected',2)) check.add (StatisticsCondition (client, 'topology', '# peers connected',2)) check.add (StatisticsCondition (client, 'fs', '# peers connected',2)) check.add (StatisticsCondition (client2, 'transport', '# peers connected',2)) check.add (StatisticsCondition (client2, 'core', '# neighbour entries allocated',2)) - check.add (StatisticsCondition (client2, 'core', '# entries in session map',2)) + check.add (StatisticsCondition (client2, 'core', '# peers connected',2)) check.add (StatisticsCondition (client2, 'topology', '# peers connected',2)) check.add (StatisticsCondition (client2, 'fs', '# peers connected',2)) check.add (StatisticsCondition (server, 'transport', '# peers connected',2)) check.add (StatisticsCondition (server, 'core', '# neighbour entries allocated',2)) - check.add (StatisticsCondition (server, 'core', '# entries in session map',2)) + check.add (StatisticsCondition (server, 'core', '# peers connected',2)) check.add (StatisticsCondition (server, 'topology', '# peers connected',2)) check.add (StatisticsCondition (server, 'fs', '# peers connected',2)) diff --git a/src/integration-tests/test_integration_clique_nat.py.in b/src/integration-tests/test_integration_clique_nat.py.in index e8f7719..59d1179 100755 --- a/src/integration-tests/test_integration_clique_nat.py.in +++ b/src/integration-tests/test_integration_clique_nat.py.in @@ -42,7 +42,7 @@ from gnunet_testing import * #definitions testname = "test_integration_clique_nat" verbose = True -check_timeout = 30 +check_timeout = 180 def cleanup (): @@ -73,7 +73,7 @@ def check_disconnect_client (): check.add (StatisticsCondition (client2, 'transport', '# peers connected',0)) check.add (StatisticsCondition (client2, 'core', '# neighbour entries allocated',0)) - check.add (StatisticsCondition (client2, 'core', '# entries in session map',0)) + check.add (StatisticsCondition (client2, 'core', '# peers connected',0)) check.add (StatisticsCondition (client2, 'topology', '# peers connected',0)) check.add (StatisticsCondition (client2, 'fs', '# peers connected',0)) @@ -96,13 +96,13 @@ def check_disconnect_server (): check = Check (test) check.add (StatisticsCondition (client, 'transport', '# peers connected',1)) check.add (StatisticsCondition (client, 'core', '# neighbour entries allocated',1)) - check.add (StatisticsCondition (client, 'core', '# entries in session map',1)) + check.add (StatisticsCondition (client, 'core', '# peers connected',1)) check.add (StatisticsCondition (client, 'topology', '# peers connected',1)) check.add (StatisticsCondition (client, 'fs', '# peers connected',1)) check.add (StatisticsCondition (client2, 'transport', '# peers connected',1)) check.add (StatisticsCondition (client2, 'core', '# neighbour entries allocated',1)) - check.add (StatisticsCondition (client2, 'core', '# entries in session map',1)) + check.add (StatisticsCondition (client2, 'core', '# peers connected',1)) check.add (StatisticsCondition (client2, 'topology', '# peers connected',1)) check.add (StatisticsCondition (client2, 'fs', '# peers connected',1)) @@ -123,19 +123,19 @@ def check_connect (): check = Check (test) check.add (StatisticsCondition (client, 'transport', '# peers connected',2)) check.add (StatisticsCondition (client, 'core', '# neighbour entries allocated',2)) - check.add (StatisticsCondition (client, 'core', '# entries in session map',2)) + check.add (StatisticsCondition (client, 'core', '# peers connected',2)) check.add (StatisticsCondition (client, 'topology', '# peers connected',2)) check.add (StatisticsCondition (client, 'fs', '# peers connected',2)) check.add (StatisticsCondition (client2, 'transport', '# peers connected',2)) check.add (StatisticsCondition (client2, 'core', '# neighbour entries allocated',2)) - check.add (StatisticsCondition (client2, 'core', '# entries in session map',2)) + check.add (StatisticsCondition (client2, 'core', '# peers connected',2)) check.add (StatisticsCondition (client2, 'topology', '# peers connected',2)) check.add (StatisticsCondition (client2, 'fs', '# peers connected',2)) check.add (StatisticsCondition (server, 'transport', '# peers connected',2)) check.add (StatisticsCondition (server, 'core', '# neighbour entries allocated',2)) - check.add (StatisticsCondition (server, 'core', '# entries in session map',2)) + check.add (StatisticsCondition (server, 'core', '# peers connected',2)) check.add (StatisticsCondition (server, 'topology', '# peers connected',2)) check.add (StatisticsCondition (server, 'fs', '# peers connected',2)) diff --git a/src/integration-tests/test_integration_connect_on_restart.py.in b/src/integration-tests/test_integration_connect_on_restart.py.in new file mode 100755 index 0000000..f77fd1c --- /dev/null +++ b/src/integration-tests/test_integration_connect_on_restart.py.in @@ -0,0 +1,180 @@ +#!@PYTHON@ +# This file is part of GNUnet. +# (C) 2010 Christian Grothoff (and other contributing authors) +# +# GNUnet is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published +# by the Free Software Foundation; either version 2, or (at your +# option) any later version. +# +# GNUnet is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNUnet; see the file COPYING. If not, write to the +# Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. +# +# +# +# This test starts 3 peers and expects bootstrap and a connected clique +# After a successful clique it shuts down all peers and starts the non-bootstrap +# peers, expecting them to reconnect +# +# Conditions for successful exit: +# Both peers have 1 connected peer in transport, core, topology, fs + +import sys +import os +import subprocess +import re +import shutil +import time +import pexpect +from gnunet_testing import Peer +from gnunet_testing import Test +from gnunet_testing import Check +from gnunet_testing import Condition +from gnunet_testing import * + + +#definitions + +testname = "test_integration_clique" +verbose = True +check_timeout = 180 + + +def cleanup (): + if os.name == "nt": + shutil.rmtree (os.path.join (os.getenv ("TEMP"), "c_bootstrap_server"), True) + shutil.rmtree (os.path.join (os.getenv ("TEMP"), "c_no_nat_client"), True) + shutil.rmtree (os.path.join (os.getenv ("TEMP"), "c_no_nat_client_2"), True) + else: + shutil.rmtree ("/tmp/c_bootstrap_server/", True) + shutil.rmtree ("/tmp/c_no_nat_client/", True) + shutil.rmtree ("/tmp/c_no_nat_client_2/", True) + + +def success_cont (check): + global success + success = True; + check.evaluate(True) + +def fail_cont (check): + global success + success = False; + check.evaluate(False) + + +def success_connect_cont (check): + check.evaluate(True) + print "Connected clique, shutdown" + server.stop () + client.stop () + client2.stop () + time.sleep (3) + client.start () + client2.start () + + check = Check (test) + check.add (StatisticsCondition (client, 'transport', '# peers connected',1)) + check.add (StatisticsCondition (client, 'core', '# neighbour entries allocated',1)) + check.add (StatisticsCondition (client, 'core', '# peers connected',1)) + check.add (StatisticsCondition (client, 'topology', '# peers connected',1)) + check.add (StatisticsCondition (client, 'fs', '# peers connected',1)) + + check.add (StatisticsCondition (client2, 'transport', '# peers connected',1)) + check.add (StatisticsCondition (client2, 'core', '# neighbour entries allocated',1)) + check.add (StatisticsCondition (client2, 'core', '# peers connected',1)) + check.add (StatisticsCondition (client2, 'topology', '# peers connected',1)) + check.add (StatisticsCondition (client2, 'fs', '# peers connected',1)) + + check.run_blocking (check_timeout, success_cont, fail_cont) + + +def fail_connect_cont (check): + global success + print "Failed to connect clique, shutdown" + success = False; + check.evaluate(False) + + +def check_connect (): + check = Check (test) + check.add (StatisticsCondition (client, 'transport', '# peers connected',2)) + check.add (StatisticsCondition (client, 'core', '# neighbour entries allocated',2)) + check.add (StatisticsCondition (client, 'core', '# peers connected',2)) + check.add (StatisticsCondition (client, 'topology', '# peers connected',2)) + check.add (StatisticsCondition (client, 'fs', '# peers connected',2)) + + check.add (StatisticsCondition (client2, 'transport', '# peers connected',2)) + check.add (StatisticsCondition (client2, 'core', '# neighbour entries allocated',2)) + check.add (StatisticsCondition (client2, 'core', '# peers connected',2)) + check.add (StatisticsCondition (client2, 'topology', '# peers connected',2)) + check.add (StatisticsCondition (client2, 'fs', '# peers connected',2)) + + check.add (StatisticsCondition (server, 'transport', '# peers connected',2)) + check.add (StatisticsCondition (server, 'core', '# neighbour entries allocated',2)) + check.add (StatisticsCondition (server, 'core', '# peers connected',2)) + check.add (StatisticsCondition (server, 'topology', '# peers connected',2)) + check.add (StatisticsCondition (server, 'fs', '# peers connected',2)) + + check.run_blocking (check_timeout, success_connect_cont, fail_connect_cont) + +# +# Test execution +# +def run (): + global success + global test + global server + global client + global client2 + + success = False + + test = Test ('test_integration_disconnect', verbose) + + server = Peer(test, './confs/c_bootstrap_server.conf'); + server.start(); + + client = Peer(test, './confs/c_no_nat_client.conf'); + client.start(); + + client2 = Peer(test, './confs/c_no_nat_client_2.conf'); + client2.start(); + + if ((client.started == True) and (client2.started == True) and (server.started == True)): + test.p ('Peers started, running check') + check_connect () + + server.stop () + client.stop () + client2.stop () + + cleanup () + + if (success == False): + print ('Test failed') + return False + else: + return True + + +try: + run () +except (KeyboardInterrupt, SystemExit): + print 'Test interrupted' + server.stop () + client.stop () + client2.stop () + cleanup () +if (success == False): + sys.exit(1) +else: + sys.exit(0) + + diff --git a/src/integration-tests/test_integration_connection_values_tcp.py.in b/src/integration-tests/test_integration_connection_values_tcp.py.in new file mode 100755 index 0000000..d8a92ba --- /dev/null +++ b/src/integration-tests/test_integration_connection_values_tcp.py.in @@ -0,0 +1,124 @@ +#!@PYTHON@ +# This file is part of GNUnet. +# (C) 2010 Christian Grothoff (and other contributing authors) +# +# GNUnet is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published +# by the Free Software Foundation; either version 2, or (at your +# option) any later version. +# +# GNUnet is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNUnet; see the file COPYING. If not, write to the +# Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. +# +# +# +# This test starts 3 peers and expects bootstrap and a connected clique +# +# Conditions for successful exit: +# Both peers have 1 connected peer in transport, core, topology, fs + +import sys +import os +import subprocess +import re +import shutil +import time +import pexpect +from gnunet_testing import Peer +from gnunet_testing import Test +from gnunet_testing import Check +from gnunet_testing import Condition +from gnunet_testing import * + + +#definitions + +testname = "test_integration_connection_value" +verbose = True +check_timeout = 180 + + +def cleanup (): + if os.name == "nt": + shutil.rmtree (os.path.join (os.getenv ("TEMP"), "c_normal_client"), True) + else: + shutil.rmtree ("/tmp/c_normal_client/", True) + + +def success_cont (check): + global success + success = True; + +def fail_cont (check): + global success + success= False; + check.evaluate(True) + + +def check_connect (): + check = Check (test) + check.add (EqualStatisticsCondition (client, 'transport', '# peers connected', client, 'core', '# neighbour entries allocated')) + check.add (EqualStatisticsCondition (client, 'transport', '# peers connected', client, 'core', '# peers connected')) + check.add (EqualStatisticsCondition (client, 'core', '# neighbour entries allocated', client, 'core', '# peers connected')) + check.add (EqualStatisticsCondition (client, 'transport', '# peers connected', client, 'topology', '# peers connected')) + check.add (EqualStatisticsCondition (client, 'topology', '# peers connected', client, 'core', '# peers connected')) + + while True: + check.reset() + res = check.run_once (None, None) + print "Values are equal" + check.evaluate (False) +#if (False == res): +# break + time.sleep (5) + +# +# Test execution +# +def run (): + global success + global test + global client + + + success = False + + test = Test ('test_integration_connection_value', verbose) + + client = Peer(test, './confs/c_normal_client_tcp.conf'); + client.start(); + + if (client.started == True): + test.p ('Peers started, running check') + check_connect () + + client.stop () + + cleanup () + + if (success == False): + print ('Test failed') + return False + else: + return True + + +try: + run () +except (KeyboardInterrupt, SystemExit): + print 'Test interrupted' + client.stop () + cleanup () +if (success == False): + sys.exit(1) +else: + sys.exit(0) + + diff --git a/src/integration-tests/test_integration_connection_values_tcp_udp.py.in b/src/integration-tests/test_integration_connection_values_tcp_udp.py.in new file mode 100755 index 0000000..11b8266 --- /dev/null +++ b/src/integration-tests/test_integration_connection_values_tcp_udp.py.in @@ -0,0 +1,124 @@ +#!@PYTHON@ +# This file is part of GNUnet. +# (C) 2010 Christian Grothoff (and other contributing authors) +# +# GNUnet is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published +# by the Free Software Foundation; either version 2, or (at your +# option) any later version. +# +# GNUnet is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNUnet; see the file COPYING. If not, write to the +# Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. +# +# +# +# This test starts 3 peers and expects bootstrap and a connected clique +# +# Conditions for successful exit: +# Both peers have 1 connected peer in transport, core, topology, fs + +import sys +import os +import subprocess +import re +import shutil +import time +import pexpect +from gnunet_testing import Peer +from gnunet_testing import Test +from gnunet_testing import Check +from gnunet_testing import Condition +from gnunet_testing import * + + +#definitions + +testname = "test_integration_connection_value" +verbose = True +check_timeout = 180 + + +def cleanup (): + if os.name == "nt": + shutil.rmtree (os.path.join (os.getenv ("TEMP"), "c_normal_client"), True) + else: + shutil.rmtree ("/tmp/c_normal_client/", True) + + +def success_cont (check): + global success + success = True; + +def fail_cont (check): + global success + success= False; + check.evaluate(True) + + +def check_connect (): + check = Check (test) + check.add (EqualStatisticsCondition (client, 'transport', '# peers connected', client, 'core', '# neighbour entries allocated')) + check.add (EqualStatisticsCondition (client, 'transport', '# peers connected', client, 'core', '# peers connected')) + check.add (EqualStatisticsCondition (client, 'core', '# neighbour entries allocated', client, 'core', '# peers connected')) + check.add (EqualStatisticsCondition (client, 'transport', '# peers connected', client, 'topology', '# peers connected')) + check.add (EqualStatisticsCondition (client, 'topology', '# peers connected', client, 'core', '# peers connected')) + + while True: + check.reset() + res = check.run_once (None, None) + print "Values are equal" + check.evaluate (False) +#if (False == res): +# break + time.sleep (5) + +# +# Test execution +# +def run (): + global success + global test + global client + + + success = False + + test = Test ('test_integration_connection_value', verbose) + + client = Peer(test, './confs/c_normal_client_tcp_udp.conf'); + client.start(); + + if (client.started == True): + test.p ('Peers started, running check') + check_connect () + + client.stop () + + cleanup () + + if (success == False): + print ('Test failed') + return False + else: + return True + + +try: + run () +except (KeyboardInterrupt, SystemExit): + print 'Test interrupted' + client.stop () + cleanup () +if (success == False): + sys.exit(1) +else: + sys.exit(0) + + diff --git a/src/integration-tests/test_integration_connection_values_tcp_udp_http.py.in b/src/integration-tests/test_integration_connection_values_tcp_udp_http.py.in new file mode 100755 index 0000000..69184a2 --- /dev/null +++ b/src/integration-tests/test_integration_connection_values_tcp_udp_http.py.in @@ -0,0 +1,124 @@ +#!@PYTHON@ +# This file is part of GNUnet. +# (C) 2010 Christian Grothoff (and other contributing authors) +# +# GNUnet is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published +# by the Free Software Foundation; either version 2, or (at your +# option) any later version. +# +# GNUnet is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNUnet; see the file COPYING. If not, write to the +# Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. +# +# +# +# This test starts 3 peers and expects bootstrap and a connected clique +# +# Conditions for successful exit: +# Both peers have 1 connected peer in transport, core, topology, fs + +import sys +import os +import subprocess +import re +import shutil +import time +import pexpect +from gnunet_testing import Peer +from gnunet_testing import Test +from gnunet_testing import Check +from gnunet_testing import Condition +from gnunet_testing import * + + +#definitions + +testname = "test_integration_connection_value" +verbose = True +check_timeout = 180 + + +def cleanup (): + if os.name == "nt": + shutil.rmtree (os.path.join (os.getenv ("TEMP"), "c_normal_client"), True) + else: + shutil.rmtree ("/tmp/c_normal_client/", True) + + +def success_cont (check): + global success + success = True; + +def fail_cont (check): + global success + success= False; + check.evaluate(True) + + +def check_connect (): + check = Check (test) + check.add (EqualStatisticsCondition (client, 'transport', '# peers connected', client, 'core', '# neighbour entries allocated')) + check.add (EqualStatisticsCondition (client, 'transport', '# peers connected', client, 'core', '# peers connected')) + check.add (EqualStatisticsCondition (client, 'core', '# neighbour entries allocated', client, 'core', '# peers connected')) + check.add (EqualStatisticsCondition (client, 'transport', '# peers connected', client, 'topology', '# peers connected')) + check.add (EqualStatisticsCondition (client, 'topology', '# peers connected', client, 'core', '# peers connected')) + + while True: + check.reset() + res = check.run_once (None, None) + print "Values are equal" + check.evaluate (False) +#if (False == res): +# break + time.sleep (5) + +# +# Test execution +# +def run (): + global success + global test + global client + + + success = False + + test = Test ('test_integration_connection_value', verbose) + + client = Peer(test, './confs/c_normal_client_tcp_udp_http.conf'); + client.start(); + + if (client.started == True): + test.p ('Peers started, running check') + check_connect () + + client.stop () + + cleanup () + + if (success == False): + print ('Test failed') + return False + else: + return True + + +try: + run () +except (KeyboardInterrupt, SystemExit): + print 'Test interrupted' + client.stop () + cleanup () +if (success == False): + sys.exit(1) +else: + sys.exit(0) + + diff --git a/src/integration-tests/test_integration_disconnect.py.in b/src/integration-tests/test_integration_disconnect.py.in index 5e137cf..6f84f37 100755 --- a/src/integration-tests/test_integration_disconnect.py.in +++ b/src/integration-tests/test_integration_disconnect.py.in @@ -44,7 +44,7 @@ from gnunet_testing import * testname = "test_integration_disconnect" verbose = True -check_timeout = 30 +check_timeout = 180 def cleanup (): @@ -73,7 +73,7 @@ def check_disconnect (): check = Check (test) check.add (StatisticsCondition (client, 'transport', '# peers connected',0)) check.add (StatisticsCondition (client, 'core', '# neighbour entries allocated',0)) - check.add (StatisticsCondition (client, 'core', '# entries in session map',0)) + check.add (StatisticsCondition (client, 'core', '# peers connected',0)) check.add (StatisticsCondition (client, 'topology', '# peers connected',0)) check.add (StatisticsCondition (client, 'fs', '# peers connected',0)) check.run_blocking (check_timeout, success_disconnect_cont, fail_disconnect_cont) @@ -93,13 +93,13 @@ def check_connect (): check = Check (test) check.add (StatisticsCondition (client, 'transport', '# peers connected',1)) check.add (StatisticsCondition (client, 'core', '# neighbour entries allocated',1)) - check.add (StatisticsCondition (client, 'core', '# entries in session map',1)) + check.add (StatisticsCondition (client, 'core', '# peers connected',1)) check.add (StatisticsCondition (client, 'topology', '# peers connected',1)) check.add (StatisticsCondition (client, 'fs', '# peers connected',1)) check.add (StatisticsCondition (server, 'transport', '# peers connected',1)) check.add (StatisticsCondition (server, 'core', '# neighbour entries allocated',1)) - check.add (StatisticsCondition (server, 'core', '# entries in session map',1)) + check.add (StatisticsCondition (server, 'core', '# peers connected',1)) check.add (StatisticsCondition (server, 'topology', '# peers connected',1)) check.add (StatisticsCondition (server, 'fs', '# peers connected',1)) diff --git a/src/integration-tests/test_integration_restart.py.in b/src/integration-tests/test_integration_restart.py.in index e2a72e7..26917d0 100755 --- a/src/integration-tests/test_integration_restart.py.in +++ b/src/integration-tests/test_integration_restart.py.in @@ -45,7 +45,7 @@ from gnunet_testing import * testname = "test_integration_restart" verbose = False -check_timeout = 30 +check_timeout = 180 def cleanup (): @@ -85,13 +85,13 @@ def success_connect_cont (check): check = Check (test) check.add (StatisticsCondition (client, 'transport', '# peers connected',1)) check.add (StatisticsCondition (client, 'core', '# neighbour entries allocated',1)) - check.add (StatisticsCondition (client, 'core', '# entries in session map',1)) + check.add (StatisticsCondition (client, 'core', '# peers connected',1)) check.add (StatisticsCondition (client, 'topology', '# peers connected',1)) check.add (StatisticsCondition (client, 'fs', '# peers connected',1)) check.add (StatisticsCondition (server, 'transport', '# peers connected',1)) check.add (StatisticsCondition (server, 'core', '# neighbour entries allocated',1)) - check.add (StatisticsCondition (server, 'core', '# entries in session map',1)) + check.add (StatisticsCondition (server, 'core', '# peers connected',1)) check.add (StatisticsCondition (server, 'topology', '# peers connected',1)) check.add (StatisticsCondition (server, 'fs', '# peers connected',1)) @@ -108,13 +108,13 @@ def check_connect (): check = Check (test) check.add (StatisticsCondition (client, 'transport', '# peers connected',1)) check.add (StatisticsCondition (client, 'core', '# neighbour entries allocated',1)) - check.add (StatisticsCondition (client, 'core', '# entries in session map',1)) + check.add (StatisticsCondition (client, 'core', '# peers connected',1)) check.add (StatisticsCondition (client, 'topology', '# peers connected',1)) check.add (StatisticsCondition (client, 'fs', '# peers connected',1)) check.add (StatisticsCondition (server, 'transport', '# peers connected',1)) check.add (StatisticsCondition (server, 'core', '# neighbour entries allocated',1)) - check.add (StatisticsCondition (server, 'core', '# entries in session map',1)) + check.add (StatisticsCondition (server, 'core', '# peers connected',1)) check.add (StatisticsCondition (server, 'topology', '# peers connected',1)) check.add (StatisticsCondition (server, 'fs', '# peers connected',1)) |