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>
utils_libvirtd_unittest: remove skipIf to avoid incompatible issue for python2.6

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
tests.cfg: Set up the lowest_mem for unattended_install

As we try to shrink memory size when host don't have enough huge pages.
unattended_install may fail because guest don't have enough RAM in Linux guests
when we start guest with huge pages. This is caused by anaconda memory size
check. For newest RHEL and fedora the lowest memory size is 512M. So set up the
it to 512M in cfg file.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
virt: Remove vcpucount_live() and fix vcpucount() in virsh.py

1. Remove vcpucount_live() and modify virsh vcpupin test file
2. Remove a unused parameter 'vcpu' in virsh vcpupin test file
   which was found by run_pylint.py
3. Add return value for vcpucount()

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
Merge pull request #823 from ypu/low

 tests.cfg: Set up the lowest_mem for unattended_install
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>