KVM Test: Add qmp_command test.

This script have coverd following qmp command:
query-hpet, query-kvm, query-mice, query-status
query-name, query-uuid, query-version, query-chardev
query-blockstats, memsave, pmemsave, query-cpus
cpu, query-vnc, query-block, query-commands
query-balloon, balloon, cont, stop
and a negative test with wrong command.

This script will check result by following way:
cmd_result_check = equal, will compare cmd_return_value with qmp command output.
cmd_result_check = contain, will try to find cmd_return_value in qmp command output.
cmd_result_check = m_equal_q, will compare key value in monitor command output and qmp command output.
cmd_result_check = m_in_q, will try to find monitor command output's key value in qmp command output.
cmd_result_check = post_contain, will try to find cmd_return_value in post command output.

This update is base on upstream QMP patchset.

Changes from v1:
Bug fix and update according to ldoktor's comment

Signed-off-by: Feng Yang <fyang@redhat.com>
KVM-test: Add format check for qmp_command test
Signed-off-by: Yiqiao Pu <ypu@redhat.com>
qemu.tests.cfg: Add config for qmp_command.py test script.

Signed-off-by: Feng Yang <fyang@redhat.com>
qemu.tests: Make qmp_command suitable for more host

List some case only Host_RHEL.6
Do not run these case in RHEL3, RHEL4 guest.
Reconfig qmp_query-mice test case.
Rename qmp_device_add to qmp_redhat_device_add.
Re-design qmp_command.qmp_query-version test case

Signed-off-by: Feng Yang <fyang@redhat.com>
virt: Added GithubIssues tool/module/class and example

Signed-off-by: Chris Evich <cevich@redhat.com>
virt: Improve github_issues and examples

* Be less pedantic about re-formatting already cached data
* Added 'url' key to standardized issue format
* Added two useful sample report scripts

Signed-off-by: Chris Evich <cevich@redhat.com>
virttest.build_helper: Add remote origin and submodule init

Add the proper origin, and fetch submodules for git repos,
that'll make it possible to build QEMU with spice support
from source.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
qemu/cfg/build.cfg: Remove qemu-kvm and add spice-common repos

QEMU-KVM is no more, and spice was split in spice common and
protocol, so let's update the build.cfg file with that
information.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
lib namespace: Remove unnecessary init files

Those files were added there mainly to mirror qemu,
since that is used as a module, since for that
case we do use things like

from qemu.tests import block_copy

That's not needed for libvirt, and we'd like to
dump it from qemu as well, although it needs
more care.

This solves a problem where it's not possible
to import the python library bindings on virt-test,
since the libvirt module present in virt-test would
take precedence over the library installed system
wide.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
to add nodememstats function
to add configuration file for virsh nodememstats testcase
to add testcase file for virsh nodememstats command
virttest.qemu_vm: Remove init_pci_addr from VM.

Now vm.init_pci_addr is effected by previous vm.

We set init_pci_addr to 3 in multi_disk.max_disk, but this case still
fail for:
VMPCIOutOfRangeError: Too many PCI devices added on vm 'virt-tests-vm1',
 max supported '31'

because previous case use default value 4.

As init_pci_addr only used in get_free_pci_addr, so remove it from vm
 and only get init_pci_addr in get_free_pci_addr().
Also set default for init_pci_addr to 3.

Signed-off-by: Feng Yang <fyang@redhat.com>
kill_app.py: Kill selected application

This test is substitution (successor) for tests like rv_disconnect
where the one and only purpose is to kill application and
check exit code.

Signed-off-by: Vaclav Ehrlich <vehrlich@redhat.com>
rv_disconnect: Remove test

This test is substituted by kill_application test.

Signed-off-by: Vaclav Ehrlich <vehrlich@redhat.com>
rv_video.py: Spice video test

Test of video playback. Could be played in loop/one time,
fullscreen/windowed.

Signed-off-by: Vaclav Ehrlich <vehrlich@redhat.com>
rv_connect: SSL, audio, smartcard, ipv6, menu updates.

- remove kill_all function
- support for 4 tests for host subject values for ssl tests
 Testing: valid explicit host subject value, valid implicit host subject value,
 invalid explicit host subject value, invalid implicit host subject value.
- enable connecting using menu and not cli
 Done by adding a new parameter (rv_menu) and handling it accordingly
 Also renames and modifies send_ticket(), as this function is now
 more generic and allows sending of arbitrary strings; the new
 function might later be moved to qemu_vm.py or some utils
- add support for disable audio option
- add support for smartcard options
- add possibility to connect to ipv6 address

Signed-off-by: Tomas Jamrisko <tjamrisk@redhat.com>
Signed-off-by: Vimal Patel <vipatel@redhat.com>
Signed-off-by: Marian Krcmarik <mkrcmari@redhat.com>
virttest/qemu_vm.py: spice related updates.

- add support to add the ip address for SSL Host Subject tests.
- add support for semicolon
- fix used port if VM running
 Previously, when the VM was already running the spice_port for the
 VM was automatically generated anyway -> VM had incorrect parameters
 and connection failed.
 This patch makes sure, that spice_port with which the VM got created
 will persist between launches of autotest.
- suppport to set VM listening address.
 Listening address can be none, explicit ipv4 or
 an explicit ipv6 address.
- add getting spice info from the qemu monitor
- add devices needed for smartcard support

Signed-off-by: Vimal Patel <vipatel@redhat.com>
Signed-off-by: Tomas Jamrisko <tjamrisk@redhat.com>
tests/rv_audio.py: Adds rv_audio test

This tests audio between client and guest

Signed-off-by: Tomas Jamrisko <tjamrisk@redhat.com>
unattended/RHEL-6.3.ks:

- testing audio requires a loopback device
 This loads alsa loopback kernel modules by default at each start
 of our VMs.
 Note, that this does not modify the default devices.
- add Smart Card support packages to the VMs for testing
- add possibility to shutdown VM under test user

Signed-off-by: Tomas Jamrisko <tjamrisk@redhat.com>
Signed-off-by: Vimal Patel <vipatel@redhat.com>
Signed-off-by: Marian Krcmarik <mkrcmari@redhat.com>
utils_misc.py: Add function to convert ipv4 address to ipv6 format.

Signed-off-by: Vimal Patel <vipatel@redhat.com>