diff --git a/.gitignore b/.gitignore index 5684048..c102fa6 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /avocado-50.0.tar.gz /avocado-51.0.tar.gz /avocado-52.0.tar.gz +/avocado-52.1.tar.gz diff --git a/avocado-selftest-fix-cmdline-check.patch b/avocado-selftest-fix-cmdline-check.patch new file mode 100644 index 0000000..525a869 --- /dev/null +++ b/avocado-selftest-fix-cmdline-check.patch @@ -0,0 +1,15 @@ +diff -ru ../avocado-52.1.orig/selftests/functional/test_plugin_diff.py ./selftests/functional/test_plugin_diff.py +--- ../avocado-52.1.orig/selftests/functional/test_plugin_diff.py 2018-03-01 12:05:02.000000000 -0600 ++++ ./selftests/functional/test_plugin_diff.py 2018-03-13 16:50:33.662490323 -0500 +@@ -52,9 +52,9 @@ + result = self.run_and_check(cmd_line, expected_rc) + msg = "# COMMAND LINE" + self.assertIn(msg, result.stdout) +- msg = "-./scripts/avocado run" ++ msg = "-%s run" % AVOCADO + self.assertIn(msg, result.stdout) +- msg = "+./scripts/avocado run" ++ msg = "+%s run" % AVOCADO + self.assertIn(msg, result.stdout) + + def test_diff_nocmdline(self): diff --git a/python-avocado.spec b/python-avocado.spec index fc9c075..036169a 100644 --- a/python-avocado.spec +++ b/python-avocado.spec @@ -11,10 +11,10 @@ %global gittar %{srcname}-%{version}.tar.gz %else %if ! 0%{?commit:1} - %global commit bb62fe5a1fa93ea6573da46556928af5041c1b7d + %global commit 0ddd3c7b92f18c85157766e9e0ec810e6b3dd37e %endif %if ! 0%{?commit_date:1} - %global commit_date 20170626 + %global commit_date 20180301 %endif %global shortcommit %(c=%{commit};echo ${c:0:7}) %global gitrel .%{commit_date}git%{shortcommit} @@ -27,14 +27,14 @@ # enabled by default. # However, selftests need to be disabled when libvirt is not available. %global with_tests 1 -%if 0%{?rhel} +%if 0%{?rhel} && 0%{?rhel} <= 7 # libvirt is not available for all RHEL builder architectures %global with_tests 0 %endif Name: python-%{pkgname} -Version: 52.0 -Release: 3%{?gitrel}%{?dist} +Version: 52.1 +Release: 1%{?gitrel}%{?dist} Summary: Framework with tools and libraries for Automated Testing Group: Development/Tools # Found licenses: @@ -51,6 +51,7 @@ Source0: https://github.com/avocado-framework/%{srcname}/archive/%{version}.tar. Source0: https://github.com/avocado-framework/%{srcname}/archive/%{commit}.tar.gz#/%{gittar} %endif Patch0: avocado-selftest-doublefree-disable.patch +Patch1: avocado-selftest-fix-cmdline-check.patch BuildArch: noarch BuildRequires: fabric BuildRequires: pystache @@ -65,14 +66,14 @@ BuildRequires: python-resultsdb_api %if 0%{?with_tests} BuildRequires: libvirt-python BuildRequires: perl(TAP::Parser) -%if 0%{?rhel} +%if 0%{?rhel} && 0%{?rhel} <= 7 BuildRequires: python-yaml %else BuildRequires: python2-yaml %endif %endif -%if 0%{?rhel} +%if 0%{?rhel} && 0%{?rhel} <= 7 BuildRequires: python-psutil BuildRequires: python-requests BuildRequires: python-setuptools @@ -105,10 +106,7 @@ BuildRequires: procps-ng BuildRequires: python-crypto %endif -%if 0%{?fedora} >= 25 -BuildRequires: kmod -%endif -%if 0%{?rhel} >= 7 +%if 0%{?fedora} >= 25 || 0%{?rhel} >= 7 BuildRequires: kmod %endif @@ -128,7 +126,7 @@ Requires: pyliblzma Requires: pystache Requires: python2 -%if 0%{?rhel} +%if 0%{?rhel} && 0%{?rhel} <= 7 Requires: python-requests Requires: python-stevedore %else @@ -219,7 +217,7 @@ server. Summary: Avocado plugin to generate variants out of yaml files %{?python_provide:%python_provide python2-%{pkgname}-plugins-resultsdb} Requires: python2-%{pkgname} == %{version}-%{release} -%if 0%{?rhel} +%if 0%{?rhel} && 0%{?rhel} <= 7 Requires: python-yaml %else Requires: python2-yaml @@ -249,6 +247,7 @@ examples of how to write tests on your own. %setup -q -n %{srcname}-%{commit} %endif %patch0 -p1 +%patch1 -p1 # package plugins-runner-vm requires libvirt-python, but the RPM # version of libvirt-python does not publish the egg info and this # causes that dep to be attempted to be installed by pip @@ -296,6 +295,12 @@ popd pushd optional_plugins/varianter_yaml_to_mux %{__python2} setup.py install --root %{buildroot} --skip-build popd +%{__mv} %{buildroot}%{_bindir}/avocado %{buildroot}%{_bindir}/avocado-%{python2_version} +%{__ln_s} avocado-%{python2_version} %{buildroot}%{_bindir}/avocado-2 +%{__ln_s} avocado-%{python2_version} %{buildroot}%{_bindir}/avocado +%{__mv} %{buildroot}%{_bindir}/avocado-rest-client %{buildroot}%{_bindir}/avocado-rest-client-%{python2_version} +%{__ln_s} avocado-rest-client-%{python2_version} %{buildroot}%{_bindir}/avocado-rest-client-2 +%{__ln_s} avocado-rest-client-%{python2_version} %{buildroot}%{_bindir}/avocado-rest-client %{__mkdir_p} %{buildroot}%{_mandir}/man1 %{__install} -m 0644 man/avocado.1 %{buildroot}%{_mandir}/man1/avocado.1 %{__install} -m 0644 man/avocado-rest-client.1 %{buildroot}%{_mandir}/man1/avocado-rest-client.1 @@ -331,7 +336,9 @@ find %{buildroot}%{_docdir}/avocado -type f -name '*.py' -exec %{__chmod} -c -x # 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. - AVOCADO_CHECK_LEVEL=0 selftests/run + # Also, use of unversioned python is deprecated, so force use of python2 as per + # https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build + AVOCADO_CHECK_LEVEL=0 UNITTEST_AVOCADO_CMD="$HOME/.local/bin/avocado" %{__python2} selftests/run %endif @@ -355,7 +362,11 @@ find %{buildroot}%{_docdir}/avocado -type f -name '*.py' -exec %{__chmod} -c -x %{_sysconfdir}/avocado/scripts/job/post.d/README %{python2_sitelib}/avocado/ %{python2_sitelib}/avocado_framework-%{version}-py%{python2_version}.egg-info +%{_bindir}/avocado-%{python2_version} +%{_bindir}/avocado-2 %{_bindir}/avocado +%{_bindir}/avocado-rest-client-%{python2_version} +%{_bindir}/avocado-rest-client-2 %{_bindir}/avocado-rest-client %{_mandir}/man1/avocado.1.gz %{_mandir}/man1/avocado-rest-client.1.gz @@ -408,6 +419,10 @@ find %{buildroot}%{_docdir}/avocado -type f -name '*.py' -exec %{__chmod} -c -x %changelog +* Tue Apr 03 2018 Merlin Mathesius - 52.1-1 +- Sync with upstream release 52.1 (LTS series). +- Correct deprecated use of unversioned python. + * 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 diff --git a/sources b/sources index 13be916..54aeac2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (avocado-52.0.tar.gz) = 291587c90b2774e3030595cb9ae3781e1bd151c9a3d21e899a64ba1da766387b40979700f4c6b1c373156f2eda4be1857c98b08cc32c5a712c8bd4f168da04cc +SHA512 (avocado-52.1.tar.gz) = fb97ea6056700f57f34e8e4ce0c27774c386d646aaffc7da2abb8d0a797cff4448934789ffaf81da1592fceae1bb464da2b5dde000730c4f417b03552a432c6c diff --git a/test/help-usage-1/Makefile b/test/help-usage-1/Makefile deleted file mode 100644 index d71e61f..0000000 --- a/test/help-usage-1/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -.PHONY: all install download clean - -BUILT_FILES= - -FILES=runtest.sh Makefile - -run: $(FILES) build - ./runtest.sh - -build: $(BUILT_FILES) - chmod a+x ./runtest.sh - -clean: - rm -f *~ $(BUILT_FILES) diff --git a/test/help-usage-1/README.rst b/test/help-usage-1/README.rst deleted file mode 100644 index 1d25e34..0000000 --- a/test/help-usage-1/README.rst +++ /dev/null @@ -1,13 +0,0 @@ -help-usage-1 -============ - -This is an example task for `Taskotron `_ -that tests the basic functionality of 'avocado --help' to confirm it generates a usage message. - -Standalone you can run it like this:: - - $ make run - -Through taskotron runner you can run it like this:: - - $ runtask -i python-avocado-46.0-2.fc25 -t koji_build -a noarch runtask.yml diff --git a/test/help-usage-1/runtask.yml b/test/help-usage-1/runtask.yml deleted file mode 100644 index 1ff3857..0000000 --- a/test/help-usage-1/runtask.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -name: help-usage-1 -desc: "Tests the basic functionality of 'avocado --help' to confirm it generates a usage message." -maintainer: merlinm - -input: - args: - - koji_build - - arch - -environment: - rpm: - - make - -actions: - - name: download the build - koji: - action: download - koji_build: ${koji_build} - arch: $arch - target_dir: ${workdir}/rpms - - - name: install the build - shell: - - dnf install -y ${workdir}/rpms/*.rpm - - - name: run test - shell: - - make run diff --git a/test/help-usage-1/runtest.sh b/test/help-usage-1/runtest.sh deleted file mode 100755 index b2cb24b..0000000 --- a/test/help-usage-1/runtest.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -PACKAGE=python-avocado - -# Assume the test will pass. -result=PASS - -avocado --help | grep -q -i '^usage:' -if [ $? -ne 0 ]; then - result=FAIL -fi - -echo $result