qemu: Add qmp_event_notification test

This case test QEMU Monitor Protocol Events.
It verifies if the appropriate qmp event
will be emitted when the required conditions
are met.

It tests the following events now:
RESET SHUTDOWN STOP RESUME WATCHDOG.

All tests follow the qmp commands:
system_reset, quit, system_powerdown.

Signed-off-by: Feng Yang <fyang@redhat.com>
config: Update qmp_event_notification config for rhel4 guest

RHEL4 guests need some special config to make this test work.

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest.storage: Pylint/Eclipse style fixes

No actual changes, just cleanups.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.storage: Change default location

Use root_dir/$backup_dir in case $backup_dir is not absolute path
and change the default backup location to $autotest_data/images/.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.storage: Don't overwrite backup image during preprocess

Allow backup_image to skip_existing files and use this during
preprocess_image. This could save a lot of time with intrusive tests.

The idea is to create backup image only once and in case of
intrusive tests use restore_image_after_testing_on_error.

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

Design this case according to manual case

[x2APIC] switch kernel with kexec

This case check that x2apic is still enabled after kexec.

Signed-off-by: Feng Yang <fyang@redhat.com>
tests.cfg: Add a config block for simple ping test

The ping test contains 2 subtest now, this patch adds one
more subtest for a simple single-nic-card ping test.

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

Adapt to final version which was committed to qemu upstream.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
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>
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>