summaryrefslogtreecommitdiff
path: root/source3/torture
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/torture
parentb9c99a29286c748bbd706fd8757be6ef3fa9abc1 (diff)
downloadsamba-756f83796fd307ed769bbc049d50c017f5eb4423.tar.gz
samba-756f83796fd307ed769bbc049d50c017f5eb4423.tar.bz2
samba-756f83796fd307ed769bbc049d50c017f5eb4423.zip
Add tiny tldap test
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c36
1 files changed, 36 insertions, 0 deletions
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},