Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backends: add new test type virttools #3270

Merged
merged 1 commit into from
Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions virttest/backends/virttools/cfg/drivers.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Configuration files for some special variables in specific uri.
variants:
- qemu:
34 changes: 34 additions & 0 deletions virttest/backends/virttools/cfg/tests-shared.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copy this file to tests-shared.cfg and edit it.
#
# This file contains the base test set definitions, shared among single host
# and multi host jobs.

# Virtualization type (qemu or libvirt)
vm_type = libvirt
# The hypervisor uri (default, qemu://hostname/system, etc.)
# where default or unset means derive from installed system
connect_uri = default

# Include the base config files.
include base.cfg
include subtests.cfg
include host.cfg
include machines.cfg
include guest-os.cfg
include guest-hw.cfg
include cdkeys.cfg
include virtio-win.cfg
# Include special variable for specific driver.
include drivers.cfg

# Modify/comment the following lines if you wish to modify the paths of the
# image files, ISO files or qemu binaries.
#
# As for the defaults:
# * qemu and qemu-img are expected to be found under /usr/bin/qemu-kvm and
# /usr/bin/qemu-img respectively.

# Uncomment the following lines to enable abort-on-error mode:
#abort_on_error = yes
#kill_vm.* ?= no
#kill_unresponsive_vms.* ?= no
26 changes: 26 additions & 0 deletions virttest/backends/virttools/cfg/tests.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# File reserved for avocado-vt use, don't modify.
include tests-shared.cfg

variants:
- @virttools_quick:
start_vm = no
virt_install_binary = /usr/bin/virt-install
qemu_img_binary = /usr/bin/qemu-img
hvm_or_pv = hvm
use_os_variant = yes
use_os_type = yes
only qcow2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need below filters when you enable virttools type?

Copy link
Contributor Author

@smitterl smitterl Dec 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chunfuwen In short, yes, I believe they are necessary, at least I prefer to keep them. I tried to run tests without them and I conclude it's better to keep them.

Details:

I believe they are not necessary functionally. However, I've found they have a big impact regarding performance. When I tried test case without these filters, they never started in a reasonable time while I found the cartesian config was still creating its test dictionaries in the background (can be seen in the crash log after ^C).

I assume the reason is that the number of variants explodes without these standard filters.

Please notice that many of these filters usually don't have an impact on the tp-libvirt test functions but are rather tp-qemu specific. I took these filters to be the same as the ones the tp-libvirt/libvirt test type uses, where they possibly aren't functionally necessary either. I'm not sure.

In any case, as mentioned before, without these filters I never got the test to start in a reasonable time, so I propose let's keep them. :)

only virtio_net
only virtio_blk
only smp2
only no_9p_export
only no_virtio_rng
only no_pci_assignable
only (image_backend=filesystem)
only smallpages
only default_bios
only bridge



only virttools_quick
18 changes: 13 additions & 5 deletions virttest/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,39 +36,47 @@
'openvswitch': [],
'lvsb': [('semanage',), ('getfattr',), ('restorecon',), ('virt-sandbox')],
'v2v': [],
'libguestfs': [('perl',)]}
'libguestfs': [('perl',)],
'virttools': []}

mandatory_programs = {'qemu': basic_program_requirements + ['gcc'],
'spice': basic_program_requirements + ['gcc'],
'libvirt': basic_program_requirements,
'openvswitch': basic_program_requirements,
'lvsb': ['virt-sandbox', 'virt-sandbox-service', 'virsh'],
'v2v': basic_program_requirements,
'libguestfs': basic_program_requirements}
'libguestfs': basic_program_requirements,
'virttools': basic_program_requirements + ['virt-install',
'virt-clone',
'virt-manager',
'virt-xml']}

mandatory_headers = {'qemu': ['Python.h', 'types.h', 'socket.h', 'unistd.h'],
'spice': [],
'libvirt': [],
'openvswitch': [],
'v2v': [],
'lvsb': [],
'libguestfs': []}
'libguestfs': [],
'virttools': []}

first_subtest = {'qemu': ['unattended_install', 'steps'],
'spice': ['unattended_install', 'steps'],
'libvirt': ['unattended_install'],
'openvswitch': ['unattended_install'],
'v2v': ['unattended_install'],
'libguestfs': ['unattended_install'],
'lvsb': []}
'lvsb': [],
'virttools': []}

last_subtest = {'qemu': ['shutdown'],
'spice': ['shutdown'],
'libvirt': ['shutdown', 'remove_guest'],
'openvswitch': ['shutdown'],
'v2v': ['shutdown'],
'libguestfs': ['shutdown'],
'lvsb': []}
'lvsb': [],
'virttools': []}

test_filter = ['__init__', 'cfg', 'dropin.py']

Expand Down
2 changes: 1 addition & 1 deletion virttest/standalone_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def _variant_only_file(filename):
#: value. See :func:`avocado_vt.plugins.vt.add_basic_vt_options` and
#: class:`avocado_vt.options.VirtTestOptionsProcess` for usage examples.
SUPPORTED_TEST_TYPES = [
'qemu', 'libvirt', 'libguestfs', 'openvswitch', 'v2v', 'lvsb', 'spice']
'qemu', 'libvirt', 'libguestfs', 'openvswitch', 'v2v', 'lvsb', 'spice', 'virttools']

SUPPORTED_LIBVIRT_URIS = ['qemu:///system', 'lxc:///']
SUPPORTED_LIBVIRT_DRIVERS = ['qemu', 'lxc', 'xen']
Expand Down
2 changes: 2 additions & 0 deletions virttest/test-providers.d/io-github-autotest-libvirt.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ subdir: libguestfs/
subdir: lvsb/
[v2v]
subdir: v2v/
[virttools]
subdir: virttools/