Refactor all of the persistent state managing code in the client job
class into the common_lib base job class. The major change is that all
the details of the job state implementation are pulled into a class
base_job.job_state. This class handles all the internal details of the
state managment that job.get_state and job.set_state did, and also
provides a mechanism for creating job properties which are automatically
backed by job state.

This also includes a major change to the semantics of state passed
between autoserv and any Autotest clients it ran. Previously the code
was a bit of a hack, with code in server/autotest.py that would
pre-generate a state file with some pre-set values, and code that would
pull back the state file after the client job and extract some values
from it, as well as some more code that would prepend a bunch of
state initialization calls at the start of the client control file.
Instead of all these hacks, autotest.py now just pushes all of the
state out to the client at the start, and pulls it all back at the end
(with a special exception for __steps that's difficult to eliminate at
this time). So any state set on the server is automatically available
on the client, and any state set on the client is automatically
available on the server.

There are a couple of outstanding issues:
  * More of the set_state/get_state code needs to be refactored
    to either use the automatic properties, or the job-internal state
    API (so that all the internal state is not leaked into the "public"
    state visible through get_state and set_state).
  * The job_state class is perhaps somewhat overengineered. It's really
    just a big, automatically persistect dict-of-dicts. But most of it
    is actually code that was being used before, it was just scattered
    all over server/autotest.py and client/bin/job.py so it was less
    obvious how overgrownt he state managment is.

Risk: High
Visibility: Replaces a bunch of get_*+set_*+default_* methods with
            persistent properties, refactors all of the state managment
    into a single implementation consistently used in both the
    server and client.

Signed-off-by: John Admanski <jadmanski@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4022 592f7852-d20e-0410-864c-8624ca9c26a4
9 files changed