Blob Blame History Raw
# Conditional for release vs. snapshot builds. Set to 1 for release build.
%if ! 0%{?rel_build:1}
    %global rel_build 1

# Settings used for build from snapshots.
%if 0%{?rel_build}
    %global gitref          %{version}
    %global gittar          avocado-%{version}.tar.gz
    %if ! 0%{?commit:1}
        %global commit      e97540793998c4f24a16000465dd7fdd213bf2b9
    %if ! 0%{?commit_date:1}
        %global commit_date 20200911
    %global shortcommit     %(c=%{commit};echo ${c:0:9})
    %global gitrel          .%{commit_date}git%{shortcommit}
    %global gitref          %{commit}
    %global gittar          avocado-%{shortcommit}.tar.gz

# Selftests are provided but may need to be skipped because many of
# the functional tests are time and resource sensitive and can
# cause race conditions and random build failures. They are
# enabled by default.
%global with_tests 1

# resultsdb is not available for RHEL
%if ! 0%{?rhel}
%global with_resultsdb 1
%global with_resultsdb 0

Name: python-avocado
Version: 82.0
Release: 4%{?gitrel}%{?dist}
Summary: Framework with tools and libraries for Automated Testing
# Found licenses:
# avocado/core/ MIT
# avocado/utils/external/ MIT
# avocado/utils/external/ MIT
# optional_plugins/html/avocado_result_html/templates/bootstrap.min.css: MIT
# optional_plugins/html/avocado_result_html/templates/bootstrap.min.js: MIT
# selftests/.data/jenkins-junit.xsd: MIT
# Other files: GPLv2 and GPLv2+
License: GPLv2+ and GPLv2 and MIT
BuildArch: noarch

BuildRequires: kmod
BuildRequires: procps-ng
BuildRequires: python3-devel
BuildRequires: python3-docutils
BuildRequires: python3-jinja2
BuildRequires: python3-lxml
BuildRequires: python3-psutil
BuildRequires: python3-setuptools
%if %{with_resultsdb}
BuildRequires: python3-resultsdb_api
BuildRequires: python3-pycdlib

%if 0%{?with_tests}
BuildRequires: genisoimage
BuildRequires: libcdio
BuildRequires: psmisc
%if ! 0%{?rhel}
BuildRequires: perl-Test-Harness
BuildRequires: glibc-all-langpacks
BuildRequires: python3-netifaces
BuildRequires: python3-yaml
# with_tests

Avocado is a set of tools and libraries (what people call
these days a framework) to perform automated testing.

%setup -q -n avocado-%{gitref}
%if 0%{?rhel}
sed -e "s/'PyYAML>=4.2b2'/'PyYAML>=3.12'/" -i optional_plugins/varianter_yaml_to_mux/
# drop unnecessary install requirement
sed -e "s/'markupsafe<2.0.0', //" -i optional_plugins/html/
# loosen jinja2 version requirement
sed -e "s/'jinja2<3.0.0'/'jinja2'/" -i optional_plugins/html/

pushd optional_plugins/html
%if %{with_resultsdb}
pushd optional_plugins/resultsdb
pushd optional_plugins/varianter_yaml_to_mux
pushd optional_plugins/loader_yaml
pushd optional_plugins/golang
pushd optional_plugins/varianter_pict
pushd optional_plugins/varianter_cit
pushd optional_plugins/result_upload
pushd optional_plugins/glib
rst2man man/avocado.rst man/avocado.1

for exe in \
    avocado \
    avocado-runner \
    avocado-runner-noop \
    avocado-runner-exec \
    avocado-runner-exec-test \
    avocado-runner-python-unittest \
    avocado-runner-avocado-instrumented \
    avocado-runner-tap \
    mv %{buildroot}%{_bindir}/$exe %{buildroot}%{_bindir}/$exe-%{python3_version}
    ln -s $exe-%{python3_version} %{buildroot}%{_bindir}/$exe-3
    ln -s $exe-%{python3_version} %{buildroot}%{_bindir}/$exe
