cli.action_common_unittest: Make it python 2.4 friendly

Also, remove some unused imports.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
kvm_qtree: Make it more py2.4 friendly

Fix some issues running qtree unittests in py 2.4,
that don't regress 2.6 behavior.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
client.shared.ssh_key: Fix typo in setup_ssh_key

Fix the undefined name problem introduced by copy-paste.

Signed-off-by: Wayne Sun <gsun@redhat.com>
virt: Fix incorrect names from name_prefix for virtio_port chardevs

name_prefix for virtio_port used wrong filenames in actual VM
creation.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virt: Add dummy test for virtio_console

Current virtio_console tests only checks the existence of compiled
version of guest script. When the script changes it won't recognize
it and still use the old one.

In production it shouldn't be run and fresh image should be used instead.
In development we might find this script useful when developing new
version with the same image.

It's disabled by default so shouldn't affect production users.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
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>