test: MessengerDriver implements its part of the alert system.

And TestDriver has a very simple run_tests sample.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
test: change calling conventions in msgr TestDriver

Expecting tests to be based on subclasses is wrong. Instead, just
expose the management functions to the public. Then we can start
making it more capable of handling grunt work on its own.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
StateTracker: extract State from StateTrackerImpl.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
test: TestMsgr::connect_messengers takes two MDrivers

Nobody's going to be setting up connections to an endpoint they
don't control, right?

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
test: add lookup_state functions to TestDriver

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
test: add a unittest_msgr with the sample test.

Move the sample test to a new msgr_tests_functions header.
test: add more reporting states to MessengerDriver.

Unfortunately there's not yet a good way to trigger these; it'll
require introducing faults to the system.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
test: add TestDriver::clean_up() to stop all the attached MDrivers.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
test: extract the single-message send test from sample_test.

Make sample_test refer to it.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
test: msgr new generate_message function

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
test: convert StateAlerts to be allocated by TestDriver.

Give them a reference to their lock as well, and let users either
specify a lock and Cond, or generate the data members. This
will make life easier on simple tests (which don't need to handle so
many objects), and on complicated tests (which will want to watch
for multiple alerts at once).

Convert current users.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
test: enable Ceph debugging in test_msgrawesome.

Yay, messenger debugging output!

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
test: add a test for mark_down behavior.

And add a wait_until_complete function instead of writing loops
continously.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
msgr: annotate the socket syscalls in SimpleMessenger.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
msgr: add a really boring failure injection macro.

Right now it only works for the Pipe, but it's enough to let us inject
a wide class of failures once we have more intelligence in other areas.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
test msgr: implement primitive use of socket failures and a test.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
StateMaker: rename StateTracker -> StateMaker

This better describes what it does.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
StateTracker: write an actual state tracking system interface

Define a separate ModularStateMaker that will hold a bundle of
StateMakers, and then define an abstract StateTracker interface.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
test: MessengerDriver implements the StateTracker interface.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
test: define a FailureInjector interface

Put stubs in the MessengerDriver.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>