shared.cfg: Disable S3/S4 test on all ppc64 guests

According to https://github.com/autotest/virt-test/pull/558
All S3/S4 tests should be disabled on ppc64 guests.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
Add a class named RemoteFile in virttest-remote module.

A class to handle remote file.
Currently, we support three operations on remote file.
add: append lines in to file.
sub: replace string which match pattern to repl.
remove: delete lines that match pattern.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
Add some unittest for RemoteFile.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
qemu.tests.cfg: Don't start vm in usb_multi_disk.max_disk test

The virt-test framework checks both 'start_vm' and 'restart_vm'
parameters before starting a VM. So if we don't want to start
VM by framework, we should set both of these parameters to 'no'.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virt.virt_vm: Print usb device map when raising exception

The VMUSBControllerPortFullError exception doesn't provide
enough message to point out where has the problem.

This patch prints the usb device map when the exception is
raised, so that we can see which device caused the exception.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virt.qemu_vm: Fix usb port assignment problem

If there are more than one usb controllers on VM,
the usb port assignment code would assign one port
on every controller. This patch tries to fix this
problem.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
qemu.tests.cfg: Force create images for usb testing

If we run the usb_multi_disk.max_disk several times,
this test would fail because the images are formatted
and no usable free space.

This patch makes these images created force everytime,
to avoid this problem.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
qemu.tests.usb: Wait for some time when getting usb disk name

This `usb_storage` script would fail when getting
usb disk name in guest, since the guest doesn't
fully boot up.
Thus it needs some more time to wait for guest
initiate usb disk after boot.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
shard.cfg.guest-os: Update config file sturcture for RHEL

This patch adds an extra directory level for RHEL guest,
so that we can add arch independent config in single place.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
Fix for RemoteFile and unittest.

(1).Change uuid to tempfile to build a unique filename.
(2).Add a __del__ method for unittest class to remove remote_file.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>

Fix indenting error in remote.py.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
qemu: RDMA migration test support

Signed-off-by: Michael R. Hines <mrhines@us.ibm.com>
qemu_vm: If QEMU doesn't know a given migration protocol, skip the test

When starting QEMU with an incoming migration protocol
it doesn't know about, a VMCreateError will be thrown.
We can do better in this case. Create a new exception
class that inherits from error.TestNAError, so the test
is skipped rather than errored or failed.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
run: Make the default QEMU set stricter

The default QEMU set, migrate, can usually be run with
a variety of QEMU shipped by current distros.

With the new migration protocols, people running the
default set will frequently have SKIPPED tests, which
is not good. So, restrict the default set to
protocols that are widely available. Once the new
formats are widespread (could take over a year for
that to happen), we can revert this change.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
small fix for nodedev_xml

(1).__schema_name__ = "nodedev"
(2).change get_key2syspath_dict and get_key2value_dict
    from @staticmethod to method of NodedevXML.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
Add test for nodedev-dumpxml

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
libvirt.tests: Fix pylint complaint for virsh nodedev-dumpxml.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
Add virsh domif-setlink domif-getlink test

Introduce virsh domif-setlink domif-getlink  testing:

    1. Positive testing
        1.1 Running domain and shutting off domain testing
        1.2 Setlink domain interface up and down then check
        1.3 Options "--config" testing
        1.4 Interface name and MAC address testing

    2. Negative testing
        2.1 Invalid options testing
        2.2 Shutting off domain with interface name

Signed-off-by: whuang <whuang@redhat.com>
virt: add virsh functions for virsh domif-setlink and domif-getlink

Signed-off-by: whuang <whuang@redhat.com>
virt: add functions get net devices of domain from guest xml

Signed-off-by: whuang <whuang@redhat.com>
modify some issue according to cevich's suggestion

Signed-off-by: whuang <whuang@redhat.com>