virt-libvirt: Add virsh function for virsh cpu-stats

Signed-off-by: Kyla Zhang <weizhan@redhat.com>
virt-libvirt: Add test for virsh cpu-stats

The checkpoint including

1. When option = 'total'
   Displayed Total cpu_time >= User + System cpu_time
2. When option = 'start' or 'count'
   a. Displayed CPU's == Expected CPU's
   b. Cgroup cpu_time* >= sum of cpu_time of each cpu's displayed
3. When option has a combination of 'start', 'count', 'total'
   All the above conditions 1 & 2 are checked.
4. When option is None
   a. Displayed Total cpu_time >= sum of cpu_time of all cpu's displayed
   b. Pass condition when option = 'total' (1) is checked.

Signed-off-by: Kyla Zhang <weizhan@redhat.com>
virt-libvirt: Add configuration for virsh cpu-stats

Signed-off-by: Kyla Zhang <weizhan@redhat.com>
virt-libvirt: Skip cpu-stats on old libvirt

Signed-off-by: Chris Evich <cevich@redhat.com>
virt: Add a couple debugging messages

And fix a comment

Signed-off-by: Cole Robinson <crobinso@redhat.com>
virt: Shorten timeout to 3 mins for unattended import install

Since this mode isn't really an 'install', just libvirt-ifying a
pre-installed disk image. At most we should have to wait for the
VM to boot.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
virt: Add libvirt/env to .gitignore

Signed-off-by: Cole Robinson <crobinso@redhat.com>
virt: Try arp for non-root IP lookup

The default set of libvirt tests invoked via ./run actually work
quite well for me as non root (connecting to the libvirt session
instance). The only problem is that the initial import install test
times out, since non-root can't run tcpdump.

But we can get this info from arp, and there's already code in place
that basically does what we want, just needs a little reorg.

I'm sure the layering here isn't right, so please break out the clue
stick if neccessary.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
virt: Don't try to login to a paused guest

Since it's going to fail and just waste time.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
virt-libvirt: Use state() helper more

Signed-off-by: Cole Robinson <crobinso@redhat.com>
virt: Add 'skip_image_processing' parameter

Some of the libvirt tests at least involve virtually no guest interraction,
so being able to skip the image checks speeds things up for us. Will be used
in the next patch.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
virt: Try harder when checking guest liveness in post processing

If a quick test started the VM during preprocessing, it may not
have even finished booting up by the time we call the postprocess
login() liveness check. login() then immediately fails since the
guest doesn't have a discernable IP.

Use wait_for_login() with a short timeout to fix things, but not
lose too much time on a hung VM.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
virt: Increase postprocess login timeout

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: virsh_domid remote bufgix

Signed-off-by: Chris Evich <cevich@redhat.com>
qemu_vm: Fix is_paused() method

The verify_status() method raises an exception if the
vm state does not match the one passed to the function.
So this leads to massive failures in the qemu related
tests. Let's fix it by handling the exceptions raised
by verify_status() properly.

CC: Chris Evich <cevich@redhat.com>
CC: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
cartesian_config.py: add -r option for "repr mode"

This will allow us to generate output files in a format that can be parsed
using Python.

Signed-off-by: Eduardo Habkost <ehabkost@raisama.net>
cartesian_config: very simple unit test file

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
cartesian_config_unittest: Check using config file dump

Add the dump of a combination of very complex config files, and
check if the results match the config file dump exactly.

Signed-off-by: Eduardo Habkost <ehabkost@raisama.net>
tests.virtio_console: reorganize cfg

In order to be able to run all virtio smoke tests easily I added
virtio_console_smoke variant with all related subtest inside.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
qemu.virtio_console: Add negative boot test with too much ports

Set more than allowed number of ports per virtio-serial-pci.

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