The systemctrl ststus command does not work on all distirbutions. Add a check to see how to get the status.

Signed-off-by: Ray Spear <ray.spear@hp.com>
contrib/install-autotest-server.sh: Fix py 2.7 bug only if installed

Only try to work around a python 2.7 + selinux bug
if it is installed on the system.

Signed-off-by: Ray Spear <ray.spear@hp.com>
conmux/ivm: use immediate reboot rather than delayed

Delayed reboots use EPOW, which does not always result in a shutdown of
the LPAR. Use the more sever immediate shutdown, to ensure the LPAR goes
down. This matches the HMC code.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
virt: add two scripts to disable services for perf tests

System services on guest and host take uncertain resource, it effects
the perf results. We can use the below two scripts to disable some
services of host and guest.

rh_stop_serivices.sh is used to stop the running serivices.
rh_off_service.sh is used to off services when host starts up.

We can use them to prepare environment for performance testcases.
Using scripts can split the environment preparation with real testing,
it's easy to maintain.

Those two scripts are prepared for RHEL/Fedora system, it's just an
example. Users can reference those to create their own scripts.

Signed-off-by: Amos Kong <akong@redhat.com>
virt: introduce services_setup()

Introduce services_setup() to setup services in guest/host.

Host reboot is not supported in client tests, you can submit
a job to setup host env, reboot host, then execute real tests.
The best solution is integrating this to kickstart.

example tests.cfg:
.. variances:
..     - prepare_env:
..         only boot
..         stop_services_script = scripts/rh_stop_services.sh
..         off_services_script = scripts/rh_off_services.sh
..     - perf_tests:
..         only ntttcp.guest_guest netperf.exhost_guest

Signed-off-by: Amos Kong <akong@redhat.com>
virt: pinning guest cpus to a numa-node

Currently we only pin guet memory to a numa-node,
taskset is used to pin vcpu thread to pyshical cpu core.
This patch pins guest cpus to a numa-node.

man page of numactl:
 --cpunodebind=nodes, -N nodes
   Only execute command on the CPUs of nodes.  Note that nodes may
   consist of multiple CPUs.  nodes may be specified as noted above.

Signed-off-by: Amos Kong <akong@redhat.com>
Fix wrong reference to image functions

Now that they were moved to virt_utils.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt.qemu_io: Make QemuIO inherit from object

Constructs like

MyClass():

Without explicit inheritance are not allowed on py 2.4.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
kvm.tests.qemu_io_blkdebug: Fix up use of python > 2.4 construct

Replace it with a larger, more boring, but nevertheless,
working python 2.4 implementation.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
cobbler support: check profile and support arbitrary number of installation attempts

Check if the profile set on the resulting system is identical to the
one requested. If not, give the system another go at installing the
chosen profile. Also, add support for setting the number of installation
attempts.

This is related to github issue #279.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
tko: Improve autotest-db-delete-job

It was pointed out that autotest-db-delete-job was not
a complete solution for issue #123, since:
 * It didn't work if you already had removed the job dirs
 * It assumed a fixed autotest user
 * It didn't remove the jobs from the test view

This patch solves the remaining issues, now the tool
is more complete in usefulness for people wanting to
prune the results of a job.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
tko.autotest-db-delete-job: Try to completely remove job dir

Usually, the job tag looks like [number]-[user]/[machine].
Let's download the parent [number]-[user] parent if possible

As a result, the script won't leave empty job result
directories.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt: integrate perf tunning to env script

This patch integrate rh_off_services.sh and rh_stop_services.sh to
one script, and ded setup of arp_filter, bridge, runlevel.

Signed-off-by: Amos Kong <akong@redhat.com>
virt: update services_setup()

Signed-off-by: Amos Kong <akong@redhat.com>
virt: use services_setup() in tests

This patch uses services_setup() in reboot/netperf to
setup environment.

We might use disk snapshot in netperf test when boot up
more than one guests, setup would not effect, so
execute a reboot test and setup env at that time.

example tests.cfg:
.. variances:
..     - prepare_env:
..         only reboot
..         rh_perf_envsetup_script = scripts/rh_perf_envsetup.sh
..         rebooted = none
..     - reboot_host:
..         # host needs reboot, client test doesn't support it, you can
..         # submit two jobs, one for env preparation, one for real test)
..     - perf_tests:
..         only netperf.exhost_guest
..         rh_perf_envsetup_script = scripts/rh_perf_envsetup.sh

Signed-off-by: Amos Kong <akong@redhat.com>
cobbler support: fix typo when parsing the configuration file

The last patch had a typo and was fetching the number of attempts
from the 'type' entry in the config file, instead of the obvious
'num_attempts' entry.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
kvm test: Parametrisation of multi_disk test

This patch makes multi_disk test more flexible. You can use
stg_params variable to set all kinds of setups. As example
I added few tests for virtio_scsi disks and all_drive_format test.

stg_params is a space separated set of parameters of newly added
disks. Every parameter have to have a name and after ':'
it can be ',' separated list of words or 'range(...)'.

range() is similar to python range(), but it supports 4th argument,
which multiplies occurrence of each value:
range(0,2,1,2) => [0,0,1,1]
Also range() supports 'n' which is substituted later to fit the
number of disks. See the code for details.

Signed-off-by: Lukas Doktor <ldoktor@redhat.com>