client tests: Introduce libvirt_tck wrapper

    This is an autotest wrapper based on the released
    TCK version 0.1.0.

     *Sys-Virt-TCK-v0.1.0.tar.gz  libvirt-tck tarball
     *control
     *default.cfg
     *ks.cfg
     *libvirt_tck.py
     *testcase.cfg

Signed-off-by: Guannan Ren <gren@redhat.com>
tests.cgroup: Fix cfg parameters

This patch solves the problem with smp parameter.
* cpu_cfs_util - test creates the first VM instead of preprocess
* cpu_share - 'cgroup_use_max_smp' cfg parameter let test calculate smp
* cpuset_cpus - when cpusets is defined it calculates smp from it. Otherwise
                user can force test to set smp by cgroup_use_half_smp.
                When nothing is specified it tries to run on current VM(s).

Signed-off-by: Lukas Doktor <ldoktor@redhat.com>
client.tests.cpu_hotplug: Fix test execution and parsing

As it was, the cpu_hotplug test was executing the lhcs
suite main entry point and checking its return value.
However, the suite was not well structured, and it will
return 0 even if the subtests failed.

So worked on the suite itself and created a patch
that makes it comply with the rules stablished by
the testsuite author:

http://cpansearch.perl.org/src/BRYCE/Test-Parser-1.3/lib/Test/Parser/LHCS.pm

Also, made the autotest wrapper to parse correctly
the test suite output. Now it should execute and
actually report failures during the test execution.

Some of the testcases were disabled, since they
describe a behavior in the userspace program sar
that I can't reproduce with any sar available in
Fedora or RHEL 5-6 to date, and one of the testcases
does require a linux kernel tree for kernel
compilation.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
kernbench: Bump kernel version used to 3.2.1

The version 2.6.11 does not compile anymore on older
distros, asking for an update.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Disable drive_cache for xen hvm installation

Commit b6bb71130 fix using drive_cache option. However, this is not
supported by xen qemu and so breaks xen hvm installation.

This patch unset drive_cache so it is not used for hvm installation.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
common_lib.base_utils: Fix spelling errors.

Signed-off-by: Vinson Lee <vlee@twitter.com>
virt test: Make cpus check pattern configurable

The cpus info output from monitor is different between human
monitor and qmp monitor, so make it configurable to fit different
cases.

changes from v1:
  - typo fix
  - Add default value for the pattern. Use the pattern for human
    monitor as default
  - Add comments in base.cfg.sample for the value of qmp monitor

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
memory_api: Do not recreate the temporary test directory.

The directory has already been created by base_test.

Fixes OSError exception.

Signed-off-by: Vinson Lee <vlee@twitter.com>
dhclient failed in nic_bonding cases V3

Before dhclient, we need to check if it has been running,and then kill it

Signed-off-by: Lei Yang <yanglei.fage@gmail.com>
Add three test cases for "virsh capabilities" command

This patch adds three test cases for "virsh capabilities" command.

Use three cases:(1) Call virsh capabilities
                 (2) Call virsh capabilities with an unexpected option
                 (3) Call virsh capabilities with libvirtd service stop

Signed-off-by: Gu Yanhua <guyanhua-fnst@cn.fujitsu.com>
Add configuration for "virsh capabilities" test

This adds configuration for "virsh capabilities" test.

Signed-off-by: Gu Yanhua <guyanhua-fnst@cn.fujitsu.com>
deps: Update stale tarball links.

Signed-off-by: Vinson Lee <vlee@twitter.com>
apache: avoid globally modifying /media serving

When attempting to serve a sles11-sp2 install from cobbler on the same
host as autotest, I got 404s for

http://<server>/cblr/links/sles11-sp2-suseboot-ppc64/media.1

with httpd complaining:

File does not exist: x/usr/lib/python2.7/site-packages/django/contrib/admin/media/.1

This is because of the django directives from autotest being global to
apache's configuration, so they affect more than just autotest's
installation. Fix this by pushing the RewriteRules under the Location
tag.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
client.tests: Introduce libvirt-test-api wrapper

