virt.virt_test: Execute multiple tests sequentially

A python dict has no concept of key order, so we
can't guarantee that when we specify 2 test types,
such as

type = s4 migrate

The tests will be executed in the specified order.
So let's use a list of tuples to enforce that
order.

Signed-off-by: Alex Jia <ajia@redhat.com>
install_server: Save system cfg on cobbler before DHCP sync

This way we'll try to guarantee that the changes made
on the system state will be made active after the DHCP
sync.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
scheduler.scheduler_models: Do not order by reason anymore

When fetching the results of the tests executed during
a job, remove the order by reason, previously used to
group similar failures. This way, the pass reports and
the failure reports will be ordered by execution order,
which is more interesting with the new report.

Also, show the job URL right after the job summary.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt.kvm_vm: Make sure boot=on\off is added

Commit 52f94e55 attempts to search the boot option to
a given drive if qemu command line supports the syntax,
but it turns out it was slightly incorrect. This patch
fixes it.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virt.kvm: Handle migrate errors using QMP monitor properly

When using QMP monitor as the sole monitor on KVM autotest
(something that we sadly did not exercise on our test farms),
starting qemu with -S and then issuing 'cont' will cause
errors, since the error treatment with QMP monitors is more
strict [1]. Take advantage of the fact that error treatment
with the QMP json structures is much easier, and handle
failures during migration accordingly.

With this patch, migration works properly using only QMP
monitors.

[1] This means we probably should be more rigorous treating
Human Monitor errors, but that's going to be handled later.

CC: Qingtang Zhou <qzhou@redhat.com>
CC: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt.kvm_vm: Autodetect whenever bootindex should be used

Also, avoid checking twice and use the result when to
add boot=on/off to the command line.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
contrib.virt: Update template control file

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt.kvm_monitor: Future proof migration handling on QMP monitor

With d46ad35c74, the exception handling for migrations
happening when using a single QMP monitor relies on
an exception class that's going to disappear in future
versions of QEMU, being replaced by the GenericError
class. So let's also handle this exception class.

CC: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt.netperf: Use ssh_key lib rather than off limits server lib

When running the kvm autotest tests on a given host through
the autotest server, it's important to remember that only
the autotest client is copied to machines, making anything
that is not on the autotest.client namespace *off-limits*.

So, replace usage of SSHHost server class (here used only
to get ssh key setup) to use the ssh_key module, recently
split out due to a similar mistake made by test authors.

CC: Amos Kong <akong@redhat.com>
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
base.cfg: Add host_ip_addr parameter

Signed-off-by: Marian Krcmarik <mkrcmari@redhat.com>
virt.kvm_vm.py: Use host ip for informing spice client about migration

Spice client may not run on localhost even during single host migration
so we need to inform spice client about host IP which is not localhost.

Signed-off-by: Marian Krcmarik <mkrcmari@redhat.com>
utils_misc: Add get_host_ip_address() function

Function returns Host IP specified in host_ip parameter If It exists
otherwise returns IP on interface specified in netdst parameter.

Signed-off-by: Marian Krcmarik <mkrcmari@redhat.com>
virt.rv_connect: Use get_host_ip_address()

Using get_host_ip_address() to be able to change
host ip of host address (where remote-viewer connects to)
in configuration.

Signed-off-by: Marian Krcmarik <mkrcmari@redhat.com>
Add list and managedsave(remove)() methods to libvirt_vm.

This patch adds functions list,managedsave(remove) to libvirt_vm.py.

Signed-off-by: Yu Mingfei<yumingfei@cn.fujitsu.com>
Add configuration for the virsh list testcases to subtest.cfg.sample.

Signed-off-by: Yu Mingfei<yumingfei@cn.fujitsu.com>
Add test for virsh list command

Signed-off-by: Yu Mingfei<yumingfei@cn.fujitsu.com>
virt-libvirt: Add basic libvirt_xml module

Signed-off-by: Chris Evich <cevich@redhat.com>