standalone_test: Fix TAG_INDEX problem

When the guest_name changes (arch, machine, ...) the TAG_INDEX length
might differs from the previous one. Store indexes per name to avoid
shortname corruption.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virt: Add OpenSUSE 12.3 x86_64 config.

Signed-off-by: Chris Evich <cevich@redhat.com>
virt: Fix legacy driver_type 'kvm' use

* Get rid of old virt-test reference to 'kvm' driver_type
* virtnet style doesn't care about kvm vs qemu difference
* unattended_install uses it for both qemu and libvirt virt-test
* No other usage found for vm.driver_type sensitive to 'kvm' value

Signed-off-by: Chris Evich <cevich@redhat.com>
virttest.funcatexit: Prevent weird errors while storing nasty args

Because all arguments are stored in env we have to ensure the arguments
are pickable before storing them. Otherwise users would get weird errors
pointing at env:
    TypeError: can't pickle ... objects

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.funcatexit: Prevent weird errors while storing nasty functions

Local functions are not pickable. Raise a sane exception when the test
tries to use them.

Global functions (defined on the module scope) are fine.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virt and standalone_test: Raise TestWarn when funcatexit fails

Since funcatexit are cleanup functions, make the test fail with
TestWarn and proceed with postprocess_on_error.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
shared.cfg: Show guest disk/nic/cpu/image config by default

Normally, these configs are important to a test job, thus show
them all in test's name.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virttest API: Introduce version module

In order to get useful debug information for virt test,
introduce a module version that is concerned with finding
the current git version, top commit, condensed version
suitable for python setup tools.

Most of the time we're interested in using the results
from the get_pretty_version_info(), as it is complete,
nice for debug logs.

Also, add the RELEASE-VERSION file that the module
creates (might be useful if/when virt test gets packaged)
to .gitignore.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
standalone_test/virt: Add virt test information to test logs

Add complete virt test info to test logs, to help debug
issues with the test suite itself.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt: Adds support for multi-host migration of system without serial console.

For multi-host migration system without serial console is
necessary to have bridge on hosts where guest should be
migrated in same network.

 _________                _________
|  host1  |              |  host2  |
|         |              |         |
| src br--|--------------|-dst br  |
|    |    |              |    |    |
|  |vm1|  |              |  |vm1|  |
|_________|              |_________|

Otherwise host2 couldn't connect to vm1 after migration.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Adds multihost migration test for floppy ejecting.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt.qemu_monitor: Add an API for terminating monitor connection

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virt.env_process: Close monitor socket after test

The socket connection is stll alive after a test finishes,
normally it works well.
But there is one situation that the next test case tries to
re-connect to these monitor sockets after unpickled from env
file, even though the former monitor socket connection is
still established. In this case auotest will report a error
of "Could not find (qemu) prompt", though the monitor works
well in fact.

To avoid this problem, this patch just close all monitors'
socket connections at the end of a test case, and let the
following test case try to re-connect if needed.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virt.qemu_vm: Move get_monitor_filename(s) functions to qemu_monitor

These 2 function are monitor related operation, thus better to put
them in qemu_monitor module.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virt.qemu_monitor: Create 2 functions for creating monitor object

This patch introduces 2 helper functions in qemu_monitor module,
to help user create monitor object.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virt.qemu_vm: Use monitor creation function in qemu_monitor

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virt.qemu_monitor: Store qemu VM object in monitor object

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
qemu.tests.cfg: Enable qemu_guest_agent tests on newer Fedora host

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
qemu.tests.cfg: Update qemu guest agent config

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
qemu.tests: Fix module import problem in qemu_guest_agent_snapshot test

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>