2 ''' A simple script to test the modification od Schema and configuration by applying some ldif files that create new classes,
3 and display specifiers. Ldifs are located in ../scheca_config_ldifs. Optionally it attempts to add the class ms-Exch-Computer-Policy which at present returns an error.
5 1. Apply all ldif files
6 schema-config-test --domain=mydomain.com --username=administrator --password=mypassword
7 2. Add only ms-Exch-Computer-Policy:
8 schema-config-test --domain=mydomain.com --username=administrator --password=mypassword --testname=testdn_failure '''
15 sys
.path
.append("../../../../bin/python")
16 sys
.path
.append("../lib/subunit/python")
19 from samba
.credentials
import DONT_USE_KERBEROS
20 from samba
.auth
import system_session
21 import samba
.getopt
as options
22 from samba
import param
23 from ldifapplier
import LdifApplier
26 #todo check if we need to use a different option set
27 parser
= optparse
.OptionParser("schema-config-test [options]")
28 sambaopts
= options
.SambaOptions(parser
)
29 parser
.add_option_group(sambaopts
)
30 parser
.add_option_group(options
.VersionOptions(parser
))
31 credopts
= options
.CredentialsOptions(parser
)
32 parser
.add_option_group(credopts
)
34 parser
.add_option("--domain", type="string", metavar
="DOMAIN",
37 parser
.add_option("--testname", type="string", metavar
="TESTNAME",
40 opts
= parser
.parse_args()[0]
42 lp
= sambaopts
.get_loadparm()
43 creds
= credopts
.get_credentials(lp
)
45 creds
.set_kerberos_state(DONT_USE_KERBEROS
)
47 ldf
= LdifApplier(opts
.domain
, system_session(), creds
, lp
)
49 if opts
.testname
== "testdn_failure":