virttest: Restore the working dir in download_test_provider

After check the repo informations we should restore the working
dir to original one. Otherwise it will cause problems after we
call it in our scripts.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
virttest: Remove sit0 in get_linux_ifname of utils_net

sit0 is IPv6-in-IPv4 device added in system which not represent devices
added by vm.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
virt: Add clone_volume func to PoolVolume class

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
virt: Add create func to VolXML class

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
virt: Add functions to get/set cpu status

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
utils_libvirtd: Don't need to wait if start failed

If libvirtd service start or restart failed, just checking the exit code
will be enough, we don't need to wait 60 seconds to check whether a
virsh command can be executed.

Signed-off-by: Hao Liu <hliu@redhat.com>
libvirt: Declare LIBVIRT_DEFAULT_URI in preprocess().

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
env_process: Recreate vm in env if vm.connect_uri is not params.get('connect_uri').

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
libvirt_vm: Override __setattr__ of libvirt_vm.VM.

For VMs in different uri, we need some different params for them.
This patch introduce a way we can set these params in base.cfg only
for VM in a special uri. What we need to do is adding the special
param with a prefix of 'libvirt_URI_' into base.cfg. That's all.
libvirt_vm.VM will check the connect_uri and use the param you want.

Example:
	isa_serial = "serial0" is not usable for lxc VM. lxc does
not support serial device yet. In this case, we need not to change
the default value of isa_serial. We can add a new param in base.cfg.
	libvirt_lxc_isa_serial = "console0"
Then if your VM is a lxc guest, it will use "console0".

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
run: Introduce an option --connect-uri to assign uri for test.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
virttest.utils_test: Init subtest_dir in run_virt_sub_test

Init subtest_dir to None otherwise, it will report the variable
referenced before assignment.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
virttest.utils_misc: Support url in get_path().

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest.utils_netperf: Add netperf class.

Add netperf class as base class.

Support netperf client in windows guest.

Support install parameter to control whether install netperf or not.

Signed-off-by: Feng Yang <fyang@redhat.com>
Add APIs: fill, fill_dir, strings, head, head_n, tail, pread, ls
Merge pull request #1717 from ypu/run_virt_sub_test

virttest.utils_test: Init subtest_dir in run_virt_sub_test
libvirt_xml: Introduce a method get_section_string() in base

Sometimes we need to get the all element in xml, this
method will return a string of a element.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
virt: Fix a bug in preprocess_vm func

If VM is running before test, and param.get('start_vm') == 'yes',
the variable 'start_vm' will be False, at this situation
params.get("kill_vm_before_test") will work, if it's 'yes',
the VM will be shutdown, and make the test fail.

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
libvirt: adapt the default_tests.cfg to new framework of test-provider.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
virt: Add a func to make filesystem on partition

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
Merge pull request #1727 from liyangfnst/env

virt: Fix a bug in preprocess_vm func