-
Notifications
You must be signed in to change notification settings - Fork 27
/
bug479254.py
69 lines (60 loc) · 1.55 KB
/
bug479254.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
from bug_harness import DSAdminHarness as DSAdmin
from dsadmin import Entry
import os
import sys
import time
import ldap
host1 = "localhost.localdomain"
host2 = host1
cfgport = 1200
port1 = cfgport+10
port2 = cfgport+20
basedn = "dc=testdomain,dc=com"
m1replargs = {
'suffix': basedn,
'bename': "userRoot",
'binddn': "cn=replrepl,cn=config",
'bindcn': "replrepl",
'bindpw': "replrepl",
'bindmethod': 'SASL/GSSAPI',
'starttls': True,
'log' : False
}
#os.environ['USE_DBX'] = "1"
m1 = DSAdmin.createAndSetupReplica({
'newrootpw': 'password',
'newhost': host1,
'newport': port1,
'newinst': 'm1',
'newsuffix': basedn,
'verbose': False,
'no_admin': True
}, m1replargs
)
#del os.environ['USE_DBX']
m2replargs = m1replargs
#os.environ['USE_DBX'] = 1
m2 = DSAdmin.createAndSetupReplica({
'newrootpw': 'password',
'newhost': host2,
'newport': port2,
'newinst': 'm2',
'newsuffix': basedn,
'verbose': False,
'no_admin': True
}, m2replargs
)
#del os.environ['USE_DBX']
initfile = ''
if os.environ.has_key('SERVER_ROOT'):
initfile = "%s/slapd-%s/ldif/Example.ldif" % (m1.sroot,m1.inst)
else:
initfile = "%s/share/dirsrv/data/Example.ldif" % os.environ.get('PREFIX', '/usr')
#m1.importLDIF(initfile, '', "userRoot", True)
print "create agreements and init consumers"
try: agmtm1tom2 = m1.setupAgreement(m2, m1replargs)
except ldap.LDAPError, e: print "caught exception", e
del m2replargs['starttls']
m2replargs['bindmethod'] = 'SSLCLIENTAUTH'
try: agmtm2tom1 = m2.setupAgreement(m1, m2replargs)
except ldap.LDAPError, e: print "caught exception", e