tools.checkpatch: Make checkpatch work under submodule directory

.git can be also a file, in case virt test is a submodule.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
unattended: Fix params update for unattended install

Some of the params can be changed when we setup unattended install.
However, updating params is not done properly in every case - code
mix update only internal variables and params dictionary update.

This patch ensure that all changes done during setup are properly
reflected in params dictionary.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
libvirt_xml: Use pv for xen paravirtual machine type

Patch 65080193 introduce os_arch_machine_map for checking supported
guest type. However, libvirt uses 'xen' as name for XEN PV guests so
test fails as we use 'pv' for this type of guests.

This patch map xen type to pv as we use this value on various place
(mainly in unattended install) for XEN PV related quirks.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
virtio_console: Fix location of the virtio console guest path v2

In fact, the parent dir of the data dir can be safely
used even when virt-test is running inside autotest.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virtio_console: Fix background thread handling

Background threads of Th*Check might be blocked. Even use of
InterruptableThread() from base_utils didn't help.
Anyway in this scenarios threads are usually unblocked by cleaning
the ports so it's usually safe to wait till the test end and
recheck, whether the thread finished or not.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virtio_console: Mark 2 tests only for virtserialport

virtconsole uses virtserialport and creates console on top of it.
It creates an additional layer between the port and the user
and as the result it handles certain things differently, like
Non-blocking mode and not-connected-host are situations, which are
not handled and there is currently no plan of when and how it will
be handled as console is always connected to virtserialport and
console always uses blocking mode to talk to virtserialport.
That's why it doesn't make sense to run tests and pretend it
should act as virtserialport.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
virt: Add support for disktest install on vm.

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Improve cpuflags-test stressmem util.

1) adds support for continuous memory fill in time in cpuflags-test stressmem
2) limits usage of memory for stressmem.
    --memstress memory_usage[,memory_fill]
      it fills memory_fill amount of memory by memory_usage parts.
      rounds = memory_fill/memory_usage
      roundtime = 1/rounds
      for rounds:
         fill(memory_usage)
         sleep(roundtime-time) - rest of time to next fill roundvirt: Improve cpuflags-test stressmem util.

1) adds support for spread memory fill in time in cpuflags-test stressmem
2) limit usage memory for stressmem.
    --memstress memory_usage[,memory_fill]
      it fills memory_fill amount of memory by memory_usage parts.
      rounds = memory_fill/memory_usage
      for rounds:
         fill(memory_usage)
         sleep(rest of time to next fill round for spread filling over time)

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt: Add migration_multihost_pingpong_test.

Multiple migration of VM between master and
slave with different types of stress (no stress,
disk stress, memory stress, both).

Signed-off-by: Jiří Župka <jzupka@redhat.com>
virt-libvirt: add module of virsh setmem testcases.

Signed-off-by: Yu Mingfei<yumingfei@cn.fujitsu.com>
virt-libvirt: Add has_command_help_match update setmem

+ Fixed up imports
+ Fixed up a few comments
+ Added has_command_help_match
+ Added unittest for has_command_help_match
+ Updated setmem method to accept all combinations of parameters

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Update virsh_setmem test to run on older libvirt

+ Reorganized code/config with result-based logic
+ Added code/config to allow older libvirt failure testing
+ Added / Fixed typos on a few comments

Signed-off-by: Chris Evich <cevich@redhat.com>
virt-libvirt: Fix virsh get mac address bug

If a vm is already running when autotest starts and there is no
env or address_pool state, vm.get_address() is unable to obtain
a mac address (it isn't stored anywhere).  However, this information
is retrievable, from the command-line or libvirt vm's XML.

Checking the xml, a secondary XML parsing bug was reveiled in the
libvirt vm.get_virsh_mac_address method.  Switching to using xml_utils
resolved this. As long as a DHCP request comes in (to update
address_cache) a libvirt test is able to continue.

In order for this to work with KVM, some mechanism is needed
to retrieve the mac address from the already running qemu-kvm
process.  This is beyond the scope of this fix.

Signed-off-by: Chris Evich <cevich@redhat.com>
libvirt_vm: Fix incorrect import from autotest lib

xml_utils were moved from autotest to virt-test,
given that it was the only user of the code.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virttest.kvm_qtree:add null drive check in QtreeDisksContainer

Currently, in hmp monitor, try 'info qtree' it will display
some infomation, but as    dev: spapr-nvram, id "nvram@1001"
                                reg = 4097
                                drive = <null>
                                irq = 4098
This drive=<null> will cause a lot errors in qtree related test.
and if drive=<null> , it will not map to a disk in 'info block',
and it is not a bug. So add that as a exception.

Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
Fedora 16: remove dmidecode

It's not in the repos (or at least not on the DVD image), thus
trying to run a unattended Fedora 16 install fails because the
packet is missing.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
run: fix --config

The test runner applies a default test selection in case --tests is not
specified.  That is a pretty pointless in case a custom cartesian config
is specified, so don't do that.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
run: allow combining --config with --tests

I can't find a reason why combining --config and --tests is disallowed.
Picking a subset of the tests on the command line, without having to
edit my custom cartesian config file, is a useful feature.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
run: make --config & --list-tests play together

There is no reason to hard-code tests.cfg for --list-tests.
With a custom config we better don't strip the shortnames though
as we don't know whenever the first six elements of the shortname
are really identical.  So don't do that.

[ Note: We could try something more clever like figuring whenever
        all tests have a common prefix and if that happens to be
        the case strip that.  I'll leave that as excercise for
        someone else though ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
image_copy: write images into data dir

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>