virttest.virsh: Fix error of referenced before defined.

a += b equals to a = a + b.
So for self.virsh_exec += " -c xxx" in VirshSession.
It will cause problem of referenced before defined.
Now define self.virsh_exec before this line.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
libvirt-tests: fix virsh_vcpuinfo test, mv shutoff_option test from error_test to normal test.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
libvirt-tests: virsh_vcpuinfo, add more debug message.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
boottool/version: Fix __all__ dictionary

A newer pylint version caught a problem in the __all__
dictionary for these 2 files, fix it.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Merge pull request #814 from yumingfei/fix_virsh_module

virttest.virsh: Fix error of referenced before defined.
Add a method named sub_else_add in RemoteFile class.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
Add utils_conn module in virttest.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
Add test for virsh connect.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
utils_conn: add more comments and make tmp_dir unique.

* Remove tmp_dir from param of __init__, and build tmp_dir
  using tempfile to assure it unique for each instance.
* Add more comment for the varaibles of connection class to
  make it more clear.
* Pick the CA key build method out from TLSConnection as a
  function in utils_conn.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
utils_conn: Add more unittest for utils_conn.

* Add a unittest for tmp_dir to make sure it is unique for
  each instance.
* Add three unittests for functions in utils_conn which build
  CA key.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
virttest.utils_conn: add auto_recover into __init__().

B/c the errors in __del__() will be ignored, then we want
user call conn_recover() manually our of __del__().

* rename conn_finish to conn_recover.
* add auto_recover into __init__.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
libvirt-tests: replace /var/run/libvirt/lxc with /usr/libvirtexec/libvirt_lxc.

Path /var/run/libvirt/lxc means there is a running lxc guest, but not the lxc
driver is available.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
libvirt.tests: Fix pylint complaint for virsh connect.

* Specify string format arguments for logging functions.
* Remove unused variables.
* Replace invalid name "e" to "detail".

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
virttest.utils_conn_unittest: method conn_finish has been changed to conn_recover.

Signed-off-by: Yu Mingfei <yumingfei@cn.fujitsu.com>
Merge pull request #805 from yangdongsheng/update_virsh_vcpuinfo

Update virsh vcpuinfo test.
qemu.tests: add scenario '1 0' in test loop

Add missed test scenario '1 0', AKA "indirect_desc on, event_idx off" test;

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: fix duplicate properites for device

Signed-off-by: Xu Tian <xutian@redhat.com>
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>