# configuration is held at /etc/avocado only and part of the
# python-avocado-common package
rm -rf %{buildroot}%{python3_sitelib}/avocado/etc
# ditto for libexec files
rm -rf %{buildroot}%{python3_sitelib}/avocado/libexec
# adjust permissions for file containing shebang line needed for
# spawning tasks in podman containers
chmod -c +x %{buildroot}%{python3_sitelib}/avocado/core/
pushd optional_plugins/html
%if %{with_resultsdb}
pushd optional_plugins/resultsdb
pushd optional_plugins/varianter_yaml_to_mux
pushd optional_plugins/loader_yaml
pushd optional_plugins/golang
pushd optional_plugins/varianter_pict
pushd optional_plugins/varianter_cit
pushd optional_plugins/result_upload
pushd optional_plugins/glib
# cleanup plugin test cruft
rm -rf %{buildroot}%{python3_sitelib}/tests
mkdir -p %{buildroot}%{_sysconfdir}/avocado
cp -r avocado/etc/avocado/scripts %{buildroot}%{_sysconfdir}/avocado/scripts
cp -r avocado/etc/avocado/sysinfo %{buildroot}%{_sysconfdir}/avocado/sysinfo
mkdir -p %{buildroot}%{_libexecdir}/avocado
cp avocado/libexec/avocado-bash-utils %{buildroot}%{_libexecdir}/avocado/avocado-bash-utils
cp avocado/libexec/avocado_debug %{buildroot}%{_libexecdir}/avocado/avocado_debug
cp avocado/libexec/avocado_error %{buildroot}%{_libexecdir}/avocado/avocado_error
cp avocado/libexec/avocado_info %{buildroot}%{_libexecdir}/avocado/avocado_info
cp avocado/libexec/avocado_warn %{buildroot}%{_libexecdir}/avocado/avocado_warn
mkdir -p %{buildroot}%{_mandir}/man1
install -m 0644 man/avocado.1 %{buildroot}%{_mandir}/man1/avocado.1
mkdir -p %{buildroot}%{_pkgdocdir}
install -m 0644 README.rst %{buildroot}%{_pkgdocdir}
install -d -m 0755 %{buildroot}%{_sharedstatedir}/avocado/data
# place examples in documentation directory
install -d -m 0755 %{buildroot}%{_docdir}/avocado
cp -r examples/gdb-prerun-scripts %{buildroot}%{_docdir}/avocado/gdb-prerun-scripts
cp -r examples/plugins %{buildroot}%{_docdir}/avocado/plugins
cp -r examples/tests %{buildroot}%{_docdir}/avocado/tests
cp -r examples/varianter_cit %{buildroot}%{_docdir}/avocado/varianter_cit
cp -r examples/varianter_pict %{buildroot}%{_docdir}/avocado/varianter_pict
cp -r examples/wrappers %{buildroot}%{_docdir}/avocado/wrappers
cp -r examples/yaml_to_mux %{buildroot}%{_docdir}/avocado/yaml_to_mux
cp -r examples/yaml_to_mux_loader %{buildroot}%{_docdir}/avocado/yaml_to_mux_loader
find %{buildroot}%{_docdir}/avocado -type f -name '*.py' -exec chmod -c -x {} ';'

%if 0%{?with_tests}
    # LANG: to make the results predictable, we pin the language
    # that is used during test execution.
    # AVOCADO_CHECK_LEVEL: package build environments have the least
    # amount of resources we have observed so far. Let's avoid tests that
    # require too much resources or are time sensitive
    PATH=%{buildroot}%{_bindir}:%{buildroot}%{_libexecdir}/avocado:$PATH \
        PYTHONPATH=%{buildroot}%{python3_sitelib}:. \
        LANG=en_US.UTF-8 \
        %{python3} selftests/run

%package -n python3-avocado
Summary: %{summary}
Requires: python-avocado-common == %{version}-%{release}
Requires: gdb
Requires: gdb-gdbserver
Requires: procps-ng
%if ! 0%{?rhel}
Requires: python3-pycdlib

%description -n python3-avocado
Avocado is a set of tools and libraries (what people call
these days a framework) to perform automated testing.

%files -n python3-avocado
%license LICENSE

%package -n python-avocado-common
Summary: Avocado common files
License: GPLv2+

%description -n python-avocado-common
Common files (such as configuration) for the Avocado Testing Framework.

