qemu.tests: Install cygwin in windows guest

Add case for install cygwin env in windows guests.

change from v1:
   - Add cdrom letter replace to fit different system
   - typo fix and parameter adjust
change from v2:
   - cdrom check command change and the install command update

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Acked-by: Qingtang Zhou <qzhou@redhat.com>
qemu.tests: Add case for device properties bit check

This case will check some properties bits for virtio devices set in
the command line. This script will support both block and nic devices.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
virttest.qemu_vm: Change snapshot and boot default to None

Ignore boot and snapshot if not set. This affects only cdrom and
floppy, which doesn't set those variables explicitly.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
qemu: Add test kernbench2

This case is used for performance testing.

Changes for V2
1. Only update gcc when testing on host.
2. Add record_result() function to record the result value to a file.
Changes for V3:
Clean the folder used to make kernel

Signed-off-by: Feng Yang <fyang@redhat.com>
Acked-by: Qingtang Zhou <qzhou@redhat.com>
Acked-by: Amos Kong <akong@redhat.com>
qemu.tests.kexec: Fix a couple of problems found by pylint

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt-libvirt: fix wrong directory for virsh schedinfo test module.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
utils_net: Handle missing ctypes module on python 2.4

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.qemu_vm: set global_image_bootindex to 1 when using -kernel

As -kernel option should take the bootindex 0, so we should make
global_image_bootindex for images bootindex count start from 1.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
virt: fix problem of checking persistent in virsh.net_state_dict().

When network is transient, net_autostart() will raise.
The next step will try to get "transient" in result_object.
While error messages may not be in stderr but exist in result
object indeed:

 * Command:
 net-autostart default --disable
 Exit status: 1
 Duration: 0
 stdout:
 error: failed to unmark network default as autostarted
 error: Requested operation is not valid: cannot set autostart
        for transient network

Message "transient" exists, but stderr is None.
So search "ranient" in whole result object will be more suitable.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
virt-libvirt: Add test module for virsh net-define|undefine.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
guest-os: Change kickstart/unattended parameters passed to kernel

With recent changes in the QEMU VM code, the cdrom order
is not honored anymore. Let's change the linux guests
configuration to honor that change.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
tests/autotest_control.py: simple identation fix

Signed-off-by: Cleber Rosa <crosa@redhat.com>
virttest/utils_test.py: allow running autotest tests with standalone control files

This fix is needed when running tests on vms based on the autotest
client, when using control files that do not use job.run_test() and
similar calls. That is, the control files are standalone and do not
reference a client test.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
virt: introduce autotest_distro_detect test

This is a trivial test that exercises the recently added distro.py
module on autotest.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
qemu.tests: Bring back missing tests code in cdrom.py

Some test code in this script was deleted by accident in
commit 2b5e0f6151419dd403d7f959e0492510f790b8e0. This patch
brings them back.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
qemu.tests: Add a kvm subtest format_disk.

This test will simply create a file system on disk, mount it and write
a file with some content to the disk. Check whether the write could be
succeeded.

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

Checking guest os type with 'guest_name' parameter may not
always work for all guests, and not supported by upstream.
Thus update all these places to using 'os_type'.

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

In the format disk test, the status of the harddisk is different in different
env in Windows guest. Should check if the disk plused is offline and writeable.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>

This patch try to fix all the tab and trailing space problems.

Signed-off-by: Jason Wang <jasowang@redhat.com>

Make command timeout of format_disk.py scirpt longer and configurable

Signed-off-by: Feng Yang <fyang@redhat.com>
virt: Adds support for new qemu-kvm -cpu interface.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Add get_iface functions for libvirt_xml module.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
virt-libvirt: Add test for virsh attach|detach interface.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
virt: fix problem of checking persistent in virsh.net_state_dict().

When network is transient, net_autostart() will raise.
The next step will try to get "transient" in result_object.
While error messages may not be in stderr but exist in result
object indeed:

 * Command:
 net-autostart default --disable
 Exit status: 1
 Duration: 0
 stdout:
 error: failed to unmark network default as autostarted
 error: Requested operation is not valid: cannot set autostart
        for transient network

Message "transient" exists, but stderr is None.
So search "ranient" in whole result object will be more suitable.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>