[Buildbot-devel] How to add a reboot step?

Brian Warner warner-buildbot at lothar.com
Tue Apr 18 07:55:11 UTC 2006


> To push the testing farther than just recompiling the source for different
> architecture/subprojects etc, we would like to test the resulting kernel. I
> think I will not have a lot of problems when we cross-compile for a
> separate target board which we can reboot by shutting the power off and on
> again by using a network controlled power switch.
> 
> I have however targets which compile the kernel for themselves, install it
> and then reboot.

I would be inclined to have the buildslaves live on machines that stay
powered up all the time, and have processes there be responsible for remotely
rebooting the target boards and initiating tests on them with the new kernel.
Having buildslaves which come and go as part of the test process strikes me
as too hard to make work in a sensible way (i.e. it is too different from the
current design to be an easy addition).

Have your source tree include some targets like:

 'make compile': create a kernel image

 'make set-target1-bootenv': copy the compiled kernel image / runtime image
                             into a TFTP/DHCP/NFS/whatever server's directory
                             so that when target board #1 boots, it will load
                             the compiled kernel, then run the unit tests.

 'make reboot-target1': reboot target board #1 with the power switch

 'make wait-for-target1-tests': ask the target board (via ssh or HTTP or
                                something) for its test results, looping
                                until they become available, then dumping the
                                results to stdout

The buildslave (which in this case is running on some sort of
target-board-controlling host that does not run any of the target code, but
just serves to control the boards) then just has a process that invokes all
of these steps in sequence.

I used to do a lot of embedded work.. this is the approach I would have used
back in that environment. You lose the immediacy and clarity of having your
buildprocess invoke shell commands on the DUT (Device Under Test) directly,
but really you shouldn't have that much intelligence in your buildbot config
anyway, it should all be in your Makefiles.

cheers,
 -Brian




More information about the devel mailing list