[SCM] Samba Shared Repository - branch master updated

Jelmer Vernooij jelmer at samba.org
Wed Nov 3 13:56:02 MDT 2010


The branch, master has been updated
       via  fdcbc08 selftest/tests.py: Fix typos.
       via  6bd903e provision: Look for in source setup data first, in case an older version of samba 4 is installed in the system.
       via  654fdce samba: Make in_source_tree() public.
       via  4bf6a3e urgent_replication: Fix formatting
       via  46bca5e possibleinferiors: Report subunit.
       via  9ae3c82 possibleinferiors: Fix formatting.
      from  d1dd211 replace/wscript: add size checks for stdint.h types

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit fdcbc087c0fe6abc61bf8d98ca8782a148a94f23
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Nov 3 19:14:02 2010 +0100

    selftest/tests.py: Fix typos.
    
    Autobuild-User: Jelmer Vernooij <jelmer at samba.org>
    Autobuild-Date: Wed Nov  3 19:55:55 UTC 2010 on sn-devel-104

commit 6bd903ebe09f79431ff10bfaf5c7769c8a79e133
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Nov 3 19:13:03 2010 +0100

    provision: Look for in source setup data first, in case an older version
    of samba 4 is installed in the system.

commit 654fdce6a2b67c739675fb29c5072ca676ac00a7
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Nov 3 19:12:17 2010 +0100

    samba: Make in_source_tree() public.

commit 4bf6a3e72c9c954aa1f7ff566e30dd21d75fcfcc
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Nov 3 19:11:26 2010 +0100

    urgent_replication: Fix formatting

commit 46bca5e7b7a4b7aea57ed8db6d4b2927f1188ae6
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Nov 3 18:43:38 2010 +0100

    possibleinferiors: Report subunit.

commit 9ae3c822d18cea4710d8d7cec265bd9ecdea35a4
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Nov 3 18:41:49 2010 +0100

    possibleinferiors: Fix formatting.

-----------------------------------------------------------------------

Summary of changes:
 .../samdb/ldb_modules/tests/possibleinferiors.py   |   41 +++++++------
 source4/dsdb/tests/python/urgent_replication.py    |   66 ++++++++++----------
 source4/scripting/python/samba/__init__.py         |    6 +-
 source4/scripting/python/samba/provision.py        |   44 ++++++++-----
 source4/selftest/tests.py                          |    4 +-
 5 files changed, 88 insertions(+), 73 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/tests/possibleinferiors.py b/source4/dsdb/samdb/ldb_modules/tests/possibleinferiors.py
index c1e935f..b1c4c2e 100755
--- a/source4/dsdb/samdb/ldb_modules/tests/possibleinferiors.py
+++ b/source4/dsdb/samdb/ldb_modules/tests/possibleinferiors.py
@@ -7,12 +7,12 @@
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
-#   
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-#   
+#
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
@@ -26,7 +26,6 @@ import sys
 # Find right directory when running from source tree
 sys.path.insert(0, "bin/python")
 
-import samba
 from samba import getopt as options, Ldb
 import ldb
 
@@ -88,7 +87,7 @@ def possible_inferiors_search(db, oc):
         poss.append(str(item))
     poss = uniq_list(poss)
     poss.sort()
-    return poss;
+    return poss
 
 
 
@@ -99,20 +98,20 @@ def possible_inferiors_search(db, oc):
 # !objectClassCategory=2
 # !objectClassCategory=3
 
-def SUPCLASSES(classinfo, oc):
+def supclasses(classinfo, oc):
     list = []
     if oc == "top":
         return list
     if classinfo[oc].get("SUPCLASSES") is not None:
         return classinfo[oc]["SUPCLASSES"]
-    res = classinfo[oc]["subClassOf"];
+    res = classinfo[oc]["subClassOf"]
     for r in res:
         list.append(r)
-        list.extend(SUPCLASSES(classinfo,r))
+        list.extend(supclasses(classinfo,r))
     classinfo[oc]["SUPCLASSES"] = list
     return list
 
