Author: jelmer Date: 2007-12-25 16:36:53 +0000 (Tue, 25 Dec 2007) New Revision: 26598
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=26598 Log: Simplify the way Python tests are run. Modified: branches/SAMBA_4_0/ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/tests/samba3sam.py branches/SAMBA_4_0/source/samba4-skip branches/SAMBA_4_0/source/scripting/bin/subunitrun branches/SAMBA_4_0/source/selftest/samba4_tests.sh branches/SAMBA_4_0/source/setup/provision.py branches/SAMBA_4_0/source/setup/upgrade.py Changeset: Property changes on: branches/SAMBA_4_0 ___________________________________________________________________ Name: bzr:revision-info ...skipped... Name: bzr:revision-id:v3-trunk0 ...skipped... Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/tests/samba3sam.py =================================================================== --- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/tests/samba3sam.py 2007-12-25 16:36:50 UTC (rev 26597) +++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/tests/samba3sam.py 2007-12-25 16:36:53 UTC (rev 26598) @@ -1034,18 +1034,18 @@ self.samba4.connect() def tearDown(self): - super(Samba3SamTestCase, self).tearDown() os.unlink(self.ldbfile) os.unlink(self.samba3.file) os.unlink(self.templates.file) os.unlink(self.samba4.file) + super(Samba3SamTestCase, self).tearDown() def test_s3sam(self): ldb = Ldb(self.ldburl) self.setup_data(self.samba3, open(os.path.join(datadir, "samba3.ldif"), 'r').read()) self.setup_data(self.templates, open(os.path.join(datadir, "provision_samba3sam_templates.ldif"), 'r').read()) ldif = open(os.path.join(datadir, "provision_samba3sam.ldif"), 'r').read() - ldb.add_ldif(substitute_var(ldif, s4.substvars)) + ldb.add_ldif(substitute_var(ldif, self.samba4.substvars)) self.setup_modules(ldb, self.samba3, self.samba4) ldb = Ldb(self.ldburl) @@ -1057,7 +1057,7 @@ ldb = Ldb(self.ldburl) self.setup_data(self.templates, open(os.path.join(datadir, "provision_samba3sam_templates.ldif"), 'r').read()) ldif = open(os.path.join(datadir, "provision_samba3sam.ldif"), 'r').read() - ldb.add_ldif(substitute_var(ldif, s4.substvars)) + ldb.add_ldif(substitute_var(ldif, self.samba4.substvars)) self.setup_modules(ldb, self.samba3, self.samba4) ldb = Ldb(self.ldburl) Modified: branches/SAMBA_4_0/source/samba4-skip =================================================================== --- branches/SAMBA_4_0/source/samba4-skip 2007-12-25 16:36:50 UTC (rev 26597) +++ branches/SAMBA_4_0/source/samba4-skip 2007-12-25 16:36:53 UTC (rev 26598) @@ -50,3 +50,4 @@ WINBIND # FIXME: This should not be skipped NSS-TEST # Fails samba4.ldap.python # Conversion from EJS not yet finished +samba4.samba3sam.python # Conversion from EJS not yet finished Modified: branches/SAMBA_4_0/source/scripting/bin/subunitrun =================================================================== --- branches/SAMBA_4_0/source/scripting/bin/subunitrun 2007-12-25 16:36:50 UTC (rev 26597) +++ branches/SAMBA_4_0/source/scripting/bin/subunitrun 2007-12-25 16:36:53 UTC (rev 26598) @@ -21,5 +21,6 @@ import sys from unittest import TestProgram -program = TestProgram(module=None, argv=sys.argv, testRunner=SubunitTestRunner()) +program = TestProgram(module=None, argv=sys.argv, + testRunner=SubunitTestRunner()) program.runTests() Modified: branches/SAMBA_4_0/source/selftest/samba4_tests.sh =================================================================== --- branches/SAMBA_4_0/source/selftest/samba4_tests.sh 2007-12-25 16:36:50 UTC (rev 26597) +++ branches/SAMBA_4_0/source/selftest/samba4_tests.sh 2007-12-25 16:36:53 UTC (rev 26598) @@ -284,24 +284,21 @@ if test -f $samba4bindir/smbpython then PYTHON=bin/smbpython - plantest "ldb.python" none PYTHONPATH=bin/python:scripting/python:lib/ldb/tests/python/ $PYTHON scripting/bin/subunitrun api - plantest "credentials.python" none PYTHONPATH=bin/python:scripting/python:auth/credentials/tests $PYTHON scripting/bin/subunitrun bindings - plantest "registry.python" none PYTHONPATH=bin/python:scripting/python:lib/registry/tests/ $PYTHON scripting/bin/subunitrun bindings - plantest "tdb.python" none PYTHONPATH=bin/python:scripting/python:lib/tdb/python/tests $PYTHON scripting/bin/subunitrun simple - plantest "auth.python" none PYTHONPATH=bin/python:scripting/python:auth/tests/ $PYTHON scripting/bin/subunitrun bindings - plantest "security.python" none PYTHONPATH=bin/python:scripting/python:libcli/security/tests/ $PYTHON scripting/bin/subunitrun bindings - plantest "param.python" none PYTHONPATH=bin/python:scripting/python:param/tests $PYTHON scripting/bin/subunitrun bindings - plantest "upgrade.python" none PYTHONPATH=bin/python:scripting/python $PYTHON scripting/bin/subunitrun samba.tests.upgrade - plantest "samba.python" none PYTHONPATH=bin/python:scripting/python $PYTHON scripting/bin/subunitrun samba.tests - plantest "provision.python" none PYTHONPATH=bin/python:scripting/python $PYTHON scripting/bin/subunitrun samba.tests.provision - plantest "samba3.python" none PYTHONPATH=bin/python:scripting/python $PYTHON scripting/bin/subunitrun samba.tests.samba3 - plantest "samba3sam.python" none PYTHONPATH=bin/python:scripting/python $PYTHON dsdb/samdb/ldb_modules/tests/samba3sam.py `pwd` $DATADIR/samba3/ + SUBUNITRUN="$PYTHON ./scripting/bin/subunitrun" + plantest "ldb.python" none PYTHONPATH="$PYTHONPATH:lib/ldb/tests/python/" $SUBUNITRUN api + plantest "credentials.python" none PYTHONPATH="$PYTHONPATH:auth/credentials/tests" $SUBUNITRUN bindings + plantest "registry.python" none PYTHONPATH="$PYTHONPATH:lib/registry/tests/" $SUBUNITRUN bindings + plantest "tdb.python" none PYTHONPATH="$PYTHONPATH:lib/tdb/python/tests" $SUBUNITRUN simple + plantest "auth.python" none PYTHONPATH="$PYTHONPATH:auth/tests/" $SUBUNITRUN bindings + plantest "security.python" none PYTHONPATH="$PYTHONPATH:libcli/security/tests" $SUBUNITRUN bindings + plantest "param.python" none PYTHONPATH="$PYTHONPATH:param/tests" $SUBUNITRUN bindings + plantest "upgrade.python" none $SUBUNITRUN samba.tests.upgrade + plantest "samba.python" none $SUBUNITRUN samba.tests + plantest "provision.python" none $SUBUNITRUN samba.tests.provision + plantest "samba3.python" none $SUBUNITRUN samba.tests.samba3 + plantest "samba3sam.python" none PYTHONPATH="$PYTHONPATH:dsdb/samdb/ldb_modules/tests" $SUBUNITRUN samba3sam plantest "ldap.python" dc $PYTHON $samba4srcdir/lib/ldb/tests/python/ldap.py \$SERVER -U\$USERNAME%\$PASSWORD plantest "blackbox.samba3dump" none $PYTHON scripting/bin/samba3dump $samba4srcdir/../testdata/samba3 - rm -rf $PREFIX/upgrade - mkdir -p $PREFIX/upgrade plantest "blackbox.upgrade" none $PYTHON setup/upgrade.py $CONFIGURATION --targetdir=$PREFIX ../testdata/samba3 ../testdata/samba3/smb.conf - rm -rf $PREFIX/provision - mkdir -p $PREFIX/provision plantest "blackbox.provision.py" none $PYTHON ./setup/provision.py $CONFIGURATION --domain=FOO --realm=foo --targetdir=$PREFIX/provision fi Modified: branches/SAMBA_4_0/source/setup/provision.py =================================================================== --- branches/SAMBA_4_0/source/setup/provision.py 2007-12-25 16:36:50 UTC (rev 26597) +++ branches/SAMBA_4_0/source/setup/provision.py 2007-12-25 16:36:53 UTC (rev 26598) @@ -116,6 +116,8 @@ if opts.configfile: lp.load(opts.configfile) if opts.targetdir is not None: + if not os.path.exists(opts.targetdir): + os.mkdir(opts.targetdir) lp.set("private dir", os.path.abspath(opts.targetdir)) lp.set("lock dir", os.path.abspath(opts.targetdir)) lp.set("realm", opts.realm) Modified: branches/SAMBA_4_0/source/setup/upgrade.py =================================================================== --- branches/SAMBA_4_0/source/setup/upgrade.py 2007-12-25 16:36:50 UTC (rev 26597) +++ branches/SAMBA_4_0/source/setup/upgrade.py 2007-12-25 16:36:53 UTC (rev 26598) @@ -63,6 +63,8 @@ if opts.configfile: lp.load(opts.configfile) if opts.targetdir is not None: + if not os.path.exists(opts.targetdir): + os.mkdir(opts.targetdir) lp.set("private dir", os.path.abspath(opts.targetdir)) lp.set("lock dir", os.path.abspath(opts.targetdir)) paths = provision_paths_from_lp(lp, "")
