virt: Removes whitespace from libvirt_vm.py

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Add memory stress test to cpu_flags test

usage:
  ./cpuflags-test --stressmem 100 (in MB)

Signed-off-by: Jiří Župka <jzupka@redhat.com>
shared: Adds class for simple statistics and convert size function

convert_data_size('1M') == 1024 * 1024 bytes

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt.kvm: Unifying qmp/human monitor set_migration_speed

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt.kvm_vm: Adds possibility to don't wait for finish of migration

After setting not_wait_for_migration the kvm_vm.migration method
returns control to parent function immediately after sending
of migration command to qemu monitor.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Adds funtion to virt_utils install_cpuflags_util_on_vm

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Adds support for new QMP status command output.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
kvm-test: Repairs multihost control file

Repairs an error with processing test fail exception.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
kvm-tests: Adds tests for measure migration speed.

tests:
  1) Single host measure migration speed.
  2) Multi host measure migration speed.

description:
  1) start mem stresser in VM to avoid end of migraiton
  2) get statistic of migraiton speed
  3) kill VMs
  4) if migration speed is slower than desired migration speed it raise warning

Signed-off-by: Jiří Župka <jzupka@redhat.com>
netperf: add the default port to netserver

We launch netserver in remote system by ssh,
command will hang with RHEL5 guest, adding
the port parameter can resolve this issue.

Reported-by: Wenli Quan <wquan@redhat.com>
Signed-off-by: Amos Kong <akong@redhat.com>
virt: convert averages to float before compare

Currently the averages are string type. Sometimes,
the compare result will be wrong.

eg:
>>> 85.2 > 100
False
>>> "85.2" > "100"
True

Reported-by: Wenli Quan <wquan@redhat.com>
Signed-off-by: Amos Kong <akong@redhat.com>
netperf: enable burst ability in TCP_RR tests

We have many sessions in TCP_RR tests, burst ability is requested.
--enable-burst include intial request burst ability in _RR
               tests, may affect result

Signed-off-by: Amos Kong <akong@redhat.com>
virt: do not compute Total Significance if samples don't have enough items

If samples only have one items, t-test will return 'nan'.

Signed-off-by: Amos Kong <akong@redhat.com>
rename virtio_console.performance to virtio_console.perf

'performance' will be used for a new subtest.

Signed-off-by: Amos Kong <akong@redhat.com>
KVM-Test: kvm_monitor.py: Add function sendkey() for QMP monitor

QMP monitor doesn't support sendkey command, this function will
call sendkey in human command. With this function, we can send
key event via QMP monitor directly.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
Acked-by: Yiqiao Pu <ypu@redhat.com>
Acked-by: Feng Yang <fyang@redhat.com>
KVM-test: Add 'timeout' parameter for function human_monitor_cmd

Add 'timeout' parameter when need specify the cmd_timeout
using human_monitor_cmd().

Changes from v2:
 - Use CMD_TIMEOUT instead of hardcoded timeout value.

change from v1:
1. fix -- lack 'timeout' in return value of human_monitor_cmd()

Signed-off-by: Golita Yue <gyue@redhat.com>
Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
Acked-by: Feng Yang <fyang@redhat.com>
Acked-by: Xiaoqing Wei <xwei@redhat.com>
KVM Test: Add get_block, check_block_locked function to kvm_vm.py

get_block  could get specified block device from monitor.
check_block_locked check whether specified block device is locked or not.

Changes from v3:
 - Update get_block method's docstring.

Changes from v2:
 - Check 'value' in the beginning of check_block_locked
 - Make sure 'value' contains in the output of monitor command

Changes from v1:
Put these two functions to kvm_vm
Put all the parameters to p_dict dictionary.

Signed-off-by: Feng Yang <fyang@redhat.com>
Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
virt: kvm_monitor.py: Convent float number string to float type

send_arg_cmds can convent some types of string to python type.
This patch makes it convent float number string to float type.

Changes from V1:
 - Update regex string as ldoktor's advice.

Signed-off-by: Feng Yang <fyang@redhat.com>
Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
Acked-by: Xiaoqing Wei <xwei@redhat.com>
virt: Add migrate_set_downtime function for qmp monitor.

We already have this function for human monitor, so some case fail without this
function.

dd migrate_set_downtime function in kvm_monitor.

Signed-off-by: Feng Yang <fyang@redhat.com>
Acked-by: Qingtang Zhou <qzhou@redhat.com>
virt test: Add live_snapshot function in vm and monitor class

Add live_snapshot function in kvm_vm and kvm_monitor class. In
kvm_vm tests only need pass base image name, snapshot image name
and snapshot image format(default qcow2) to call live_snapshot.
The function will get the device id by itself.

Signed-off-by: Yiqiao Pu<ypu@redhat.com>
Acked-by: Suqin Huang <shuang@redhat.com>