[SCM] Samba Shared Repository - branch master updated

Jelmer Vernooij jelmer at samba.org
Sun Nov 30 12:55:02 MST 2014


The branch, master has been updated
       via  7dbc58f Reduce number of places where sys.path is (possibly) updated for external module paths.
       via  4323504 Don't assume st/subunit being present means it was generated by the current process.
      from  02e063b Be consistent about what functions add $LISTOPT and $LOADLIST to the command-line.

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


- Log -----------------------------------------------------------------
commit 7dbc58f524fbde517966d671da138b69566929d7
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Nov 4 20:37:41 2014 +0000

    Reduce number of places where sys.path is (possibly) updated for external module paths.
    
    Change-Id: I69d060f27ea090d14405e884d1ce271975358c56
    Signed-Off-By: Jelmer Vernooij <jelmer at samba.org>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Jelmer Vernooij <jelmer at samba.org>
    Autobuild-Date(master): Sun Nov 30 20:54:04 CET 2014 on sn-devel-104

commit 4323504921ff0a566c43dada90443bdad3162f9b
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Sun Nov 2 12:36:13 2014 -0800

    Don't assume st/subunit being present means it was generated by the current process.
    
    This fixes --list.
    
    Change-Id: I75fc765757e06861cf3bb489246e0845564a1123
    Signed-off-by: Jelmer Vernooij <jelmer at samba.org>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

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

Summary of changes:
 python/samba/tests/__init__.py                |  2 ++
 python/samba/tests/subunitrun.py              |  4 +---
 selftest/filter-subunit                       | 11 ++++++-----
 selftest/format-subunit                       | 10 ++++++----
 selftest/wscript                              | 14 ++++++++------
 source4/dsdb/tests/python/dsdb_schema_info.py |  3 +--
 source4/torture/drs/python/drs_base.py        |  6 +-----
 7 files changed, 25 insertions(+), 25 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/samba/tests/__init__.py b/python/samba/tests/__init__.py
index 8d3b4dd..8e662ed 100644
--- a/python/samba/tests/__init__.py
+++ b/python/samba/tests/__init__.py
@@ -26,6 +26,8 @@ from samba.samdb import SamDB
 import subprocess
 import tempfile
 
+samba.ensure_external_module("mimeparse", "mimeparse")
+samba.ensure_external_module("extras", "extras")
 samba.ensure_external_module("testtools", "testtools")
 
 # Other modules import these two classes from here, for convenience:
diff --git a/python/samba/tests/subunitrun.py b/python/samba/tests/subunitrun.py
index d454676..291e7ab 100755
--- a/python/samba/tests/subunitrun.py
+++ b/python/samba/tests/subunitrun.py
@@ -37,9 +37,7 @@ signal.signal(signal.SIGINT, signal.SIG_DFL)
 import optparse
 import samba
 import sys
-samba.ensure_external_module("mimeparse", "mimeparse")
-samba.ensure_external_module("extras", "extras")
-samba.ensure_external_module("testtools", "testtools")
+import samba.tests
 samba.ensure_external_module("subunit", "subunit/python")
 import subunit.run
 
diff --git a/selftest/filter-subunit b/selftest/filter-subunit
index 2ce9584..4f95546 100755
--- a/selftest/filter-subunit
+++ b/selftest/filter-subunit
@@ -19,14 +19,15 @@
 # to upstream subunit's filtering tools.
 
 import optparse
-import os
 import sys
 import signal
 
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib/subunit/python"))
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib/testtools"))
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib/mimeparse"))
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib/extras"))
+sys.path.insert(0, "bin/python")
+import samba
+samba.ensure_external_module("mimeparse", "mimeparse")
+samba.ensure_external_module("extras", "extras")
+samba.ensure_external_module("testtools", "testtools")
+samba.ensure_external_module("subunit", "subunit/python")
 
 import subunithelper
 
diff --git a/selftest/format-subunit b/selftest/format-subunit
index f59de97..58321bf 100755
--- a/selftest/format-subunit
+++ b/selftest/format-subunit
@@ -9,10 +9,12 @@ import os
 import signal
 import sys
 
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib/subunit/python"))
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib/testtools"))
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib/mimeparse"))
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib/extras"))
+sys.path.insert(0, "bin/python")
+import samba
+samba.ensure_external_module("mimeparse", "mimeparse")
+samba.ensure_external_module("extras", "extras")
+samba.ensure_external_module("testtools", "testtools")
+samba.ensure_external_module("subunit", "subunit/python")
 
 import subunithelper
 
