From b5c3feda1788301bea7f1dd4f9bb240d13862bd0 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Fri, 30 Jul 2010 00:47:49 +0200 Subject: NTLM tests: boost coverage by forcing the hostname A shared library tests/libtest/.libs/lihostname.so is preloaded in NTLM test-cases to override the system implementation of gethostname(). It makes it possible to test the NTLM authentication for exact match, and this way test the implementation of MD4 and DES. If LD_PRELOAD doesn't work, a debug build willl also workk as debug builds are now made to prefer a specific environment variable and will then return that content as host name instead of the actual one. Kamil wrote the bulk of this, Daniel Stenberg polished it. --- tests/libtest/Makefile.am | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/libtest/Makefile.am') diff --git a/tests/libtest/Makefile.am b/tests/libtest/Makefile.am index 70b0f12a4..2a0e3eaa4 100644 --- a/tests/libtest/Makefile.am +++ b/tests/libtest/Makefile.am @@ -53,6 +53,16 @@ endif EXTRA_DIST = test75.pl test307.pl test610.pl test613.pl test1013.pl \ test1022.pl Makefile.inc +if STATICLIB +# this means no shared option is enabled so we can disable the LD_PRELOAD +# attempt +libhostname_la_CFLAGS = -DDISABLE_PRELOAD +endif + +# we force our own host name, in order to make some tests machine independent +lib_LTLIBRARIES = libhostname.la +libhostname_la_SOURCES = sethostname.c + # Dependencies (may need to be overriden) LDADD = $(top_builddir)/lib/libcurl.la DEPENDENCIES = $(top_builddir)/lib/libcurl.la -- cgit v1.2.3