KVM test: Create autotest_lib.client.virt namespace

This patch moves all libraries from the KVM test to
autotest_lib.client.virt, and makes the needed adaptations
and abstracts the KVM implementation from the generic
infrastructure. The patch contains bugfixes pointed by
Ray Chauvin, and also patches from Cleber Rosa that
isolate base vm functionality into a BaseVM class, with
a collection of public methods, intended to be used in
tests

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Signed-off-by: Ray Chauvin <rchauvin@redhat.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
KVM test: Moving generic tests to common tests area

So other virt tests can benefit from them. The tests that
don't depend on any KVM VM specific features (ie, monitors)
were moved. As soon as we abstract some of the monitor
functionality, the KVM specific tests can be rewritten on
a virt tech agnostic way and then be moved.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt.virt_utils: Get rid of create_report function

As it has been transfered to the html_report module itself.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
KVM test: Fix problem when unexpected strings appear on SSH prompt

In some conditions, ssh may respond things like:

Warning: Permanently added localhost' (RSA) to the list of known hosts.

Take that into account on the remote login function.

Signed-off-by: Jason D. Gaston <jason.d.gaston@intel.com>
KVM test: Repair bug of creating kvm guest machine

Signed-off-by: Jiri Zupka <jzupka@redhat.com>
client.virt.kvm_vm: Remove shebang from source file

It is not necessary as this file is not a stand alone program.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt.virt_utils: Fix hardcoded test URL in run_tests()

Now that we aim to have different implementations of
virtualization tests, the utility function run_tests()
can't have the 'kvm' url hardcoded in the function. Rather,
it needs to pick up 'vm_type' from the test params.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
KVM test: installer: Fix KojiInstaller bug

That code was not updated during the last version of the
refactor patches, so it was referencing the old KojiDownloader
class. Let's fix this.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Mass permission and spacing fixes

All across the autotest tree.

Signed-off-by: Lucas Menghel Rodrigues <lmr@redhat.com>
Merge branch 'master' of git://github.com/autotest/autotest

1. Fix conflicts
2. Make internal script works with new interface.

Conflicts:
	client/tests/kvm/control
	client/tests/kvm/control.parallel
	client/tests/kvm/kvm_config.py
	client/tests/kvm/kvm_utils.py
	client/tests/kvm/scripts/check_image.py
	client/tests/kvm/scripts/unattended.py
	client/tests/kvm/tests/balloon_check.py
	client/tests/kvm/tests/boot.py
	client/tests/kvm/tests/clock_getres.py
	client/tests/kvm/tests/enospc.py
	client/tests/kvm/tests/migration.py
	client/tests/kvm/tests/migration_with_reboot.py
	client/tests/kvm/tests/module_probe.py
	client/tests/kvm/tests/netperf.py
	client/tests/kvm/tests/nic_hotplug.py
	client/tests/kvm/tests/pci_hotplug.py
	client/tests/kvm/tests/qemu_img.py
	client/tests/kvm/tests/qmp_basic.py
	client/tests/kvm/tests/set_link.py
	client/tests/kvm/tests/timedrift.py
	client/tests/kvm/tests/timedrift_with_migration.py
	client/tests/kvm/tests/timedrift_with_reboot.py
	client/tests/kvm/tests/unattended_install.py
	client/tests/kvm/tests/virtio_console.py
	client/tests/kvm/tests_base.cfg.sample
	client/tests/kvm/unattended/RHEL-3-series.ks
	client/tests/kvm/unattended/RHEL-4-series.ks
	client/tests/kvm/unattended/RHEL-5-series.ks
	client/tests/kvm/unattended/win2003-32.sif
	client/tests/kvm/unattended/win2003-64.sif
	client/tests/kvm/unattended/win2008-32-autounattend.xml
	client/tests/kvm/unattended/win2008-64-autounattend.xml
	client/tests/kvm/unattended/win2008-r2-autounattend.xml
	client/tests/kvm/unattended/win7-32-autounattend.xml
	client/tests/kvm/unattended/win7-64-autounattend.xml
	client/tests/kvm/unattended/winvista-64-autounattend.xml
	client/tests/kvm/unattended/winxp32.sif
	client/virt/kvm_monitor.py
	client/virt/kvm_vm.py
	client/virt/tests/autotest.py
	client/virt/tests/ethtool.py
	client/virt/tests/guest_test.py
	client/virt/tests/ping.py
	client/virt/tests/shutdown.py
	client/virt/virt_env_process.py
	client/virt/virt_test_utils.py

