client.base_utils: Remove probe_cpus()

This function is unused, unmaintained since 2008 and IMO broken,
thus it should be removed.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
client.kernel_config: Fortify feature_enabled

Make feature_enabled work with manually modified config files.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
install: move mysql configuration until after it has been installed as a dependency.

If mysql isn't already installed the `setup_mysql_service_rh` and
`restart_mysql_rh` functions fail.  Mysql is installed as a dependency in
`install_packages`, so move the functions after `install_packages`

Tested on a Fedora 18 ISO "minimal" install VM.
Not tested on debian.

Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
frontend/afe/reservations_unittest.py: requires Django

This test was left out of the list of tests that requires Django.
Putting it there now, so that running the unittest suite (without
the --full option) doesn't give false positives.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Syncing to the latest client tests

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
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>