-def AUXCLASSES(classinfo, oclist):
+def auxclasses(classinfo, oclist):
     list = []
     if oclist == []:
         return list
@@ -122,21 +121,21 @@ def AUXCLASSES(classinfo, oclist):
         else:
             list2 = []
             list2.extend(classinfo[oc]["systemAuxiliaryClass"])
-            list2.extend(AUXCLASSES(classinfo, classinfo[oc]["systemAuxiliaryClass"]))
+            list2.extend(auxclasses(classinfo, classinfo[oc]["systemAuxiliaryClass"]))
             list2.extend(classinfo[oc]["auxiliaryClass"])
-            list2.extend(AUXCLASSES(classinfo, classinfo[oc]["auxiliaryClass"]))
-            list2.extend(AUXCLASSES(classinfo, SUPCLASSES(classinfo, oc)))
+            list2.extend(auxclasses(classinfo, classinfo[oc]["auxiliaryClass"]))
+            list2.extend(auxclasses(classinfo, supclasses(classinfo, oc)))
             classinfo[oc]["AUXCLASSES"] = list2
             list.extend(list2)
     return list
 
-def SUBCLASSES(classinfo, oclist):
+def subclasses(classinfo, oclist):
     list = []
     for oc in oclist:
         list.extend(classinfo[oc]["SUBCLASSES"])
     return list
 
-def POSSSUPERIORS(classinfo, oclist):
+def posssuperiors(classinfo, oclist):
     list = []
     for oc in oclist:
         if classinfo[oc].get("POSSSUPERIORS") is not None:
@@ -145,13 +144,13 @@ def POSSSUPERIORS(classinfo, oclist):
             list2 = []
             list2.extend(classinfo[oc]["systemPossSuperiors"])
             list2.extend(classinfo[oc]["possSuperiors"])
-            list2.extend(POSSSUPERIORS(classinfo, SUPCLASSES(classinfo, oc)))
+            list2.extend(posssuperiors(classinfo, supclasses(classinfo, oc)))
             if opts.wspp:
                 # the WSPP docs suggest we should do this:
-                list2.extend(POSSSUPERIORS(classinfo, AUXCLASSES(classinfo, [oc])))
+                list2.extend(posssuperiors(classinfo, auxclasses(classinfo, [oc])))
             else:
                 # but testing against w2k3 and w2k8 shows that we need to do this instead
-                list2.extend(SUBCLASSES(classinfo, list2))
+                list2.extend(subclasses(classinfo, list2))
             classinfo[oc]["POSSSUPERIORS"] = list2
             list.extend(list2)
     return list
@@ -211,7 +210,7 @@ def is_in_list(list, c):
 def possible_inferiors_constructed(db, classinfo, c):
     list = []
     for oc in classinfo:
-        superiors = POSSSUPERIORS(classinfo, [oc])
+        superiors = posssuperiors(classinfo, [oc])
         if (is_in_list(superiors, c) and
             classinfo[oc]["systemOnly"] == False and
             classinfo[oc]["objectClassCategory"] != 2 and
@@ -223,16 +222,20 @@ def possible_inferiors_constructed(db, classinfo, c):
 
 def test_class(db, classinfo, oc):
     """test to see if one objectclass returns the correct possibleInferiors"""
-    print "Testing objectClass %s" % oc
+    print "test: objectClass.%s" % oc
     poss1 = possible_inferiors_search(db, oc)
     poss2 = possible_inferiors_constructed(db, classinfo, oc)
     if poss1 != poss2:
+        print "failure: objectClass.%s [" % oc
         print "Returned incorrect list for objectclass %s" % oc
         print "search:      %s" % poss1
         print "constructed: %s" % poss2
         for i in range(0,min(len(poss1),len(poss2))):
             print "%30s %30s" % (poss1[i], poss2[i])
-        exit(1)
+        print "]"
+        sys.exit(1)
+    else:
+        print "success: objectClass.%s" % oc
 
 def get_object_classes(db):
     """return a list of all object classes"""
diff --git a/source4/dsdb/tests/python/urgent_replication.py b/source4/dsdb/tests/python/urgent_replication.py
index af5caca..7f0956e 100755
--- a/source4/dsdb/tests/python/urgent_replication.py
+++ b/source4/dsdb/tests/python/urgent_replication.py
@@ -67,11 +67,11 @@ class UrgentReplicationTests(samba.tests.TestCase):
             "dn": "cn=nonurgenttest,cn=users," + self.base_dn,
             "objectclass":"user",
             "samaccountname":"nonurgenttest",
-            "description":"nonurgenttest description"});
+            "description":"nonurgenttest description"})
 
         # urgent replication should not be enabled when creating 
         res = self.ldb.load_partition_usn(self.base_dn)
