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>
libvirt: Adapt the remote config in base.cfg to existing tests.

Since there are several tests in libvirt are using ENTER.YOUR as
the default configuration of remote, we should add this substring
into base.cfg.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
libvirt-virsh: Add remote_pwd into VirshPersistent.__slots__.

If 'remote_pwd' is not in __slots__, we can not pass a remote_pwd
into VirshConnectBack and VirshPersistent, so that we can not connect
to a remote host with password. Same reason to 'remote_user'.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
libvirt_xml.pool_xml: Fix PoolXMLBase class.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
virsh: Add readonly param in __init__ of VirshSession.

As there is no param about readonly for VirshSession, then we
can not create a readonly Virsh session. This patch add a param
in __init__ of VirshSession class and pass readonly in new_session()
of VirshPersistent. Then we can create a readonly VirshSession and
a readonly VirshPersistent.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
virt: Add 'debug' paramter to print result in VirshSession.cmd_result()

Signed-off-by: Li Yang <liyang.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>