[Buildbot-devel] Testing a client-server system
Brad Hards
bradh at frogmouth.net
Sun Mar 8 11:38:21 UTC 2009
Hi,
I've set up a buildbot for the OpenChange project
(http://buildbot.openchange.org).
The basic build and test is all fine. I'm now trying to get a more complex
test going now, involving client and server tests.
I need to configure the server (working).
I need to start the server (basically working). The server could go into the
background, but I really need to detect when the server is functional (I'm
hoping to use a LogLineObserver subclass for this).
When the server is up and running, I need to start a few client processes and
check the output. I then need to shut down the server. I was hoping to start
another builder using a Triggerable scheduler, with a "killall" ShellCommand
as the last buildstep to shut the server back down.
The LogLineObserver is basically working (I see the log.msg for "trying to
trigger clienttest"), but the Trigger doesn't appear to cause the clientest
scheduler to do anything.
Here is some key parts of the master.cfg setup:
clienttest = Triggerable(name="clienttest",
builderNames=["clienttest-centos52"])
c['schedulers'] = [quick, full, clienttest]
from buildbot.steps.trigger import Trigger
clienttest = factory.BuildFactory()
clienttest.addStep(ShellCommand(command=["/home/buildslave2/openchangeinstall/bin/mapiprofile", "--help"]))
clienttest.addStep(ShellCommand(command=["sudo", "/usr/bin/killall", "samba"]))
b7 = {'name': "clienttest-centos52",
'slavename': "buildslave2",
'builddir': "clienttest",
'factory': clienttest,
}
from buildbot.process.buildstep import LogLineObserver
class ServerReadyDetector(LogLineObserver):
def outLineReceived(self, line):
if line.startswith("Registered OPENCHANGE"):
# trigger client side
log.msg("trying to trigger clienttest")
Trigger("clienttest")
class OCServerRun(ShellCommand):
command=["sudo", "/usr/local/samba/sbin/samba", "--debuglevel=5", "--interactive", "--model=single", "--option=dcerpc
endpoint servers=epmapper,
mapiproxy", "--option=dcerpc_mapiproxy:server=true", "--option=dcerpc_mapiproxy:interfaces=exchange_emsmdb,
exchange_nsp,
exchange_ds_rfr", "--configfile=/home/buildslave2/octestconfig/etc/smb.conf"]
description=["OC Server"]
descriptionDone=["OC Server"]
def __init__(self, **kwargs):
ShellCommand.__init__(self, **kwargs) # always upcall!
readydetector = ServerReadyDetector()
self.addLogObserver('stdio', readydetector)
Any suggestions for either fixing this approach, or for an alternative
approach?
Brad
More information about the devel
mailing list