From f807d171934dafbfdf42812b66ab11ab05aee93c Mon Sep 17 00:00:00 2001 From: Tomas Guisasola Date: Tue, 7 Jun 2005 17:06:30 +0000 Subject: Correcting Makefile to link against libldap.so. Correcting test to skip using TLS if its not available. --- lualdap/Makefile | 4 ++-- lualdap/tests/test.lua | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lualdap/Makefile b/lualdap/Makefile index 9ff4d34..e2e659c 100755 --- a/lualdap/Makefile +++ b/lualdap/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.23 2005-06-06 22:24:02 tomas Exp $ +# $Id: Makefile,v 1.24 2005-06-07 17:06:30 tomas Exp $ T= lualdap V= 1.0 @@ -15,7 +15,7 @@ LIB= src/lib$T-$V.a dynamic: src/$(LIBNAME) src/$(LIBNAME): $(OBJS) - export MACOSX_DEPLOYMENT_TARGET="10.3"; $(CC) $(CFLAGS) $(LIB_OPTION) -o src/$(LIBNAME) $(OBJS) + export MACOSX_DEPLOYMENT_TARGET="10.3"; $(CC) $(CFLAGS) $(LIB_OPTION) -o src/$(LIBNAME) $(OBJS) -lldap lib: $(LIB) $(LIB): $(OBJS) diff --git a/lualdap/tests/test.lua b/lualdap/tests/test.lua index 502a961..034e7c9 100755 --- a/lualdap/tests/test.lua +++ b/lualdap/tests/test.lua @@ -6,7 +6,7 @@ -- renamed and deleted at the end. -- -- See Copyright Notice in license.html --- $Id: test.lua,v 1.12 2005-02-23 22:39:26 tomas Exp $ +-- $Id: test.lua,v 1.13 2005-06-07 17:06:30 tomas Exp $ --------------------------------------------------------------------- -- @@ -107,7 +107,14 @@ function basic_test () -- trying to connect to an invalid host. assert2 (nil, lualdap.open_simple ("unknown-server"), "this should be an error") -- reopen the connection. - LD = CONN_OK (lualdap.open_simple (HOSTNAME, WHO, PASSWORD, true)) + -- first, try using TLS + local ok = lualdap.open_simple (HOSTNAME, WHO, PASSWORD, true) + if not ok then + -- second, try without TLS + io.write ("\nWarning! Couldn't connect with TLS. Trying again without it.") + ok = lualdap.open_simple (HOSTNAME, WHO, PASSWORD, false) + end + LD = CONN_OK (ok) CLOSED_LD = ld collectgarbage() end -- cgit v1.2.3-59-g8ed1b