[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha3-1964-g89fc39f

Andrew Bartlett abartlet at samba.org
Fri May 30 04:27:39 GMT 2008


The branch, v4-0-test has been updated
       via  89fc39f7edb214065aff461bc225f41443eae3c7 (commit)
       via  cd10b381765f9146f22f5cf23f0ef5f6a65e804d (commit)
       via  df8c0bb8f9367b425080a43ed6f1d3384dde340b (commit)
      from  d335fd11637f5e138b08a5e0fcf54b19cef9a646 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit 89fc39f7edb214065aff461bc225f41443eae3c7
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri May 30 14:26:47 2008 +1000

    Fix up provision and samdb tests.
    
    This fixes up the provision to operate with a target directory - it
    must override the smb.conf in this case.
    
    Andrew Bartlett

commit cd10b381765f9146f22f5cf23f0ef5f6a65e804d
Merge: df8c0bb8f9367b425080a43ed6f1d3384dde340b d335fd11637f5e138b08a5e0fcf54b19cef9a646
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri May 30 07:55:29 2008 +1000

    Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into 4-0-local

commit df8c0bb8f9367b425080a43ed6f1d3384dde340b
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri May 30 07:54:09 2008 +1000

    Remove test from samba4-skip, it is avoided in samba4_tests.sh
    
    Andrew Bartlett

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

Summary of changes:
 source/samba4-skip                           |    1 -
 source/scripting/python/samba/provision.py   |    5 +++--
 source/scripting/python/samba/tests/samdb.py |   25 ++++++++++++++++++++-----
 3 files changed, 23 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/samba4-skip b/source/samba4-skip
index de572ed..0b2d852 100644
--- a/source/samba4-skip
+++ b/source/samba4-skip
@@ -10,7 +10,6 @@ raw.hold.oplock		# Not a test, but a way to block other clients for a test
 raw.ping.pong		# Needs second server to test
 rpc.samr_accessmask
 raw.scan.eamax
-samba4.ntvfs.cifs.raw.qfileinfo.ipc
 base.utable
 base.smb
 smb2.notify
diff --git a/source/scripting/python/samba/provision.py b/source/scripting/python/samba/provision.py
index 71c1ac3..b7112e1 100644
--- a/source/scripting/python/samba/provision.py
+++ b/source/scripting/python/samba/provision.py
@@ -930,8 +930,9 @@ def provision(setup_dir, message, session_info,
     if aci is None:
         aci = "# no aci for local ldb"
 
-    if smbconf is None:
-        os.makedirs(os.path.join(targetdir, "etc"))
+    if targetdir is not None:
+        if (not os.path.exists(os.path.join(targetdir, "etc"))):
+            os.makedirs(os.path.join(targetdir, "etc"))
         smbconf = os.path.join(targetdir, "etc", "smb.conf")
 
     # only install a new smb.conf if there isn't one there already
diff --git a/source/scripting/python/samba/tests/samdb.py b/source/scripting/python/samba/tests/samdb.py
index 7e8ba05..fcf93a3 100644
--- a/source/scripting/python/samba/tests/samdb.py
+++ b/source/scripting/python/samba/tests/samdb.py
@@ -19,12 +19,13 @@
 from samba.auth import system_session
 from samba.credentials import Credentials
 import os
-from samba.provision import setup_samdb, guess_names, setup_templatesdb
+from samba.provision import setup_samdb, guess_names, setup_templatesdb, make_smbconf
 from samba.samdb import SamDB
 from samba.tests import cmdline_loadparm, TestCaseInTempDir
 from samba import security
 from unittest import TestCase
 import uuid
+import param
 
 class SamDBTestCase(TestCaseInTempDir):
     def setUp(self):
@@ -43,9 +44,22 @@ class SamDBTestCase(TestCaseInTempDir):
         hostguid = str(uuid.uuid4())
         path = os.path.join(self.tempdir, "samdb.ldb")
         session_info = system_session()
-        names = guess_names(lp=cmdline_loadparm, hostname="foo", 
-                            domain="EXAMPLE.COM", dnsdomain="example.com", 
-                            serverrole="domain controller", 
+        
+        hostname="foo"
+        domain="EXAMPLE"
+        dnsdomain="example.com" 
+        serverrole="domain controller"
+
+        smbconf = os.path.join(self.tempdir, "smb.conf")
+        make_smbconf(smbconf, setup_path, hostname, domain, dnsdomain, serverrole, 
+                     self.tempdir)
+
+        lp = param.LoadParm()
+        lp.load(smbconf)
+
+        names = guess_names(lp=lp, hostname=hostname, 
+                            domain=domain, dnsdomain=dnsdomain, 
+                            serverrole=severrole, 
                             domaindn=self.domaindn, configdn=configdn, 
                             schemadn=schemadn)
         setup_templatesdb(os.path.join(self.tempdir, "templates.ldb"), 
@@ -58,9 +72,10 @@ class SamDBTestCase(TestCaseInTempDir):
                                  policyguid, False, "secret", 
                                  "secret", "secret", invocationid, 
                                  "secret", "domain controller")
+
     def tearDown(self):
         for f in ['templates.ldb', 'schema.ldb', 'configuration.ldb', 
-                  'users.ldb', 'samdb.ldb']:
+                  'users.ldb', 'samdb.ldb', 'smb.conf']:
             os.remove(os.path.join(self.tempdir, f))
         super(SamDBTestCase, self).tearDown()
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list