autobuild: Merge samba-simpleserver into samba-nt4
[amitay/samba.git] / script / autobuild.py
index adeea22a34de501825cde9727d9197ff295ca50b..3889d6ed6200c35f395fe6cda58aad8411797d22 100755 (executable)
@@ -121,31 +121,6 @@ cleanup_list = []
 
 builddirs = {
     "ctdb": "ctdb",
-    "samba": ".",
-    "samba-mitkrb5": ".",
-    "samba-nt4": ".",
-    "samba-fileserver": ".",
-    "samba-admem": ".",
-    "samba-admem-mit": ".",
-    "samba-xc": ".",
-    "samba-o3": ".",
-    "samba-ctdb": ".",
-    "samba-libs": ".",
-    "samba-static": ".",
-    "samba-none-env": ".",
-    "samba-ad-dc-1": ".",
-    "samba-ad-dc-1-mitkrb5": ".",
-    "samba-ad-dc-2": ".",
-    "samba-ad-dc-3": ".",
-    "samba-ad-dc-4": ".",
-    "samba-ad-dc-4-mitkrb5": ".",
-    "samba-ad-dc-5": ".",
-    "samba-ad-dc-6": ".",
-    "samba-ad-dc-ntvfs": ".",
-    "samba-ad-dc-backup": ".",
-    "samba-nopython": ".",
-    "samba-nopython-py2": ".",
-    "samba-schemaupgrade": ".",
     "ldb": "lib/ldb",
     "tdb": "lib/tdb",
     "talloc": "lib/talloc",
@@ -154,11 +129,6 @@ builddirs = {
     "pidl": "pidl"
 }
 
-defaulttasks = list(builddirs.keys())
-
-if os.environ.get("AUTOBUILD_SKIP_SAMBA_O3", "0") == "1":
-    defaulttasks.remove("samba-o3")
-
 ctdb_configure_params = " --enable-developer ${PREFIX}"
 samba_configure_params = " ${ENABLE_COVERAGE} ${PREFIX} --with-profiling-data"
 
@@ -206,6 +176,9 @@ def make_test(
     return ' '.join([cmd] + _options)
 
 
+# When updating this list, also update .gitlab-ci.yml to add the job
+# and to make it a dependency of 'page' for the coverage report.
+
 tasks = {
     "ctdb": [
         ("random-sleep", random_sleep(300, 900)),
@@ -261,6 +234,7 @@ tasks = {
             "ad_dc_slowtests",
             "schema_pair_dc",
             "schema_dc",
+            "clusteredmember",
             ])),
         ("lcov", LCOV_CMD),
         ("install", "make install"),
@@ -312,6 +286,7 @@ tasks = {
             "ad_dc_slowtests",
             "schema_pair_dc",
             "schema_dc",
+            "clusteredmember",
             ])),
         ("lcov", LCOV_CMD),
         ("install", "make install"),
