client.tests: Add new autotest_regression module

Add a new autotest_regression module, tailored to
perform some quick, basic checks against the autotest
tree. It leverages the new install_distro_packages
API to try installing the appropriate package in
some popular distros.

The plan is to expand this check routine, to include
things like basic automated assessment of the health
of the web and cli interfaces.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt: Add iscsi module

This patch add iscsi support module in framework. It can handle
 the basic operations of iscsi such as connect, login and get
 the device name. And also can init an emulated iscsi in local.

 Iscsi class can be use for both real iscsi device or emulated iscsi
 device just with different params, such as:

   - Real iscsi device:
         params = {"target": $target_name,
                   "portal_ip": $server_ip,
                   "initiator": $initiator_name}
   - Emulate iscsi device:
         params = {"emulated_image": $file_path_in_local,
                   "target": $target_name,
                   "image_size": $file_size}
 You can use it easilly with these steps:
     - Init your params for different type of iscsi device
       iscsi = Iscsi(params)
     - Login
       iscsi.login()
     - Get device name
       iscsi_device = iscsi.get_device_name()
     - Clean env after you finish your tests
       iscsi.cleanup()

Also provide more functions as get_target_id() and so on.

Move the generate_random_string() from software_manager to
base_utils as it maybe widely used by other modules.

changes from v3:
  - Fix unreferenced variable bug
  - Adding shebang and executable permissions to unittest
  - Miscellaneous fixes
changes from v1:
  - Fix some typo and mistakes
  - Use the implement of generate_random_string in virt_utils which
    has more implementations
changes from v2:
  - Change some bad function name
  - Add stubs with mock in iscsi_uinttest

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
virt: Add iscsi support for virt cases

Add iscsi support for virt cases. It should make most of the cases
can run with real iscsi and emulate iscsi devices. Still have some
cases which deal with the image object inside cases may need modify
to suitable to support iscsi. Comments the related params as default
Please setup them according your environment.

changes from v2:
  - Fixed incorrect class name call on virt_env_process
  - Fixed indentation error

changes from v1:
  - typo fix
  - use super() when init Iscsidev in kvm_storage
  - add the device_id for formated iscsi devices as the partition
    number.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
virt: move virtual disk related utility functions to a separate module

Making that code available to other tests and utilities.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
virt: introduce virt_disk.py tool

Simple tool that wraps the functionality in virt_utils_disk.py that
creates virtual disk images for floppy, cdrom, etc.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
frontend.afe.rpc_interface: Fix incorrect call to rpc logger

On commit c7af4524, the idea was to log to the rpc server
logger when a given hostname was not registered on the
available install server, but referred to the wrong object
(it was getting the rpc server logger object defined on
rpcserver_logging, which is in fact None). Fix this by
retrieving the actual rpc_logger singleton using a standard
logging API.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
utils/check_patch: Introduce return codes

The autotest_regression test relies on the return code
of the utilities check_patch and unittest_suite to
determine success or failure, but check_patch does not
return exit code != 0 in case a problem was found with
a given file. So let's add the return code.

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