r19737: - add some more CLDAP rootdse tests
authorStefan Metzmacher <metze@samba.org>
Thu, 16 Nov 2006 10:48:51 +0000 (10:48 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:28:17 +0000 (14:28 -0500)
- don't ignore CLDAP rootdse errors anymore

metze
(This used to be commit 712577d9e284445e9257b691aefb719511d6a57c)

source4/torture/ldap/cldap.c

index 321feb639f8b648079982150c0b990d3fe13b778..05f978719135fe1cc8fcbe736ba7218bd63780de 100644 (file)
@@ -210,7 +210,9 @@ static BOOL test_cldap_generic(TALLOC_CTX *mem_ctx, const char *dest)
        NTSTATUS status;
        struct cldap_search search;
        BOOL ret = True;
-       const char *attrs[] = { "currentTime", "highestCommittedUSN", NULL };
+       const char *attrs1[] = { "currentTime", "highestCommittedUSN", NULL };
+       const char *attrs2[] = { "currentTime", "highestCommittedUSN", "netlogon", NULL };
+       const char *attrs3[] = { "netlogon", NULL };
 
        ZERO_STRUCT(search);
        search.in.dest_address = dest;
@@ -231,22 +233,39 @@ static BOOL test_cldap_generic(TALLOC_CTX *mem_ctx, const char *dest)
 
        printf("fetching currentTime and USN\n");
        search.in.filter = "(objectclass=*)";
-       search.in.attributes = attrs;
+       search.in.attributes = attrs1;
 
        status = cldap_search(cldap, mem_ctx, &search);
        CHECK_STATUS(status, NT_STATUS_OK);
        
        if (DEBUGLVL(3)) cldap_dump_results(&search);
 
+       printf("Testing currentTime, USN and netlogon\n");
+       search.in.filter = "(objectclass=*)";
+       search.in.attributes = attrs2;
+
+       status = cldap_search(cldap, mem_ctx, &search);
+       CHECK_STATUS(status, NT_STATUS_OK);
+
+       if (DEBUGLVL(3)) cldap_dump_results(&search);
+
+       printf("Testing objectClass=* and netlogon\n");
+       search.in.filter = "(objectclass2=*)";
+       search.in.attributes = attrs2;
+
+       status = cldap_search(cldap, mem_ctx, &search);
+       CHECK_STATUS(status, NT_STATUS_OK);
+
+       if (DEBUGLVL(3)) cldap_dump_results(&search);
+
        printf("Testing a false expression\n");
        search.in.filter = "(&(objectclass=*)(highestCommittedUSN=2))";
-       search.in.attributes = attrs;
+       search.in.attributes = attrs1;
 
        status = cldap_search(cldap, mem_ctx, &search);
        CHECK_STATUS(status, NT_STATUS_OK);
-       
-       if (DEBUGLVL(3)) cldap_dump_results(&search);
-       
+
+       if (DEBUGLVL(3)) cldap_dump_results(&search);   
 
 done:
        return ret;     
@@ -261,9 +280,7 @@ BOOL torture_cldap(struct torture_context *torture)
        mem_ctx = talloc_init("torture_cldap");
 
        ret &= test_cldap_netlogon(mem_ctx, host);
-
-       /* at the moment don't consider this failing to be a failure */
-       test_cldap_generic(mem_ctx, host);
+       ret &= test_cldap_generic(mem_ctx, host);
 
        talloc_free(mem_ctx);