selftest:Samba4: test --domain-critical-only in provision_vampire_dc()
[ira/wip.git] / selftest / wscript
index ecf650274a777076e251e7ff1b51342a8a03a5a0..558cb2abd2ed9d35aea5a6e37b3c843b6938b820 100644 (file)
@@ -73,6 +73,19 @@ def set_options(opt):
 def configure(conf):
     conf.env.SELFTEST_PREFIX = Options.options.SELFTEST_PREFIX
 
+def combine_files(file1, file2, outfile):
+
+    f1 = open(file1)
+    f2 = open(file2)
+    of = open(outfile, mode='w')
+    for line in f1:
+        of.write(line)
+    for line in f2:
+        of.write(line)
+    f1.close()
+    f2.close()
+    of.close()
+
 def cmd_testonly(opt):
     '''run tests without doing a build first'''
     env = LOAD_ENVIRONMENT()
@@ -161,6 +174,9 @@ def cmd_testonly(opt):
     if env.USING_SYSTEM_LDB:
         os.environ['LDB_MODULES_PATH'] = 'bin/modules/ldb'
 
+    if env.BUILD_TDB2:
+        os.environ['BUILD_TDB2'] = '1'
+
     # tell build system where to find config.h
     os.environ['VFSLIBDIR'] = os.path.abspath('bin/modules/vfs')
     os.environ['CONFIG_H'] = 'bin/default/include/config.h'
@@ -175,15 +191,28 @@ def cmd_testonly(opt):
     if Options.options.TARGET:
         env.SELFTEST_TARGET = Options.options.TARGET
     else:
-        env.SELFTEST_TARGET = "samba4"
+        env.SELFTEST_TARGET = "samba"
 
     if env.SELFTEST_TARGET == "samba4":
         env.SELFTEST_DIR = "${srcdir}/source4/selftest"
     elif env.SELFTEST_TARGET == "samba3":
         env.SELFTEST_DIR = "${srcdir}/source3/selftest"
 
-        # We use the full path rather than relative path because it cause problems on some plateforms (ie. solaris 8).
-    cmd = '(${PERL} ${srcdir}/selftest/selftest.pl --target=${SELFTEST_TARGET} --prefix=${SELFTEST_PREFIX} --srcdir=${srcdir} --exclude=${SELFTEST_DIR}/skip --testlist="${PYTHON} ${SELFTEST_DIR}/tests.py|" ${OPTIONS} --socket-wrapper ${TESTS} && touch ${SELFTEST_PREFIX}/st_done) | ${FILTER_OPTIONS} | tee ${SELFTEST_PREFIX}/subunit'
+    if env.SELFTEST_TARGET == "samba":
+        for f in ["knownfail", "slow", "quick", "skip" ]:
+            combine_files(env.srcdir + "/source4/selftest/" + f,
+                          env.srcdir + "/source3/selftest/" + f,
+                          env.SELFTEST_PREFIX + "/" + f)
+
+        env.SELFTEST_DIR = env.SELFTEST_PREFIX
+        env.TESTLISTS = ('--testlist="${PYTHON} ${srcdir}/source3/selftest/tests.py|" ' +
+                         '--testlist="${PYTHON} ${srcdir}/source4/selftest/tests.py|"')
+    else:
+        env.TESTLISTS = '--testlist="${SELFTEST_DIR}/tests.py|"'
+
+    # We use the full path rather than relative path because it cause problems on some plateforms (ie. solaris 8).
+    cmd = '(${PERL} ${srcdir}/selftest/selftest.pl --target=${SELFTEST_TARGET} --prefix=${SELFTEST_PREFIX} --srcdir=${srcdir} --exclude=${SELFTEST_DIR}/skip ${TESTLISTS} ${OPTIONS} --socket-wrapper ${TESTS} && touch ${SELFTEST_PREFIX}/st_done) | ${FILTER_OPTIONS} | tee ${SELFTEST_PREFIX}/subunit'
+
     if os.environ.get('RUN_FROM_BUILD_FARM') is None and not Options.options.FILTERED_SUBUNIT:
         cmd += ' | ${FORMAT_TEST_OUTPUT}'
     else: