qemu.tests: update test script according test case

updated test script since case steps changed;

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.test: remove useless file

remove useless script block_stream_with_stress, since
block_stream_stress in used by block_stream.with_stress tests;

Signed-off-by: Xu Tian <xutian@redhat.com>
unattended_install.cfg: Add previously hidden image_copy_on_error param

The param image_copy_on_error tells virt-test that
when an unattended install fails, copy an already
installed guest image from a NFS mount. However,
not all test grids will have such a NFS mount configured,
so just assuming by default that such a mount is configured
is wrong.

This param was introduced on a previous commit, and it
is not available anywhere in the default config files.
Add it and set it by default to "no".

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
Move image_copy test to virttest.utils_test

The namespace autotest.virt.tests is not available
when running virt-tests from outside autotest. So
move image_copy to utils_test, and use it from there.

This commit moves the code to the right places and
changes the imports accordingly.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
unattended_install: Fix message wording

The messages assume images will be copied from an
NFS mount in case of unattended install failure,
when said mount may not even exist. Let's fix the
message and notify the image copy only if the grid
owners actually configured it to do so.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
utils_disk: Fix python 2.4 incompatible construct

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
CPUID dump-extraction scripts

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
test case to compare full CPUID dump for unexpected ABI changes

This adds a new test function to the cpuid.py test module, where the
CPUID data exposed by QEMU is compared with a full CPUID dump extracted
previously.

The new test code ensures that there are no ABI changes for a given
machine-type + CPU model combination, between QEMU versions.

The reference dumps were generated using the build-qemu-and-dump-cpus,
and copied using the copy-ref-dumps script.

There are some known QEMU bugs and past ABI changes that require
ignoring some differences. Those cases handled as rules that set
ignore_cpuid_leaves on qemu_cpu.cfg.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
shared.unattended: enable serial console for ubuntu

changes from v1:
    remove non-related changes

enable serial console in preseed for ubuntu guest

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests.floppy: Fix issue 'NoneType' object has no attribute 'create'

When fail to get vm from env file, we will meet following issue:
Traceback (most recent call last):
  File "/root/ypu/autotest_upstream_master/client/shared/test.py", line 426, in _exec
    _call_test_function(self.execute, *p_args, **p_dargs)
  File "/root/ypu/autotest_upstream_master/client/shared/test.py", line 853, in _call_test_function
    raise error.UnhandledTestFail(e)
UnhandledTestFail: Unhandled AttributeError: 'NoneType' object has no attribute 'create'    [context: Boot up guest with a floppy]
Traceback (most recent call last):
  File "/root/ypu/autotest_upstream_master/client/shared/test.py", line 846, in _call_test_function
    return func(*args, **dargs)
  File "/root/ypu/autotest_upstream_master/client/shared/test.py", line 299, in execute
    postprocess_profiled_run, args, dargs)
  File "/root/ypu/autotest_upstream_master/client/shared/test.py", line 216, in _call_run_once
    *args, **dargs)
  File "/root/ypu/autotest_upstream_master/client/shared/test.py", line 322, in run_once_profiling
    self.run_once(*args, **dargs)
  File "/root/ypu/autotest_upstream_master/client/tests/virt/virt.py", line 133, in run_once
    run_func(self, params, env)
  File "/root/ypu/autotest_upstream_master/client/shared/error.py", line 138, in new_fn
    return fn(*args, **kwargs)
  File "/root/ypu/autotest_upstream_master/client/tests/virt/qemu/tests/floppy.py", line 33, in run_floppy
    vm.create()
AttributeError: 'NoneType' object has no attribute 'create'

Call env_process.preprocess_vm(test, params, env, vm_name) to create vm could skip this issue.

Signed-off-by: Feng Yang <fyang@redhat.com>
shared.cfg: Disable the serail number check in low verson Windows guest

Only Win8 and above wmic will give the results in the right format.
So disable it for lower version of Windows guests

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
tools/download_manager.py: Exit cleanly on Ctrl+C

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
tools/download_manager.py: Clarify how to get out of the script

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.qemu_vm: follow up with 'info block' changed in new qemu

add info block support of get_block() and
check_block_locked() in new qemu

Signed-of-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
qemu.tests.cdrom:add new qemu block format support in cdrom

add new qemu block format support in cdrom, like tray, lock,
block file, etc.

Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
virttest.utils_disk: Fix python 2.4 incompatibility

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
qemu_devices: Fix network creation problem with RHEL5

We were assembling the network device cmd line for RHEL5
QEMU incorrectly, post the qemu_devices work.

 bad cmdline:
     -net id=idprh29y,macaddr=9a:49:4a:4b:4c:4d,model=virtio,type=nic,vlan=0  \
     -net tap,vlan=0,fd=24  \

 good cmdline:
     -net nic,vlan=0,model=virtio,macaddr='9a:21:22:23:24:25',id='idxlzqAk' \
     -net tap,vlan=0,fd=24 \

Fix this by making the 'nic' param of the custom QDevice
NO_STRING_EQUAL, and making sure such params come first before others.

CC: Lukas Doktor <ldoktor@redhat.com>
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.qemu_devices: Add support for USB controllers

this patch adds support to create USB controllers using qemu_devices.
This version supports all current options including usb-hubs plus
adds couple of new options.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_vm: Use qemu_devices to handle usbs

Use qemu_devices to create usb controllers and usb devices.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virttest.qemu_devices: Add none_or_int wrapper

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