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
qemu_vm, aexpect, utils_misc: attempt to catch qemu in defunct state.

Add support to detect if qemu becomes <defunct> (zombie)
after it was started. If qemu is detected defunct, it will
raise virt_vm.VMStartError().

Signed-off-by: Ruda Moura <rmoura@redhat.com>