-        self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"])
 
         # urgent replication should not be enabled when modifying
         m = Message()
@@ -80,12 +80,12 @@ class UrgentReplicationTests(samba.tests.TestCase):
           "description")
         ldb.modify(m)
         res = self.ldb.load_partition_usn(self.base_dn)
-        self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"])
 
         # urgent replication should not be enabled when deleting
         self.delete_force(self.ldb, "cn=nonurgenttest,cn=users," + self.base_dn)
         res = self.ldb.load_partition_usn(self.base_dn)
-        self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"])
 
 
     def test_nTDSDSA_object(self):
@@ -96,7 +96,7 @@ class UrgentReplicationTests(samba.tests.TestCase):
             "objectclass":"server",
             "cn":"test server",
             "name":"test server",
-            "systemFlags":"50000000", ["relax:0"]});
+            "systemFlags":"50000000"}, ["relax:0"])
 
         self.ldb.add_ldif(
             """dn: cn=NTDS Settings test,cn=test server,cn=Servers,cn=Default-First-Site-Name,cn=Sites,cn=Configuration,%s""" % (self.base_dn) + """
@@ -104,11 +104,11 @@ objectclass: nTDSDSA
 cn: NTDS Settings test
 options: 1
 instanceType: 4
-systemFlags: 33554432""", ["relax:0"]);
+systemFlags: 33554432""", ["relax:0"])
 
         # urgent replication should be enabled when creation
         res = self.ldb.load_partition_usn("cn=Configuration," + self.base_dn)
-        self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertEquals(res["uSNHighest"], res["uSNUrgent"])
 
         # urgent replication should NOT be enabled when modifying
         m = Message()
@@ -117,12 +117,12 @@ systemFlags: 33554432""", ["relax:0"]);
           "options")
         ldb.modify(m)
         res = self.ldb.load_partition_usn("cn=Configuration," + self.base_dn)
-        self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"])
 
         # urgent replication should be enabled when deleting
         self.delete_force(self.ldb, "cn=NTDS Settings test,cn=test server,cn=Servers,cn=Default-First-Site-Name,cn=Sites,cn=Configuration," + self.base_dn)
         res = self.ldb.load_partition_usn("cn=Configuration," + self.base_dn)
-        self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertEquals(res["uSNHighest"], res["uSNUrgent"])
 
         self.delete_force(self.ldb, "cn=test server,cn=Servers,cn=Default-First-Site-Name,cn=Sites,cn=Configuration," + self.base_dn)
 
@@ -139,11 +139,11 @@ systemFlags: 33554432""", ["relax:0"]);
                       "nCName": self.base_dn,
                       "showInAdvancedViewOnly": "TRUE",
                       "name": "test crossRef",
-                      "systemFlags": "1", ["relax:0"]});
+                      "systemFlags": "1", ["relax:0"]})
 
         # urgent replication should be enabled when creating
         res = self.ldb.load_partition_usn("cn=Configuration," + self.base_dn)
-        self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertEquals(res["uSNHighest"], res["uSNUrgent"])
 
         # urgent replication should NOT be enabled when modifying
         m = Message()
@@ -152,13 +152,13 @@ systemFlags: 33554432""", ["relax:0"]);
           "systemFlags")
         ldb.modify(m)
         res = self.ldb.load_partition_usn("cn=Configuration," + self.base_dn)