@@ -321,12 +296,13 @@ tasks = {
 
     "samba-nt4": [
         ("random-sleep", random_sleep(300, 900)),
-        ("configure", "./configure.developer --without-ads --with-selftest-prefix=./bin/ab" + samba_configure_params),
+        ("configure", "./configure.developer --without-ad-dc --without-ldap --without-ads --without-json --with-selftest-prefix=./bin/ab" + samba_configure_params),
         ("make", "make -j"),
         ("test", make_test(include_envs=[
             "nt4_dc",
             "nt4_dc_schannel",
             "nt4_member",
+            "simpleserver",
             ])),
         ("lcov", LCOV_CMD),
         ("install", "make install"),
@@ -334,24 +310,15 @@ tasks = {
         ("clean", "make clean"),
         ],
 
-    "samba-simpleserver": [
-        ("random-sleep", random_sleep(300, 900)),
-        ("configure", "./configure.developer --without-ad-dc --without-ldap --without-ads --without-json --with-selftest-prefix=./bin/ab" + samba_configure_params),
-        ("make", "make -j"),
-        ("test", make_test(include_envs=[
-            "simpleserver",
-            ])),
-        ("lcov", LCOV_CMD),
-        ("check-clean-tree", "script/clean-source-tree.sh"),
-        ],
-
     "samba-fileserver": [
         ("random-sleep", random_sleep(300, 900)),
-        ("configure", "./configure.developer --without-ad-dc --with-selftest-prefix=./bin/ab" + samba_configure_params),
+        ("configure", "./configure.developer --without-ad-dc --with-system-heimdalkrb5 --with-selftest-prefix=./bin/ab" + samba_configure_params),
         ("make", "make -j"),
         ("test", make_test(include_envs=[
             "fileserver",
             "maptoguest",
+            "ktest", # ktest is also tested in samba and samba-mitkrb5
+                     # but is tested here against a system Heimdal
             ])),
         ("lcov", LCOV_CMD),
         ("check-clean-tree", "script/clean-source-tree.sh"),
@@ -558,7 +525,8 @@ tasks = {
         ("random-sleep", random_sleep(300, 900)),
         ("configure", "ADDITIONAL_CFLAGS='-O3 -Wp,-D_FORTIFY_SOURCE=2' ./configure.developer --with-selftest-prefix=./bin/ab --abi-check-disable" + samba_configure_params),
         ("make", "make -j"),
-        ("test", make_test(cmd='make quicktest', include_envs=["ad_dc"])),
+        ("test", make_test(cmd='make test', include_envs=["none"])),
+        ("quicktest", make_test(cmd='make quicktest', include_envs=["ad_dc"])),
         ("lcov", LCOV_CMD),
         ("install", "make install"),
         ("check-clean-tree", "script/clean-source-tree.sh"),
@@ -574,12 +542,24 @@ tasks = {
         ("tdb-install", "cd lib/tdb && make install"),
 
         # build samba with cluster support (also building ctdb):
-        ("samba-configure", "PYTHONPATH=${PYTHON_PREFIX}:$PYTHONPATH PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH} ./configure.developer ${PREFIX} --with-selftest-prefix=./bin/ab --with-cluster-support --bundled-libraries=!tdb"),
+        ("samba-configure",
+         "PYTHONPATH=${PYTHON_PREFIX}:$PYTHONPATH "
+         "PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH} "
+         "./configure.developer ${PREFIX} "
+         "--with-selftest-prefix=./bin/ab "
+         "--with-cluster-support "
+         "--without-ad-dc "
+         "--bundled-libraries=!tdb"),
         ("samba-make", "make"),
         ("samba-check", "./bin/smbd -b | grep CLUSTER_SUPPORT"),
         ("samba-install", "make install"),
         ("ctdb-check", "test -e ${PREFIX_DIR}/sbin/ctdbd"),
 
+        ("test",
+         make_test(cmd='make test',
+                   include_envs=["clusteredmember"])
+        ),
+
         # clean up:
         ("check-clean-tree", "script/clean-source-tree.sh"),
         ("clean", "make clean"),
@@ -616,14 +596,6 @@ tasks = {
         ("allshared-make", "make -j"),
         ],
 
-    "samba-none-env": [
-        ("random-sleep", random_sleep(1, 1)),
-        ("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params),
-        ("make", "make -j"),
-        ("test", make_test(include_envs=["none"])),
-        ("lcov", LCOV_CMD),
-        ],
-
     "samba-static": [
         ("random-sleep", random_sleep(1, 1)),
         # build with all modules static
@@ -639,8 +611,15 @@ tasks = {
 
         # retry with nonshared smbd and smbtorture
         ("nonshared-distclean", "make distclean"),
-        ("nonshared-configure", "./configure.developer " + samba_configure_params + " --bundled-libraries=talloc,tdb,pytdb,ldb,pyldb,tevent,pytevent --with-static-modules=ALL --nonshared-binary=smbtorture,smbd/smbd"),
-        ("nonshared-make", "make -j"),
+        ("nonshared-configure", "./configure.developer " + samba_configure_params + " --bundled-libraries=ALL --with-static-modules=ALL --nonshared-binary=smbtorture,smbd/smbd"),
+        ("nonshared-make", "make -j")
+        ],
+
+    "samba-fuzz": [
+        # build the fuzzers (static) via the oss-fuzz script
+        ("fuzzers-mkdir-prefix", "mkdir -p ${PREFIX_DIR}"),
+        ("fuzzers-build", "OUT=${PREFIX_DIR} LIB_FUZZING_ENGINE= SANITIZER=address CXX= CFLAGS= ./lib/fuzzing/oss-fuzz/build_samba.sh --enable-afl"),
+        ("fuzzers-check", "./lib/fuzzing/oss-fuzz/check_build.sh ${PREFIX_DIR}")
         ],
 
     # Test Samba without python still builds.  When this test fails
@@ -803,6 +782,15 @@ tasks = {
     'fail': [("fail", 'echo failing && /bin/false')],
 }
 
+defaulttasks = list(tasks.keys())
+
+defaulttasks.remove("pass")
+defaulttasks.remove("fail")
+defaulttasks.remove("samba-test-only")
+defaulttasks.remove("samba-fuzz")
+if os.environ.get("AUTOBUILD_SKIP_SAMBA_O3", "0") == "1":
+    defaulttasks.remove("samba-o3")
+
 
 def do_print(msg):
     print("%s" % msg)