summaryrefslogtreecommitdiffstats
path: root/Makefile.am
diff options
context:
space:
mode:
authorNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>2014-11-24 19:13:16 +0200
committerJakub Hrozek <jhrozek@redhat.com>2015-05-28 13:55:52 +0200
commit9d453f1e8b28983b363b44c49b7cd701a994fd97 (patch)
treef681e8183b68cfcca3e7b618b119238489b46cce /Makefile.am
parent9c5e4ae08ea41f9b1cdb3b3d0e9c35056baeab86 (diff)
downloadsssd-9d453f1e8b28983b363b44c49b7cd701a994fd97.tar.gz
sssd-9d453f1e8b28983b363b44c49b7cd701a994fd97.tar.xz
sssd-9d453f1e8b28983b363b44c49b7cd701a994fd97.zip
Add integration tests
Add "intgcheck" make target. Update CI to use it. The "intgcheck" target configures and builds sssd in a sub-directory, installs it into a prefix in another sub-directory, and then makes the "intgcheck-installed" target from within src/tests/intg in that separate build. The "intgcheck-installed" target in src/tests/intg runs py.test for all tests it can find in that directory, under fakeroot and nss_wrapper/uid_wrapper environments emulating running under root. It also adds the value of INTGCHECK_PYTEST_ARGS environment/make variable to the py.test command line. You can use it to pass additional py.test options, such as specifying a subset of tests to run. See "py.test --help" output. There are only two test suites in src/tests/intg at the moment: ent_test.py and ldap_test.py. The ent_test.py runs tests on ent.py - a module of assertion functions for checking entries in NSS database (passwd and group), for use in actual tests. The ent_test.py suite can be used as ent.py usage reference. The ldap_test.py suite sets up and starts a slapd instance, adds a few user and group entries, configures and starts sssd and verifies that those users and groups are retrieved correctly using various NSS functions. The tests are very basic at the moment. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Michal Židek <mzidek@redhat.com>
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am28
1 files changed, 27 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 322f49887..1970b812e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,7 +19,7 @@ if HAVE_MANPAGES
SUBDIRS += src/man
endif
-SUBDIRS += . src/tests/cwrap
+SUBDIRS += . src/tests/cwrap src/tests/intg
# Some old versions of automake don't define builddir
builddir ?= .
@@ -2424,6 +2424,32 @@ autofs_test_client_CFLAGS = $(AM_CFLAGS)
autofs_test_client_LDADD = -lpopt $(CLIENT_LIBS)
endif
+#####################
+# Integration tests #
+#####################
+
+intgcheck:
+ set -e; \
+ rm -Rf intg; \
+ $(MKDIR_P) intg/bld; \
+ : Use /hopefully/ short prefix to keep D-Bus socket path short; \
+ prefix=`mktemp --tmpdir --directory sssd-intg.XXXXXXXX`; \
+ $(LN_S) "$$prefix" intg/pfx; \
+ cd intg/bld; \
+ $(abs_top_srcdir)/configure \
+ --prefix="$$prefix" \
+ --with-ldb-lib-dir="$$prefix"/lib/ldb \
+ --enable-intgcheck-reqs \
+ $(INTGCHECK_CONFIGURE_FLAGS); \
+ $(MAKE) $(AM_MAKEFLAGS); \
+ : Force single-thread install to workaround concurrency issues; \
+ $(MAKE) $(AM_MAKEFLAGS) -j1 install; \
+ : Remove .la files from LDB module directory to avoid loader warnings; \
+ rm "$$prefix"/lib/ldb/*.la; \
+ $(MAKE) $(AM_MAKEFLAGS) -C src/tests/intg intgcheck-installed; \
+ cd ../..; \
+ rm -Rf "$$prefix" intg
+
####################
# Client Libraries #
####################