print "Replication started" print "Press Enter to continue . . ." foo = sys.stdin.readline() print "modify entry on m1" dn = "uid=scarter,ou=people,dc=example,dc=com" mod = [(ldap.MOD_ADD, 'description', 'description')] m1.modify_s(dn, mod) c1.waitForEntry(dn, 10, 'description') print "Modify entry on c1" dn = "uid=jvedder,ou=people,dc=example,dc=com" cc1 = DSAdmin(host2, port2, dn, "befitting") mod = [(ldap.MOD_REPLACE, 'telephonenumber', '123456789')] cc1.modify_s(dn, mod) print "Wait for mod to show up on m1" time.sleep(10) ents = m1.search_s(dn, ldap.SCOPE_BASE, '(objectclass=*)', ['telephonenumber']) ent = ents[0] if ent.telephonenumber == '123456789': print "m1 success - telephonenumber changed" else: print "m1 failed - value is still " + ent.telephonenumber ents = c1.search_s(dn, ldap.SCOPE_BASE, '(objectclass=*)', ['telephonenumber']) ent = ents[0] if ent.telephonenumber == '123456789': print "c1 success - telephonenumber changed" else: print "c1 failed - value is still " + ent.telephonenumber
time.sleep(5) print "repl status:", ds.getReplStatus(agmtdn) for ii in xrange(1,6): ent = makeADUserEnt(ii) try: ad.add_s(ent) except ldap.ALREADY_EXISTS: print "AD entry", ent.dn, "already exists" setWindowsPwd(ad, ent.dn) kk = ii % len(userAcctVals) mod = [] for attr, val in userAcctVals[kk].iteritems(): mod.append((ldap.MOD_REPLACE, attr, str(val))) ad.modify_s(ent.dn, mod) for ii in xrange(6,11): ent = makeDSUserEnt(ii) try: ds.add_s(ent) except ldap.ALREADY_EXISTS: print "DS entry", ent.dn, "already exists" print "Wait for sync to happen . . ." time.sleep(syncinterval+1) print "with ipa, new ds users are not added to AD - so we must add them now to AD in order for them to sync . . ." for ii in xrange(6,11): ent = makeADUserEnt(ii) try: ad.add_s(ent) except ldap.ALREADY_EXISTS:
print "Replication started" print "Press Enter to continue . . ." foo = sys.stdin.readline() print "modify entry on m1" dn = "uid=scarter,ou=people,dc=example,dc=com" mod = [(ldap.MOD_ADD, 'description', 'description')] m1.modify_s(dn, mod) c1.waitForEntry(dn, 10, 'description') print "Modify entry on c1" dn = "uid=jvedder,ou=people,dc=example,dc=com" cc1 = DSAdmin(host2, port2, dn, "befitting") mod = [(ldap.MOD_REPLACE, 'telephonenumber', '123456789')] cc1.modify_s(dn, mod) print "Wait for mod to show up on m1" time.sleep(10) ents = m1.search_s(dn, ldap.SCOPE_BASE, '(objectclass=*)', ['telephonenumber']) ent = ents[0] if ent.telephonenumber == '123456789': print "m1 success - telephonenumber changed" else: print "m1 failed - value is still " + ent.telephonenumber ents = c1.search_s(dn, ldap.SCOPE_BASE, '(objectclass=*)', ['telephonenumber']) ent = ents[0] if ent.telephonenumber == '123456789': print "c1 success - telephonenumber changed" else: print "c1 failed - value is still " + ent.telephonenumber
(ldap.MOD_ADD, 'ntUserDomainId', uid)] ds.modify_s(ent.dn, mod) time.sleep(1) print "Added ntuser, changing telephonenumber . . ." mod = [(ldap.MOD_DELETE, 'telephoneNumber', telnum1), (ldap.MOD_ADD, 'telephoneNumber', telnum2)] ds.modify_s(ent.dn, mod) time.sleep(1) print "changed telephonenumber, changing description . . ." mod = [(ldap.MOD_ADD, 'description', 'test bug471068')] ds.modify_s(ent.dn, mod) time.sleep(1) print "Delete description in AD, then in DS . . ." mod = [(ldap.MOD_DELETE, 'description', None)] ad.modify_s(adent.dn, mod) ds.modify_s(ent.dn, mod) time.sleep(1) print "Add description in AD, then in DS . . ." mod = [(ldap.MOD_ADD, 'description', 'test bug471068')] ad.modify_s(adent.dn, mod) ds.modify_s(ent.dn, mod) time.sleep(1) print "Now compare the entries . . ." ents = ds.search_s(suffix, scope, "(uid=%s)" % uid) print "DS Entry: ", str(ents[0]) ents = ad.search_s(suffix, scope, "(samaccountname=%s)" % uid) print "AD Entry: ", str(ents[0])
(ldap.MOD_ADD, 'ntUserDomainId', uid)] ds.modify_s(ent.dn, mod) time.sleep(1) print "Added ntuser, changing telephonenumber . . ." mod = [(ldap.MOD_DELETE, 'telephoneNumber', telnum1), (ldap.MOD_ADD, 'telephoneNumber', telnum2)] ds.modify_s(ent.dn, mod) time.sleep(1) print "changed telephonenumber, changing description . . ." mod = [(ldap.MOD_ADD, 'description', 'test bug471068')] ds.modify_s(ent.dn, mod) time.sleep(1) print "Delete description in AD, then in DS . . ." mod = [(ldap.MOD_DELETE, 'description', None)] ad.modify_s(adent.dn, mod) ds.modify_s(ent.dn, mod) time.sleep(1) print "Add description in AD, then in DS . . ." mod = [(ldap.MOD_ADD, 'description', 'test bug471068')] ad.modify_s(adent.dn, mod) ds.modify_s(ent.dn, mod) time.sleep(1) print "Now compare the entries . . ." ents = ds.search_s(suffix, scope, "(uid=%s)" % uid) print "DS Entry: ", str(ents[0]) ents = ad.search_s(suffix, scope, "(samaccountname=%s)" % uid) print "AD Entry: ", str(ents[0])
time.sleep(5) print "repl status:", ds.getReplStatus(agmtdn) for ii in xrange(1, 6): ent = makeADUserEnt(ii) try: ad.add_s(ent) except ldap.ALREADY_EXISTS: print "AD entry", ent.dn, "already exists" setWindowsPwd(ad, ent.dn) kk = ii % len(userAcctVals) mod = [] for attr, val in userAcctVals[kk].iteritems(): mod.append((ldap.MOD_REPLACE, attr, str(val))) ad.modify_s(ent.dn, mod) for ii in xrange(6, 11): ent = makeDSUserEnt(ii) try: ds.add_s(ent) except ldap.ALREADY_EXISTS: print "DS entry", ent.dn, "already exists" print "Wait for sync to happen . . ." time.sleep(syncinterval + 1) print "with ipa, new ds users are not added to AD - so we must add them now to AD in order for them to sync . . ." for ii in xrange(6, 11): ent = makeADUserEnt(ii) try: