"make install",
"TDB_NO_FSYNC=1 make test FAIL_IMMEDIATELY=1" ],
- "source4" : [ "./autogen.sh",
- "./configure.developer ${PREFIX}",
+ "source4" : [ "./configure.developer ${PREFIX}",
"make -j",
"make install",
"TDB_NO_FSYNC=1 make test FAIL_IMMEDIATELY=1" ],
- "source4/lib/ldb" : [ "./autogen-waf.sh",
- "./configure --enable-developer -C ${PREFIX}",
+ "source4/lib/ldb" : [ "./configure --enable-developer -C ${PREFIX}",
"make -j",
"make install",
"make test" ],
"make install",
"make test" ],
- "lib/tevent" : [ "./autogen-waf.sh",
- "./configure --enable-developer -C ${PREFIX}",
+ "lib/tevent" : [ "./configure --enable-developer -C ${PREFIX}",
"make -j",
"make install",
"make test" ],
def start_tail(self):
cwd = os.getcwd()
cmd = "tail -f *.stdout *.stderr"
- os.chdir(testbase)
+ os.chdir(gitroot)
self.tail_proc = Popen(cmd, shell=True)
os.chdir(cwd)
def find_git_root():
'''get to the top of the git repo'''
- cwd=os.getcwd()
- while os.getcwd() != '/':
+ p=os.getcwd()
+ while p != '/':
+ if os.path.isdir(os.path.join(p, ".git")):
+ return p
+ p = os.path.abspath(os.path.join(p, '..'))
+ return None
+
+
+def daemonize(logfile):
+ pid = os.fork()
+ if pid == 0: # Parent
+ os.setsid()
+ pid = os.fork()
+ if pid != 0: # Actual daemon
+ os._exit(0)
+ else: # Grandparent
+ os._exit(0)
+
+ import resource # Resource usage information.
+ maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
+ if maxfd == resource.RLIM_INFINITY:
+ maxfd = 1024 # Rough guess at maximum number of open file descriptors.
+ for fd in range(0, maxfd):
try:
- os.stat(".git")
- ret = os.getcwd()
- os.chdir(cwd)
- return ret
- except:
- os.chdir("..")
+ os.close(fd)
+ except OSError:
pass
- os.chdir(cwd)
- return None
+ os.open(logfile, os.O_RDWR | os.O_CREAT)
+ os.dup2(0, 1)
+ os.dup2(0, 2)
+
def rebase_tree(url):
print("Rebasing on %s" % url)
default=False, action="store_true")
parser.add_option("", "--email", help="send email to the given address on failure",
type='str', default=None)
+parser.add_option("", "--daemon", help="daemonize after initial setup",
+ action="store_true")
def email_failure(status, failed_task, failed_tag, errstr):
raise Exception("Unable to create %s : %s" % (testbase, reason))
cleanup_list.append(testbase)
+if options.daemon:
+ logfile = os.path.join(testbase, "log")
+ print "Forking into the background, writing progress to %s" % logfile
+ daemonize(logfile)
+
while True:
try:
run_cmd("rm -rf %s" % test_master)