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>
Merge pull request #1256 from autotest/more-unittest-fixes

More unittest fixes
virsh_restart: Remove temporary files

Depending on cfg, it's possible that when the test completes either
'empty_new_file' or 'saved_file' is left - they need to be cleaned up