import tarfile
import sys
import time
+import random
from optparse import OptionParser
import smtplib
import email
else:
LCOV_CMD = 'echo "lcov skipped since no --enable-coverage specified"'
+if args:
+ # If we are only running specific test,
+ # do not sleep randomly to wait for it to start
+ def random_sleep(low, high):
+ return 'sleep 1'
+else:
+ def random_sleep(low, high):
+ return 'sleep {}'.format(random.randint(low, high))
+
cleanup_list = []
builddirs = {
tasks = {
"ctdb": [
- ("random-sleep", "../script/random-sleep.sh 300 900"),
+ ("random-sleep", random_sleep(300, 900)),
("configure", "./configure " + ctdb_configure_params),
("make", "make all"),
("install", "make install"),
# We have 'test' before 'install' because, 'test' should work without 'install (runs all the other envs)'
"samba": [
- ("random-sleep", "script/random-sleep.sh 300 900"),
+ ("random-sleep", random_sleep(300, 900)),
("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params),
("make", "make -j"),
("test", "make test FAIL_IMMEDIATELY=1 "
],
"samba-nt4": [
- ("random-sleep", "script/random-sleep.sh 300 900"),
+ ("random-sleep", random_sleep(300, 900)),
("configure", "./configure.developer --without-ads --with-selftest-prefix=./bin/ab" + samba_configure_params),
("make", "make -j"),
("test", "make test FAIL_IMMEDIATELY=1 "
],
"samba-fileserver": [
- ("random-sleep", "script/random-sleep.sh 300 900"),
+ ("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 FAIL_IMMEDIATELY=1 "
],
"samba-ad-member": [
- ("random-sleep", "script/random-sleep.sh 300 900"),
+ ("random-sleep", random_sleep(300, 900)),
("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params),
("make", "make -j"),
("test", "make test FAIL_IMMEDIATELY=1 "
],
"samba-ad-dc-1": [
- ("random-sleep", "script/random-sleep.sh 1 1"),
+ ("random-sleep", random_sleep(1, 1)),
("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params),
("make", "make -j"),
("test", "make test FAIL_IMMEDIATELY=1 "
],
"samba-ad-dc-2": [
- ("random-sleep", "script/random-sleep.sh 1 1"),
+ ("random-sleep", random_sleep(1, 1)),
("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params),
("make", "make -j"),
("test", "make test FAIL_IMMEDIATELY=1 "
],
"samba-ad-dc-3": [
- ("random-sleep", "script/random-sleep.sh 1 1"),
+ ("random-sleep", random_sleep(1, 1)),
("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params),
("make", "make -j"),
("test", "make test FAIL_IMMEDIATELY=1 "
],
"samba-ad-dc-4": [
- ("random-sleep", "script/random-sleep.sh 1 1"),
+ ("random-sleep", random_sleep(1, 1)),
("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params),
("make", "make -j"),
("test", "make test FAIL_IMMEDIATELY=1 "
],
"samba-ad-dc-5": [
- ("random-sleep", "script/random-sleep.sh 1 1"),
+ ("random-sleep", random_sleep(1, 1)),
("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params),
("make", "make -j"),
("test", "make test FAIL_IMMEDIATELY=1 "
],
"samba-ad-dc-6": [
- ("random-sleep", "script/random-sleep.sh 1 1"),
+ ("random-sleep", random_sleep(1, 1)),
("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params),
("make", "make -j"),
("test", "make test FAIL_IMMEDIATELY=1 "
],
"samba-schemaupgrade": [
- ("random-sleep", "script/random-sleep.sh 1 1"),
+ ("random-sleep", random_sleep(1, 1)),
("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params),
("make", "make -j"),
("test", "make test FAIL_IMMEDIATELY=1 "
# We split out the ad_dc_ntvfs tests (which are long) so other test do not wait
# This is currently the longest task, so we don't randomly delay it.
"samba-ad-dc-ntvfs": [
- ("random-sleep", "script/random-sleep.sh 1 1"),
+ ("random-sleep", random_sleep(1, 1)),
("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params),
("make", "make -j"),
("test", "make test FAIL_IMMEDIATELY=1 "
# run the backup/restore testenvs separately as they're fairly standalone
# (and CI seems to max out at ~8 different DCs running at once)
"samba-ad-dc-backup": [
- ("random-sleep", "script/random-sleep.sh 300 900"),
+ ("random-sleep", random_sleep(300, 900)),
("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params),
("make", "make -j"),
("test", "make test FAIL_IMMEDIATELY=1 "
# Test cross-compile infrastructure
"samba-xc": [
- ("random-sleep", "script/random-sleep.sh 900 1500"),
+ ("random-sleep", random_sleep(900, 1500)),
("configure-native", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params),
("configure-cross-execute", "./configure.developer --out ./bin-xe --cross-compile --cross-execute=script/identity_cc.sh" \
" --cross-answers=./bin-xe/cross-answers.txt --with-selftest-prefix=./bin-xe/ab" + samba_configure_params),
# test build with -O3 -- catches extra warnings and bugs, tests the ad_dc environments
"samba-o3": [
- ("random-sleep", "script/random-sleep.sh 300 900"),
+ ("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 quicktest FAIL_IMMEDIATELY=1 "
],
"samba-ctdb": [
- ("random-sleep", "script/random-sleep.sh 900 1500"),
+ ("random-sleep", random_sleep(900, 1500)),
# make sure we have tdb around:
("tdb-configure", "cd lib/tdb && PYTHONPATH=${PYTHON_PREFIX}:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}"),
],
"samba-libs": [
- ("random-sleep", "script/random-sleep.sh 300 900"),
+ ("random-sleep", random_sleep(300, 900)),
("talloc-configure", "cd lib/talloc && " + samba_libs_configure_libs),
("talloc-make", "cd lib/talloc && make"),
("talloc-install", "cd lib/talloc && make install"),
],
"samba-none-env": [
- ("random-sleep", "script/random-sleep.sh 1 1"),
+ ("random-sleep", random_sleep(1, 1)),
("configure", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params),
("make", "make -j"),
("test", "make test "
],
"samba-static": [
- ("random-sleep", "script/random-sleep.sh 1 1"),
+ ("random-sleep", random_sleep(1, 1)),
# build with all modules static
("allstatic-configure", "./configure.developer " + samba_configure_params + " --with-static-modules=ALL"),
("allstatic-make", "make -j"),
],
"samba-systemkrb5": [
- ("random-sleep", "script/random-sleep.sh 900 1500"),
+ ("random-sleep", random_sleep(900, 1500)),
("configure", "./configure.developer " + samba_configure_params + " --with-system-mitkrb5 --with-experimental-mit-ad-dc"),
("make", "make -j"),
# we currently cannot run a full make test, a limited list of tests could be run
# support this environment). The target here is for vendors
# shipping a minimal smbd.
"samba-nopython": [
- ("random-sleep", "script/random-sleep.sh 300 900"),
+ ("random-sleep", random_sleep(300, 900)),
("configure", "./configure.developer ${ENABLE_COVERAGE} --picky-developer ${PREFIX} --with-profiling-data --disable-python --without-ad-dc"),
("make", "make -j"),
("install", "make install"),
# check we can do the same thing using python2
"samba-nopython-py2": [
- ("random-sleep", "script/random-sleep.sh 300 900"),
+ ("random-sleep", random_sleep(300, 900)),
("configure", "PYTHON=python2 ./configure.developer ${ENABLE_COVERAGE} --picky-developer ${PREFIX} --with-profiling-data --disable-python --without-ad-dc"),
("make", "PYTHON=python2 make -j"),
("install", "PYTHON=python2 make install"),
],
"ldb": [
- ("random-sleep", "../../script/random-sleep.sh 60 600"),
+ ("random-sleep", random_sleep(60, 600)),
("configure", "./configure ${ENABLE_COVERAGE} --enable-developer -C ${PREFIX}"),
("make", "make"),
("install", "make install"),
],
"tdb": [
- ("random-sleep", "../../script/random-sleep.sh 60 600"),
+ ("random-sleep", random_sleep(60, 600)),
("configure", "./configure ${ENABLE_COVERAGE} --enable-developer -C ${PREFIX}"),
("make", "make"),
("install", "make install"),
],
"talloc": [
- ("random-sleep", "../../script/random-sleep.sh 60 600"),
+ ("random-sleep", random_sleep(60, 600)),
("configure", "./configure ${ENABLE_COVERAGE} --enable-developer -C ${PREFIX}"),
("make", "make"),
("install", "make install"),
],
"replace": [
- ("random-sleep", "../../script/random-sleep.sh 60 600"),
+ ("random-sleep", random_sleep(60, 600)),
("configure", "./configure ${ENABLE_COVERAGE} --enable-developer -C ${PREFIX}"),
("make", "make"),
("install", "make install"),
],
"tevent": [
- ("random-sleep", "../../script/random-sleep.sh 60 600"),
+ ("random-sleep", random_sleep(60, 600)),
("configure", "./configure ${ENABLE_COVERAGE} --enable-developer -C ${PREFIX}"),
("make", "make"),
("install", "make install"),
],
"pidl": [
- ("random-sleep", "../script/random-sleep.sh 60 600"),
+ ("random-sleep", random_sleep(60, 600)),
("configure", "perl Makefile.PL PREFIX=${PREFIX_DIR}"),
("touch", "touch *.yp"),
("make", "make"),
tasknames = ["samba-test-only"]
else:
tasknames = defaulttasks
- else:
- # If we are only running one test,
- # do not sleep randomly to wait for it to start
- os.environ['AUTOBUILD_RANDOM_SLEEP_OVERRIDE'] = '1'
for n in tasknames:
b = builder(n, tasks[n], cp=n is not "pidl")