run: When setup is taking too long, print a message to the user

If JeOS has to be downloaded and uncompressed, the user
will execute the test runner and see no output for a long
time (in my system, ~200 seconds). So, if we have to wait
for setup for complete more than 3 seconds, print a message
to the user that setup is being executed.

In order to do this, moved the bootstrap stage to a thread,
where we can check whether more than 3 seconds have elapsed
since it started. In order to keep the run script clean,
the bootstrap functions were moved to standalone_test,
and the functions were properly documented.

Before:

[lmr@freedom virt-test.git]$ ./run -t kvm --tests "fail_test warning_test skip_test" --restore-image
SETUP: PASS (21.44 s)
DATA DIR: /home/lmr/virt_test

After:

[lmr@freedom virt-test.git]$ ./run -t kvm --tests "fail_test warning_test skip_test" --restore-image
Running setup. Please wait...
SETUP: PASS (21.44 s)
DATA DIR: /home/lmr/virt_test

If the setup stage is under 3 seconds, no change in the output:

[lmr@freedom virt-test.git]$ ./run -t kvm
SETUP: PASS (0.90 s)
DATA DIR: /home/lmr/virt_test

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
utils_misc: Fix hard coded /var/tmp image location

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
kvm.ksm_overcommit: Change the path of the scripts

Currently, the scripts dir has change from virt/scripts to virt/shared/
scripts. This make the test fail. Change it to correct dir.

Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
utils_misc: Fix exception handling when restoring env file

If we had an exception loading the environment, we
won't have an exception in the trace stack, so an
error like:

21:12:18 ERROR| Traceback (most recent call last):
21:12:18 ERROR|   File "/home/lmr/Code/virt-test.git/virttest/standalone_test.py", line 85, in run_once
21:12:18 ERROR|     env = utils_misc.Env(env_filename, self.env_version)
21:12:18 ERROR|   File "/home/lmr/Code/virt-test.git/virttest/utils_misc.py", line 395, in __init__
21:12:18 ERROR|     traceback.print_last()
21:12:18 ERROR|   File "/usr/lib64/python2.7/traceback.py", line 250, in print_last
21:12:18 ERROR|     raise ValueError("no last exception")
21:12:18 ERROR| ValueError: no last exception
21:12:18 ERROR|
21:12:18 ERROR| FAIL -> ValueError: no last exception

Will be thrown. Instead, let's just error the exception
thrown as an error message.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
utils_misc: Removing unused import

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
utils_misc: Fix use of reserved keyword in generate_random_string

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt_test_assistant: Restore missing uncompressed JeOS image

This is a solution for issue #93.

If for some reason there's a pristine, compressed JeOS
image in the appropriate location, but not an uncompressed
file, decompress it so the user doesn't get an error and
the tests can proceed normally.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt-tests: Add .gitignore file

This is a solution for issue #88.

Create a .gitignore file with appropriate list of
files to be ignored by the version control system.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
kvm.multi_disk: Only preprocess required VM disks

This is a solution for issue #108, reported by Gerd.

The test multi_disk was calling a full preprocess
from the test scope, which is quite dangerous, as
it messes with threads set by the virt tests infrastructure,
making the test runner to hang.

As the idea here is just to create the required disks
before the vm starts, call preprocess_image for all
the images in params.

CC: Lukas Doktor <ldoktor@redhat.com>
CC: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>