[SCM] Samba Shared Repository - branch master updated
Jelmer Vernooij
jelmer at samba.org
Mon Mar 1 08:25:19 MST 2010
The branch, master has been updated
via 24d52dc... Fix the build, add filtered subunit runner.
via 4e4e341... Add testrepository configuration.
via 86e2b25... More formatting fixes, pointed out by pylint.
from 719cecb... s4:RPC-NETLOGON: remove useless rpc callback
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 24d52dc362210328e16545830835361ac82432c4
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Mon Mar 1 16:24:29 2010 +0100
Fix the build, add filtered subunit runner.
commit 4e4e341c68473d92516a3e3c612153a792017bb9
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Mon Mar 1 14:42:38 2010 +0100
Add testrepository configuration.
commit 86e2b251861055d770327639808fddc84cdb0b56
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Mon Mar 1 05:04:23 2010 +0100
More formatting fixes, pointed out by pylint.
-----------------------------------------------------------------------
Summary of changes:
.gitignore | 1 +
source4/.testr.conf | 3 +
source4/scripting/python/samba/__init__.py | 52 +++++++++++--------
source4/scripting/python/samba/misc.py | 12 ++--
source4/scripting/python/samba/ntacls.py | 10 ++--
source4/scripting/python/samba/provision.py | 6 +-
source4/scripting/python/samba/provisionbackend.py | 11 ++--
source4/scripting/python/samba/samdb.py | 2 +-
source4/scripting/python/samba/tests/provision.py | 1 +
source4/scripting/python/samba/upgradehelpers.py | 1 -
source4/selftest/config.mk | 4 ++
11 files changed, 59 insertions(+), 44 deletions(-)
create mode 100644 source4/.testr.conf
Changeset truncated at 500 lines:
diff --git a/.gitignore b/.gitignore
index b40c794..7f1a9be 100644
--- a/.gitignore
+++ b/.gitignore
@@ -412,3 +412,4 @@ docs-xml/Samba3-HOWTO/images/idmap-uid2sid.png
docs-xml/Samba3-HOWTO/images/pdftoepsonusb.png
docs-xml/Samba3-HOWTO/images/pdftosocket.png
docs-xml/Samba3-HOWTO/images/trusts1.png
+source4/.testrepository
diff --git a/source4/.testr.conf b/source4/.testr.conf
new file mode 100644
index 0000000..0ddb369
--- /dev/null
+++ b/source4/.testr.conf
@@ -0,0 +1,3 @@
+[DEFAULT]
+test_command=make test-subunit-filtered TESTS="$IDLIST"
+test_id_list_default=
diff --git a/source4/scripting/python/samba/__init__.py b/source4/scripting/python/samba/__init__.py
index 776c274..9cc224b 100644
--- a/source4/scripting/python/samba/__init__.py
+++ b/source4/scripting/python/samba/__init__.py
@@ -145,17 +145,20 @@ class Ldb(ldb.Ldb):
try:
res = self.search(base=dn, scope=ldb.SCOPE_SUBTREE, attrs=[],
expression="(|(objectclass=user)(objectclass=computer))")
- except ldb.LdbError, (ldb.ERR_NO_SUCH_OBJECT, _):
- # Ignore no such object errors
- return
- pass
+ except ldb.LdbError, (errno, _):
+ if errno == ldb.ERR_NO_SUCH_OBJECT:
+ # Ignore no such object errors
+ return
+ else:
+ raise
try:
for msg in res:
self.delete(msg.dn)
- except ldb.LdbError, (ldb.ERR_NO_SUCH_OBJECT, _):
- # Ignore no such object errors
- return
+ except ldb.LdbError, (errno, _):
+ if errno != ldb.ERR_NO_SUCH_OBJECT:
+ # Ignore no such object errors
+ raise
def erase_except_schema_controlled(self):
"""Erase this ldb, removing all records, except those that are controlled by Samba4's schema."""
@@ -171,9 +174,10 @@ class Ldb(ldb.Ldb):
[], controls=["show_deleted:0"]):
try:
self.delete(msg.dn)
- except ldb.LdbError, (ldb.ERR_NO_SUCH_OBJECT, _):
- # Ignore no such object errors
- pass
+ except ldb.LdbError, (errno, _):
+ if errno != ldb.ERR_NO_SUCH_OBJECT:
+ # Ignore no such object errors
+ raise
res = self.search(basedn, ldb.SCOPE_SUBTREE,
"(&(|(objectclass=*)(distinguishedName=*))(!(distinguishedName=@BASEINFO)))",
@@ -185,9 +189,10 @@ class Ldb(ldb.Ldb):
"@OPTIONS", "@PARTITION", "@KLUDGEACL"]:
try:
self.delete(attr)
- except ldb.LdbError, (ldb.ERR_NO_SUCH_OBJECT, _):
- # Ignore missing dn errors
- pass
+ except ldb.LdbError, (errno, _):
+ if errno != ldb.ERR_NO_SUCH_OBJECT:
+ # Ignore missing dn errors
+ raise
def erase(self):
"""Erase this ldb, removing all records."""
@@ -198,9 +203,10 @@ class Ldb(ldb.Ldb):
for attr in ["@INDEXLIST", "@ATTRIBUTES"]:
try:
self.delete(attr)
- except ldb.LdbError, (ldb.ERR_NO_SUCH_OBJECT, _):
- # Ignore missing dn errors
- pass
+ except ldb.LdbError, (errno, _):
+ if errno != ldb.ERR_NO_SUCH_OBJECT:
+ # Ignore missing dn errors
+ raise
def erase_partitions(self):
"""Erase an ldb, removing all records."""
@@ -209,18 +215,20 @@ class Ldb(ldb.Ldb):
try:
res = self.search(base=dn, scope=ldb.SCOPE_ONELEVEL, attrs=[],
controls=["show_deleted:0"])
- except ldb.LdbError, (ldb.ERR_NO_SUCH_OBJECT, _):
- # Ignore no such object errors
- return
+ except ldb.LdbError, (errno, _):
+ if errno == ldb.ERR_NO_SUCH_OBJECT:
+ # Ignore no such object errors
+ return
for msg in res:
erase_recursive(self, msg.dn)
try:
self.delete(dn)
- except ldb.LdbError, (ldb.ERR_NO_SUCH_OBJECT, _):
- # Ignore no such object errors
- pass
+ except ldb.LdbError, (errno, _):
+ if errno != ldb.ERR_NO_SUCH_OBJECT:
+ # Ignore no such object errors
+ raise
res = self.search("", ldb.SCOPE_BASE, "(objectClass=*)",
["namingContexts"])
diff --git a/source4/scripting/python/samba/misc.py b/source4/scripting/python/samba/misc.py
index b01b134..0089751 100644
--- a/source4/scripting/python/samba/misc.py
+++ b/source4/scripting/python/samba/misc.py
@@ -25,9 +25,9 @@ __docformat__ = "restructuredText"
import ldb
def messageEltFlagToString(flag):
- if flag == ldb.FLAG_MOD_ADD:
- return "MOD_ADD"
- elif flag == ldb.FLAG_MOD_REPLACE:
- return "MOD_REPLACE"
- elif flag == ldb.FLAG_MOD_DELETE:
- return "MOD_DELETE"
+ if flag == ldb.FLAG_MOD_ADD:
+ return "MOD_ADD"
+ elif flag == ldb.FLAG_MOD_REPLACE:
+ return "MOD_REPLACE"
+ elif flag == ldb.FLAG_MOD_DELETE:
+ return "MOD_DELETE"
diff --git a/source4/scripting/python/samba/ntacls.py b/source4/scripting/python/samba/ntacls.py
index ad2156a..edcd643 100644
--- a/source4/scripting/python/samba/ntacls.py
+++ b/source4/scripting/python/samba/ntacls.py
@@ -52,7 +52,7 @@ def getntacl(lp, file, backend=None, eadbfile=None):
ntacl = ndr_unpack(xattr.NTACL,attribute)
return ntacl
-def setntacl(lp,file,sddl,domsid,backend=None,eadbfile=None):
+def setntacl(lp, file, sddl, domsid, backend=None, eadbfile=None):
checkset_backend(lp,backend,eadbfile)
ntacl=xattr.NTACL()
ntacl.version = 1
@@ -62,12 +62,12 @@ def setntacl(lp,file,sddl,domsid,backend=None,eadbfile=None):
eadbname = lp.get("posix:eadb")
if eadbname != None and eadbname != "":
try:
- attribute = samba.xattr_tdb.wrap_setxattr(eadbname,file,xattr.XATTR_NTACL_NAME,ndr_pack(ntacl))
+ samba.xattr_tdb.wrap_setxattr(eadbname,file,xattr.XATTR_NTACL_NAME,ndr_pack(ntacl))
except:
print "Fail to open %s"%eadbname
- attribute = samba.xattr_native.wrap_setxattr(file,xattr.XATTR_NTACL_NAME,ndr_pack(ntacl))
+ samba.xattr_native.wrap_setxattr(file,xattr.XATTR_NTACL_NAME,ndr_pack(ntacl))
else:
- attribute = samba.xattr_native.wrap_setxattr(file,xattr.XATTR_NTACL_NAME,ndr_pack(ntacl))
+ samba.xattr_native.wrap_setxattr(file,xattr.XATTR_NTACL_NAME,ndr_pack(ntacl))
def ldapmask2filemask(ldm):
"""Takes the access mask of a DS ACE and transform them in a File ACE mask"""
@@ -138,7 +138,7 @@ def dsacl2fsacl(dssddl, domsid):
fdescr.revision = ref.revision
fdescr.sacl = ref.sacl
aces = ref.dacl.aces
- for i in range(0,len(aces)):
+ for i in range(0, len(aces)):
ace = aces[i]
if not ace.type & security.SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT and str(ace.trustee) != security.SID_BUILTIN_PREW2K:
# if fdescr.type & security.SEC_DESC_DACL_AUTO_INHERITED:
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py
index 57c8e7f..7287a89 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -602,7 +602,7 @@ def secretsdb_self_join(secretsdb, domain,
"privateKeytab"]
- msg = ldb.Message(ldb.Dn(secretsdb, "flatname=%s,cn=Primary Domains" % domain));
+ msg = ldb.Message(ldb.Dn(secretsdb, "flatname=%s,cn=Primary Domains" % domain))
msg["secureChannelType"] = str(secure_channel_type)
msg["flatname"] = [domain]
msg["objectClass"] = ["top", "primaryDomain"]
@@ -613,7 +613,7 @@ def secretsdb_self_join(secretsdb, domain,
msg["realm"] = realm
msg["saltPrincipal"] = "host/%s.%s@%s" % (netbiosname.lower(), dnsdomain.lower(), realm.upper())
msg["msDS-KeyVersionNumber"] = [str(key_version_number)]
- msg["privateKeytab"] = ["secrets.keytab"];
+ msg["privateKeytab"] = ["secrets.keytab"]
msg["secret"] = [machinepass]
@@ -971,7 +971,7 @@ def setup_samdb(path, setup_path, session_info, provision_backend, lp,
setup_add_ldif(samdb, setup_path("aggregate_schema.ldif"),
{"SCHEMADN": names.schemadn})
- message("Reopening sam.ldb with new schema");
+ message("Reopening sam.ldb with new schema")
samdb.transaction_commit()
samdb = Ldb(session_info=admin_session_info,
credentials=provision_backend.credentials, lp=lp)
diff --git a/source4/scripting/python/samba/provisionbackend.py b/source4/scripting/python/samba/provisionbackend.py
index 649113e..083f1dc 100644
--- a/source4/scripting/python/samba/provisionbackend.py
+++ b/source4/scripting/python/samba/provisionbackend.py
@@ -119,7 +119,7 @@ class ExistingBackend(ProvisionBackend):
def init(self):
#Check to see that this 'existing' LDAP backend in fact exists
ldapi_db = Ldb(self.ldapi_uri, credentials=self.credentials)
- search_ol_rootdse = ldapi_db.search(base="", scope=SCOPE_BASE,
+ ldapi_db.search(base="", scope=SCOPE_BASE,
expression="(objectClass=OpenLDAProotDSE)")
# If we have got here, then we must have a valid connection to the LDAP server, with valid credentials supplied
@@ -170,7 +170,7 @@ class LDAPBackend(ProvisionBackend):
try:
ldapi_db = Ldb(self.ldapi_uri)
ldapi_db.search(base="", scope=SCOPE_BASE,
- expression="(objectClass=OpenLDAProotDSE)");
+ expression="(objectClass=OpenLDAProotDSE)")
try:
f = open(self.paths.slapdpid, "r")
p = f.read()
@@ -204,7 +204,7 @@ class LDAPBackend(ProvisionBackend):
except OSError:
pass
- self.schema.write_to_tmp_ldb(schemadb_path);
+ self.schema.write_to_tmp_ldb(schemadb_path)
self.credentials = Credentials()
self.credentials.guess(self.lp)
@@ -243,7 +243,6 @@ class LDAPBackend(ProvisionBackend):
return
except LdbError:
time.sleep(1)
- pass
raise ProvisioningError("slapd died before we could make a connection to it")
@@ -297,7 +296,7 @@ class OpenLDAPBackend(LDAPBackend):
self.domainsid,
schemadn=self.names.schemadn,
serverdn=self.names.serverdn,
- files=[setup_path("schema_samba4.ldif")]);
+ files=[setup_path("schema_samba4.ldif")])
def provision(self):
# Wipe the directories so we can start
@@ -674,7 +673,7 @@ class FDSBackend(LDAPBackend):
fedora_ds_dir = os.path.join(self.paths.ldapdir, "slapd-samba4")
shutil.rmtree(fedora_ds_dir, True)
- self.slapd_provision_command = [self.slapd_path, "-D", fedora_ds_dir, "-i", self.paths.slapdpid];
+ self.slapd_provision_command = [self.slapd_path, "-D", fedora_ds_dir, "-i", self.paths.slapdpid]
#In the 'provision' command line, stay in the foreground so we can easily kill it
self.slapd_provision_command.append("-d0")
diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py
index 39cf1d6..f3622fe 100644
--- a/source4/scripting/python/samba/samdb.py
+++ b/source4/scripting/python/samba/samdb.py
@@ -229,5 +229,5 @@ accountExpires: %u
except:
self.transaction_cancel()
raise
- self.transaction_commit();
+ self.transaction_commit()
diff --git a/source4/scripting/python/samba/tests/provision.py b/source4/scripting/python/samba/tests/provision.py
index 692477d..45c237f 100644
--- a/source4/scripting/python/samba/tests/provision.py
+++ b/source4/scripting/python/samba/tests/provision.py
@@ -62,6 +62,7 @@ class FindNssTests(unittest.TestCase):
class Disabled(object):
+
def test_setup_templatesdb(self):
raise NotImplementedError(self.test_setup_templatesdb)
diff --git a/source4/scripting/python/samba/upgradehelpers.py b/source4/scripting/python/samba/upgradehelpers.py
index 31af490..57c7fee 100755
--- a/source4/scripting/python/samba/upgradehelpers.py
+++ b/source4/scripting/python/samba/upgradehelpers.py
@@ -27,7 +27,6 @@ import string
import re
import shutil
-import samba
from samba import Ldb, DS_DOMAIN_FUNCTION_2000
from ldb import SCOPE_SUBTREE, SCOPE_ONELEVEL, SCOPE_BASE
import ldb
diff --git a/source4/selftest/config.mk b/source4/selftest/config.mk
index 9e2896e..04d42d2 100644
--- a/source4/selftest/config.mk
+++ b/source4/selftest/config.mk
@@ -23,6 +23,10 @@ test-subunit:: everything
$(ST_RM) $(SELFTEST) --socket-wrapper $(TESTS) $(ST_TOUCH)
$(ST_DONE_TEST)
+test-subunit-filtered:: everything
+ $(ST_RM) $(SELFTEST) --socket-wrapper $(TESTS) $(ST_TOUCH) | $(FILTER_XFAIL)
+ $(ST_DONE_TEST)
+
slowtest:: everything
$(ST_RM) $(SELFTEST) $(DEFAULT_TEST_OPTIONS) $(TESTS) $(ST_TOUCH) | $(FORMAT_TEST_OUTPUT)
$(ST_DONE_TEST)
--
Samba Shared Repository
More information about the samba-cvs
mailing list