autotest (dhcp): improve debuggability

This CL makes two changes to make it easier to debug DHCP
test failures:

1. When a test fails, report a) the class of the current
   DhcpHandlingRule, and b) the most recent warning from that
   rule (if any).

2. If the DhcpTestServer encounters an exception inside
   the _loop_body, a) stash the exception, b) end the test,
   and c) re-raise it when the main thread calls the
   wait_for_test_to_finish method.

   This is useful, e.g., when you write a new DhcpHandlingRule.
   Previously, when a rule raised an exception, the test
   would hang indefinitely. That's because the main thread would
   wait for the server thread to finish, but the server thread
   wouldn't finish cleanly, since it encountered an exception.

While there: demote an IPConfig-related log message from
error to info. The condition it reports does not seem to be
an error.

BUG=None
TEST=manual

Manual test: wrote a new DhcpHandlingRule that raised an
exception. Verified that the test ended in a reasonable time,
and that it reported the exception from the DhcpHandlingRule.

Change-Id: I31486e04bb77254896bab2ecc2cc2c50dbe7fa87
Reviewed-on: https://chromium-review.googlesource.com/194943
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
3 files changed