-        self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"])
 
 
         # urgent replication should be enabled when deleting
         self.delete_force(self.ldb, "cn=test crossRef,CN=Partitions,CN=Configuration," + self.base_dn)
         res = self.ldb.load_partition_usn("cn=Configuration," + self.base_dn)
-        self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertEquals(res["uSNHighest"], res["uSNUrgent"])
 
 
 
@@ -182,11 +182,11 @@ oMSyntax: 64
 systemOnly: FALSE
 searchFlags: 8
 lDAPDisplayName: test attributeSchema
-name: test attributeSchema""");
+name: test attributeSchema""")
 
             # urgent replication should be enabled when creating
             res = self.ldb.load_partition_usn("cn=Schema,cn=Configuration," + self.base_dn)
-            self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
+            self.assertEquals(res["uSNHighest"], res["uSNUrgent"])
 
         except LdbError:
             print "Not testing urgent replication when creating attributeSchema object ...\n"
@@ -198,7 +198,7 @@ name: test attributeSchema""");
           "lDAPDisplayName")
         ldb.modify(m)
         res = self.ldb.load_partition_usn("cn=Schema,cn=Configuration," + self.base_dn)
-        self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertEquals(res["uSNHighest"], res["uSNUrgent"])
 
 
     def test_classSchema_object(self):
@@ -225,11 +225,11 @@ systemMustContain: msDFS-SchemaMajorVersion
 defaultSecurityDescriptor: D:(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;DA)(A;;RPWPCRCCD
  CLCLORCWOWDSDDTSW;;;SY)(A;;RPLCLORC;;;AU)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;CO)
 systemFlags: 16
-defaultHidingValue: TRUE""");
+defaultHidingValue: TRUE""")
 
             # urgent replication should be enabled when creating
             res = self.ldb.load_partition_usn("cn=Schema,cn=Configuration," + self.base_dn)
-            self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
+            self.assertEquals(res["uSNHighest"], res["uSNUrgent"])
 
         except LdbError:
             print "Not testing urgent replication when creating classSchema object ...\n"
@@ -241,7 +241,7 @@ defaultHidingValue: TRUE""");
           "lDAPDisplayName")
         ldb.modify(m)
         res = self.ldb.load_partition_usn("cn=Schema,cn=Configuration," + self.base_dn)
-        self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertEquals(res["uSNHighest"], res["uSNUrgent"])
 
 
     def test_secret_object(self):
@@ -253,11 +253,11 @@ defaultHidingValue: TRUE""");
             "objectClass":"secret",
             "cn":"test secret",
             "name":"test secret",
-            "currentValue":"xxxxxxx"}, ["relax:0"]);
+            "currentValue":"xxxxxxx"}, ["relax:0"])
 
         # urgent replication should be enabled when creating
         res = self.ldb.load_partition_usn(self.base_dn)
-        self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertEquals(res["uSNHighest"], res["uSNUrgent"])
 
         # urgent replication should be enabled when modifying
         m = Message()
@@ -266,12 +266,12 @@ defaultHidingValue: TRUE""");
           "currentValue")
         ldb.modify(m)
         res = self.ldb.load_partition_usn(self.base_dn)
-        self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertEquals(res["uSNHighest"], res["uSNUrgent"])
 
         # urgent replication should NOT be enabled when deleting 
         self.delete_force(self.ldb, "cn=test secret,cn=System," + self.base_dn)
         res = self.ldb.load_partition_usn(self.base_dn)
-        self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"])
 
 
     def test_rIDManager_object(self):
@@ -290,7 +290,7 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
 
         # urgent replication should be enabled when creating
         res = self.ldb.load_partition_usn(self.base_dn)