%files -n python-avocado-common
%license LICENSE
%dir %{_docdir}/avocado
%dir %{_sharedstatedir}/avocado
%dir %{_sysconfdir}/avocado
%dir %{_sysconfdir}/avocado/sysinfo
%dir %{_sysconfdir}/avocado/scripts
%dir %{_sysconfdir}/avocado/scripts/job
%dir %{_sysconfdir}/avocado/scripts/job/pre.d
%dir %{_sysconfdir}/avocado/scripts/job/post.d
%config(noreplace) %{_sysconfdir}/avocado/sysinfo/commands
%config(noreplace) %{_sysconfdir}/avocado/sysinfo/files
%config(noreplace) %{_sysconfdir}/avocado/sysinfo/profilers

%package -n python3-avocado-plugins-output-html
Summary: Avocado HTML report plugin
License: GPLv2+ and MIT
Requires: python3-avocado == %{version}-%{release}

%description -n python3-avocado-plugins-output-html
Adds to avocado the ability to generate an HTML report at every job results
directory. It also gives the user the ability to write a report on an
arbitrary filesystem location.

%files -n python3-avocado-plugins-output-html

%if %{with_resultsdb}
%package -n python3-avocado-plugins-resultsdb
Summary: Avocado plugin to propagate job results to ResultsDB
License: GPLv2+
Requires: python3-avocado == %{version}-%{release}

%description -n python3-avocado-plugins-resultsdb
Allows Avocado to send job results directly to a ResultsDB

%files -n python3-avocado-plugins-resultsdb
# with_resultsdb

%package -n python3-avocado-plugins-varianter-yaml-to-mux
Summary: Avocado plugin to generate variants out of yaml files
License: GPLv2+
Requires: python3-avocado == %{version}-%{release}

%description -n python3-avocado-plugins-varianter-yaml-to-mux
Can be used to produce multiple test variants with test parameters
defined in a yaml file(s).

%files -n python3-avocado-plugins-varianter-yaml-to-mux

%package -n python3-avocado-plugins-loader-yaml
Summary: Avocado plugin that loads tests from YAML files
License: GPLv2+
Requires: python3-avocado-plugins-varianter-yaml-to-mux == %{version}-%{release}

%description -n python3-avocado-plugins-loader-yaml
Can be used to produce a test suite from definitions in a YAML file,
similar to the one used in the yaml_to_mux varianter plugin.

%files -n python3-avocado-plugins-loader-yaml

%package -n python3-avocado-plugins-golang
Summary: Avocado plugin for execution of golang tests
License: GPLv2+
Requires: python3-avocado == %{version}-%{release}
Requires: golang

%description -n python3-avocado-plugins-golang
Allows Avocado to list golang tests, and if golang is installed,
also run them.

%files -n python3-avocado-plugins-golang

%package -n python3-avocado-plugins-varianter-pict
Summary: Varianter with combinatorial capabilities by PICT
License: GPLv2+
Requires: python3-avocado == %{version}-%{release}

%description -n python3-avocado-plugins-varianter-pict
This plugin uses a third-party tool to provide variants created by
Pair-Wise algorithms, also known as Combinatorial Independent Testing.

%files -n python3-avocado-plugins-varianter-pict

%package -n python3-avocado-plugins-varianter-cit
Summary: Varianter with Combinatorial Independent Testing capabilities
License: GPLv2+
Requires: python3-avocado == %{version}-%{release}

%description -n python3-avocado-plugins-varianter-cit
A varianter plugin that generates variants using Combinatorial
Independent Testing (AKA Pair-Wise) algorithm developed in
collaboration with CVUT Prague.

%files -n python3-avocado-plugins-varianter-cit

%package -n python3-avocado-plugins-result-upload
Summary: Avocado plugin propagate job results to a remote host
License: GPLv2+
Requires: python3-avocado == %{version}-%{release}

%description -n python3-avocado-plugins-result-upload
This optional plugin is intended to upload the Avocado Job results to
a dedicated sever.

%files -n python3-avocado-plugins-result-upload

%package -n python3-avocado-plugins-glib
Summary: Avocado plugin for execution of GLib Test Framework tests
License: GPLv2+
Requires: python3-avocado == %{version}-%{release}

%description -n python3-avocado-plugins-glib
This optional plugin is intended to list and run tests written in the
GLib Test Framework.

%files -n python3-avocado-plugins-glib

