msds_intid: Add test for (non-schema) linked attributes
authorGarming Sam <garming@catalyst.net.nz>
Tue, 26 Jul 2016 04:12:05 +0000 (16:12 +1200)
committerStefan Metzmacher <metze@samba.org>
Thu, 28 Jul 2016 08:06:09 +0000 (10:06 +0200)
Prior to this, none of the linked attributes would be checked for their
ids.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/knownfail
source4/torture/drs/rpc/msds_intid.c

index 397e53c1f08464329bb27ab6fe57592d80c05368..cdcc8e1feac3427a2d7e193a03a05d5fe8202bcf 100644 (file)
 ^samba4.krb5.kdc.*as-req-aes.*fl2000dc
 # nt4_member and ad_member don't support ntlmv1
 ^samba3.blackbox.smbclient_auth.plain.*_member.*option=clientntlmv2auth=no.member.creds.*as.user
+^samba4.drs.rpc.msDSIntId.*msDSIntId.Schema
index 13c9625cd4c61b1894049f1d2374ca65cd8897d0..6313513889710528d7c95893785704d2ef3b953f 100644 (file)
@@ -100,12 +100,36 @@ struct DsIntIdTestCtx {
                "-\n" \
                "\n" \
                "###########################################################\n" \
+               "# Update schema (with linked attribute)\n" \
+               "###########################################################\n" \
+               "dn: CN=msds-intid-link-%1$d,CN=Schema,CN=Configuration,%2$s\n" \
+               "changetype: add\n" \
+               "objectClass: top\n" \
+               "objectClass: attributeSchema\n" \
+               "cn: msds-intid-link-%1$d\n" \
+               "attributeID: 1.3.6.1.4.1.7165.4.6.1.%1$d.1.5.9941\n" \
+               "attributeSyntax: 2.5.5.1\n" \
+               "omSyntax: 127\n" \
+               "instanceType: 4\n" \
+               "isSingleValued: TRUE\n" \
+               "systemOnly: FALSE\n" \
+               "linkID: 88880\n" \
+               "\n" \
+               "# schemaUpdateNow\n" \
+               "DN:\n" \
+               "changeType: modify\n" \
+               "add: schemaUpdateNow\n" \
+               "schemaUpdateNow: 1\n" \
+               "-\n" \
+               "\n" \
+               "###########################################################\n" \
                "# Update User class\n" \
                "###########################################################\n" \
                "dn: CN=User,CN=Schema,CN=Configuration,%2$s\n" \
                "changetype: modify\n" \
                "add: mayContain\n" \
                "mayContain: msdsIntid%1$d\n" \
+               "mayContain: msdsIntidLink%1$d\n" \
                "-\n" \
                "\n" \
                "# schemaUpdateNow\n" \
@@ -126,6 +150,7 @@ struct DsIntIdTestCtx {
                "displayName: dsIntId_usr_%1$d\n" \
                "sAMAccountName: dsIntId_usr_%1$d\n" \
                "msdsIntid%1$d: msDS-IntId-%1$d attribute value\n" \
+               "msdsIntidLink%1$d: %2$s\n" \
                "\n"
 
 
@@ -467,7 +492,15 @@ static bool _test_GetNCChanges(struct torture_context *tctx,
                        for (cur = ctr6.first_object; cur->next_object; cur = cur->next_object) {}
                        cur->next_object = ctr6_chunk->first_object;
 
-                       /* TODO: store the chunk of linked_attributes if needed */
+                       if (ctr6_chunk->linked_attributes_count != 0) {
+                               uint32_t i;
+                               ctr6.linked_attributes = talloc_realloc(mem_ctx, ctr6.linked_attributes,
+                                                                      struct drsuapi_DsReplicaLinkedAttribute,
+                                                                      ctr6.linked_attributes_count + ctr6_chunk->linked_attributes_count);
+                               for (i = 0; i < ctr6_chunk->linked_attributes_count; i++) {
+                                       ctr6.linked_attributes[ctr6.linked_attributes_count++] = ctr6_chunk->linked_attributes[i];
+                               }
+                       }
                }
 
                /* prepare for next request */