-        self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertEquals(res["uSNHighest"], res["uSNUrgent"])
 
         # urgent replication should be enabled when modifying
         m = Message()
@@ -299,12 +299,12 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
           "systemFlags")
         ldb.modify(m)
         res = self.ldb.load_partition_usn(self.base_dn)
-        self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertEquals(res["uSNHighest"], res["uSNUrgent"])
 
         # urgent replication should NOT be enabled when deleting 
         self.delete_force(self.ldb, "CN=RID Manager test,CN=System," + self.base_dn)
         res = self.ldb.load_partition_usn(self.base_dn)
-        self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"])
 
 
     def test_urgent_attributes(self):
@@ -318,11 +318,11 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
             "userAccountControl":"1",
             "lockoutTime":"0",
             "pwdLastSet":"0",
-            "description":"urgent attributes test description"});
+            "description":"urgent attributes test description"})
 
         # urgent replication should NOT be enabled when creating
         res = self.ldb.load_partition_usn(self.base_dn)
-        self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"])
 
         # urgent replication should be enabled when modifying userAccountControl 
         m = Message()
@@ -331,7 +331,7 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
           "userAccountControl")
         ldb.modify(m)
         res = self.ldb.load_partition_usn(self.base_dn)
-        self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertEquals(res["uSNHighest"], res["uSNUrgent"])
 
         # urgent replication should be enabled when modifying lockoutTime
         m = Message()
@@ -340,7 +340,7 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
           "lockoutTime")
         ldb.modify(m)
         res = self.ldb.load_partition_usn(self.base_dn)
-        self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertEquals(res["uSNHighest"], res["uSNUrgent"])
 
         # urgent replication should be enabled when modifying pwdLastSet
         m = Message()
@@ -349,7 +349,7 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
           "pwdLastSet")
         ldb.modify(m)
         res = self.ldb.load_partition_usn(self.base_dn)
-        self.assertEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertEquals(res["uSNHighest"], res["uSNUrgent"])
 
         # urgent replication should NOT be enabled when modifying a not-urgent
         # attribute
@@ -359,12 +359,12 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
                                           FLAG_MOD_REPLACE, "description")
         ldb.modify(m)
         res = self.ldb.load_partition_usn(self.base_dn)
-        self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"])
 
         # urgent replication should NOT be enabled when deleting
         self.delete_force(self.ldb, "cn=user UrgAttr test,cn=users," + self.base_dn)
         res = self.ldb.load_partition_usn(self.base_dn)
-        self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"]);
+        self.assertNotEquals(res["uSNHighest"], res["uSNUrgent"])
 
 
 if not "://" in host:
diff --git a/source4/scripting/python/samba/__init__.py b/source4/scripting/python/samba/__init__.py
index 5299e07..5a9df50 100644
--- a/source4/scripting/python/samba/__init__.py
+++ b/source4/scripting/python/samba/__init__.py
@@ -27,13 +27,13 @@ __docformat__ = "restructuredText"
 import os
 import sys
 
-def _in_source_tree():
+def in_source_tree():
     """Check whether the script is being run from the source dir. """
     return os.path.exists("%s/../../../selftest/skip" % os.path.dirname(__file__))
 
 
 # When running, in-tree, make sure bin/python is in the PYTHONPATH
-if _in_source_tree():
+if in_source_tree():
     srcdir = "%s/../../.." % os.path.dirname(__file__)
     sys.path.append("%s/bin/python" % srcdir)
     default_ldb_modules_dir = "%s/bin/modules/ldb" % srcdir
@@ -312,7 +312,7 @@ def ensure_external_module(modulename, location):
     try:
         __import__(modulename)
     except ImportError:
-        if _in_source_tree():
+        if in_source_tree():
             sys.path.insert(0, 
                 os.path.join(os.path.dirname(__file__),
                              "../../../../lib", location))
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py
index 7c38197..ce3fa17 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -41,9 +41,21 @@ import ldb
 
 from samba.auth import system_session, admin_session
 import samba