%package -n python-avocado-examples
Summary: Avocado Test Framework Example Tests
License: GPLv2+
# documentation does not require main package, but needs to be in lock-step if present
Conflicts: python3-avocado < %{version}-%{release}, python3-avocado > %{version}-%{release}

%description -n python-avocado-examples
The set of example tests present in the upstream tree of the Avocado framework.
Some of them are used as functional tests of the framework, others serve as
examples of how to write tests on your own.

%files -n python-avocado-examples
%license LICENSE
%dir %{_docdir}/avocado

%package -n python-avocado-bash
Summary: Avocado Test Framework Bash Utilities
License: GPLv2+ and GPLv2
Requires: python-avocado-common == %{version}-%{release}

%description -n python-avocado-bash
A small set of utilities to interact with Avocado from the Bourne
Again Shell code (and possibly other similar shells).

%files -n python-avocado-bash
%license LICENSE
%dir %{_libexecdir}/avocado

* Wed Jul 28 2021 Merlin Mathesius <> - 82.0-4
- Loosen jinja2 version requirement to fix FTBFS in Rawhide

* Fri Jul 23 2021 Fedora Release Engineering <> - 82.0-3
- Rebuilt for

* Thu Mar 18 2021 Merlin Mathesius <> - 82.0-2
- Drop obsolete packages from BuildRequires
- Generate man page directly using 'rst2man' rather than requiring 'make'
- Adjust PATH to make sure self-tests find internal modules
- Spec file cleanup following package review.

* Mon Sep 14 2020 Cleber Rosa <> - 82.0-1
- Sync with upstream release 82.0.
- Removed python libvirt depedency as the vm runner has been removed
- Dropped configuration files to sync with upstream which made them
  optional and doesn't ship them anymore
- Add on extra character to short commit to sync with upstream

* Sat Jun  6 2020 Cleber Rosa <> - 80.0-1
- Sync with upstream release 80.0.
- Dropped use of custom avocado command for tests
- Do not build deprecated runners

* Tue May 12 2020 Cleber Rosa <> - 79.0-1
- Sync with upstream release 79.0.
- Added Python's user base bin dir to the PATH environment variable
  while running tests, so that avocado-runner-* scripts can be found
- Moved comment to new lines closing the conditionals, to avoid
  errors from rpmlint and rpmbuild

* Wed Apr 15 2020 Merlin Mathesius <> - 78.0-1
- Sync with upstream release 78.0.

* Tue Mar 17 2020 Merlin Mathesius <> - 77.0-1
- Sync with upstream release 77.0.

* Mon Mar 09 2020 Merlin Mathesius <> - 76.0-1
- Sync with upstream release 76.0.

* Mon Jan 20 2020 Merlin Mathesius <> - 75.1-1
- Sync with upstream release 75.1.

* Mon Dec 23 2019 Merlin Mathesius <> - 74.0-1
- Sync with upstream release 74.0.

* Wed Nov 27 2019 Merlin Mathesius <> - 73.0-1
- Sync with upstream release 73.0.
- Adjustments to build for RHEL 8.

* Wed Oct 02 2019 Merlin Mathesius <> - 72.0-1
- Sync with upstream release 72.0.

* Wed Aug 28 2019 Merlin Mathesius <> - 71.0-1
- Sync with upstream release 71.0.

* Wed Jun 26 2019 Merlin Mathesius <> - 70.0-1
- Sync with upstream release 70.0.
- Drop all Python 2 support from SPEC file.

* Wed May 22 2019 Merlin Mathesius <> - 69.0-4
- pyliblzma is Python 2-only and no longer available as of F31.
- Unversioned executables should now be Python 3.

* Mon May 20 2019 Merlin Mathesius <> - 69.0-3
- Drop Python 2 support from F31 and RHEL8 onward.
- Disable components dependent upon Fiber in Fedora 31 and later,
  since avocado is currently incompatible with the new Fiber API.

* Tue Mar 19 2019 Merlin Mathesius <> - 69.0-2
- python2-sphinx is no longer available or needed as of F31

* Wed Feb 27 2019 Merlin Mathesius <> - 69.0-1
- Sync with upstream release 69.0.

* Fri Feb 22 2019 Merlin Mathesius <> - 68.0-1
- Sync with upstream release 68.0.

