samples: IPython >0.11 compatibility

Signed-off-by: Jiří Župka <jzupka@redhat.com>
client.lv_utils: Add vg_list method.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
Introduce client.shared.utils_koji

This is a library from virt-test, that is more suited to a general
purpose library, so it makes sense to have it at the autotest level.

Signed-off-by: Feng Yang <fyang@redhat.com>
service_lib: create utility classes to start/stop service for both sytemd and sys_v by autodetecting the current init proccess at PID 1

All these examples work on both systemd and sys_v_init.

```python
service_lib.auto_init_service_manager()
service_lib.get_service_manager().stop("iptables", ignore_status=True)

units = service_lib.get_service_manager().list().stdout
for s in services_to_disable:
    if re.search(r"\s" + s, units):
        logging.info("disabling %s", s)
        service_lib.get_service_manager().disable(s)
        service_lib.get_service_manager().stop(s)

lldpad = SpecificServiceManager("lldpad", service_lib.auto_create_specific_service_command_generator())
lldpad.stop()
lldpad.start()
```

The classes are split into two responsibilities, one classes generates all the
correct command lists by re-arranging the order of arguments to fit systemctl
or service, `service lldpad stop`  versus  `systemctl lldpad.service stop`

The other classes take these command generators and bind them to a
specific service name:
`lldpad.start()` or create a generic systemd or sys_v service object and
take a service name as an argument:
`service_lib.get_service_manager().stop("iptables", ignore_status=True)`

The module uses lazy initialization, in that it will detect systemd or
sys_v_init once when first accessed and will cache that value and not re-detect
`init` again.

This module mainly uses closures which are turned into staticmethods.
Test cases included.

Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
service: rename service_lib to service and hide methods and classes only exposing ServiceManager() and SpecificServiceManager() as entry points

Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
service: add docstrings to main entry point functions

Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
service: add set_target command to set the current runlevel/target using telinit or systemctl isolateo

update unit tests for set_target.

Refactor TestSpecificServiceManager to test actual filtering of
command_list in _auto_create_specific_service_command_generator.

Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
client.shared.service: Remove executable bit set on new library files
Merge autotest and virttest cgroup_utils library

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
client.shared.utils_cgroup: Apply modifications from virttest version

Apply modifications which were accepted in virttest version of this
library.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
utils/check_patch.py: fix error while formatting string

Signed-off-by: Cleber Rosa <crosa@redhat.com>
client/kernel_unittest.py: unittest fix

Signed-off-by: Cleber Rosa <crosa@redhat.com>
gitignore: remove client tests paths

Client tests are now in separate repo

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
client/kernel.py: fix various mistypes

- Pass make_opt argument during modules compilation as we do
  during vmlinux compilation
- fix mistype in apply_overrides()

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
client/kernel_unittest.py: add empty value for make_opts

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Merge pull request #683 from ldoktor/framework

Merge autotest and virttest cgroup_utils library
tko.db: Fix job status when deleting jobs

When deleting jobs, we should delete job_id instead of id in table
afe_host_queue_entries. Otherwise after deleting a job, all other
job's status were also deleted.

Signed-off-by: Wenli Quan <wquan@redhat.com>
client.shared.iscsi: Default for self.export_flag

self.export_flag is used in cleanup and has to be defined in __init__

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
client/shared/software_manager.py: use distro detection API instead

This was a leftover from the original conversion to the distro API.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
frontend/pkgdeps.py: use distro names as returned by distro.detect()

We were using the names provided by the old API (client.utils.get_os_vendor()).

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