Add tools subdirectory

The tools subdirectory will include useful scripts for
users of the virt tests. The first app is the koji/brew
pkg spec tool, that allows people to list information
about a koji or brew build.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt-libvirt: /tests/virsh_uri: virsh_uri bugfix

connect_uri is used for canonical_uri(),but it will not
be changed even remote test. While the connect_uri for
remote test should be target_uri.

Signed-off-by: Yu Mingfei<yumingfei@cn.fujitsu.com>
virt-libvirt: add virsh_nodecpustats function

Signed-off-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
virt-libvirt: add virsh_nodecpustats configuration

Signed-off-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
virt-libvirt: add virsh_nodecpustats module

Test the command virsh nodecpustats

(1) Call the virsh nodecpustats command for all cpu host cpus
    separately
(2) Get the output
(3) Check the against /proc/stat output(o) for respective cpu
    user: o[0] + o[1]
    system: o[2] + o[5] + o[6]
    idle: o[3]
    iowait: o[4]
(4) Call the virsh nodecpustats command with an unexpected option
(5) Call the virsh nodecpustats command with libvirtd service stop

Signed-off-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
virttest/storage.py: Fix backup of good images

It took us a while to notice that the source for good
images was incorrect in the backup code:

10/19 08:07:59 DEBUG|   storage:0185| Copying
/tmp/kvm_autotest_root/images/win7-64-sp1.qcow2.backup ->
/tmp/kvm_autotest_root/images_archive/win7-64-sp1.qcow2.good.XWUf
10/19 08:07:59 INFO |   storage:0189| No source file
/tmp/kvm_autotest_root/images/win7-64-sp1.qcow2.backup, skipping copy...

Let's fix that.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt-libvirt: add function schedinfo to virsh.py.

Signed-off-by: Yu Mingfei<yumingfei@cn.fujitsu.com>
virt-libvirt: add virsh function setmem.

Signed-off-by: Yu Mingfei<yumingfei@cn.fujitsu.com>
virt-libvirt: add configuration for virsh setmem test.

Signed-off-by: Yu Mingfei<yumingfei@cn.fujitsu.com>
virt-libvirt: add methods dominfo & get_current_mem

Signed-off-by: Yu Mingfei<yumingfei@cn.fujitsu.com>
virt: Add configuration for Ubuntu 12.10

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virtio_console: Modify virtio_console_guest.py guest to support Windows

This patch enables virtio_console_guest.py script to run on Windows.
It's a first very limited version.

VirtioGuest class now contains all functions, which might be used in
virtio_console tests and should be implemented.

The Posix version is the original Linux version with minor bugfixes.

The Nt version is simplified version which currently doesn't support
port reconnection (migration) and implements only "open" and "close"
features.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virtio_console: windows support for loopback and virt.exit_threads()

This patch enables virtio_console_guest.py to initiate loopback
under windows.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virtio_console: windows support for send and recv

This patch adds windows support for sending/receiving data
from/to guest.

It also adds send_loop support for guest sender thread.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virtio_console: Modify virtio_console to suit Windows testing

This patch changes the GuestWorker to run on windows and adjusts
virtio_console test also to support windows testing.

Currently supported tests are:
* open
* multiopen
* close
* max_serials_and_conosles (windows won't initialize consoles. I need
           to check it with the developer if this is a bug or feature)
* rw_host_offline (fails, need to check with developer the expected
                   results)
* basic_loopback (fails, data are corrupted)
* loopback (fails, data are corrupted)
* migrate (fails, data are corrupted)
* hotplug (fails, windows won't initialize consoles properly)
* shutdown

Beware on my laptop in 50% the ports were not initialized properly,
VM reboot usually helped (not always). You might use "Winobj" program
to list \\Device\vport* ports or \\.\$port_name devices/symlinks.

I checked the data corruption and it happends (winXP->Fedora18)
pretty regularly even with Amit's C++ testing script.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virtio_console: Notify user about missing python/pywin32

Notify user that he have to install python and pywin32 on his
tested machine.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virtio_console: Modify defaul cfg to allow windows testing

Supported tests:
* open
* multi_open
* close
* rw_host_offline
* basic_loopback
* migration
* poweroff
* hotplug
* rw_notconnect_guest
* max_ports

Note that current drivers often fails port initialization, corrupt
data and doesn't work as they should.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virtio_console: FIX loopback test result when background thread fails

Make the loopback test fail when the background loopback thread
fails.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virtio_console: FIX the background thread handling

Fail virtio_console subtest when background threads fails.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virtio_console: FIX emit exit_event on failures in migrate test

When migration fails we have to emit exit_event to background threads
otherwise there are confusing errors in log.

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