#3 Add initial set of CI tests using Standard Test Interface
Closed 3 years ago by berrange. Opened 5 years ago by ymankad.
https://github.com/yashkmankad/fedora_qemu_dist-git.git tests  into  f28

Add initial set of CI tests using the Standard Test Interface
Yash Mankad • 5 years ago  
tests/devel_minimum.txt
file added
+4
@@ -0,0 +1,4 @@

+ io-github-autotest-qemu.boot

+ io-github-autotest-qemu.reboot

+ type_specific.io-github-autotest-qemu.migrate.default.tcp

+ io-github-autotest-qemu.shutdown

tests/tests.yml
file added
+103
@@ -0,0 +1,103 @@

+ ---

+ # tests that run in a classic context

+ - hosts: localhost

+   vars:

+     vt_type: qemu

+     vt_machine_type: 'i440fx'

+ 

+   tags:

+   - classic

+ 

+   tasks:

+   - name: Install avocado-fedora repo

+     yum_repository:

+       name: avocado

+       description: avocado-fedora repo

+       baseurl: https://avocado-project.org/data/repos/fedora-28-noarch/

+       skip_if_unavailable: yes

+       gpgkey: https://avocado-project.org/data/repos/crosa_redhat_com.gpg

+       gpgcheck: yes

+       enabled: yes

+ 

+   - name: Add EPEL repository

EPEL is an addon for RHEL, so irrelevant for Fedora.

+     yum_repository:

+       name: epel

+       description: EPEL repo

+       baseurl: https://dl.fedoraproject.org/pub/epel/$releasever/$basearch/

+       gpgkey: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-$releasever

+ 

+   # If packages are installed, this will not update them

+   # If they are not installed, it will install from the default repo

+   - name: Check to see if virtualization packages are installed

+     dnf:

+       name: "{{ item }}"

+       state: present

+     with_items:

+       - qemu-kvm

+       - libvirt

+       - libvirt-python

+       - libvirt-devel

+ 

+   - name: Install system packages needed for Avocado

+     package:

+       name: "{{ item }}"

+       state: present

+     ignore_errors: True

+     with_items:

+       - tcpdump

+       - genisoimage

+       - fakeroot

+       - virt-install

+       - python-requests

+       - python-sphinx

+       - gdb

+       - gdb-gdbserver

+       - git

+       - python-devel

+       - gcc

+       - python-stevedore

+       - policycoreutils-python

+       - attr

+       - autotest-framework

+       - python2-yaml

+       - gstreamer1-plugins-good

+       - policycoreutils-python-utils

+       - pygobject2

+       - python-aexpect

+       - python-imaging

+       - python-netaddr

+       - python-netifaces

+       - python-simplejson

+ 

+   - name: Install Avocado

+     dnf:

+       name: '{{ item }}'

+       state: latest

+       # Disbaling 'updates' and 'rawhide' repo as it installs python-avocado-52.1

+       # which is available in these repos

+       disablerepo: "rawhide,updates"

+     with_items:

+       - python2-avocado

+       - avocado-plugins-vt

+       - python2-avocado-plugins-varianter-yaml-to-mux

+ 

+   - name: Start the libvirtd service

+     service:

+       name: libvirtd

+       state: started

+       enabled: yes

+ 

+   # Runs the bootstrap command which lets Avocado run virtualization tests

+   # and also downloads the JeOS image

+   - name: Avocado-VT bootstrap

+     shell: avocado vt-bootstrap --vt-type {{ vt_type }} --yes-to-all

+ 

+   # Runs the basic set of tests listed in the devel_minimum file

+   - name: Run avocado tests

+     shell: >

+       avocado run --vt-type {{ vt_type }} --vt-machine-type {{ vt_machine_type }}

+       $(cat {{ test_suite }}.txt)

+       --vt-extra-params 'verify_host_dmesg = no'

+     vars:

+       - test_suite: devel_minimum

+     ignore_errors: yes

no initial comment

Adding initial set of basic tests for qemu according to the
Standard Test Interface [1]. These tests are run using the Avocado
framework [2] using the Avocado-VT plugin [3].

The key here is to have nested virtualization enabled on the VM
that will run these tests. This patchset has been tested by me on
a Fedora 28 VM that had nested virtualization enabled and it passes.

Without nested virtualization support, the libvirtd service fails to start
or Avocado fails as the kvm_module required for the tests to run is
not loaded.

Also, creating a new PR against the f28 branch as when I tested in
against master (which will run on rawhide), it broke on all kinds of things.

[1] https://fedoraproject.org/wiki/CI/Standard_Test_Interface
[2] https://avocado-framework.readthedocs.io/en/63.0/Introduction.html
[3] http://avocado-vt.readthedocs.io/en/latest/

Signed-off-by: Yash Mankad ymankad@redhat.com

This needs to be submitted for rawhide, before any stable branch. Stable branches are initialized with content from rawhide, so if something is not present in rawhide, it will be lost when next Fedora stable branch is created.

EPEL is an addon for RHEL, so irrelevant for Fedora.

All the comments added to the libvirt version of this pull request apply here, so rather than duplicating them all, just refer to that PR https://src.fedoraproject.org/rpms/libvirt/pull-request/2#request_diff

FEdora 28 branch is obsolete

Pull-Request has been closed by berrange

3 years ago