virttest: fix login refused when nettype is user

when nettype is 'user' localhost used as hostname by default, and login
windows guest via nc failed; fix it by get hostname/IP address via
socket module;

Signed-off-by: Xu Tian <xutian@redhat.com>
virttest.data_dir: add interface to get deps dir

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: new case for timedrift testing

changes from V1:
    1. fix typo and update doc strings

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: configuration for new timedrift testing

changes from v1:
    fix typo and add image_snapshot = no for s4

Signed-off-by: Xu Tian <xutian@redhat.com>
shared.deps: script to adjust host/guest time

Signed-off-by: Xu Tian <xutian@redhat.com>
virttest.env_process: try to catch windows guest bsod

This patch add bsod images catch when do crash check.
script will check whether the screendump image looks like a
bsod image by calculate the screendump image hamming distance
from the reference image(bsod image). if two images hamming
distance is less than the threshold(10), will mark this
screendump image as suspect, and raise guest BSOD error.
Configuration:
    check_guest_bsod = yes
    bsod_reference_img = XX.jpg (if not configure will use
    all the image under "share/deps/bsod_img")

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
Merge pull request #1162 from xutian/timedrift_new_case

Timedrift new case
Merge pull request #1203 from humanux/bsod

try to catch windows bsod
Add virttest.staging.backports module

We'll have to stick with python 2.4 for a little while
yet, so let's bring autotest's backport module to virt-test.

This module contains some functions people have been
using to write their tests. In order to use them, you
can just make

from virttest.backports import all, bin, next

The module takes care of figuring out if there's a
builtin present, or if the backported implementation
has to be used.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
tests: Fix usage of functions available only on py versions > 2.4

The virttest.staging.backports module offers backport
implementations of the functions used, so they work under
python 2.4. Even if said tests won't be executed on older
distros, at least pylint checks will pass.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.qemu_devices: Supress pylint warning

The methods hotplug and verify_hotplug are called
correctly in the inherited classes.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.ppm_utils: Replace conditional expressions

They are not present in python 2.4. Replace them with
equivalent, py 2.4 compatible constructs.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Merge pull request #1254 from autotest/backports

Backports
virttest/unittest_data: Fix mistake made on commit a5e55b7

In fact, we could not change the unittest data, which is
fixed to match the representation dump needed for that
unittest.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest: Replace itertools usage with backports version

This will ensure that, if some py 2.4 incompatible API
is used, it'll be appropriately patched up.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.libvirt_storage_unittest: Fix py 2.4 incompatible construct

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest/versionable_class_unittest: Fix reference to base_utils

That module no longer exists in autotest. The correct
import should be utils anyway.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.qemu_devices: Use backport implementation of OrderedDict

This will make the qemu devices unittest to pass on
python 2.4 systems.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.qemu_devices: Replace use of .super() in Exception definitions

Apparently Exception() is not a new style class in python 2.4.
Therefore, exception related classes have to use the
BaseClass.__init__(self, **kwargs) notation, otherwise we'd
have a TypeError when calling it.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest: Remove bad unittests

The utils_conn_unittest and utils_selinux_unittest were
relying on the actual commands to execute, being therefore
more of a functional test than a unittest.

Therefore, get rid of them.

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