* Thu Jan 31 2019 Merlin Mathesius <> - 67.0-1
- Sync with upstream release 67.0.
- genisoimage, libcdio, and psmisc added as build deps so iso9660 tests run.
- Replace pystache requirement with jinja2.
- glibc-all-langpacks added as build dep for F30+ so vmimage tests run.
- python2-resultsdb_api package has been removed in F30 so
  python2-avocado-plugins-resultsdb was also disabled.

* Wed Nov 21 2018 Merlin Mathesius <> - 66.0-1
- Sync with upstream release 66.0.
- python2-pycdlib package has been removed in F30 as part of

* Thu Oct 04 2018 Merlin Mathesius <> - 65.0-1
- Sync with upstream release 65.0.

* Tue Aug 28 2018 Merlin Mathesius <> - 64.0-1
- Sync with upstream release 64.0.

* Thu Jul 26 2018 Merlin Mathesius <> - 63.0-2
- Added missing python[2]-enum34 requirement.

* Mon Jul 23 2018 Merlin Mathesius <> - 63.0-1
- Sync with upstream release 63.0. (BZ#1602175)
  Include upstream patches needed to build for Rawhide.

* Wed Jun 13 2018 Merlin Mathesius <> - 62.0-1
- Sync with upstream release 62.0. (BZ#1590572)
- Correct libvirt dependency for EPEL7/RHEL7

* Thu May 17 2018 Merlin Mathesius <> - 61.0-1
- Sync with upstream release 61.0.
- Packaging updates for Python 3.
- Reorganize SPEC file.

* Mon Apr  9 2018 Cleber Rosa <> - 52.1-2
- Added Fedora CI tests

* Tue Apr 03 2018 Merlin Mathesius <> - 52.1-1
- Sync with upstream release 52.1 (LTS series).
- Correct deprecated use of unversioned python.

* Mon Mar 26 2018 Iryna Shcherbina <> - 52.0-5
- Update Python 2 dependency declarations to new packaging standards

* Fri Feb 09 2018 Fedora Release Engineering <> - 52.0-4
- Rebuilt for

* Wed Aug 09 2017 Merlin Mathesius <> - 52.0-3
- Fix FTBFS error by disabling selfcheck producing false failures
- Update SPEC to use pkgname instead of srcname macro where appropriate

* Thu Jul 27 2017 Fedora Release Engineering <> - 52.0-2
- Rebuilt for

* Thu Jun 29 2017 Merlin Mathesius <> - 52.0-1
- Sync with upstream release 52.0. (BZ#1465409)

* Wed Jun 14 2017 Merlin Mathesius <> - 51.0-1
- Sync with upstream release 51.0. (BZ#1460837)
- Disable selftests when libvirt may not be available.

* Wed May 17 2017 Merlin Mathesius <> - 50.0-1
- Sync with upstream release 50.0. (BZ#1431413)
- Be explicit about selftest level run on check.

* Tue Apr 25 2017 Merlin Mathesius <> - 49.0-1
- Sync with upstream release 49.0. (BZ#1431413)

* Tue Apr 18 2017 Merlin Mathesius <> - 48.0-1
- Sync with upstream release 48.0. (BZ#1431413)
- Allow rel_build macro to be defined outside of the SPEC file.

* Mon Mar 27 2017 Merlin Mathesius <> - 47.0-1
- Sync with upstream release 47.0.
- Enable self-tests during build.
- Add example test to be run by Taskotron.

* Mon Feb 27 2017 Merlin Mathesius <> - 46.0-2
- Incorporate upstream SPEC file changes to split plugins into subpackages.
- Remove obsolete CC-BY-SA license, which went away with the halflings font.

* Tue Feb 14 2017 Merlin Mathesius <> - 46.0-1
- Sync with upstream release 46.0.
- Remove halflings license since font was removed from upstream.
- SPEC updates to easily switch between release and snapshot builds.

* Sat Feb 11 2017 Fedora Release Engineering <> - 43.0-8
- Rebuilt for

* Tue Jan 10 2017 Merlin Mathesius <> - 43.0-7
- SPEC updates to build and install for EPEL.

* Mon Nov 21 2016 Merlin Mathesius <> - 43.0-6
- Initial packaging for Fedora.