tools: Add check_patch

Make it easier to apply and verify patches going on the
virt-test repo.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
cfg: FIX: virtio_console subtest variant must have unique name

The reboot variant is also test name. This leads to automatical runs
of this test when reboot test is specified. Changing this variant name
to reset should fix this issue.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
tools: Make check_patch to use its own copies of run_pylint and reindent

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
KVM Test: Update qemu guest agent test case

Create a new class QemuGuestAgentTest which contains
qemu guest agent installation/startup action.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
KVM Test: Add some basic tests for qemu guest agent

This patch contains several test cases:
 * Execute "guest-sync" command to guest agent
 * Halt guest with command "guest-shutdown"
 * Reboot guest with command "guest-shutdown"
 * Shutdown guest with command "guest-shutdown"
 * Check the guest status with command "guest-fsfreeze-status"
 * Freeze guest with command "guest-fsfreeze-freeze"
 * Thaw guest with command "guest-fsfreeze-thaw"

Changes from V2:
 * Add some hook method which can inject test steps in
   guest fsfreeze testing.
   The methods are:
    - _action_before_fsfreeze
    - _action_after_fsfreeze
    - _action_before_fsthaw
    - _action_after_fsthaw

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
KVM Test: Add new test qemu_guest_agent_snapshot

This test script runs live snapshot after guest
fs is frozen, then check if the file created on
guest disk is correct.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
standalone_test: Include xterm-256color in the list of allowed terms

Fedora 18 introduces 'xterm-256color', which was not
accounted for on initial versions of the bcolors class.
Let's add it so we get colored output for this new
version of Fedora.

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

Add a script that will run all unittests available on
virt tests source dir. With this it'll be easier to
run the unittests and have a quick glance of the code
state.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Mass reindent across the virt test tree

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
tests.virtio_console: Pylint fix
guest_agent: Pylint fix
tests: Move autotest.py -> autotest_control.py

Turns out this caused for a long time a namespace
collision that confused pylint. So, in order to get
a fully clean run_pylint.py -q in the entire tree,
let's rename the test to autotest_control.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
check_patch: Fix string message formatting

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt: Adds OpenVSwitch support to virt tests

When autotest tries add tap to bridge then test recognize if
test is bridge is standard linux or OpenVSwitch.

And add some utils for bridge manipulation.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Adds functionality for vms

Allow creating of machine with tap devices which are not
connected to bridge, and add function to fill virtnet
object with address.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Adds OpenVSwitch tests

    Test uses virttest for virtual machine management.

    /tests/openvswitch/
    preparing test environment:
      ./get_started.py

    tests:
    1) Performance test.
    2) Vlan tests.
    3) Ping test.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt-libvirt: De-duplicate virsh/libvirt_xml bases

The virt networking code in utils_misc and base classes from the virsh
and libvirt_xml modules were duplicating a lot of functionality.  Moved
the comonalities under a new utils_misc PropCanBase base class. Added
new unittests for the new base class and fixed up all usage mismatches.

Also moved Closure class from virsh into utils_misc so it's more
centrally located for common use.

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Impliment basic libvirt_xml functionality

Follow a properties and accessor-method pattern so allowing higher
level code to ignore all details of underlying XML format.  Also,
provide intermediate methods for working with XML related virsh
commands along-side the abstracted XML-manupulator classes.

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Update vm.uuid on vm.get_uuid()

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Add virsh_define (and undefine) test

Thanks to Yu Mingfei <yumingfei@cn.fujitsu.com> for the original
virsh_rename_domain test which this is based upon. Exercises
virsh define and virsh_undefine plus auto-generated uuids.

Signed-off-by: Chris Evich <cevich@redhat.com>