[Avocado-devel] [Avocado-vt] How to create a custom config image to import and run the tests

Lukáš Doktor ldoktor at redhat.com
Tue Feb 13 06:50:12 UTC 2018


Hello Chandrashekar,

in meeting we discussed ways to write custom cartesian-config files to get greater flexibility when defining Avocado-vt tests. In attachment you can find 2 examples similar to what I use. You need to put them into the `$AVOCADO_DATA/avocado-vt/backend/$VTTYPE/cfg` file in order to be able to include the `tests-shared.cfg`. You can as well extract just the variants you are interested in and maintain it downstream, which would be faster to execute, but you'd have to watch for changes in the upstream configs.

During the meeting I also forgot to mention there is a support in Avocado to specify tests by yaml files, which allows similar flexibility as cartesian configs but for all tests (not just Avocado-vt, but any test). Some details can be found here: http://avocado-framework.readthedocs.io/en/latest/optional_plugins/yaml_loader.html and examples are in examples dir in Avocado sources.

I hope the quick-start meeting was useful and it'll be easier to read the documentation now. Ideally send issues/prs to update it in case you see some difficulties, but we try to keep it in a good shape. Unfortunately Avocado-vt is full of magic so it's not user-friendly at first, on the other hand it allows writing tests independent on hw, provider, machine-type, guest-os, ....

Kind regards,
Lukáš
-------------- next part --------------
# THIS IS INCOMPLETE EXAMPLE FILE, YOU WON'T BE ABLE TO DIRECTLY USE IT
# but it demonstrate how multiple tests can be organized according to features
# and sub-features. The none simply executes:
#
#     avocado run --vt-config $this_file -- network_suite
#
# which executes all tests defined by `network_suite`. Alternatively one can
# can specify only `feature_a`, which will execute all tests defined by
# `network_suite.feature_a` and `block_suite.feature_a`.
#
# BEWARE: All (unnamed) parameters are global so in case multiple variants
# share the same name, odd things are happening (usually all/many tests
# are executed). This is good and bad. It allows to filter-out certain
# things like `usb` or `suspend` even from subtests, machines or whatever.
# On the other hand it's hard to debug when such clash is introduced.
# Chose widely or use longer filters (`no Host.RHEL.7.5` instead of `no 7.5`)

include /home/medic/avocado/data/avocado-vt/backends/qemu/cfg/tests-shared.cfg
#only spice
no no_9p_export
spice_ssl = yes
only no_pci_assignable
only qcow2
usb_controller_tablet1 = xhci
usb_devices = tablet1
usb_max_port = 4
usb_type = nec-usb-xhci
usb_type_tablet1 = usb-tablet
usb_type_usb1 = nec-usb-xhci
usbs = usb1
only filesystem
only smallpages
virtio_ports = "vs"
virtio_port_type = serialport
soundcards = hda-duplex
cd_format = ide
no gluster
only i440fx
only no_virtio_rng
only default_bios
only bridge
#smp = 2
only smp2
mem = 2048
variants:
    - @install_loop:
        smp = {max_cpu}
        mem = {mid_mem}
        only unattended_install.cdrom.extra_cdrom_ks.default_install.aio_threads shutdown
        no PAE
        variants:
            - @scsi_test:
                only virtio_net
                only virtio_scsi
                only RHEL.7.devel
            - @block_test:
                only virtio_net
                only virtio_blk
                only RHEL.6.7

    - @network_suite:
        only RHEL.7.devel
        only virtio_net
        only virtio_scsi
        variants:
            - @feature_a:
                only foo bar baz
            - @feature_b:
                only aaa bbb ccc
            - @feature_c:
                only some other tests

    - @block_suite:
        only RHEL.7.devel
        only virtio_net
        only virtio_scsi
        variants:
            - @feature_a:
                only foo bar baz
            - @feature_b:
                only aaa bbb ccc
            - @feature_c:
                only some other set of tests

-------------- next part --------------
# File reserved for avocado-vt use, don't modify.
include tests-shared.cfg

# copied from tests.cfg
only (image_backend=filesystem)
only no_9p_export
only no_virtio_rng
only no_pci_assignable
only smallpages
only default_bios
only bridge
# only user
no multi_host

# additional filters
only RHEL.7.devel
# Migrate with file transfer (probably) generates false-negatives...
#only migrate.with_file_transfer.tcp
only migrate.default.tcp
only pseries
only virtio_net
only virtio_blk
only qcow2
only smp2

# default values
qemu_binary = /home/jenkins/$ARCH/qemu-master/build/bin/qemu-system-ppc64
qemu_img_binary = /home/jenkins/$ARCH/qemu-master/build/bin/qemu-img
qemu_io_binary = /home/jenkins/$ARCH/qemu-master/build/bin/qemu-io
smp = 12
kill_vm = yes
ping_pong = 60

# custom variants
variants:
    - pseries-2-6:
        machine_type = pseries-2.6
    - pseries-2-7:
        machine_type = pseries-2.7
    - pseries-2-8:
        machine_type = pseries-2.8

variants:
    - master_master:
        qemu_dst_binary = /home/jenkins/$ARCH/qemu-master/build/bin/qemu-system-ppc64
        variants:

    - master_2-6:
        only pseries-2-6
        qemu_dst_binary = /home/jenkins/$ARCH/qemu-2.6.0/bin/qemu-system-ppc64

    - 2-6_master:
        only pseries-2-6
        qemu_binary = /home/jenkins/$ARCH/qemu-2.6.0/bin/qemu-system-ppc64
        qemu_dst_binary = /home/jenkins/$ARCH/qemu-master/build/bin/qemu-system-ppc64
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 512 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/avocado-devel/attachments/20180213/7f9e0272/attachment.sig>


More information about the Avocado-devel mailing list