Add test for snapshot current and parent

Signed-off-by: Kyla Zhang <weizhan@redhat.com>
virttest: Support get VF from specified sr-iov PF.

We can set device_name to PF's devname in host.

If PF not specified, will try to get VF from all PF in turn.

Signed-off-by: Feng Yang <fyang@redhat.com>
sr-iov: virttest.test_setup: Try to get more pxception when VF/Pf clean up command fail.

Also delete self.dev_unbind_drivers.

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest.test_setup: Add devices parameter for get_pf_devs() and get_vf_devs()

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest.test_setup: Check available before load/unload self.driver.

Sleep 3s after loading self.driver.

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu:Disable balloon_fix_value case in ppc64

ppc64 platform does not support X86 ACPI s3 and s4 cases,
disable it in ppc64 platform

Signed-off-by: Man Li <limansh@cn.ibm.com>
Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
tests.kdump: Add new sub test for multiple guests

define some functions for kdump, maybe other case
can reuse these functions late.

Signed-off-by: Shuping Cui <scui@redhat.com>
qemu.tests.multi_disk_random_hotplug: Improve the unplug part

This patch changes the handling of unplug. The simplu_unplug has sometimes
problem detecting correctly the unplug status, as it might take seconds
before the disk is removed (monitor returns output, but qemu still
waits for OS repsonse before it removes the device from qtree).

This custom handler waits up to 1s for device to be removed and even
when it's not proved to be removed it removes it from representation.
We can afford this as all devices are again checked later in the test
and the VM state is for the whole period set to dirty.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
qemu.tests.multi_disk_random_hotplug: Improve logging

Add context for easier debugging.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
qemu.tests.multi_disk_random_hotplug: Put images_define in try/catch

The qdev.images_define_by_variables needs to be in the try/except
block in order to work as expected (remove format and try another round)

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
qemu.tests.multi_disk_random_hotplug: raise exception if no disks added

With incorrect configuration it might happen that no disks can be added.
Throw exception instead of simple warning and clean test run.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
libvirt_vm: remove setup_serial_ports() method.

Commit c37a86ca picked out the create_serial_console() from setup_serial_ports(),
and call it in env_process(). But it is not robust enough.

This patch rename the setup_serial_ports() to create_serial_console() to be called
in env_process() and remove the older create_serial_console().

Reported-by: Yanbing Du <ydu@redhat.com>
Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Reviewed-by: Yanbing Du <ydu@redhat.com>
Tested-by: Yanbing Du <ydu@redhat.com>
virt-test: add Fedora 20

Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Merge pull request #1147 from FengYang/sr-iov2

SR-IOV: Support get VF from specified sr-iov PF.
virt-libvirt: net_state_dict() use another virsh

This virsh module function becomes a Virsh class method, but
internally it makes other calls to the virsh module directly.
Sometimes this is not what is needed, rather a specific Virsh
class instance should be used (i.e. to run against a remote
system or with special args/dargs).  Added a parameter
with None default to allow this.  Fixed up all references to
this function so they also pass through proper virsh_instance
state.

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: unittest virsh isolation

Many unittests require testing codepaths containing
the virsh module and/or Virsh() class instances.  However
it is necessary to isolate them from eachother AND provide
a check to make sure no "real" system-virsh calls are made.

To make this work easier for other unittests, added a
factory function that returns a mocked Virsh() class instance.
Every closed method on this instance will raise a
bogusVirshFailureException (subclass of
unittest.TestCase.failureException).

Now, unittest tests only need to call this function and
override the resulting instance's methods as needed for
testing.  I also added a unittest to do a basic check of
this new unittest helper function.

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Fix for issue #1303

Running these unittests in a specific order resulted in many
failures.  The problem is, the unittests all modify contents
of the virsh module, then they proceede to make shared-access
of the module.  To fix this, isolation of the virsh module for
each unittest would be needed.  However this is not practical
since python likes to save memory by sharing loaded modules.

Since all unittests that use the virsh module normally create
an instance of the Virsh() class anyway, it's much easier to
not isolate the module, but work with a copy of a specially
prepared Virsh() class instance.  This instance can be generated
with the new FakeVirshFactory() function from the virsh_unittest
module.

Signed-off-by: Chris Evich <cevich@redhat.com>
virt: codespell + reindent mass cleanup

Signed-off-by: Chris Evich <cevich@redhat.com>
virt: Fix propcan pylint complaint

Somewhere the new-ness of the class heirarchy is getting lost leading
to these errors:

    # tools/run_pylint.py -q virttest/utils_net.py
    ************* Module autotest.client.tests.virt.virttest.utils_net
    E1001:1221,0: VirtIface: Use of __slots__ on an old style class
    E1001:1334,0: LibvirtIface: Use of __slots__ on an old style class
    E1001:1342,0: QemuIface: Use of __slots__ on an old style class

Adding a multi-inheritance of ``object`` to the base class makes pylint
happy and all unittests run clean.  I'm assuming that means there are
no negative consequences.
shared/cfg/guest-os/Windows/WinXP/i386.cfg: remove leading white space

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