-from samba import version, Ldb, substitute_var, valid_netbios_name
-from samba import check_all_substituted, read_and_sub_file, setup_file
-from samba.dsdb import DS_DOMAIN_FUNCTION_2003, DS_DOMAIN_FUNCTION_2008_R2, ENC_ALL_TYPES
+from samba import (
+    Ldb,
+    check_all_substituted,
+    in_source_tree,
+    read_and_sub_file,
+    setup_file,
+    substitute_var,
+    valid_netbios_name,
+    version,
+    )
+from samba.dsdb import (
+    DS_DOMAIN_FUNCTION_2003,
+    DS_DOMAIN_FUNCTION_2008_R2,
+    ENC_ALL_TYPES,
+    )
 from samba.dcerpc import security
 from samba.dcerpc.misc import SEC_CHAN_BDC, SEC_CHAN_WKSTA
 from samba.idmap import IDmapDB
@@ -68,19 +80,19 @@ DEFAULT_DC_POLICY_GUID = "6AC1786C-016F-11D2-945F-00C04fB984F9"
 
 def find_setup_dir():
     """Find the setup directory used by provision."""
-    import sys
-    for prefix in [sys.prefix,
-            os.path.join(os.path.dirname(__file__), "../../../..")]:
-        for suffix in ["share/setup", "share/samba/setup", "setup"]:
-            ret = os.path.join(prefix, suffix)
-            if os.path.isdir(ret):
-                return ret
-    # In source tree
-    dirname = os.path.dirname(__file__)
-    ret = os.path.join(dirname, "../../../setup")
-    if os.path.isdir(ret):
-        return ret
-    raise Exception("Unable to find setup directory.")
+    if in_source_tree():
+        # In source tree
+        dirname = os.path.dirname(__file__)
+        return os.path.join(dirname, "../../../setup")
+    else:
+        import sys
+        for prefix in [sys.prefix,
+                os.path.join(os.path.dirname(__file__), "../../../..")]:
+            for suffix in ["share/setup", "share/samba/setup", "setup"]:
+                ret = os.path.join(prefix, suffix)
+                if os.path.isdir(ret):
+                    return ret
+        raise Exception("Unable to find setup directory.")
 
 # Descriptors of naming contexts and other important objects
 
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index 15a8ab3..4bb3d90 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -357,7 +357,7 @@ planperltestsuite("selftest.samba4", os.path.normpath(os.path.join(samba4srcdir,
 # work correctly.
 
 planpythontestsuite("none", "samba.tests.blackbox.ndrdump")
-plantestsuite("samba4.blackbox.samba_tool(dc:local)", "dc:local", [os.path.join(samba4srcdir, "utils/tests/test_net.sh"),  '$SERVER', "$USERNAME", "$PASSWORD", "$DOMAIN"])
+plantestsuite("samba4.blackbox.samba_tool(dc:local)", "dc:local", [os.path.join(samba4srcdir, "utils/tests/test_samba_tool.sh"),  '$SERVER', "$USERNAME", "$PASSWORD", "$DOMAIN"])
 plantestsuite("samba4.blackbox.pkinit(dc:local)", "dc:local", [os.path.join(bbdir, "test_pkinit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96", configuration])
 plantestsuite("samba4.blackbox.kinit(dc:local)", "dc:local", [os.path.join(bbdir, "test_kinit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96", configuration])
 plantestsuite("samba4.blackbox.kinit(fl2000dc:local)", "fl2000dc:local", [os.path.join(bbdir, "test_kinit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "arcfour-hmac-md5", configuration])
@@ -485,7 +485,7 @@ planpythontestsuite("dc:local", "samba.tests.upgradeprovisionneeddc")
 planpythontestsuite("none", "samba.tests.upgradeprovision")
 planpythontestsuite("none", "samba.tests.xattr")


-- 
Samba Shared Repository


More information about the samba-cvs mailing list