virt: Introducing ovirt module

With this module, we able to use SDK for the oVirt engine API to
manipulate resources in oVirt such as Data Centers, Clusters,
Hosts, Storage Domains, VMs, etc.

At present, we haven't cover everything into our oVirt module, which
only includes some necessary API implementation for virt-v2v requirement.

However, it's very easy to extend new functions to support oVirt autotest
in the future.

v2:
 - Rename class name to {VM, DataCenter, Cluster, Host, StorageDomain}Manager.
 - Directly raise error if ovirt relevant module doesn't exist.
 - Reorgnize and simplify codes with {VM, DataCenter, Cluster, Host, StorageDomain} object instance.
 - Improve codes docstring.

Signed-off-by: Alex Jia <ajia@redhat.com>
Signed-off-by: Wayne Sun <gsun@redhat.com>
virt: Add new virsh wrapper functions into libvirt_vm

Reuse previous libvirt_vm module and add new virsh pool
functions, and then we can create/check a libvirt pool
via these functions and use virt-v2v to convert an
existing VM into the pool later.

v2:
 - s/warning/error/ if failed to create a pool.
 - Remove duplicate check in virsh_pool_create_as().

Signed-off-by: Alex Jia <ajia@redhat.com>
virt: Move get_port function into BaseVM class

All VM class implementation for get_port() are identical, so move it
into BaseVM class and remove relevant codes from {kvm, libvirt}_vm.py.

Signed-off-by: Wayne Sun <gsun@redhat.com>
Signed-off-by: Alex Jia <ajia@redhat.com>
virt: Introducing virt_v2v module

With this module, we will be able to implement a virt-v2v test.

As of implementation details, we uses virt-v2v command line tool
to convert an existing VM into libvirt-managed KVM, or an open
manageable virtualized environment - oVirt.

v2:
 - Fix a typo, s/autoorization/authorization/.
 - Improve codes docstring.
 - Remove unused variables.
 - Directly return cmd_result.

Signed-off-by: Alex Jia <ajia@redhat.com>
Signed-off-by: Wayne Sun <gsun@redhat.com>
Support ovirt-engine-sdk build

client/tests/virt_v2v/tests/install.py: add install module to support ovirt-engine-sdk build.
client/virt/base_installer.py: add some flags to allow caller ignore some unnecessary steps
                               for building ovirt-engine-sdk.

v2:
 - Use glob to match filename pattern.

Signed-off-by: Alex Jia <ajia@redhat.com>
virt.virt_env_process: Add ovirt vm handling

With this patch, we make ovirt vm handling integrating to pre/postprocessing code,
making it possible the execution of a virt-v2v/ovirt test. And introduce a new
virtualization type 'virt_v2v'.

Note that, it's different with kvm/libvirt-autotest, the vm exists on other host
and don't need to start/install, so you need to set 'start_vm = no' in base.cfg.

Signed-off-by: Alex Jia <ajia@redhat.com>
virt.virt_env_process: Support remotely run tcpdump

With the patch, we can get VM IP via tcpdump on a remote host.

As usual, virt-v2v will convert/import an existing VM into ovirt-node
then we need to get VM IP on the ovirt-node, so it's necessary to
remotely run tcpdump to get VM IP.

Signed-off-by: Wayne Sun <gsun@redhat.com>
Signed-off-by: Alex Jia <ajia@redhat.com>
virt.tests: Introducing virt-v2v test

Introduce virt-v2v test. The small amount of actual code on this test is made
possible by code reuse, made possible by the kvm/libvirt refactor patchset + the
previous patches on this set.

The obvious difference is that some new parameters had to be introduced to
accomplish virt-v2v testing. A more complete description of such parameters will
be present on our online documentation (wiki) later.

v2:
 - Update some *.sample files.

Signed-off-by: Alex Jia <ajia@redhat.com>
Signed-off-by: Wayne Sun <gsun@redhat.com>
virt.tests: Add test cases for automatically converting vm

These cases are quite simple, but they will assist users to understand
how does virt-v2v-autotest work and how to write a simple case for
virt-v2v or ovirt.

v2:
 - Improve linux_vm_check test case.
 - Asyn new class name with ovirt module change.

Signed-off-by: Alex Jia <ajia@redhat.com>
Signed-off-by: Wayne Sun <gsun@redhat.com>
gitignore: Update ignores for virt-v2v tests

Signed-off-by: Alex Jia <ajia@redhat.com>
virt.spice: Modified the Spice Tests to add the ssl remote viewer test

Also fix the issue of not being able to run the same dependent
test multiple times, by adding Resolution Order to the spice tests.

Signed-off-by: Vimal Patel <vipatel@redhat.com>
client.shared.test: Avoid to make and copy src dir

Currently, client.shared.test will create a source
code directory that might be removed right away on
client.shared.base_utils.update_version function.

So, let's decide whether to create/copy the source
code directory on that function, rather than on the
test class.

Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
client.shared.base_utils: copy source code dir to test.srcdir

On update_version, if we manage to find a source
code directory of a test module in any of the known
test source locations, copy the test code to test.srcdir.

Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
virt.kvm.usb: test hid devices with xhci too

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
virt.kvm.usb: add audio test

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
virt.kvm.usb: use multiple block sizes in storage test

Write the test file multiple times to the usb stick,
using different block sizes each time.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
virt.kvm_vm: fix bootindex

_add_option() expects the value being a string or bool,
passing in a number doesn't work.  So make bootindex
a string ...

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
virt.kvm: split qemu cmd line for logging

This makes the long qemu command line in the log *alot* more readable.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
client/virt/virt_syslog_server.py: Introduce embedded syslog server

As dicussed on github issues #66 and #430.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
virt.unattended install: add syslog logging support

This way we capture the installation progress and
have a chronologically sound co-relation between
host and guest events. By default, the feature will
be turned off, as it adds a *lot* of verbosity to
the test logs, and for newer guests such as recent
Fedora, we have better logging through the virtio
console.

Signed-off-by: Cleber Rosa <crosa@redhat.com>