NTLM tests: boost coverage by forcing the hostname
authorKamil Dudka <kdudka@redhat.com>
Thu, 29 Jul 2010 22:47:49 +0000 (00:47 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 29 Jul 2010 22:51:24 +0000 (00:51 +0200)
commitb5c3feda1788301bea7f1dd4f9bb240d13862bd0
tree50e6cbe63ec308b53d3bec11456b80832f94f634
parent01c309e186b3f1055d56211d4074f451bf5282bf
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.
36 files changed:
lib/Makefile.inc
lib/curl_gethostname.c [new file with mode: 0644]
lib/curl_gethostname.h [new file with mode: 0644]
lib/http_ntlm.c
lib/smtp.c
tests/data/test1008
tests/data/test1021
tests/data/test1100
tests/data/test150
tests/data/test155
tests/data/test159
tests/data/test169
tests/data/test209
tests/data/test213
tests/data/test239
tests/data/test243
tests/data/test265
tests/data/test267
tests/data/test547
tests/data/test548
tests/data/test551
tests/data/test555
tests/data/test67
tests/data/test68
tests/data/test69
tests/data/test81
tests/data/test89
tests/data/test90
tests/data/test91
tests/libtest/.gitignore
tests/libtest/Makefile.am
tests/libtest/Makefile.inc
tests/libtest/chkhostname.c [new file with mode: 0644]
tests/libtest/hostname.c [new file with mode: 0644]
tests/libtest/sethostname.c [new file with mode: 0644]
tests/runtests.pl