diff options
author | Amarnath Valluri <amarnath.valluri@linux.intel.com> | 2013-08-22 15:27:24 +0300 |
---|---|---|
committer | Amarnath Valluri <amarnath.valluri@linux.intel.com> | 2013-08-22 16:59:26 +0300 |
commit | 1fd618eee96db111f3eea0806eccb8cf2ad91106 (patch) | |
tree | a5536e388228a0a1e51ffe8a49e0fc007d0074da /test | |
parent | e9a79beef3cd891ac16bae05a28c91c613df6442 (diff) | |
download | gsignond-1fd618eee96db111f3eea0806eccb8cf2ad91106.tar.gz gsignond-1fd618eee96db111f3eea0806eccb8cf2ad91106.tar.bz2 gsignond-1fd618eee96db111f3eea0806eccb8cf2ad91106.zip |
Release 0.0.3submit/tizen_ivi_stable/20131116.010012submit/tizen_ivi_milestone/20131113.054031submit/tizen_ivi_genivi/20140131.070607submit/tizen_ivi_generic/20140131.065427submit/tizen/20130823.063748ivi_oct_m2accepted/tizen_ivi_stable/20131116.012237accepted/tizen/ivi/genivi/20140131.070559tizen_ivi_geniviaccepted/tizen/ivi/stableaccepted/tizen/ivi/genivi
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 10 | ||||
-rw-r--r-- | test/Makefile.in | 83 | ||||
-rw-r--r-- | test/common/Makefile.am | 1 | ||||
-rw-r--r-- | test/common/Makefile.in | 37 | ||||
-rw-r--r-- | test/daemon/Makefile.in | 36 | ||||
-rw-r--r-- | test/daemon/daemon-test.c | 35 | ||||
-rw-r--r-- | test/db/Makefile.am | 3 | ||||
-rw-r--r-- | test/db/Makefile.in | 40 | ||||
-rw-r--r-- | test/db/dbtest.c | 33 | ||||
-rw-r--r-- | test/plugins/Makefile.am | 1 | ||||
-rw-r--r-- | test/plugins/Makefile.in | 37 | ||||
-rw-r--r-- | test/plugins/digestplugintest.c | 10 | ||||
-rw-r--r-- | test/plugins/passwordplugintest.c | 8 | ||||
-rw-r--r-- | test/plugins/pluginproxytest.c | 17 | ||||
-rw-r--r-- | test/plugins/pluginremotetest.c | 8 | ||||
-rw-r--r-- | test/valgrind.supp | 20 | ||||
-rw-r--r-- | test/valgrind_common.mk | 5 |
17 files changed, 275 insertions, 109 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index efbc92a..7a4a95e 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,4 +1,12 @@ +if HAVE_DEBUG SUBDIRS = common daemon db plugins +else +SUBDIRS = + +check-local: + @echo "ERROR: tests are enabled only if ./configure is run with --enable-debug" + @exit 1 +endif VALGRIND_TESTS_DISABLE = valgrind: $(SUBDIRS) @@ -8,4 +16,4 @@ valgrind: $(SUBDIRS) EXTRA_DIST = \ valgrind.supp \ - valgrind_common.mk
\ No newline at end of file + valgrind_common.mk diff --git a/test/Makefile.in b/test/Makefile.in index 353ea0e..b61d289 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -15,6 +15,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -37,9 +54,10 @@ subdir = test DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gnu_make.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -61,6 +79,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ @@ -68,7 +91,7 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ distdir ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) +DIST_SUBDIRS = common daemon db plugins DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -233,7 +256,8 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = common daemon db plugins +@HAVE_DEBUG_FALSE@SUBDIRS = +@HAVE_DEBUG_TRUE@SUBDIRS = common daemon db plugins VALGRIND_TESTS_DISABLE = EXTRA_DIST = \ valgrind.supp \ @@ -446,13 +470,10 @@ distdir: $(DISTFILES) done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -472,7 +493,9 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done +@HAVE_DEBUG_TRUE@check-local: check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local check: check-recursive all-am: Makefile installdirs: installdirs-recursive @@ -573,23 +596,27 @@ ps-am: uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \ + ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic clean-libtool \ - ctags ctags-recursive distclean 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 installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am - + all all-am check check-am check-local clean clean-generic \ + clean-libtool ctags ctags-recursive distclean \ + 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 installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am + + +@HAVE_DEBUG_FALSE@check-local: +@HAVE_DEBUG_FALSE@ @echo "ERROR: tests are enabled only if ./configure is run with --enable-debug" +@HAVE_DEBUG_FALSE@ @exit 1 valgrind: $(SUBDIRS) for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(SUBDIRS)); do \ cd $$t; $(MAKE) valgrind; cd ..;\ diff --git a/test/common/Makefile.am b/test/common/Makefile.am index a6c6885..a43367c 100644 --- a/test/common/Makefile.am +++ b/test/common/Makefile.am @@ -2,7 +2,6 @@ TESTS = commontest TESTS_ENVIRONMENT= SSO_PLUGINS_DIR=$(top_builddir)/src/plugins/.libs \ SSO_BIN_DIR=$(top_builddir)/src/daemon/.libs \ SSO_STORAGE_PATH=/tmp/gsignond \ - SSO_SECRET_PATH=/tmp/gsignond \ LD_LIBRARY_PATH="$(top_builddir)/src/daemon/plugins/plugind/.libs:$(top_builddir)/src/common/.libs:$(top_builddir)/src/common/db/.libs:$(top_builddir)/src/daemon/.libs:$(top_builddir)/src/daemon/db/.libs:$(top_builddir)/src/daemon/dbus/.libs:$(top_builddir)/src/daemon/plugins/.libs" VALGRIND_TESTS_DISABLE= diff --git a/test/common/Makefile.in b/test/common/Makefile.in index e0b10e0..296ce48 100644 --- a/test/common/Makefile.in +++ b/test/common/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -15,6 +15,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -40,9 +57,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ subdir = test/common ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gnu_make.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -89,6 +107,11 @@ am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(commontest_SOURCES) DIST_SOURCES = $(commontest_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac ETAGS = etags CTAGS = ctags am__tty_colors = \ @@ -235,7 +258,6 @@ top_srcdir = @top_srcdir@ TESTS_ENVIRONMENT = SSO_PLUGINS_DIR=$(top_builddir)/src/plugins/.libs \ SSO_BIN_DIR=$(top_builddir)/src/daemon/.libs \ SSO_STORAGE_PATH=/tmp/gsignond \ - SSO_SECRET_PATH=/tmp/gsignond \ LD_LIBRARY_PATH="$(top_builddir)/src/daemon/plugins/plugind/.libs:$(top_builddir)/src/common/.libs:$(top_builddir)/src/common/db/.libs:$(top_builddir)/src/daemon/.libs:$(top_builddir)/src/daemon/db/.libs:$(top_builddir)/src/daemon/dbus/.libs:$(top_builddir)/src/daemon/plugins/.libs" VALGRIND_TESTS_DISABLE = @@ -654,14 +676,15 @@ uninstall-am: %.valgrind: % @$(TESTS_ENVIRONMENT) \ + RUNNING_VALGRIND=yes \ CK_FORK=no \ - CK_DEFAULT_TIMEOUT=120 \ + CK_TIMEOUT_MULTIPLIER=10 \ G_SLICE=always-malloc \ $(LIBTOOL) --mode=execute \ valgrind -q \ $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \ --tool=memcheck --leak-check=full --trace-children=yes \ - --leak-resolution=high --num-callers=20 \ + --leak-resolution=high --num-callers=30 \ --error-exitcode=1 \ ./$* diff --git a/test/daemon/Makefile.in b/test/daemon/Makefile.in index 459c065..eae6ce5 100644 --- a/test/daemon/Makefile.in +++ b/test/daemon/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -15,6 +15,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -44,9 +61,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ subdir = test/daemon ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gnu_make.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -94,6 +112,11 @@ am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(daemontest_SOURCES) DIST_SOURCES = $(daemontest_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac ETAGS = etags CTAGS = ctags am__tty_colors = \ @@ -656,14 +679,15 @@ uninstall-am: %.valgrind: % @$(TESTS_ENVIRONMENT) \ + RUNNING_VALGRIND=yes \ CK_FORK=no \ - CK_DEFAULT_TIMEOUT=120 \ + CK_TIMEOUT_MULTIPLIER=10 \ G_SLICE=always-malloc \ $(LIBTOOL) --mode=execute \ valgrind -q \ $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \ --tool=memcheck --leak-check=full --trace-children=yes \ - --leak-resolution=high --num-callers=20 \ + --leak-resolution=high --num-callers=30 \ --error-exitcode=1 \ ./$* diff --git a/test/daemon/daemon-test.c b/test/daemon/daemon-test.c index 51ae1f4..2f4e470 100644 --- a/test/daemon/daemon-test.c +++ b/test/daemon/daemon-test.c @@ -37,7 +37,7 @@ #include "daemon/dbus/gsignond-dbus-auth-service-gen.h" #include "daemon/dbus/gsignond-dbus-identity-gen.h" #include "daemon/dbus/gsignond-dbus-auth-session-gen.h" -#include "gsignond/gsignond-identity-info.h" +#include "common/gsignond-identity-info.h" #include "gsignond/gsignond-log.h" #ifdef USE_P2P @@ -57,7 +57,6 @@ struct IdentityData { { "Secret", "s", "test_pass" }, { "StoreSecret", "b", (void *)TRUE} }; -gchar *exe_name = 0; #if HAVE_GTESTDBUS GTestDBus *dbus = NULL; @@ -65,19 +64,44 @@ GTestDBus *dbus = NULL; GPid daemon_pid = 0; #endif +static gchar* _get_executable_name() +{ + gchar *procfname; + char *path; + ssize_t res; + pid_t pid = getpid(); + + //valgrind does some magic with tasks, so we read the executable name of + //the 'main' task, instead of the current task + procfname = g_strdup_printf ("/proc/%d/task/%d/exe", pid, pid); + path = g_malloc0 (PATH_MAX + 1); + res = readlink (procfname, path, PATH_MAX); + g_free (procfname); + + if (res <= 0) { + WARN ("failed to follow link for pid %d", pid); + g_free (path); + return NULL; + } + return path; +} + static void setup_daemon (void) { + gchar* exe_name = _get_executable_name(); + fail_if(exe_name == NULL); + fail_if (g_setenv ("G_MESSAGES_DEBUG", "all", TRUE) == FALSE); fail_if (g_setenv ("SSO_IDENTITY_TIMEOUT", "5", TRUE) == FALSE); fail_if (g_setenv ("SSO_DAEMON_TIMEOUT", "5", TRUE) == FALSE); fail_if (g_setenv ("SSO_AUTH_SESSION_TIMEOUT", "5", TRUE) == FALSE); fail_if (g_setenv ("SSO_STORAGE_PATH", "/tmp/gsignond", TRUE) == FALSE); - fail_if (g_setenv ("SSO_SECRET_PATH", "/tmp/gsignond", TRUE) == FALSE); fail_if (g_setenv ("SSO_KEYCHAIN_SYSCTX", exe_name, TRUE) == FALSE); fail_if (g_setenv ("SSO_PLUGIN_TIMEOUT", "5", TRUE) == FALSE); - DBG ("Programe name : %s\n", exe_name); + DBG ("Programe pid %d, name : %s\n", getpid(), exe_name); + free(exe_name); if (system("rm -rf /tmp/gsignond") != 0) { DBG("Failed to clean db path : %s\n", strerror(errno)); @@ -182,7 +206,6 @@ teardown_daemon (void) g_unsetenv ("SSO_DAEMON_TIMEOUT"); g_unsetenv ("SSO_AUTH_SESSION_TIMEOUT"); g_unsetenv ("SSO_STORAGE_PATH"); - g_unsetenv ("SSO_SECRET_PATH"); g_unsetenv ("SSO_KEYCHAIN_SYSCTX"); } @@ -768,8 +791,6 @@ int main (int argc, char *argv[]) g_type_init (); #endif - exe_name = argv[0]; - s = daemon_suite(); sr = srunner_create(s); diff --git a/test/db/Makefile.am b/test/db/Makefile.am index 94574f2..5301171 100644 --- a/test/db/Makefile.am +++ b/test/db/Makefile.am @@ -1,6 +1,5 @@ TESTS = dbtest -TESTS_ENVIRONMENT= SSO_STORAGE_PATH=/tmp/gsignond \ - SSO_SECRET_PATH=/tmp/gsignond +TESTS_ENVIRONMENT= SSO_STORAGE_PATH=/tmp/gsignond VALGRIND_TESTS_DISABLE= diff --git a/test/db/Makefile.in b/test/db/Makefile.in index 7eaa9eb..6805be4 100644 --- a/test/db/Makefile.in +++ b/test/db/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -15,6 +15,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -40,9 +57,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ subdir = test/db ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gnu_make.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -90,6 +108,11 @@ am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(dbtest_SOURCES) DIST_SOURCES = $(dbtest_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac ETAGS = etags CTAGS = ctags am__tty_colors = \ @@ -233,9 +256,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -TESTS_ENVIRONMENT = SSO_STORAGE_PATH=/tmp/gsignond \ - SSO_SECRET_PATH=/tmp/gsignond - +TESTS_ENVIRONMENT = SSO_STORAGE_PATH=/tmp/gsignond VALGRIND_TESTS_DISABLE = SUPPRESSIONS = $(top_srcdir)/test/valgrind.supp dbtest_SOURCES = dbtest.c @@ -653,14 +674,15 @@ uninstall-am: %.valgrind: % @$(TESTS_ENVIRONMENT) \ + RUNNING_VALGRIND=yes \ CK_FORK=no \ - CK_DEFAULT_TIMEOUT=120 \ + CK_TIMEOUT_MULTIPLIER=10 \ G_SLICE=always-malloc \ $(LIBTOOL) --mode=execute \ valgrind -q \ $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \ --tool=memcheck --leak-check=full --trace-children=yes \ - --leak-resolution=high --num-callers=20 \ + --leak-resolution=high --num-callers=30 \ --error-exitcode=1 \ ./$* diff --git a/test/db/dbtest.c b/test/db/dbtest.c index c5156c9..72d830a 100644 --- a/test/db/dbtest.c +++ b/test/db/dbtest.c @@ -61,10 +61,11 @@ _compare_key_value( { GVariant *value2 = (GVariant *)g_hash_table_lookup (user_data->table, key); - if (value2 && g_variant_get_size (value2) == g_variant_get_size (value2) - && memcmp (g_variant_get_data (value2), + if (value2 && g_variant_get_size (value) == g_variant_get_size (value2) + && memcmp (g_variant_get_data(value2), g_variant_get_data(value), - g_variant_get_size(value2)) == 0) { + g_variant_get_size(value2)) == 0 + && g_variant_is_of_type(value2, g_variant_get_type (value))) { return; } user_data->status = 0; @@ -399,7 +400,6 @@ _gsignond_query_read_string ( START_TEST (test_sql_database) { GSignondDbSecretDatabase *database = NULL; - GSignondConfig *config = NULL; gchar *filename = NULL; const gchar *dir = NULL; GSignondCredentials *creds = NULL; @@ -435,12 +435,7 @@ START_TEST (test_sql_database) fail_unless (gsignond_db_secret_database_remove_data ( database, 1, 2) == FALSE); - config = gsignond_config_new (); - dir = gsignond_config_get_string (config, - GSIGNOND_CONFIG_GENERAL_STORAGE_PATH); - if (!dir) { - dir = g_get_user_data_dir (); - } + dir = "/tmp/gsignond"; g_mkdir_with_parents (dir, S_IRWXU); filename = g_build_filename (dir, "sql_db_test.db", NULL); fail_unless (gsignond_db_sql_database_open (sqldb, filename, @@ -449,7 +444,6 @@ START_TEST (test_sql_database) fail_unless (gsignond_db_sql_database_open (sqldb, filename, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) == TRUE); g_free (filename); - g_object_unref(config); creds = gsignond_credentials_new (); fail_if (creds == NULL); @@ -476,10 +470,15 @@ START_TEST (test_sql_database) (GDestroyNotify)g_variant_unref); fail_if (data == NULL); - g_hash_table_insert (data,"key1",g_variant_new_string ("string_value")); - g_hash_table_insert (data,"key2",g_variant_new_double (12223.4223)); - g_hash_table_insert (data,"key3",g_variant_new_uint16(20)); - g_hash_table_insert (data,"key4",g_variant_new("^ay", "byte_value")); + GVariantBuilder builder; + g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT); + g_variant_builder_add (&builder, "{sv}", "key1", g_variant_new_string ("string_value")); + g_variant_builder_add (&builder, "{sv}", "key2",g_variant_new_double (12223.4223)); + g_variant_builder_add (&builder, "{sv}", "key3",g_variant_new_uint16(20)); + g_variant_builder_add (&builder, "{sv}", "key4",g_variant_new("^ay", "byte_value")); + + g_hash_table_insert (data, "dummy_client_id", g_variant_builder_end (&builder)); + fail_unless (gsignond_db_secret_database_update_data ( database, id, method, data) == TRUE); data2 = gsignond_db_secret_database_load_data (database, id, method); @@ -610,6 +609,8 @@ START_TEST (test_secret_storage) const gchar *dir = NULL; config = gsignond_config_new (); + gsignond_config_set_string (config, GSIGNOND_CONFIG_GENERAL_SECURE_DIR, "/tmp/gsignond"); + /* Secret Storage */ storage = g_object_new (GSIGNOND_TYPE_SECRET_STORAGE, "config", config, NULL); @@ -713,6 +714,7 @@ START_TEST (test_metadata_database) GSignondSecurityContext *owner = NULL; config = gsignond_config_new (); + gsignond_config_set_string (config, GSIGNOND_CONFIG_GENERAL_SECURE_DIR, "/tmp/gsignond"); GSignondDbMetadataDatabase* metadata_db = NULL; metadata_db = gsignond_db_metadata_database_new (config); g_object_unref(config); @@ -887,6 +889,7 @@ START_TEST (test_credentials_database) GSignondDictionary *no_cap_filter = NULL; config = gsignond_config_new (); + gsignond_config_set_string (config, GSIGNOND_CONFIG_GENERAL_SECURE_DIR, "/tmp/gsignond"); storage = g_object_new (GSIGNOND_TYPE_SECRET_STORAGE, "config", config, NULL); g_object_unref(config); diff --git a/test/plugins/Makefile.am b/test/plugins/Makefile.am index 90b02ea..4b77125 100644 --- a/test/plugins/Makefile.am +++ b/test/plugins/Makefile.am @@ -3,7 +3,6 @@ TESTS = digestplugintest passwordplugintest pluginproxytest pluginremotetest TESTS_ENVIRONMENT= SSO_PLUGINS_DIR=$(top_builddir)/src/plugins/.libs \ SSO_BIN_DIR=$(top_builddir)/src/daemon/.libs \ SSO_STORAGE_PATH=/tmp/gsignond \ - SSO_SECRET_PATH=/tmp/gsignond \ LD_LIBRARY_PATH="$(top_builddir)/src/daemon/plugins/plugind/.libs:$(top_builddir)/src/common/.libs:$(top_builddir)/src/common/db/.libs:$(top_builddir)/src/daemon/.libs:$(top_builddir)/src/daemon/db/.libs:$(top_builddir)/src/daemon/dbus/.libs:$(top_builddir)/src/daemon/plugins/.libs" VALGRIND_TESTS_DISABLE = diff --git a/test/plugins/Makefile.in b/test/plugins/Makefile.in index e8a3604..f4bcbd8 100644 --- a/test/plugins/Makefile.in +++ b/test/plugins/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -15,6 +15,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -42,9 +59,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ subdir = test/plugins ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gnu_make.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -131,6 +149,11 @@ SOURCES = $(digestplugintest_SOURCES) $(passwordplugintest_SOURCES) \ DIST_SOURCES = $(digestplugintest_SOURCES) \ $(passwordplugintest_SOURCES) $(pluginproxytest_SOURCES) \ $(pluginremotetest_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac ETAGS = etags CTAGS = ctags am__tty_colors = \ @@ -277,7 +300,6 @@ top_srcdir = @top_srcdir@ TESTS_ENVIRONMENT = SSO_PLUGINS_DIR=$(top_builddir)/src/plugins/.libs \ SSO_BIN_DIR=$(top_builddir)/src/daemon/.libs \ SSO_STORAGE_PATH=/tmp/gsignond \ - SSO_SECRET_PATH=/tmp/gsignond \ LD_LIBRARY_PATH="$(top_builddir)/src/daemon/plugins/plugind/.libs:$(top_builddir)/src/common/.libs:$(top_builddir)/src/common/db/.libs:$(top_builddir)/src/daemon/.libs:$(top_builddir)/src/daemon/db/.libs:$(top_builddir)/src/daemon/dbus/.libs:$(top_builddir)/src/daemon/plugins/.libs" VALGRIND_TESTS_DISABLE = @@ -799,14 +821,15 @@ uninstall-am: %.valgrind: % @$(TESTS_ENVIRONMENT) \ + RUNNING_VALGRIND=yes \ CK_FORK=no \ - CK_DEFAULT_TIMEOUT=120 \ + CK_TIMEOUT_MULTIPLIER=10 \ G_SLICE=always-malloc \ $(LIBTOOL) --mode=execute \ valgrind -q \ $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \ --tool=memcheck --leak-check=full --trace-children=yes \ - --leak-resolution=high --num-callers=20 \ + --leak-resolution=high --num-callers=30 \ --error-exitcode=1 \ ./$* diff --git a/test/plugins/digestplugintest.c b/test/plugins/digestplugintest.c index 953eefd..4dfe3c6 100644 --- a/test/plugins/digestplugintest.c +++ b/test/plugins/digestplugintest.c @@ -117,7 +117,7 @@ START_TEST (test_digestplugin_request) gsignond_session_data_set_username(data, "user1"); gsignond_session_data_set_secret(data, "password1"); - gsignond_plugin_request_initial(plugin, data, "digest"); + gsignond_plugin_request_initial(plugin, data, NULL, "digest"); fail_if(result != NULL); fail_if(ui_action != NULL); fail_if(error == NULL); @@ -134,7 +134,7 @@ START_TEST (test_digestplugin_request) gsignond_dictionary_set_string(data, "Method", "GET"); gsignond_dictionary_set_string(data, "DigestUri", "/test/index.html"); - gsignond_plugin_request_initial(plugin, data, "digest"); + gsignond_plugin_request_initial(plugin, data, NULL, "digest"); fail_if(result == NULL); fail_if(ui_action != NULL); fail_if(error != NULL); @@ -147,7 +147,7 @@ START_TEST (test_digestplugin_request) //remove secret so that ui action is required gsignond_dictionary_remove (data, "Secret"); - gsignond_plugin_request_initial(plugin, data, "digest"); + gsignond_plugin_request_initial(plugin, data, NULL, "digest"); fail_if(result != NULL); fail_if(ui_action == NULL); fail_if(error != NULL); @@ -186,7 +186,7 @@ START_TEST (test_digestplugin_user_action_finished) G_CALLBACK(user_action_required_callback), &ui_action); g_signal_connect(plugin, "error", G_CALLBACK(error_callback), &error); - ui_data = gsignond_signonui_data_new(); + ui_data = gsignond_dictionary_new(); gsignond_signonui_data_set_query_error(ui_data, SIGNONUI_ERROR_NONE); //empty data @@ -243,7 +243,7 @@ START_TEST (test_digestplugin_user_action_finished) "abg10b1234ee1f0e8b11d0f600bfb0c093"); gsignond_dictionary_set_string (data, "Method", "GET"); gsignond_dictionary_set_string (data, "DigestUri", "/test/index.html"); - gsignond_plugin_request_initial (plugin, data, "digest"); + gsignond_plugin_request_initial (plugin, data, NULL, "digest"); gsignond_dictionary_unref (data); data = NULL; gsignond_plugin_user_action_finished (plugin, ui_data); diff --git a/test/plugins/passwordplugintest.c b/test/plugins/passwordplugintest.c index b7b3eab..5c7670a 100644 --- a/test/plugins/passwordplugintest.c +++ b/test/plugins/passwordplugintest.c @@ -105,7 +105,7 @@ START_TEST (test_passwordplugin_request) // username empty, password not empty gsignond_session_data_set_secret(data, "megapassword"); - gsignond_plugin_request_initial(plugin, data, "password"); + gsignond_plugin_request_initial(plugin, data, NULL, "password"); fail_if(result == NULL); fail_if(ui_action != NULL); fail_if(error != NULL); @@ -117,7 +117,7 @@ START_TEST (test_passwordplugin_request) // username and password not empty gsignond_session_data_set_username(data, "megauser"); - gsignond_plugin_request_initial(plugin, data, "password"); + gsignond_plugin_request_initial(plugin, data, NULL, "password"); fail_if(result == NULL); fail_if(ui_action != NULL); fail_if(error != NULL); @@ -131,7 +131,7 @@ START_TEST (test_passwordplugin_request) //username and password empty gsignond_dictionary_unref(data); data = gsignond_dictionary_new(); - gsignond_plugin_request_initial(plugin, data, "password"); + gsignond_plugin_request_initial(plugin, data, NULL, "password"); fail_if(result != NULL); fail_if(ui_action == NULL); fail_if(error != NULL); @@ -144,7 +144,7 @@ START_TEST (test_passwordplugin_request) //username not empty, password empty gsignond_session_data_set_username(data, "megauser"); - gsignond_plugin_request_initial(plugin, data, "password"); + gsignond_plugin_request_initial(plugin, data, NULL, "password"); fail_if(result != NULL); fail_if(ui_action == NULL); fail_if(error != NULL); diff --git a/test/plugins/pluginproxytest.c b/test/plugins/pluginproxytest.c index 998abfe..811b541 100644 --- a/test/plugins/pluginproxytest.c +++ b/test/plugins/pluginproxytest.c @@ -134,10 +134,10 @@ gsignond_auth_session_notify_process_result ( gsignond_session_data_set_username(data, "megauser"); gsignond_session_data_set_secret(data, "megapassword"); - gsignond_plugin_proxy_process(proxy, iface, data, "password", + gsignond_plugin_proxy_process(proxy, iface, data, NULL, "password", proxy); - gsignond_plugin_proxy_process(proxy, iface, data, "password", + gsignond_plugin_proxy_process(proxy, iface, data, NULL, "password", proxy); gsignond_dictionary_unref(data); @@ -154,7 +154,7 @@ gsignond_auth_session_notify_process_result ( fail_if(data == NULL); for (i = 0; i < 9; i++) { - gsignond_plugin_proxy_process(proxy, iface, data, "mech1", + gsignond_plugin_proxy_process(proxy, iface, data, NULL, "mech1", proxy); } gsignond_dictionary_unref(data); @@ -303,7 +303,7 @@ START_TEST (test_pluginproxy_process) testing_proxy_process = TRUE; - gsignond_plugin_proxy_process(proxy, test_auth_session, data, "password", + gsignond_plugin_proxy_process(proxy, test_auth_session, data, NULL, "password", proxy); _run_mainloop (); @@ -335,7 +335,7 @@ START_TEST (test_pluginproxy_process_cancel) testing_proxy_process_cancel = TRUE; - gsignond_plugin_proxy_process(proxy, test_auth_session, data, "mech1", + gsignond_plugin_proxy_process(proxy, test_auth_session, data, NULL, "mech1", proxy); _run_mainloop (); @@ -369,7 +369,7 @@ START_TEST (test_pluginproxy_process_queue) testing_proxy_process_queue = TRUE; - gsignond_plugin_proxy_process(proxy, test_auth_session, data, "password", + gsignond_plugin_proxy_process(proxy, test_auth_session, data, NULL, "password", proxy); _run_mainloop (); @@ -399,7 +399,7 @@ START_TEST (test_pluginproxy_process_queue_cancel) testing_proxy_process_queue_cancel = TRUE; - gsignond_plugin_proxy_process(proxy, test_auth_session, data, "mech1", + gsignond_plugin_proxy_process(proxy, test_auth_session, data, NULL, "mech1", proxy); _run_mainloop (); @@ -498,7 +498,8 @@ START_TEST (test_pluginproxyfactory_add) fail_if(gsignond_plugin_proxy_factory_add_plugin(factory, proxy) == TRUE); fail_if(gsignond_plugin_proxy_factory_get_plugin(factory, "password") != proxy); - + g_object_unref(proxy); + g_object_unref(proxy); g_object_unref(factory); g_object_unref(config); diff --git a/test/plugins/pluginremotetest.c b/test/plugins/pluginremotetest.c index 32fc2cb..18d1475 100644 --- a/test/plugins/pluginremotetest.c +++ b/test/plugins/pluginremotetest.c @@ -340,7 +340,7 @@ START_TEST (test_pluginremote_request) // username empty, password not empty gsignond_session_data_set_secret(data, "megapassword"); - gsignond_plugin_request_initial(plugin, data, "password"); + gsignond_plugin_request_initial(plugin, data, NULL, "password"); _run_mainloop (); fail_if(result == NULL); @@ -354,7 +354,7 @@ START_TEST (test_pluginremote_request) // username and password not empty gsignond_session_data_set_username(data, "megauser"); - gsignond_plugin_request_initial(plugin, data, "password"); + gsignond_plugin_request_initial(plugin, data, NULL, "password"); _run_mainloop (); fail_if(result == NULL); @@ -370,7 +370,7 @@ START_TEST (test_pluginremote_request) //username and password empty gsignond_dictionary_unref(data); data = gsignond_dictionary_new(); - gsignond_plugin_request_initial(plugin, data, "password"); + gsignond_plugin_request_initial(plugin, data, NULL, "password"); _run_mainloop (); fail_if(result != NULL); @@ -387,7 +387,7 @@ START_TEST (test_pluginremote_request) //username not empty, password empty gsignond_session_data_set_username(data, "megauser"); - gsignond_plugin_request_initial(plugin, data, "password"); + gsignond_plugin_request_initial(plugin, data, NULL, "password"); _run_mainloop (); fail_if(result != NULL); diff --git a/test/valgrind.supp b/test/valgrind.supp index e791e62..6155af4 100644 --- a/test/valgrind.supp +++ b/test/valgrind.supp @@ -52,5 +52,21 @@ Memcheck:Leak ... fun:g_resolver_lookup_by_name_async } - - +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:_dl_allocate_tls +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:gdbus_shared_thread_func +} +{ + <insert_a_suppression_name_here> + Memcheck:Leak + ... + fun:g_get_user_data_dir +} diff --git a/test/valgrind_common.mk b/test/valgrind_common.mk index 4b0cc5b..358fe3f 100644 --- a/test/valgrind_common.mk +++ b/test/valgrind_common.mk @@ -2,14 +2,15 @@ SUPPRESSIONS = $(top_srcdir)/test/valgrind.supp %.valgrind: % @$(TESTS_ENVIRONMENT) \ + RUNNING_VALGRIND=yes \ CK_FORK=no \ - CK_DEFAULT_TIMEOUT=120 \ + CK_TIMEOUT_MULTIPLIER=10 \ G_SLICE=always-malloc \ $(LIBTOOL) --mode=execute \ valgrind -q \ $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \ --tool=memcheck --leak-check=full --trace-children=yes \ - --leak-resolution=high --num-callers=20 \ + --leak-resolution=high --num-callers=30 \ --error-exitcode=1 \ ./$* |