diff --git a/selftest/wscript b/selftest/wscript
index cf57adc..d1d7425 100644
--- a/selftest/wscript
+++ b/selftest/wscript
@@ -214,6 +214,7 @@ def cmd_testonly(opt):
     env.OPTIONS += " --socket_wrapper_so_path=" + CONFIG_GET(opt, 'LIBSOCKET_WRAPPER_SO_PATH')
     env.OPTIONS += " --uid_wrapper_so_path=" + CONFIG_GET(opt, 'LIBUID_WRAPPER_SO_PATH')
 
+    subunit_cache = None
     # We use the full path rather than relative path to avoid problems on some platforms (ie. solaris 8).
     env.CORE_COMMAND = '${PERL} ${srcdir}/selftest/selftest.pl --target=${SELFTEST_TARGET} --prefix=${SELFTEST_PREFIX} --srcdir=${srcdir} --exclude=${srcdir}/selftest/skip ${TESTLISTS} ${OPTIONS} ${TESTS}'
     if Options.options.LIST:
@@ -223,7 +224,8 @@ def cmd_testonly(opt):
         cmd = '(${CORE_COMMAND} && touch ${SELFTEST_PREFIX}/st_done) | ${FILTER_OPTIONS}'
         if (os.environ.get('RUN_FROM_BUILD_FARM') is None and
             not Options.options.FILTERED_SUBUNIT):
-            cmd += ' | tee ${SELFTEST_PREFIX}/subunit | ${FORMAT_TEST_OUTPUT}'
+            subunit_cache = os.path.join(Options.options.SELFTEST_PREFIX, "subunit")
+            cmd += ' | tee %s | ${FORMAT_TEST_OUTPUT}' % subunit_cache
         else:
             cmd += ' | ${FILTER_OPTIONS}'
     runcmd = EXPAND_VARIABLES(opt, cmd)
@@ -233,15 +235,15 @@ def cmd_testonly(opt):
 
     if (os.path.exists(".testrepository") and
         not Options.options.LIST and
-        not Options.options.LOAD_LIST):
-        testrcmd = 'testr load -q < ${SELFTEST_PREFIX}/subunit > /dev/null'
+        not Options.options.LOAD_LIST and
+        subunit_cache is not None):
+        testrcmd = 'testr load -q < %s > /dev/null' % subunit_cache
         runcmd = EXPAND_VARIABLES(opt, testrcmd)
         RUN_COMMAND(runcmd, env=env)
 
-    subunit_file = "%s/subunit" % env.SELFTEST_PREFIX
-    if os.path.exists(subunit_file):
+    if subunit_cache is not None:
         nb = Options.options.NB_SLOWEST
-        cmd = "./script/show_testsuite_time %s %d" % (subunit_file, nb)
+        cmd = "./script/show_testsuite_time %s %d" % (subunit_cache, nb)
         runcmd = EXPAND_VARIABLES(opt, cmd)
         RUN_COMMAND(runcmd, env=env)
 
diff --git a/source4/dsdb/tests/python/dsdb_schema_info.py b/source4/dsdb/tests/python/dsdb_schema_info.py
index 28fce1b..8f64f10 100755
--- a/source4/dsdb/tests/python/dsdb_schema_info.py
+++ b/source4/dsdb/tests/python/dsdb_schema_info.py
@@ -30,8 +30,7 @@ import time
 import random
 
 sys.path.insert(0, "bin/python")
-import samba
-samba.ensure_external_module("testtools", "testtools")
+import samba.tests
 
 from ldb import SCOPE_BASE, LdbError
 
diff --git a/source4/torture/drs/python/drs_base.py b/source4/torture/drs/python/drs_base.py
index f692edc..683987f 100644
--- a/source4/torture/drs/python/drs_base.py
+++ b/source4/torture/drs/python/drs_base.py
@@ -24,10 +24,8 @@ import time
 import os
 
 sys.path.insert(0, "bin/python")
-import samba
+import samba.tests
 from samba import dsdb
-samba.ensure_external_module("testtools", "testtools")
-samba.ensure_external_module("subunit", "subunit/python")
 
 from ldb import (
     SCOPE_BASE,
@@ -35,8 +33,6 @@ from ldb import (
     FLAG_MOD_REPLACE,
     )
 
-import samba.tests
-
 
 class DrsBaseTestCase(samba.tests.BlackboxTestCase):
     """Base class implementation for all DRS python tests.


-- 
Samba Shared Repository


More information about the samba-cvs mailing list