virttest: Call utils_net.update_mac_ip_address() in vm.create() when mac_changeable set to yes

Sometime we directly call vm.create() to create a VM. mac_changeable could not work
in this situation. As it only used in qemu test so move utils_net.update_mac_ip_address()
to vm.create() function.

If other test need support mac_changeable later, we can call  update_mac_ip_address
in its start() function.

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest.staging.service: Introduce a class named Factory.

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

Relationship of the classes in service module.

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

* Factory provides two interfaces to create service.
    * create_specific_service to create _SpecificServiceManager.
    * create_generic_service 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 to create _GenericServiceManager.

Outline of Factory class:
                                                  Factory
                                                     |
            ---------------------------------------------------------------------------------------
            |                                        |                                            |
create_specific_service          	create_generic_service                 		  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>
staging: Add staticmethod create_service in Factory.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
virt: Adapt nfs to Factory of service.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
staging: adapt utils_cgroup to Factory in service.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
virt: adapt lvsbs to Factory in service.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
lvsbs: Add more comment for self.service in __init__().

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
staging.service: Add more comment for class Factory.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Add test providers directory

The test-providers.d directory concentrate test provider
resources, such as configuration files, download directory
and the final test filesystem location itself.

What is a test provider?

It is a directory with .py test files and .cfg config
files, plus test resources, that will be the sources
of tests inside virt-test. The test suite tracks which
providers are available by looking into .ini files that
contain information about them, such as where they are
located in, their names and what types of virt tests
they contain. A README file in the test-providers.d
directory explains how the .ini files are structured.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.data_dir: Remove unused module

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.data_dir: Add test provider dir APIs

We'll frequently need to locate providers, so this
provides an appropriate API to do that.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.asset: Add test provider related APIs

Create an API to read from all test provider resources,
and return a list of dicts with information, that will
be used to download them. Also, add APIs to download
said test providers.

Use the autotest API autotest.client.test_config, so we
can make the functions more concise. Take the time to
make get_asset_info() shorter using this API.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
run: Add --update providers option

Instead of having test providers to be updated every
time the suite executes, update them only if asked to.

Introduce the needed hooks in the bootstrap function to
have the test providers installed on the 1st virt-test
execution.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.data_dir: Add get_backend_dir API

It is very frequent that we want to find out where a
given test backend dir is. So introduce that API, that
can be used when moving all the top level test dirs to
/backends.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.data_dir: Introduce get_backend_cfg_path API

Since it is also a fairly common operation inside the
test suite to find a file inside the config directory
of a given test backend.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Move all virt backend directories to 'backends'

In order to organize the backends used in virt-test,
currently:

 * qemu
 * libvirt
 * v2v
 * openvswitch
 * libguestfs
 * lvsb
 * generic (in fact, code that can be used among
            multiple backends)

Move them to a sub directory 'backends'. Make the
necessary adjustments in the code to load tests
properly.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.asset: Add get_known_backends() function

That is far better than keeping an inventory of them
manully.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.standalone_test: Look for tests in test providers

Rather than in backend dirs.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.bootstrap: Filter all top level cfg dirs on config filter

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.asset: Change get_all_test_provider_names name and behavior

With just a little more effort, we can get test provider
names by backend, rather than simply a dumb list. So
get_all_test_provider_names changes to get_test_provider_names
and we can optionally filter by backend.

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