run: Add qemu specific options --nettype and --netdst

If you need to use bridge and tap devices for some
specific reason, now it is possible to specify those
options through the parser command line.

If you do choose --nettype = bridge however, you must
run the execution script as root, and we enforce that
restriction.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
run: Add general option --mem (-m)

Make it possible to specify the main vm's memory through
the parameter --mem (shorthand -m).

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
kvm_vm: Clean network resources upon create_qemu_cmd failure

If an exception happened when assembling the qemu cmd
(for example, unsupported cmdline flags for that
particular qemu version), clean up any tap fd open
for each nic.

This is the more proper solution for the issue first
mentioned here:

https://github.com/autotest/autotest/issues/520

That Gerd hit while running the usb related tests
in the code using RHEL 6. This patch finally makes
the usb tests properly pass when using bridge:

[root@virtblade02 virt-test]# ./run -t kvm --nettype bridge --tests "boot_with_usb reboot_with_usb"
SETUP: PASS (1.55 s)
DATA DIR: /var/lib/virt_test
DEBUG LOG: /root/virt-test/logs/run-2012-12-24-00.27.31/debug.log
TESTS: 20
(1/20) boot_with_usb.ehci: PASS (22.82 s)
(2/20) boot_with_usb.keyboard.uhci: PASS (27.84 s)
(3/20) boot_with_usb.keyboard.xhci: SKIP
(4/20) boot_with_usb.mouse.uhci: PASS (26.95 s)
(5/20) boot_with_usb.mouse.xhci: SKIP
(6/20) boot_with_usb.usb_audio: SKIP
(7/20) boot_with_usb.hub: PASS (27.07 s)
(8/20) boot_with_usb.storage.uhci: PASS (27.76 s)
(9/20) boot_with_usb.storage.ehci: PASS (27.86 s)
(10/20) boot_with_usb.storage.xhci: SKIP
(11/20) reboot_with_usb.ehci: PASS (62.71 s)
(12/20) reboot_with_usb.keyboard.uhci: PASS (64.18 s)
(13/20) reboot_with_usb.keyboard.xhci: SKIP
(14/20) reboot_with_usb.mouse.uhci: PASS (63.01 s)
(15/20) reboot_with_usb.mouse.xhci: SKIP
(16/20) reboot_with_usb.usb_audio: SKIP
(17/20) reboot_with_usb.hub: PASS (63.05 s)
(18/20) reboot_with_usb.storage.uhci: PASS (64.08 s)
(19/20) reboot_with_usb.storage.ehci: PASS (64.16 s)
(20/20) reboot_with_usb.storage.xhci: SKIP

CC: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
reorganize usb tests variants

Create a new "usb" test and move over all usb subtests step by step.
Reduce duplication and allow to run usb tests with a simple --tests=usb

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: add usb-host test

Add test for usb-test (aka pass through).  Requires a physical usb device,
which must be specified in the configuration.  When unconfigured the test
raises TestNAError so the runner flags the test as skipped.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: add hotplug test

Add a test which plugs and unplugs (virtual) usb devices.
Configured to run with the same set of devices we do
boot+reboot tests with.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
tests.multi_disk: fix vm params and root_dir

1) vm.create() have to force new params.
2) use data_dir instead of vm.root_dir for image absolute path

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
Adding the main test for spice logging tests.

rv_logging will test the logging of the qxl driver and spice_vdagent daemon on the guest machine.

Signed-off-by: Vimal Patel <vipatel@redhat.com>
tests-spice.cfg: Adding the tests for logging & normalizing the variant names.

Normalizing the variant names to be all lowercase
and use underscores to be consistent throughout the file.
Added the logging tests for spice (spice_vdagent and qxl).

Signed-off-by: Vimal Patel <vipatel@redhat.com>
virttest/kvm_vm.py: Support keyword "generate" for spice ports.

Assigning "None" to spice_port parameter does not lead to
generating a free spice port when specific value has been
assigned in previous tests of one autotest run.

Signed-off-by: Marian Krcmarik <mkrcmari@redhat.com>
virttest/utils_spice.py: Add function for launching startx.

Adding function widely used in rv_* tests and
ingoring some exceptions which are most likely caused by
color console output.

Signed-off-by: Marian Krcmarik <mkrcmari@redhat.com>
tests/rv_copyandpaste.py: Use launch_startx function from utils_spice.

Signed-off-by: Marian Krcmarik <mkrcmari@redhat.com>
tests/rv_input.py: Minor fixes

- fix condition of wxPython installation
- send useless cmd output to /dev/null
- use launch_startx from utils_spice

Signed-off-by: root <root@dhcp131-204.brq.redhat.com>
tests/rv_connect.py: Suppress unused console output.

Minor fixes to suppress console output with some escaped
characters, ingore some exceptions often hit but being
false positive when possible.

Signed-off-by: Marian Krcmarik <mkrcmari@redhat.com>
tests/fullscreen_setup.py: Use static resolution values.

Instead of guessing them from xrandr output, which doesn't
display values in available xrandr modes.

Signed-off-by: Marian Krcmarik <mkrcmari@redhat.com>
tests/rv_fullscreen.py: Suppress some console output.

Signed-off-by: Marian Krcmarik <mkrcmari@redhat.com>
kvm/tests/cfg/rv_*: Add rv_logging.cfg and change image name.

Signed-off-by: Marian Krcmarik <mkrcmari@redhat.com>
shared/cfg/guest-os.cfg: Adding a RHEL6 development build.

Signed-off-by: Marian Krcmarik <mkrcmari@redhat.com>
rv_connect/rc_logging: Fixing errors found by pylint

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
standalone_test: Do further cleanup of leftover test files

Clean not only the environment file, but also the
address_pool and the temporary aexpect_spawn directory
on every test run.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>