Internal script update:
	common_lib/cartesian_config.py
	tests/kvm/kvm_cross_host_utils.py
	tests/kvm/tests/acpi_after_hotplug.py
	tests/kvm/tests/audio.py
	tests/kvm/tests/balloon_disable.py
	tests/kvm/tests/cdrom.py
	tests/kvm/tests/change_media.py
	tests/kvm/tests/check_unhalt_vcpu.py
	tests/kvm/tests/cpuflags.py
	tests/kvm/tests/cross_host_netperf.py
	tests/kvm/tests/cross_host_transfer.py
	tests/kvm/tests/disable_win_update.py
	tests/kvm/tests/eject_media.py
	tests/kvm/tests/ext_register_vm.py
	tests/kvm/tests/ext_test.py
	tests/kvm/tests/ext_unregister_vm.py
	tests/kvm/tests/fillup_disk.py
	tests/kvm/tests/floppy.py
	tests/kvm/tests/format_disk.py
	tests/kvm/tests/hdparm.py
	tests/kvm/tests/image_copy.py
	tests/kvm/tests/iometer_windows.py
	tests/kvm/tests/ipi_x2apic.py
	tests/kvm/tests/kernbench.py
	tests/kvm/tests/kexec.py
	tests/kvm/tests/ksm_base.py
	tests/kvm/tests/lvm.py
	tests/kvm/tests/multi_disk.py
	tests/kvm/tests/multi_nics.py
	tests/kvm/tests/multi_nics_verify.py
	tests/kvm/tests/netperf2.py
	tests/kvm/tests/netperf_udp.py
	tests/kvm/tests/nfs_corrupt.py
	tests/kvm/tests/nic_bonding.py
	tests/kvm/tests/nmi_watchdog.py
	tests/kvm/tests/nx.py
	tests/kvm/tests/performance.py
	tests/kvm/tests/qemu_disk_img.py
	tests/kvm/tests/qemu_io.py
	tests/kvm/tests/qmp_command.py
	tests/kvm/tests/qmp_event_notification.py
	tests/kvm/tests/readonly_floppy.py
	tests/kvm/tests/rh_kernel_update.py
	tests/kvm/tests/screendump.py
	tests/kvm/tests/stop_continue.py
	tests/kvm/tests/system_reset_bootable.py
	tests/kvm/tests/trans_hugepage.py
	tests/kvm/tests/trans_hugepage_defrag.py
	tests/kvm/tests/trans_hugepage_swapping.py
	tests/kvm/tests/tsc_drift.py
	tests/kvm/tests/usb.py
	tests/kvm/tests/yonit_bitmap.py
	tests/kvm/unattended/RHEL-6-series.ks
	tests/kvm/virtlab_tests.cfg
	virt/tests/boot.py
	virt/tests/nic_promisc.py
	virt/virt_utils.py
	virt/virt_vm.py

Signed-off-by: Feng Yang <fyang@redhat.com>
Merge branch 'master' of git://qe-git.englab.nay.redhat.com/s2/autotest-devel/
KVM Test: Script fix after merge.

        client/tests/kvm/tests/audio.py
	client/tests/kvm/tests/change_media.py
	client/tests/kvm/tests/enospc.py
	client/tests/kvm/tests/ipi_x2apic.py
	client/tests/kvm/tests/kexec.py
	client/tests/kvm/tests/migration.py
	client/tests/kvm/tests/nx.py
	client/tests/kvm/tests/screendump.py
	client/tests/kvm/tests/trans_hugepage.py
	client/tests/kvm/tests/tsc_drift.py
	client/tests/kvm/virtlab_tests.cfg
	client/virt/kvm_vm.py
	client/virt/tests/autotest.py
	client/virt/virt_test_utils.py
        client/virt/tests/__init__.py

