ltp: Update to latest LTP 20120104.

This patch updates the version of LTP from 20091231 to 20120104.

Signed-off-by: Vinson Lee <vlee@twitter.com>
Merge pull request #175 from vinsonlee/ltp-20120104

ltp: Update to latest LTP 20120104.
client/common_lib: introduce progressbar.py

Introduce a utility class that presents a progress bar using very
simple print primitives. This is aimed at making long tasks, such
as downloading files, more user friendly.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
common_lib/base_utils.py: introduce interactive_download utility function

interactive_download is a utility function that builds upon urllib2 and
progressbar to interactively display a download progress.

Changes from v1:
* Fix typo (s/chunck/chunk)
Changes from v2:
* Display human readable data size of file and destination directory

Signed-off-by: Cleber Rosa <crosa@redhat.com>
virt: replace wget used on get_started.py with python version

This patch changes replaces the wget tool used on get_started.py
with a python-based version of an interactive download function.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
contrib: Install autotest server script for Fedora 16

The nice folks from the libvirt (http://libvirt.org/) team
started writing a script to install the autotest server
in Fedora 16. I've re-worked the script to fix some mistakes,
and added some other functionality to it, and the end
result is a fine script to get the autotest server
installed on a Fedora 16 host.

We can refactor the code to make it work with more
distros, but we feel it's wasteful to keep it to ourselves,
when we can share it with the greater public, even
if it's not suited for other distros.

Signed-off-by: Daniel Veillard <veillard@redhat.com>
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt: Fix migration bg command

In migration tests, the command we were using as a
'watchdog' command was tcpdump, but without specifying
which interface it should listen to. As this may fail
depending on the interface ordering, let's change the
command to listen in all interfaces, since this way
it's safer and the command won't fail depending on
the interface ordering.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Coding style cleanup

To improve adherence to code style, fix places where
comma, operator are not followed by a space.

Signed-off-by: Alex Jia <ajia@redhat.com>
libvirt_vm.py: Add libvirtd_stop() and libvirtd_start() functions

Hi All:

This patch adds two new API to libvirt_vm.py file:
libvirtd_stop() and libvirtd_start().

Signed-off-by: Gu Yanhua <guyanhua-fnst@cn.fujitsu.com>
Add get_uuid() function to libvirt_vm

This patch adds a get_uuid() function to libvirt_vm.

Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
libvirt_vm: Fixing error message typos

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt.kvm_vm: Add virtio-scsi support

This patch adds support for virtio-scsi devices.

Tested targets are scsi-hd, scsi-cd, scsi-disk, scsi-block and
scsi-generic where scsi-hd and scsi-cd are default virtio-scsi variant.

It's possible to use other targets in specific tests by forcing
drive_format_$DISKNAME = "scsi-generic".

NOTE: scsi-block and scsi-generic are passthrough devices and can
      be used only with physical HW (/dev/sd*, resp. /dev/sg*)

Signed-off-by: Lukas Doktor <ldoktor@redhat.com>
virt.kvm_vm: Give default value to cdrom_format

Sometimes, cdrom_format might not be set, making
a check for virtio-scsi disks to fail, since the
default value for no param is None, and None can't
be checked for startwith some pattern. Fix it by
simply giving the default value of '' to this
parameter.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt config: Unify libvirt and kvm configs + driver_type v2

Implemented tests-shared.cfg.sample in libvirt to match KVM test.

Added config key for connect_uri to allow specifying remote
uri's when the vm class supports it.  Updated comments to better explain
defaults and purpose.

Removed driver_type key because this can always be logically derived from the
connect_uri (i.e. they will never mismatch).

Added the same keys/comments to kvm tests-shared though they won't
be used.  This way the only differences in this file between libvirt and kvm
is the /tmp/... pathnames.  This keeps door open for possibility this sample
file can be merged into a shared file in the future.

Changes from v1:
 * Fixed other places that were still making reference to
   LIBVIRT_XEN, LIBVIRT_QEMU and other constants.

Signed-off-by: Chris Evich <cevich@redhat.com>
libvirt: Enhance virsh_migrate test

Updated *migrate() functions and test code to support flexable
multi-iteration bi-directional migration testing.  By default
it just reverses source and destination, but it also supports
specifying reversal options for more advanced testing.

Signed-off-by: Chris Evich <cevich@redhat.com>
libvirt: virsh_migrate comments and logging enhancements v2

Changes from v1:
 * Fixed syntax problems
 * Removed unused imports
 * Reindented the file, prunning whitespace

Signed-off-by: Chris Evich <cevich@redhat.com>
Virt: fix kvm_vm.VM.add_cdrom() when format=None

virtio-scsi commit a9ea704a5f262b03d020f853c24d8b2117afc6a3
introduced a condition that fails when no "cd_format" option is
passed in the configuration file, which happens in the default
qemu_kvm_f16_quick test set.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
kvm_vm: Amend b69c24346f912bb00ad25a6f6206b8c3afb2a865

There was yet another place that needed to be replaced
with the variable cd_format.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt: Fix using iso9660 module for xen

Commint 3b7fe85 introduced iso9660 module for handling cdrom isos. However, it just replace mounting iso with class handling work with iso. This is required forkvm based libvirt tests. Xen based tests uses special handling as cdrom is not as easily usable as with kvm. Missing mount in specified directory cause test to failed.

This patch add missing handling required for xen. Unfortunately, this is kernel based solution requiring root priviledges.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
virt: Fix 2.5+ syntax usage in libvirt_vm.py

Commit 5734af00 uses scheme from libvirt uri to identify hypervisor autotest is running on. To get scheme string "urlparse.urlsplit().scheme" expression is used. However, using touple attributes to access values of urlsplit touple is feature introduced in python 2.5 so it breaks run on system with python 2.4 (e.g. RHEL 5).

This patch uses array index access for getting requested value.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>