Introduce a wrapper for the libvirt_test_api. This
testsuite is a functional suite for libvirt, that
makes use of the python bindings available.

Some base config files are provided so the user
can tweak appropriately before running the test.
The tests currently cover:

 * domain: all classical lifetime operations, installation of
various guests OSes, snapshots
 * interfaces: define, create, destroy, undefine, NPIV
 * virtual networks: define, create, destroy, undefine
 * storage: regression tests for most storage types and
configurations dir, disk, netfs, iSCSI, multipath

Signed-off-by: Guannan Ren <gren@redhat.com>
virt test: Add qemu-io class

Add qemu-io class to provide interface for tests to execute qemu-io
command.
There are two kinds of qemu-io execute way:
  - QemuIOShellSession: Provide a shell session to execute qemu-io
    operates continuously
  - QemuIOSystem: Execute qemu-io command which will return
    immediately. Mainly for qemu-io -c, -h and -V

changes from v1:
  - typo fix
changes from v2:
  - Add function get_cmd_line to reduce the reduplicate code
  - remove useless lines
  - Use qemu_io_binary to get qemu_io from params

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
KVM test: Add qemu-io blkdebug test

This test will check if the error output from qemu-io is fit the
blkdebug.cfg. Steps as following:
    1. Create image with given parameters
    2. Write the blkdebug config file
    3. Try to do operate in image with qemu-io and get the error
       message
    4. Get the error message from perror by error number set in
       config file
    5. Compare the error message

If you want to make up your own qemu-io blkdebug test with different
error event. You can modify these parameters:
  err_event: the error event will write in blkdebug.cfg
  err_command: the command running in qemu-io which will trigger
the error event

changes from v1:
  - Use ConfigParser to generate the blkdebug.cfg file from the
changes from v2:
  - Update the interface
  - Remove the useless line and fix and make the variable name
    more clear

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
virt tests: Add test for removing guest

Running libvirt test with sample configuration create guest that stays
in system after the test. This complicate running test again. For xen is
this issue bigger complication as it does not allow to run pv and hvm test
in one run (second of them will fail as name exists).

This patch adds simple test 'remove_guest' that take care of removing guest
from system. This test is added to sample configuration of libvirt too.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
virt.kvm_vm: Fix shell_prompt regular expression not passed to "ShellSession"

if we don't pass the shell_prompt to the class "ShellSession",
it will use the default one from __init__ of "ShellSession",
if it doesn't match it, it will cause a failure.

Signed-off-by: Lei Yang <yanglei.fage@gmail.com>
virt: subtests.cfg.sample - Add "only Windows" to ntttcp testcases

So far, this testcase is designed for Windows,
so add "only Windows" in the config file to make
sure linux guest not run it.

Signed-off-by: Lei Yang <yanglei.fage@gmail.com>
virt.kvm_vm: Extend SPICE support

The past SPICE support was covering only old qemu-kvm and it's not
working any more with recent qemu

Added SPICE features (configurable qemu-kvm options):
* QXL: configurable memory for qxl
* SSL :x509-dir, x509-key-file, x509-cacert-file, x509-cert-file,
* x509-key-password, tls-port, tls-ciphers, secure-channels
* SSL: added virt_utils.create_x509_dir() which creates required
* certificates for x509 options
* Compression: image-compression, jpeg-wan-compression,
* zlib-glz-wan-compression, playback-compression
* Networking: ipv4, ipv6, addr
* Other: agent-mouse

Modified:
* QXL: replaced old way of defining number of qxl devices qxl=n ->
* -device qxl
* QXL is now being trough in kvm_vm.add_vga()
* VGA: vga = std is now defined in base.cfg.sample (removed from
* -nodefaults in kvm_vm.py)
* drop add_qxl_vga() into favor of add_vga() (+ add_qxl() in case that
* user defined qxl memory or extra qxl devices)

Signed-off-by: Lubos Kockman <lkocman@redhat.com>