cmdparser: add new command bootstrap

Because beaker uses the 'push' method for running tests, there has always
been a catch-22 on how to start autotest after provisioning the box.

Currently, beaker uses a daemon called 'beah' to do all the initial
bootstrapping.  In order to move away from beah we needed another
alternate approach.

Bill P. suggested to use an env variable.  So that is what I did.
When autotest runs from the /etc/init.d on bootup it will look for
'AUTOTEST_HARNESS'.  If that is set, call 'autotest bootstrap'.  The
env will tell autotest to use the harness beaker, download an initial
control and pass that to the 'run' command.  autotest will proceed as normal.

This is kind of an ugly hack but I could not think of another solution to deal
with bootstrapping after provisioning.

v2:  look for harness args in the environment, empty control files silently
     exit autotest (to handle reservesys case)

Signed-off-by: Don Zickus <dzickus@redhat.com>
harness: support for beaker's xml

Beaker passes its recipes through xml files.  This patch just converts the xml
recipe into a python dictionary.  Only used by beaker's get_recipe command.
Pretty straightforward.

Beaker folks should review this.  Not very interesting to autotest folks other
than style and syntax.

Signed-off-by: Don Zickus <dzickus@redhat.com>
harness: support beaker proxy protocol

This patch contains the pieces to communicate with Beaker's new stable API.

It is a thin layer that takes commands from the harness and translates them into
the appropriate http GET, POST or PUT command.

One thing I did to make debugging easier is to allow the ability to write to
files locally (offline mode).  The harness doesn't care where the data is sent,
so writing locally allow me to quickly test and address problems without complicating
it with broken http requests.

I also implemented chunk uploading to minimize memory usage.

I spent most of my time testing the log uploading and task result reporting
aspect of the API.  Everything seems to work great.  I expect the 'status'
and 'watchdog' parts to just work.

Mostly of interest to the beaker folks.  Autotest folks can review for style,
syntax and entertainment.

v2: python lint fixes

Signed-off-by: Don Zickus <dzickus@redhat.com>
harness: new beaker harness

This is the bulk of the harness file for enabling beaker.

The idea is to bootstrap it by downloading the remote xml file, parse it,
convert it into a control file and pass that to autotest.

The rest of the harness has various hacks to deal with passing info
from autotest to beaker.

Two of the biggest pieces are converting the xml recipe into a control
file.  This will still need tweaking.

The other piece is trying to figure out when recipe/tasks/sub-tasks
start and stop.  Again probably needs tweaking.

Overall, this patch has been tested with some stub recipes and responds
well.  Work still needs to be done on figuring out which files to
upload and real workflow testing.

This patch will need to be reviewed by autotest and beaker folks.

v2: rewrote file uploading to handle reboot case (save state), python
    lint fixes, handle reservesys case, param fixes
v3: Some renaming, small fixes, and squashing the beaker hook for quick
    commands into it.

Signed-off-by: Don Zickus <dzickus@redhat.com>