virt: Make virsh absence non fatal for other tests

This is a solution for issue #563.

If one is only testing kvm components, for example,
the absence of virsh should not be relevant, but
since the module throws an exception on import, and
module is imported on env_processing, a ValueError
will be thrown and fail completely all the tests.

Let's fail things only when actual functionality of
the module is called, during the initialization of
the BaseVirsh class.

CC: Chris Evich <cevich@redhat.com>
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
utils.compile_gwt_clients: Use system wide GWT dir if available

This is a drop in, more generic replacement of one of the
RPM specific patches.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
scheduler.drone_manager: Write to base results dir if available

This patch is a solution for bug #502 - drone_utility does not respect
results directory. Drone manager will always use the base autotest
install directory to write results to, making it write in an out of
bounds area for the scheduler:

OSError: [Errno 13] Permission denied:
'/usr/lib/python2.7/site-packages/autotest/results'

I first thought only choosing a different

drone_installation_directory: /usr/lib/python2.7/site-packages/autotest

In /etc/autotest/global_config.ini would help, but I just realized
AUTOTEST_INSTALL_DIR is used for other purposes, such as locating
autoserv, so this change would only cause the code to break further
in the execution path. So if we have a common dir to write results
to in global_config.ini, let's use it instead of
drones.AUTOTEST_INSTALL_DIR.

Changes from v1:

 * Drop redundant 'results' suffix I was adding manually.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
scheduler.monitor_db: Find autotest-remote path accordingly

This is a followup for #502 fix. It turns out that the autotest
scheduler won't be able to find autotest-remote on a system wide
install, therefore, it won't be possible to actually install the
autotest client on test clients. Let's fix it by figuring out
whether we have an autotest-remote installed system wide, if not,
fall back to the usual /autotest/path/server/autoserv.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
scheduler.monitor_db_watcher: Figure out results dir and scheduler path

This is another packaging related fix, we can figure out
autotest-scheduler path with os_dep in case of system wide
install, if not there fall back to the original way of
determining both scheduler and results directory.

It needs some testing to see if it doesn't break stuff I
didn't anticipate.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
scheduler/tko: Add autotest-tko-parse v2

On a system wide install, in order to successfuly parse
autotest server results, the parse utility must be available.

So let's create the new system wide installable autotest-tko-parse,
and adapt the scheduler to call it correctly.

Changes from v1:
 * parse.main() must be called rather than just main()

CC: Cleber Rosa <crosa@redhat.com>
CC: Martin Krizek <mkrizek@redhat.com>
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Add new system wide installable entry points

So autotest-local can effectively run under autotest-remote.
Handle client push in a way that it can also install the
entry points in system wide locations, and code can also
figure out those system wide locations are present.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt: give every virt test a 4 hour timeout

This should protect against situations were test code gets stuck,
using autotest's native timeout mechanism.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
contrib.virt: Fail virt job if host kernel failed to install

In python 2.4, a SystemExit exception will be thrown and
cause the test to always fail. Therefore, it's better to
just fail the virt job if host kernel failed to install.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
utils.unittest_suite: Print tests executed and status

Using a little locking it is possible to decently print
names of the unittests executed and their statuses,
making an execution log clear and easy to understand.

So implement this feature in the unittest runner, while
keeping the original runner interface.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
utils.check_patch: Skip unittest on full tree check

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
utils.check_patch: Handle reindent process failures

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt: Fixes found by automated check script

1) Give exec permissions to clipboard script.
2) Indentation fix on utils_v2v module.
3) logging argument fixes in tests.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt.utils_test: Fix run_virt_sub_test

With the refactoring, we forgot to update its functionality.
Now, find tests in the appropriate test directories.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
client: Removing client tests, as they got their own repo

Now client tests will be kept on a separate test repository,
called autotest-client-tests. Thus, we're removing this dir,
and we'll add the mentioned new repo as a submodule of this
tree.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Adding autotest-client-tests as a submodule

Now the repos can be used together, but managed separately.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
server: Removing tests directory, as it's got its own repository

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Adding autotest-server-tests as a submodule

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Updating tests submodule

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
contrib: Fixing virt site CLI extension