boottool: Fix incorrect regexp on get_entries() code

If we use

        for entry_str in re.split("^index", raw):

on raw grubby --info=ALL output, we will end up with a
single string, making boottool --info=ALL to return
an empty set, making autotest to wipe out all kernels
of a machine upon execution of the Hosts.cleanup_kernels()
method. Let's fix the regexp to be "index".

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
hosts.base_classes: Fix a bug in the cleanup_kernels code

The heuristics used to determine which kernel versions are
referenced by the bootloader configuration are no longer
valid for the newer grubby-based code - now that the entries
dict retorns a full kernel path, such as

/boot/vmlinuz-3.3.1-3.fc17.x86_64

We need to use the basename, then strip 'vmlinuz-', rather
than just strip 'vmlinuz-' from the resulting string. This
bug fixes a condition where the used kernels were being
incorrectly determined, hence autotest would go and remove
all kernels of a machine.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
kernel/kernel_config: Code style fixes

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
client.kernel_config: Fall back to running config as oldconfig

If we couldn't find any of the user provided configuration
items when no config file is explicitly provided, fall back
to the running kernel config, as it's more likely that we
will end up with a functional kernel at the end of the process
(defconfig might miss important modules, such as networking).

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
install-autotest-server.sh: Make SELinux permissive mode permanent

As SELinux is turned off only temporarily with
'setenforce 0', the next time the autotest server is
rebooted, the SELinux related problems will start to
pop out again, so change default enforcing mode to
permissive.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
install-autotest-server: Improve git management

Add the autotest repo as the origin for the git repo,
making the autotest home dir to actually behave as
a clone of the upstream tree.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt_utils.install_host_kernel: Pass config only if available

With recent changes to the kernel config selection, now
we can omit the kernel configure file. So, only call the
configure method if we have the config, otherwise let it
default to the running config of our virtualization host.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt_utils.install_host_kernel: Pass koji_build to KojiPkgSpec

Turns out we were not passing the koji_build to KojiSpec,
so if one specifies a particular build, it'll be ignored
by our code. So fix that bug.

Now, users specifying host_kernel_koji_build will have
their settings honored.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt: Add possiblity to find subtests in more directory

example:
  ovirt tests in client/tests/ovirt wants to use test from kvm/tests/
  vm_type = ovirt

  other_tests_dirs = "kvm"
  This adds client/test/kvm/tests path to subtests dir group where
  subtest will be searched.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
test-spice.cfg.sample: Misc fixes

* removing duplicates in test-spice.cfg.sample
* also removed two duplicated lines
* added spice_gen_x509
* added spice_client_host_subject

Signed-off-by: Vaclav Ehrlich <vehrlich@redhat.com>
rv_connect.py: Add openssl support

Add openssl support required for spice ssl testing.
It creates command line options for remote-viewer, then
launches it.

Signed-off-by: Vaclav Ehrlich <vehrlich@redhat.com>
virt: Removes whitespace from libvirt_vm.py

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Add memory stress test to cpu_flags test

usage:
  ./cpuflags-test --stressmem 100 (in MB)

Signed-off-by: Jiří Župka <jzupka@redhat.com>
shared: Adds class for simple statistics and convert size function

convert_data_size('1M') == 1024 * 1024 bytes

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt.kvm: Unifying qmp/human monitor set_migration_speed

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt,kvm: Adds possibility to don't wait for finish of migration

After setting not_wait_for_migration the kvm_vm.migration method
returns control to parent function immediately after sending
of migration command to qemu monitor.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Adds funtion to virt_utils install_cpuflags_util_on_vm

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Adds support for new QMP status command output.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
kvm-test: Repairs multihost control file

Repairs an error with processing test fail exception.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
kvm-tests: Adds tests for measure migration speed.

tests:
  1) Single host measure migration speed.
  2) Multi host measure migration speed.

description:
  1) start mem stresser in VM to avoid end of migraiton
  2) get statistic of migraiton speed
  3) kill VMs
  4) if migration speed is slower than desired migration speed it raise warning

Signed-off-by: Jiří Župka <jzupka@redhat.com>