Signed-off-by: Feng Yang <fyang@redhat.com>
KVM Test: Update for making netperf.py more stable.

1. Stop tcpdump by close()
Current we stop tcpdump by sending SIGSTOP to tcpdump process,
and do not do any clean up. e.g. release the lock.  Then send
SIGCOT to tcpdump process again. But if we fail continue tcpdump
process. Framework will think tcpdump still work and do not
start a new one in next case.
Then autotest could not refresh address_cache after guest's ip changed
So directly close() tcpdump, It will be started at the beginning of
next case.

2. kill netserver properly
netperf test doesn't handle all exceptions correctly, some exception
cause netserver isn't be killed, and the following netperf test will
fail. This patch will fix this problem.

Signed-off-by: Feng Yang <fyang@redhat.com>
KVM Test: Script fix suite after merge.

Correct file_transfer import link.
Update configuration for nicdriver_unload.
Make set_link works for qmp monitor

   client/tests/kvm/tests/nic_bonding.py
   client/tests/kvm/tests/nx.py
   client/tests/kvm/tests/set_link.py
   client/tests/kvm/tests/tsc_drift.py
   client/tests/kvm/virtlab_tests.cfg
   client/virt/tests/nicdriver_unload.py

Signed-off-by: Feng Yang <fyang@redhat.com>
KVM-test: introduce a verify_status method

This method is used to check if VM status is same as
we expected.

Signed-off-by: Amos Kong <akong@redhat.com>
KVM Test: fillup_disk: Introduce new client test fillup_disk

The main purpose of this case is to expand the qcow2 file to its max size.
Currently we only support Linux guest and write specified size /dev/zero
to files under /tmp.

Signed-off-by: Feng Yang <fyang@redhat.com>
Signed-off-by: Chen Cao <kcao@redhat.com>
Signed-off-by: Yolkfull Chow <yzhou@redhat.com>
Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
client.virt.virt_vm: Make it possible to specify cluster size for image

For some tests, we need to specify image cluster size for
a given image. Make it possible to specify it so qemu-img
is called with the right parameters. This way we can state
things like:

        images += ' stg1 stg2'
        image_name_stg1 = storage_4k
        image_cluster_size_stg1 = 4096
        image_format_stg1 = qcow2
        image_name_stg2 = storage_64k
        image_cluster_size_stg2 = 65536
        image_format_stg2 = qcow2

in the configuration file for a test

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
KVM Test: Add a subtest lvm

Changes from v1:
* Made the test use more current kvm autotest api, namely:
 - Error contexts, and session.cmd for shorter, cleaner code
 - Removed pre command, as the functionality needed for image_create
   was implemented on the previous patch

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>

This test sets up an lvm over two images and then format the lvm and
finally checks the fs using fsck.

Signed-off-by: Yolkfull Chow <yzhou@redhat.com>

Remove the progress of filling up.
Add a params of clean which could prevent the umount and volume removing
command and let this case usd by the following benchmark or stress test.
Add the dbench into the lvm tests.

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

This test depends on fillup_disk test and ioquit test.
Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
Clean up test thread if timeout in performance test

Should kill the guest test run thread if timeout in performance
test, or the test will hang there until it finished.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
KVM test: watchdog testing

This patch boots guest with watchdog drive i6300esb, and checks
if watchdog-action(ex: reset) occurs when guest is crashed.

This test only supports RHEL.5 and RHEL.6

Signed-off-by: Pradeep K Surisetty <psuriset@linux.vnet.ibm.com>