Add JeOS minimal guest

After exploring some possibilities, we came up with a
minimal Fedora install, which presents an interesting
compromise between features and disk space. The idea
is to host the compressed image on my FedoraPeople
area and have code to automatically download it if it's
missing, and subsequently cache it.

The unattended install variant is in fact only for
people that, for some weird reason want to rebuild
the minimal guest on a convenient way, nothing more
than that.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Modify run script to take advantage of JeOS

Modify the virt assistant function to:

 1) Download the JeOS image
 2) Setup the environment non interactively

So it all will be done without user intervention.
The first time the JeOS will have to be built,
a couple of minutes to download the 120MB compressed
image + 1 minute to uncompress the image will be
required, after that it'll keep using the uncompressed
image, unless you want to replace it by the pristine
file you have on your hard drive, then you have to call
run with --restore-image.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
jeos: Use 7za rather than 7z

In Fedora, it requires less dependencies.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
utils_misc.virt_test_assistant: Tweaks and reorganization

Now setup log goes to main debug log, setup phase is
displayed as a test. Also, there was a bug on the
uncompress stage in case the image was already
uncompressed, fixed by passing the right flags to 7za.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt: Unify and replace /tmp/kvm_autotest_root by /var/tmp/virt_test

There's no reason why all tests can't use a single roof
for their activities, moreover, /var/tmp is a safer place
to store isos and disk images, considering that we might
have /tmp on tmpfs on Fedora 18 on.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
run: Allow to specify an arbitrary qemu version to test

This introduces the flag --qemu-bin, that allows people
to specify an arbitrary qemu built on your box, such as:

./run -t kvm --qemu-bin /home/lmr/Code/virt-test.git/kvm/install_root/bin/qemu-system-x86_64

And this will automatically run the tests with that qemu.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
run: Add a test list option

Add an option --test-list, that has to be used in
conjunction with -t (test_type):

./run -t kvm --list-tests
(display list of tests)

It'll connect the list to a less pipe, if less is
available, similar to what git does. It'll show all
tests available for the JeOS so one of them can be
chosen.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
run: Allow to select a list of tests

Now that run can list the tests available, also allow
to specify a list of tests (space separated):

./run -t kvm --tests boot_with_usb reboot_with_usb

And it'll select and run those.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
run: Fix bug with option -c

With the new functionality to run tests, even when specifying
a custom config file we were applying a 'only migrate' block,
that's very likely to restrict all the tests run by the
specific configuration.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Add a new tests example config file

Since now the default tests.cfg is based on JeOS, we
cleaned up the old file and added more useful examples,
such as sets similar to the ones we run on our automated
KVM regression infrastructure.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
libvirt: Add better support on run

Allow jeos tests to work fine if you choose to run
libvirt tests. The user will have to be educated to
specify unattended_install.import.import if he/she
wants to run tests dependent on guests.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
shared/cfg/subtests.cfg.sample: Remove JeOS from some variants

In some cases, the test variant is irrelevant, in others,
JeOS lacks a toolchain for it to work. So, let's remove
them and leave a more meaningful list of tests for
people interested in JeOS.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
run: Move setup stage to headers

In order to avoid confusion, move setup to the script
initially printed headers, so it can't be mistaken with
a regular test.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
run: Improve reporting on setup error

In case '7za' is missing, we better report to the user
straight away, rather than just failing silently.
Also, we want to avoid as much as possible config
files not in their right places.

In order to accomplish that goal, check for 7za's
presence in the system on virt_test_assistant, and
throw an exception if it's not present. Also,
make sure we catch exceptions when calling
virt_test_assistant, to present error information
in a good way.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
get_started: Make JeOS download optional on script

Chris pointed out it's appropriate to ask whether the
user wants to download the minimal guest image instead
of just going ahead and downloading it. So be polite
and ask first on non interactive setup.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
run: Find correct base_dir

If the default base directory that holds guest images
and isos was modified, the setup stage won't be able
to find out the jeos images, and therefore, will
re-download the images to a location where it will not
be useful.

Let's figure out the correct base_dir from the location
of image1 instead.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
subtests.cfg.sample: Introduce virt_test_type

Introduce an additional param, virt_test_type,
that is a list of virt backends where the given
test works on, for example:

virt_test_type = kvm libvirt

Means the test can run under the kvm and libvirt
tests, while

virt_test_type = libvirt

Means the test is libvirt exclusive.

This will be used to filter available tests,
and help to fail incompatible tests.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
run: List only supported tests for each virt backend

When looking at the test list, we should only list
supported tests for each virt type (it doesn't make
sense to run virsh tests on kvm, as well as it's not
possible run tests that require a monitor interface
to work).

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
subtests.cfg.sample: Small adjustments to the test list

We're not supposed to install JeOS, unless on the libvirt
case, where we have to import the JeOS image so libvirt
can create a domain XML for it. So restrict tests with
JeOS to only those mentioned.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
run: Create config files so listing tests works out of the box

Refactor virt_test_assistant to create the config files
in the appropriate places, so listing tests works out of
the box, even if user didn't run get_started.py first.

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