On (17/12/14 18:23), Nikolai Kondrashov wrote:
Hi everyone,
In order to run integration tests as non-root we would need to have all data
directories and files to reside in a user-writeable (temporary) directory.
However, it seems that various sssd data directory and file locations are
spread over the code as preprocessor macros, resulting in static strings. See
the output of this command executed in a build dir:
I have already written it in previous thread.
Making this changeable at runtime doesn't seem to be practical.
Replacing all
these in binaries after build somehow is not easy to do reliably. So, are we
left with forgoing the idea of running cwrap tests under "make check" and
relying on a special-prefix build in "contrib/ci/run", or could there be some
other ways?
It could be "fakechroot", but it is not in RHEL repos, it seems, and I'm
not
sure how well it will work and how easy it will be to setup and maintain the
required directory tree and files.
Please do not mention fakechroot anymore. I thought we agreed in previous
thread that it isn't a way.
You can use different prefix even with make check.
"make distcheck" uses it in such way. It doesn't make sense to reinvent
wheel.
The only difference is that make distcheck does not run program. It just calls
"make install" and "make uninstall" (very simplified version)
Here is simplified part of distcheck. We can use similar approach.
distcheck: dist
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e
's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=.. --prefix="$$dc_install_base" \
^^^^^^^^^^^^^^^^^
custom prefix in make distcheck
&& $(MAKE) $(AM_MAKEFLAGS) \
LS