autotest_regression: Too few arguments for format string

Fix TypeError: not enough arguments for format string

Found by PyCharm inspection.

Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
autotest_regression: replace error.ValueError with ValueError

I think we mean ValueError here, I couldn't find any error.ValueError.

Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
autotest_regression: move copy of install-autotest-server*log outside try/except

We need the install log file to debug any error, so move it outside the
try/except, otherwise any errors will trigger aexpect.ShellCmdError and
skip the copy

Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
virt.test.nic_promisc : send command safely

Some times the kernel or other subsystems might print some info,
that will interfere with aexpect following command prompts and make
this case failed like cmd timeout.
This patch tried to resolve them by creating wrappers

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
qemu.tests: disable qemu_iotests for some image format on RHEL host

since qcow, qed, vmdk, vpc and vdi not support by qemu-kvm in RHEL so
filter out tests on these image format;

Signed-off-by: Xu Tian <xutian@redhat.com>
virsh_attach_detach_disk: attach tmp disk with config option into offline guest

We want to attach the disk with --config parameter, because we have to be sure,
that the disk will be attached using all versions of libvirt. But to use this
parameter we have to at first shutdown the guest because this chagne will affect
next boot of the guest.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
virsh_attach_detach_disk: move add acpi module after attach/detach required disks

To reduce restart count and time needed to do it I've just move this code after
disks preparation. For disk preparation you need to have the guest offline and
it would be pointless to start the guest, modprobe the acpiphp and than shutdonw
the guest again to attach/detach required disks.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
virsh_attach_detach_disk: attach second temp disk for the detach_twice test

We have to attach two disks for the detach_twice test in order to run the test.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
virsh_attach_detach_disk: make the proper return status checking

It's obvious that if you are running the attach/detach config test that you will
not see the change in the xml returned by dumpxml of a live guest.

This patch also fixes whitespace issues and typo in error message.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
libvirt: Fix a bug in virsh_change_media test and modify format

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
Merge pull request #690 from xutian/fix_qemu_iotest

disable qemu-iotest for some image format on RHEL host
virttest.utils_libvirtd: update libvirtd_start and libvirtd_restart

These two functions should wait until libvirtd is fully started. To achieve
this, I've introduced new function libvirtd_wait_for_start().

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
virsh_setmem: fix setting the memory into original size

We should restore memory into original size by using the original_outside_mem
instead of original_inside_mem because the inside mem is lower than the outside
mem and because of the virsh setmem command is setting the outside mem.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
virsh_setmem: fix the checking of the result value

There are some tests that have different result on older libvirt and
newer libvirt. The right condition is that the new libvirt should not
fail, but the older one should fail. By this patch we follow this
behaviour.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
virsh_setmem: fix the config file for old_libvirt_test

The domain name and memory size have to be defined to PASS the test
on newer libvirt.
virttest.virsh: change the order of creating the setmem command line

It is possible to call 'virsh setmem --domain test 524288' but the current
code create 'virsh setmem 524288 --domain test' for the right parameters.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
qemu.tests: enhance base_copy modules

New property self.events to contain block job events; And simplify
reboot function;

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: fix bug in get_image_file()

update regrex to avoid get incorrect image file when images has
backing file;

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: enhanced drive_mirror module

update drive_mirror module to make script works more stable;

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: update mirroring with reboot test

update tests steps to make it more reasonable;

Signed-off-by: Xu Tian <xutian@redhat.com>