summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-06-19 13:06:02 +0200
committerVolker Lendecke <vl@samba.org>2009-06-19 14:28:22 +0200
commit756f83796fd307ed769bbc049d50c017f5eb4423 (patch)
treebbd742955f9015cf4dbfb802193480187b0a75b5 /source3
parentb9c99a29286c748bbd706fd8757be6ef3fa9abc1 (diff)
downloadsamba-756f83796fd307ed769bbc049d50c017f5eb4423.tar.gz
samba-756f83796fd307ed769bbc049d50c017f5eb4423.tar.bz2
samba-756f83796fd307ed769bbc049d50c017f5eb4423.zip
Add tiny tldap test
Diffstat (limited to 'source3')
-rw-r--r--source3/Makefile.in2
-rw-r--r--source3/torture/torture.c36
2 files changed, 37 insertions, 1 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index c657786b14..5d03886634 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -1005,7 +1005,7 @@ NMBLOOKUP_OBJ = utils/nmblookup.o $(PARAM_OBJ) $(LIBNMB_OBJ) \
SMBTORTURE_OBJ1 = torture/torture.o torture/nbio.o torture/scanner.o torture/utable.o \
torture/denytest.o torture/mangle_test.o
-SMBTORTURE_OBJ = $(SMBTORTURE_OBJ1) $(PARAM_OBJ) \
+SMBTORTURE_OBJ = $(SMBTORTURE_OBJ1) $(PARAM_OBJ) $(TLDAP_OBJ) \
$(LIBSMB_OBJ) $(LDB_OBJ) $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) \
@LIBWBCLIENT_STATIC@ \
$(LIBNDR_GEN_OBJ0)
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index baa8a15da4..7a4a5fc46e 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -5585,6 +5585,41 @@ static bool run_shortname_test(int dummy)
return correct;
}
+static bool run_tldap(int dummy)
+{
+ struct tldap_context *ld;
+ int fd, rc;
+ NTSTATUS status;
+ struct sockaddr_storage addr;
+
+ if (!resolve_name(host, &addr, 0)) {
+ d_printf("could not find host %s\n", host);
+ return false;
+ }
+ status = open_socket_out(&addr, 389, 9999, &fd);
+ if (!NT_STATUS_IS_OK(status)) {
+ d_printf("open_socket_out failed: %s\n", nt_errstr(status));
+ return false;
+ }
+
+ ld = tldap_context_create(talloc_tos(), fd);
+ if (ld == NULL) {
+ close(fd);
+ d_printf("tldap_context_create failed\n");
+ return false;
+ }
+
+ rc = tldap_fetch_rootdse(ld);
+ if (rc != TLDAP_SUCCESS) {
+ d_printf("tldap_fetch_rootdse failed: %s\n",
+ tldap_errstr(talloc_tos(), ld, rc));
+ return false;
+ }
+
+ TALLOC_FREE(ld);
+ return true;
+}
+
static bool run_local_substitute(int dummy)
{
bool ok = true;
@@ -6250,6 +6285,7 @@ static struct {
{ "WINDOWS-WRITE", run_windows_write, 0},
{ "CLI_ECHO", run_cli_echo, 0},
{ "GETADDRINFO", run_getaddrinfo_send, 0},
+ { "TLDAP", run_tldap },
{ "LOCAL-SUBSTITUTE", run_local_substitute, 0},
{ "LOCAL-GENCACHE", run_local_gencache, 0},
{ "LOCAL-RBTREE", run_local_rbtree, 0},