virttest.qemu_devices: Support aliases in has_device

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_vm: Utilize aliases support in add_pcidevice

qemu_devices support aliases so we can just ask for the desired device.

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

* check params of the desired device_driver instead of pci-assign
* log the fail_params instead of the last used param

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
Disable strict host key checking for ssh session

Because of StrictHostKeyChecking=ask is the default setting in ssh config,
If there is no host key for the server, it will show the fingerprint and
ask to confirm, And because of we already set /dev/null as the user host
key database, the ssh connection always waits for the test scripts answers
"yes" for confirmation. So the test scripts will be blocked at this stage.
(unless the option StrictHostKeyChecking has been disabled in command-line
or /etc/ssh/ssh_config or ~/.ssh/config)

Signed-off-by: Lin Ma <lma@suse.com>
virt: Modify return value of virsh.version() function
data_dir: Add target parameter fo get_deps_dir()

With this parameter, get_deps_dir() will only deps folder
which contains target file/folder.

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest: Make Numa related functions can work on host have disabled node

Now the functions and classes caculate node id by nodes number. And
in a host have disabled node, it may give scripts the disabled node
id. This patch will fix this problem by use available nodes to decide
the node scripts should use.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
utils_misc: Update mount check function and fix a wrong arg in umount

When checking mountpoints, the nfs type displays 'nfs4' if mount
version 4 NFS server, so use a regex to search the mount items.
NFS not mounted is not an error, so change the message to debug
level.

Remove umount step as it doesn't make sense to umount in a mount
function.

In the umount function, the second arg in utils.system() is timeout,
so fix it as well. Also, disable verbose by default for
mount/umount/is_mount functions.

Signed-off-by: Yanbing Du <ydu@redhat.com>
virttest.env_process: move close serial_console session step

move close serial_console session in the end of postprocess as it'll help
keeping the number of filedescriptors used by virt test.

Signed-off-by: Xu Tian <xutian@redhat.com>
regression.py: don't round in compute average for integers

Signed-off-by: Amos Kong <akong@redhat.com>
regression.py: adjust round bit in calculating rate

Display 4 decimal digits of the rate is less than 100,
display 2 decimal digits of the rate is more than 100.

Signed-off-by: Amos Kong <akong@redhat.com>
regression.py: don't round in middle stage of calculations

For improving the precision, we don't round in the middle stage of
calculations, we just use rounding for the display.

Signed-off-by: Amos Kong <akong@redhat.com>
regression.py: do rounding in display stage

We don't round in middle stage of calculations, this patch
do rounding in display stage.

Display 4 decimal digits of the value is less than 100,
display 2 decimal digits of the value is more than 100.

Signed-off-by: Amos Kong <akong@redhat.com>
regression.py: still display Significance line that contains 'nan' value

T-test might returns 'nan' p-value, Significance line will wrongly miss.

Signed-off-by: Amos Kong <akong@redhat.com>
regression.py: still display Significance line that contains 'nan' value

T-test might returns 'nan' p-value, Significance line will wrongly miss.

Signed-off-by: Amos Kong <akong@redhat.com>
virttest.iscsi: Fix a regex and log level

As the newly updated of iscsi related packages, the output of iscsi
session is different from the past, so update the regex when
searching iscsi device name to adapt the update.

If no iscsi device, it should report error instead of debug msg.

Signed-off-by: Yanbing Du <ydu@redhat.com>
setup_or_cleanup_iscsi: Robust assumptions and pep8 fix

When reviewing jferlan's PR(tp-libvirt#47) to fix vol_create_from case,
i found the problems also exist in setup_or_cleanup_iscsi(), so pick up
the fixes:

When setup iscsi env, the function assumed that the iscsi tools
'tgtadm' and 'iscsiadm' were present on the host which may cause
all sorts of errors and failures. So before running these commands,
make sure the tools exist.

Additionally within iscsi_login, extended testing found that the SCSI
/dev/sdxx device didn't instantaneously appear. Sometimes it took an
extra second or two to appear, so added a loop for get_device_name().

Meanwhile, a pep8 fix to make sure no more combined module imports.

Signed-off-by: Yanbing Du <ydu@redhat.com>
Add a parameter to make using a custom path for the env file optional.

The parameter 'other_tests_dirs' is already used for defining
alternative directory for virt tests and using it as a custom
path for the env file is ambiguous. It also forces the file in
that directory for every user with custom virt tests. This commit
separates the parameters allowing for custom env directory and
custom virt tests directory.

Signed-off-by: Plamen Dimitrov <pdimitrov@pevogam.com>
Make guest Autotest verbosity configurable.

Signed-off-by: Plamen Dimitrov <pdimitrov@pevogam.com>
Move any libvirt related warnings that appear even when using solely qemu to a more appropriate place.

The warnings about missing libvirtd come from a check during
importing of the utils_libvirtd module. The module is imported
in env_process and therefore the warnings appear regardless of
whether we use libvirt or qemu. With this commit, the check will
still be performed but the warning will appear only if the user
actually intends to use the libvirtd control system.

Signed-off-by: Plamen Dimitrov <pdimitrov@pevogam.com>