autotest_regression: Too few arguments for format string

Fix TypeError: not enough arguments for format string

Found by PyCharm inspection.

Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
autotest_regression: replace error.ValueError with ValueError

I think we mean ValueError here, I couldn't find any error.ValueError.

Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
autotest_regression: move copy of install-autotest-server*log outside try/except

We need the install log file to debug any error, so move it outside the
try/except, otherwise any errors will trigger aexpect.ShellCmdError and
skip the copy

Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
virt.test.nic_promisc : send command safely

Some times the kernel or other subsystems might print some info,
that will interfere with aexpect following command prompts and make
this case failed like cmd timeout.
This patch tried to resolve them by creating wrappers

Signed-off-by: Yunping Zheng <yunzheng@redhat.com>
libvirt: Fix a bug in virsh_change_media test and modify format

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>
qemu_vm: don't hide TestNAError exceptions

We have some code to automatically raise TestNAError (a "SKIP" test
result) if a QEMU feature is missing. But that code is being rendered
useless by a catch-all exception handling block around the
make_create_command() call.

Fix this by not hiding TestNAError exceptions from the caller.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
.gitignore: add cpuid_test_kernel binary

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
qemu_vm: add comma before CPU flags if necessary

Instead of strictly requiring cpu_model_flags to start with ",", add the
comma if necessary.

The commit that changed the code to always require commas broke most of
the "qemu_cpu" test cases. This should make them work again.

Cc: Xiaoqing Wei <xwei@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
qemu_cpu.cfg: create named variants for multiple QEMU versions

Keep only the "unknown QEMU version" variant enabled, but allow people
to enable other variants if desired.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
cpuid: convenience functions for logging

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
cpuid: always parse and convert CPUID dump to a dictionary

This will make it easier to analyze the CPUID dump data.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
cpuid: remove unnecessary exception-catching code

There's no need to raise a different exception if a test failed. Simply
pass the same exception to the caller and let the test runner take care
of it.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
cpuid: get_guest_cpuid(): allow extra VM creation parameters to be specified

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
cpuid: remove exception traceback code

There's nothing special about the cpuid test case that requires special
exception-handling code. If somebody needs a traceback from a test
exception, the generic virt-test test runner should be able to provide
it.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
cpuid: eliminate MiniSubtest class

There's no reason to create an additional test object and use confusing
tricks using __new__(), if we already have a test object as the "test"
parameter.

With this, we can convert all test classes to simple functions.

To make sure we kill the VM after running each test case, add
kill_vm=yes and kill_vm_gracefully=no to qemu_cpu.cfg.

Cc: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
shared.cfg.guest-os: Add serial number check command for Windows guest

And the disk driver serial number check command for Windows guests.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
shared.control: update bonnie control file

autotest.bonnie always failed because of not enough free space to
create the testing file on a 20G virtual disk.

Therefore, update default test command to:

"bonnie++ -d xxx -n 500 -s 2048 -r 1024"

to avoid this situation.

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu: Remove the host kernel file at the beginning of control.kernel-version

Remove this file to ignore the problem caused by this file in upgraded system.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
tests.boot: Create new session for every VM in loop

Signed-off-by: Feng Yang <fyang@redhat.com>
virttest.qemu_devices: Add parameter to workaround qemu qmp crash bug

In order to avoid qemu crash dump on older qemu you can set
"workaround_qemu_qmp_crash = always" in base.cfg and qemu_devices
will wait 1 second before using QMP monitor for the first time.

By default virt-test will try using QMP directly after qemu startup
and in case of failure it still fall backs to the workaround. Still
the first attempt generates unnecessarily crashdump which might
be stored in the autotest results.

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