Skip to content

Commit 53006c9

Browse files
committedMar 9, 2017
Allow make distcheck to complete successfully
Add an override path option for distcheck so that the shared object can be installed in a user controlled directory instead of the system defined apxs one. make distcheck marks the source directory as read only, this requires passing some parameters to the tests so that they create the tests directory in a writable path. Also add rule to remove these files once done. Signed-off-by: Simo Sorce <simo@redhat.com>
1 parent d61862b commit 53006c9

File tree

5 files changed

+42
-10
lines changed

5 files changed

+42
-10
lines changed
 

‎Makefile.am

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
ACLOCAL_AMFLAGS = -I m4
2+
DISTCHECK_CONFIGURE_FLAGS=--with-installpath=`pwd`/apxs_modules
23

3-
SUBDIRS = src/asn1c src
4+
SUBDIRS = src/asn1c src tests
5+
6+
TESTSDIR=$(abs_builddir)/testsdir
7+
8+
distclean-local:
9+
rm -fr $(TESTSDIR)
410

511
check: all
6-
$(srcdir)/tests/magtests.py
12+
cd $(srcdir) && ./tests/magtests.py --path $(TESTSDIR) --so-dir=$(abs_builddir)/src/.libs
713

814
test: check

‎configure.ac

+11-4
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,22 @@ AC_TYPE_UINT32_T
2626
# Checks for library functions.
2727
AC_CHECK_FUNCS([strcasecmp])
2828

29+
AC_ARG_WITH([installpath],
30+
[AS_HELP_STRING([--with-installpath=PATH],
31+
[alternative install path])],
32+
[AC_SUBST(INSTALLPATH, $with_installpath)])
33+
2934
AC_ARG_WITH([apxs],
3035
[AS_HELP_STRING([--with-apxs=PATH/NAME],[path to the apxs binary [[apxs]]])],
3136
[AC_SUBST(APXS, $with_apxs)],
3237
[AC_PATH_PROGS(APXS, [apxs2 apxs])])
38+
3339
AS_IF([test "x${APXS}" != "x" -a -x "${APXS}"],
3440
[AC_MSG_NOTICE([apxs found at $APXS])
35-
APXS_LIBEXECDIR=`${APXS} -q LIBEXECDIR`
41+
AS_IF([test "x${INSTALLPATH}" != "x"],
42+
[AC_MSG_NOTICE([installpath set at $INSTALLPATH])
43+
APXS_LIBEXECDIR=`echo ${INSTALLPATH}`],
44+
[APXS_LIBEXECDIR=`${APXS} -q LIBEXECDIR`])
3645
AC_SUBST(APXS_LIBEXECDIR)],
3746
[AC_MSG_FAILURE(["apxs not found. Use --with-apxs"])])
3847

@@ -77,13 +86,11 @@ AC_SUBST([GSSAPI_LIBS])
7786
MAG_CFLAGS="`${APXS} -q CFLAGS` `${APXS} -q EXTRA_CPPFLAGS` `${APR} --cflags` ${GSSAPI_CFLAGS} ${OPENSSL_CFLAGS} -I`${APXS} -q INCLUDEDIR` `${APR} --includes`"
7887
MAG_LIBS="`${APR} --libs` ${GSSAPI_LIBS} ${OPENSSL_LIBS}"
7988
LIBTOOL="`${APXS} -q LIBTOOL`"
80-
MAG_LIBDIR="`${APXS} -q libexecdir`"
8189

8290
AC_SUBST([MAG_CFLAGS])
8391
AC_SUBST([MAG_LIBS])
8492
AC_SUBST([LIBTOOL])
85-
AC_SUBST([MAG_LIBDIR])
8693

87-
AC_CONFIG_FILES([Makefile src/Makefile src/asn1c/Makefile])
94+
AC_CONFIG_FILES([Makefile src/Makefile src/asn1c/Makefile tests/Makefile])
8895

8996
AC_OUTPUT

‎src/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
AM_CPPFLAGS = -I $(srcdir)/asn1c
22

3-
magdir = $(MAG_LIBDIR)
3+
magdir = $(APXS_LIBEXECDIR)
44
mag_LTLIBRARIES = \
55
mod_auth_gssapi.la
66

‎tests/Makefile.am

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
EXTRA_DIST = \
2+
401.html \
3+
httpd.conf \
4+
index.html \
5+
magtests.py \
6+
t_bad_acceptor_name.py \
7+
t_basic_k5_fail_second.py \
8+
t_basic_k5.py \
9+
t_basic_k5_two_users.py \
10+
t_basic_proxy.py \
11+
t_spnego_negotiate_once.py \
12+
t_spnego_no_auth.py \
13+
t_spnego_proxy.py \
14+
t_spnego.py \
15+
t_spnego_rewrite.py \
16+
$(NULL)

‎tests/magtests.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ def parse_args():
2121
parser = argparse.ArgumentParser(description='Mod Auth GSSAPI Tests Environment')
2222
parser.add_argument('--path', default='%s/scratchdir' % os.getcwd(),
2323
help="Directory in which tests are run")
24+
parser.add_argument('--so-dir', default='%s/src/.libs' % os.getcwd(),
25+
help="mod_auth_gssapi shared object dirpath")
2426

2527
return vars(parser.parse_args())
2628

@@ -207,7 +209,7 @@ def setup_keys(tesdir, env):
207209
return keys_env
208210

209211

210-
def setup_http(testdir, wrapenv):
212+
def setup_http(testdir, so_dir, wrapenv):
211213

212214
httpdir = os.path.join(testdir, 'httpd')
213215
if os.path.exists(httpdir):
@@ -226,7 +228,7 @@ def setup_http(testdir, wrapenv):
226228
raise ValueError("Could not find Apache module directory!")
227229
os.symlink(moddir, os.path.join(httpdir, 'modules'))
228230

229-
shutil.copy('src/.libs/mod_auth_gssapi.so', httpdir)
231+
shutil.copy('%s/mod_auth_gssapi.so' % so_dir, httpdir)
230232

231233
with open('tests/httpd.conf') as f:
232234
t = Template(f.read())
@@ -413,6 +415,7 @@ def test_bad_acceptor_name(testdir, testenv, testlog):
413415
args = parse_args()
414416

415417
testdir = args['path']
418+
so_dir = args['so_dir']
416419
if os.path.exists(testdir):
417420
shutil.rmtree(testdir)
418421
os.makedirs(testdir)
@@ -427,7 +430,7 @@ def test_bad_acceptor_name(testdir, testenv, testlog):
427430
kdcproc, kdcenv = setup_kdc(testdir, wrapenv)
428431
processes['KDC(%d)' % kdcproc.pid] = kdcproc
429432

430-
httpproc = setup_http(testdir, kdcenv)
433+
httpproc = setup_http(testdir, so_dir, kdcenv)
431434
processes['HTTPD(%d)' % httpproc.pid] = httpproc
432435

433436
keysenv = setup_keys(testdir, kdcenv)

0 commit comments

Comments
 (0)
Please sign in to comment.