virttest.test_setup: changed forward delay to 4

Currently our script set bridge forward to 0, it cann't work
in some os. checking bridge doc 802.1D-1998 and latest
802.1D-2004, in these docs Bridege Forward Delay range time
is 4.0-30.0 seconds. so modify the value to 4

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
qemu.tests.nic_bonding : Close NetworkManager before bonding

As an active NetworkManager may give us problems during
testing, stop the daemon before bonding. add a random wait
time before and after set_link.

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
virttest.qemu_devices: Support blk_extra_params

blk_extra_params were accidentally left out while rewriting
images creation. Split them and assign them as normal params.

NOTE: This version would work only for params in the standard way
      %s=%s,... Currently I haven't found any other use so I hope
      this will last for ever.

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

nic_extra_params were using an incorrect regexp to match additional
params. Use split instead similarily to blk_extra_params.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.libvirt_vm: Add domjobabort method for VM class.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
libvirt.tests: Add testcases for migration of multiple vms.

Migrate multiple vms with these features:
1.Orderly or simultaneous migration.
2.Simple live migration or combination options.
3.Different migration method.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
virt-libvirt: Pylint fixes for vm_xml

Mainly minor items that should have no effect on tests.  Some
more risky changes were made to set_agent_channel() and
get_iface_dev() methods.  Those changes were made because
it made line-wrapping easier (lines were too long) and to
make parameter passing more clear (redundant ** magic).

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Unittest causing failures in others

Our check_patch and run_unittests scripts both run all unittest files IN
PARALLEL, not one at a time. This leads to some really interesting and
difficult to debug problems, like one test deleting/modifying temp files
or state for another test.  Problems here are:

1) The VIRSH_EXEC logic isn't working right, and because the virsh
module is sharing memory, changing virsh.virsh_exec in your test is
interfering with other tests.

2) Many tests are calling self.sp.method() which execute real virsh
commands. This is fine, except that they don't all work w/o root access
and therefore are dependant on external state.

Signed-off-by: Chris Evich <cevich@redhat.com>
qemu.tests: make mutli_disk test works for linux guest

fix not all disk listed issue, get cdrom drive letter with
utils_misc.get_winutils_vol();

Signed-off-by: Xu Tian <xutian@redhat.com>
virttest: Add unittest for libvirt_storage module.

* Replace real virsh module with a bogus virsh module
* Rewrite relative virsh pool functions for unittest.
  With setting output to static strings.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
virt-libvirt: Fix small bug in storage_unittest

The pool_autostart function was not being overriden in virsh instance,
but dummy function already written.  I just added it into setUp() now
unittest is working perfectly when run as non-root.

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Avoid future param. order problems

Signed-off-by: Chris Evich <cevich@redhat.com>
libvirt_xml_unittest: Fix wrong arguments passed to function

This unittest was calling vm_xml.VMXML.new_from_dumpxml
with wrong positional arguments, making the function
ignore the dummy virsh instance passed, causing errors.
Let's fix this bug.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
tools: add tool for pep8 reformatting

This calls the PEP8 linter called autopep8:

https://github.com/hhatto/autopep8

So we can make autotest to fully adhere to PEP8,
since there's a tool that can enforce the standard.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
tools: add pep8 check into check_patch

Integrate the PEP8 linter into the virt-test full
tree and patch verification process. It works by
verifying whether the PEP8 linter modified the file in
place, if it did, it means there are non compliances
in the code.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
tools: Add codespell

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
tools/check_patch.py: Add codespell check

Integrate codespell to our own check_patch.py script.

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

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

Using the program codespell

https://github.com/lucasdemarchi/codespell

We found a number of spelling mistakes, that could be
found and fixed. The result of the automated script
was double checked, of course.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
tools/run_pep8.py: Ignoring E501,W601