Lifeguard is a library that provides the ability to query the state of mobile devices, generally via SUTAgent, and to attempt to recover devices that experience problems, such as bad SD cards. It will be an important part of Mozpool. Ideally it will function in a standalone environment as well, though it will probably still require a local MozPool.
- As with MozPool, ideally it will work on all major platforms, though Linux will be targetted initially. Lifeguard will target Python 2.7 but may work with earlier versions.
TBD, but AutoPhone provides some of this already, so probably is a good place to start. There's also a bunch of code in sut_tools that's currently used to verify device state; we could potentially re-use some of this.
- Once a device is registered with Lifeguard, it should track its state (via MozPool), and should periodically ping the device to verify that it's still alive.
- If the ping fails, Lifeguard should attempt to recover the device by resetting its power up to N times.
- If resetting the device fails, Lifeguard should mark the device (in MozPool) as offline.
- Lifeguard should provide an API with which remote components can interact with it (via TCP sockets or HTTP), and should include the following:
- an API to flash a given B2G build on a device (do we need to be able to flash fennec boards as well?).
- an API to reboot a device, given its identifier.
- an API to reset the power on a device, given its identifier.
- Lifeguard should have unit tests, that we can run before committing changes.
- Lifeguard should maintain a detailed log including, among other things, errors and all API requests.
- Lifeguard should be well-documented.
- How should Lifeguard verify a device is online? Is a simple ping enough?
- How does Lifeguard fit in with BlackMobileMagic?