libvirt.tests: Enhancements of stress migration tests.

* Support migration in thread for expanding.
* Fix bugs and some pylint problems.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
libvirt.tests: Add cross migration test for virsh_migrate_stress.

Cross migration:
local     =====      remote
           <-         vm1
vm2        ->
~~
           <-         vm2
vm3        ->

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
libvirt.tests: Add migration testcases when vms are booting.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
libvirt.tests: Expand stress type for migration stress test.

 * Seperate cpu and memory stress of stress tool.
 * Add timeout parameter for migration threads.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
libvirt.tests: Running stress tool on host for stress migration.

Do migration when stress tool is running on host:
1.Half of total memory is consumed.
2.Host is short of memory(Free memory is not enough for vms.)

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
libvirt.tests: Add network check after migration for stress migration test.

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

Various changes to make the test function:
    Adjust the read process cmdline based on the knowledge that on
        Fedora 18 or later host, the qemu-kvm command line argument
        can be changed to be "qemu-system-x86_64 accel=kvm"
    Adjust the splitting of the command line from a list of each element
        that was separated by a space to a more ordered and natural
        looking list of items with "-option [arg]" on one line rather
        than adjacent "-option" "argument" elements
    Adjust the logic to perform better diffs using sets and determining
        what is in one list and not the other
    If differences are found, print them and in which order to make for
        easier debugging of problems

Signed-off-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
virttest.libvirt_storage: Add define_disk_pool function for StoragePool class.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
v2v.tests: Support disk type pool for local virt-v2v test.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
qemu.test: Restructure balloon_check

Now have two different class for Windows and Linux balloon test. Most of the
functions in these classes are same and inherit from class BallooningTest.
They have different error_report and get_memory_status. Also add some different
method to set ballooned memory in cfg files. Now the ballooned memory size also
can be set by a given value or a ratio base on the assign memory value.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
qemu.test.cfg: Add a balloon check case with fixed value.

This case follows the following steps:
ballooned memory to 1/2
do guest s3
ballooned memory to 3/4
do guest s4
ballooned memory to 7/8

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
README.rst: Making python-gstreamer required pkg more prominent
Introducing samples directory

The samples directory is supposed to contain example
tests that one can use as a test skeleton, so they can
get started by simply typing

cp samples/template.py tests/new_test.py

And start editing their new test.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
README.rst: Adding first new test docs

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt: Make test can create env file on its own directory

When I execute libguestfs tests, "libvirt/env" will be updated/created,
there is no env file created in "libguestfs/".So do this modification to
make env file can be created/updated in "libguestfs/" and other test
directory.

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
qemu: Add sr_iov_irqbalance test case.

This case check whether irqbalance service works in guest with vf/pf.

Signed-off-by: Feng Yang <fyang@redhat.com>
use blacklist instead of whitelist to filter out unsupported platform

so even there's new release we dont have to modify the cfg
and watchdog device is supported on all Linux distro

Signed-off-by: Xiaoqing Wei <xwei@redhat.com>
libvirt: rename all libvirt tests from virsh_* to virsh.*

This rename is useful for testers who wants to run only virsh tests
and don't wan't to write list of all available tests. Now to run
all virsh tests just execute './run -t libvirt --tests=virsh'.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
virt-libvirt: Remove all virt_test_type Params

Signed-off-by: Chris Evich <cevich@redhat.com>
virttest.staging.service: Introduce a class named ServiceManagerFactory.

Introduce a class named ServiceManagerFactory to create kinds of service manager.
* Class ServiceManagerFactory provides two staticmethod to create generate service manager
and to create specific service manager.
* Internal class named FactoryHelper to provide some help method for ServiceManagerFactory.

Relationship of the classes in service module.

                                        service
                                           |
                          -------------------------------------
                          |                                   |
               _GenericServiceManager                _SpecificServiceManager
                          |
            -----------------------------
            |                           |
      _SystemdServiceManager   _SystemdServiceManager

* ServiceManagerFactory provides two interfaces to create service.
    * create_specific_service_manager() to create _SpecificServiceManager.
    * create_generic_service_manager() to create _GenericServiceManager.
      * FactoryHelper provides a method get_service_manager_type() to
      auto detect the system type and return constructor of
      _SystemdServiceManager or _SystemdServiceManager.
      So, user do not have to know about the system type when they use
      create_generic_service_manager() to create _GenericServiceManager.

Outline of ServiceManagerFactory class:
                                             ServiceManagerFactory
                                                     |
            ---------------------------------------------------------------------------------------
            |                                        |                                            |
create_specific_service_manager()          create_generic_service_manager()                   FactoryHelper
            |                                        |                                            |
            |                                        |                      ----------------------------------------------
            |                                        |                      |                     |                      |
            |                                        |             |----------------------| |---------------------| get_name_of_init()
            |                                        |             |*get_specific_service_| |*get_generic_service_|
            |                                        |------------>|command_generator()   | |command_generator()  |
            |                                                      |*get_specific_service_| |*get_generic_service_|
            |                                                      |result_parser()       | |result_parser()      |
            |                                                      |----------------------| |*get_generic_service_|
            |------------------------------------------------------------------------------>|manager_type()       |
                                                                                            -----------------------

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>