From b678a5f2c186f6135f106805c66657d88de7dcc3 Mon Sep 17 00:00:00 2001 From: Merlin Mathesius Date: Jan 31 2019 19:37:05 +0000 Subject: 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. Signed-off-by: Merlin Mathesius --- diff --git a/.gitignore b/.gitignore index 0a06a3b..8de3b1d 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ /avocado-64.0.tar.gz /avocado-65.0.tar.gz /avocado-66.0.tar.gz +/avocado-67.0.tar.gz diff --git a/avocado-66.0-skip-unreliable-selftests.patch b/avocado-66.0-skip-unreliable-selftests.patch deleted file mode 100644 index e01b4a5..0000000 --- a/avocado-66.0-skip-unreliable-selftests.patch +++ /dev/null @@ -1,41 +0,0 @@ -diff -ru ../avocado-66.0.ORIG/selftests/unit/test_runner_queue.py ./selftests/unit/test_runner_queue.py ---- ../avocado-66.0.ORIG/selftests/unit/test_runner_queue.py 2018-11-19 21:24:10.000000000 -0600 -+++ ./selftests/unit/test_runner_queue.py 2018-11-21 09:48:14.926103800 -0600 -@@ -39,6 +39,7 @@ - msg = queue.get() - return msg - -+ @unittest.skip("Test currently unreliable resulting in Fedora build failures") - def test_whiteboard(self): - """ - Tests if the whiteboard content is the expected one -diff -ru ../avocado-66.0.ORIG/selftests/unit/test_utils_iso9660.py ./selftests/unit/test_utils_iso9660.py ---- ../avocado-66.0.ORIG/selftests/unit/test_utils_iso9660.py 2018-11-19 21:24:10.000000000 -0600 -+++ ./selftests/unit/test_utils_iso9660.py 2018-11-21 10:06:22.806008200 -0600 -@@ -169,6 +169,7 @@ - PyCDLib-based check - """ - -+ @unittest.skip("Test currently unreliable resulting in Fedora build failures") - @unittest.skipUnless(iso9660.has_pycdlib(), "pycdlib not installed") - def setUp(self): - super(PyCDLib, self).setUp() -diff -ru ../avocado-66.0.ORIG/selftests/unit/test_utils_vmimage.py ./selftests/unit/test_utils_vmimage.py ---- ../avocado-66.0.ORIG/selftests/unit/test_utils_vmimage.py 2018-11-19 21:24:10.000000000 -0600 -+++ ./selftests/unit/test_utils_vmimage.py 2018-11-21 14:19:44.915818674 -0600 -@@ -138,6 +138,7 @@ - self.assertEqual(suse_provider.get_best_version(self.suse_available_versions), - suse_latest_version) - -+ @unittest.skip("Test currently unreliable resulting in Fedora build failures") - @mock.patch('avocado.utils.vmimage.urlopen') - def test_get_image_url(self, urlopen_mock): - image = 'openSUSE-Leap-15.0-OpenStack.x86_64-0.0.4-Buildlp150.12.30.qcow2' -@@ -150,6 +151,7 @@ - suse_provider.get_version = mock.Mock(return_value='15.0') - self.assertEqual(suse_provider.get_image_url(), expected_image_url) - -+ @unittest.skip("Test currently unreliable resulting in Fedora build failures") - @mock.patch('avocado.utils.vmimage.urlopen') - def test_get_image_url_defining_build(self, urlopen_mock): - image = 'openSUSE-Leap-15.0-OpenStack.x86_64-1.1.1-Buildlp111.11.11.qcow2' diff --git a/python-avocado-67.0-vmimage-host-arch.patch b/python-avocado-67.0-vmimage-host-arch.patch new file mode 100644 index 0000000..f8be96a --- /dev/null +++ b/python-avocado-67.0-vmimage-host-arch.patch @@ -0,0 +1,59 @@ +From 7c67cc73ad30dc784f6a98abab3bfd5c5fd05ece Mon Sep 17 00:00:00 2001 +From: Cleber Rosa +Date: Tue, 29 Jan 2019 15:47:10 -0500 +Subject: [PATCH] selftests/unit/test_utils_vmimage.py: do not depend on host + arch + +Some tests for the vmimage module do not specify the arch to use to +determine the image that will (would) be fetched. It then relies on +the default of using the host arch. But, if the test is run on a host +arch different than x86_64, the test will fail. + +Let's make the test more deterministic by providing the arch parameter +value. + +Reference: https://trello.com/c/92VQRMoC/1483-vmimage-tests-fail-under-x8664 +Signed-off-by: Cleber Rosa +--- + selftests/unit/test_utils_vmimage.py | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/selftests/unit/test_utils_vmimage.py b/selftests/unit/test_utils_vmimage.py +index ff3448409..ac4805174 100644 +--- a/selftests/unit/test_utils_vmimage.py ++++ b/selftests/unit/test_utils_vmimage.py +@@ -133,13 +133,13 @@ def get_html_with_image_link(image_link): + + def test_get_best_version_default(self): + suse_latest_version = 15.0 +- suse_provider = vmimage.OpenSUSEImageProvider() ++ suse_provider = vmimage.OpenSUSEImageProvider(arch='x86_64') + self.assertEqual(suse_provider.get_best_version(self.suse_available_versions), + suse_latest_version) + + def test_get_best_version_leap_4_series(self): + suse_latest_version = 42.3 +- suse_provider = vmimage.OpenSUSEImageProvider(version='4(.)*') ++ suse_provider = vmimage.OpenSUSEImageProvider(version='4(.)*', arch='x86_64') + self.assertEqual(suse_provider.get_best_version(self.suse_available_versions), + suse_latest_version) + +@@ -151,7 +151,7 @@ def test_get_image_url(self, urlopen_mock): + urlopen_mock.return_value = mock.Mock(read=urlread_mocked) + expected_image_url = self.base_images_url + image + +- suse_provider = vmimage.OpenSUSEImageProvider() ++ suse_provider = vmimage.OpenSUSEImageProvider(arch='x86_64') + suse_provider.get_version = mock.Mock(return_value='15.0') + self.assertEqual(suse_provider.get_image_url(), expected_image_url) + +@@ -163,7 +163,8 @@ def test_get_image_url_defining_build(self, urlopen_mock): + urlopen_mock.return_value = mock.Mock(read=urlread_mocked) + expected_image_url = self.base_images_url + image + +- suse_provider = vmimage.OpenSUSEImageProvider(build='1.1.1-Buildlp111.11.11') ++ suse_provider = vmimage.OpenSUSEImageProvider(build='1.1.1-Buildlp111.11.11', ++ arch='x86_64') + suse_provider.get_version = mock.Mock(return_value='15.0') + self.assertEqual(suse_provider.get_image_url(), expected_image_url) + diff --git a/python-avocado-67.0-yaml-versions-1.patch b/python-avocado-67.0-yaml-versions-1.patch new file mode 100644 index 0000000..8265491 --- /dev/null +++ b/python-avocado-67.0-yaml-versions-1.patch @@ -0,0 +1,53 @@ +From c60f0ae859e0df4ac748ddc2e5cc32207679c538 Mon Sep 17 00:00:00 2001 +From: Caio Carrara +Date: Mon, 7 Jan 2019 12:13:54 -0200 +Subject: [PATCH] yaml_to_mux: bump pyyaml version + +This changes addresses the CVE-2017-18342[1] that defines: "In PyYAML +before 4.1, the yaml.load() API could execute arbitrary code. In other +words, yaml.safe_load is not used." + +The change affects only installation using Python 3 because when +building EL7 RPMs, we want to use version 3.10, which is packaged on +EPEL. + +[1] - https://nvd.nist.gov/vuln/detail/CVE-2017-18342 + +Signed-off-by: Caio Carrara +--- + optional_plugins/varianter_yaml_to_mux/setup.py | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/optional_plugins/varianter_yaml_to_mux/setup.py b/optional_plugins/varianter_yaml_to_mux/setup.py +index a5fa10c64..744bf06be 100644 +--- a/optional_plugins/varianter_yaml_to_mux/setup.py ++++ b/optional_plugins/varianter_yaml_to_mux/setup.py +@@ -13,9 +13,18 @@ + # Copyright: Red Hat Inc. 2017 + # Author: Cleber Rosa + ++import sys + from setuptools import setup, find_packages + + ++INSTALL_REQUIREMENTS = ['avocado-framework'] ++ ++if sys.version_info[0] == 2: ++ INSTALL_REQUIREMENTS.append('PyYAML>=3.10') ++else: ++ INSTALL_REQUIREMENTS.append('PyYAML>=4.2b2') ++ ++ + setup(name='avocado-framework-plugin-varianter-yaml-to-mux', + description='Avocado Varianter plugin to parse YAML file into variants', + version=open("VERSION", "r").read().strip(), +@@ -24,8 +33,7 @@ + url='http://avocado-framework.github.io/', + packages=find_packages(exclude=('tests*',)), + include_package_data=True, +- install_requires=['avocado-framework', +- 'PyYAML>=3.10,!=4.0,!=4.1,!=4.2b1'], ++ install_requires=INSTALL_REQUIREMENTS, + test_suite='tests', + entry_points={ + "avocado.plugins.cli": [ diff --git a/python-avocado-67.0-yaml-versions-2.patch b/python-avocado-67.0-yaml-versions-2.patch new file mode 100644 index 0000000..0f5cea3 --- /dev/null +++ b/python-avocado-67.0-yaml-versions-2.patch @@ -0,0 +1,71 @@ +From 8be7c4fb325aa875e7d752975d61cd89f9239e7b Mon Sep 17 00:00:00 2001 +From: Cleber Rosa +Date: Tue, 29 Jan 2019 13:49:32 -0500 +Subject: [PATCH] YAML to Mux plugin: use downstream versions in the SPEC file + only + +Commit c60f0ae85 fixed a CVE warning that GitHub sent notifications +about. While so, it was attempted to fulfill the downstream (Fedora +and EPEL) dependencies in the same patch, keeping users of Python 2 +with possibly vulnerable versions. + +The matching of versions that ship in the Fedora and EPEL distros are +really best done in the SPEC file. Finally, this was motivated by the +fact that the simple Python version check was not enough because +PyYAML>=4.2b2 is not available on Fedora 28, even though it contains +Python 3. + +Reference: https://trello.com/c/3UMFOyzQ/1484-pyyaml-requirement-not-fulfilled-on-f28 +Signed-off-by: Cleber Rosa +--- + optional_plugins/varianter_yaml_to_mux/setup.py | 11 +---------- + python-avocado.spec | 4 ++++ + 2 files changed, 5 insertions(+), 10 deletions(-) + +diff --git a/optional_plugins/varianter_yaml_to_mux/setup.py b/optional_plugins/varianter_yaml_to_mux/setup.py +index 744bf06be..e6fb8ffa4 100644 +--- a/optional_plugins/varianter_yaml_to_mux/setup.py ++++ b/optional_plugins/varianter_yaml_to_mux/setup.py +@@ -13,18 +13,9 @@ + # Copyright: Red Hat Inc. 2017 + # Author: Cleber Rosa + +-import sys + from setuptools import setup, find_packages + + +-INSTALL_REQUIREMENTS = ['avocado-framework'] +- +-if sys.version_info[0] == 2: +- INSTALL_REQUIREMENTS.append('PyYAML>=3.10') +-else: +- INSTALL_REQUIREMENTS.append('PyYAML>=4.2b2') +- +- + setup(name='avocado-framework-plugin-varianter-yaml-to-mux', + description='Avocado Varianter plugin to parse YAML file into variants', + version=open("VERSION", "r").read().strip(), +@@ -33,7 +24,7 @@ + url='http://avocado-framework.github.io/', + packages=find_packages(exclude=('tests*',)), + include_package_data=True, +- install_requires=INSTALL_REQUIREMENTS, ++ install_requires=('avocado-framework', 'PyYAML>=4.2b2'), + test_suite='tests', + entry_points={ + "avocado.plugins.cli": [ +diff --git a/python-avocado.spec b/python-avocado.spec +index ca4841a0f..8e2bb3032 100644 +--- a/python-avocado.spec ++++ b/python-avocado.spec +@@ -214,6 +214,10 @@ sed -e "s/'libvirt-python'//" -i optional_plugins/runner_vm/setup.py + %build + %if 0%{?rhel} == 7 + sed -e "s/'six>=1.10.0'/'six>=1.9.0'/" -i setup.py ++sed -e "s/'PyYAML>=4.2b2'/'PyYAML>=3.10'/" -i optional_plugins/varianter_yaml_to_mux/setup.py ++%endif ++%if 0%{?fedora} && 0%{?fedora} < 29 ++sed -e "s/'PyYAML>=4.2b2'/'PyYAML>=3.12'/" -i optional_plugins/varianter_yaml_to_mux/setup.py + %endif + %py2_build + %if %{with_python3} diff --git a/python-avocado.spec b/python-avocado.spec index 1475bf3..70a4dc6 100644 --- a/python-avocado.spec +++ b/python-avocado.spec @@ -12,10 +12,10 @@ %global gittar %{srcname}-%{version}.tar.gz %else %if ! 0%{?commit:1} - %global commit d3487744354bc4a37c238a463fcb867992a2cfe8 + %global commit 1fe02ba801b3e76bb5a6b141b6272e8180bea49d %endif %if ! 0%{?commit_date:1} - %global commit_date 20181119 + %global commit_date 20181217 %endif %global shortcommit %(c=%{commit};echo ${c:0:8}) %global gitrel .%{commit_date}git%{shortcommit} @@ -49,7 +49,7 @@ %endif Name: python-%{pkgname} -Version: 66.0 +Version: 67.0 Release: 1%{?gitrel}%{?dist} Summary: Framework with tools and libraries for Automated Testing Group: Development/Tools @@ -61,8 +61,15 @@ License: GPLv2 and MIT URL: http://avocado-framework.github.io/ Source0: https://github.com/avocado-framework/%{srcname}/archive/%{gitref}.tar.gz#/%{gittar} BuildArch: noarch -# Patch to skip unreliable tests that result in Fedora build failures -Patch0: avocado-66.0-skip-unreliable-selftests.patch +# Patch to make vmimage tests not depend on host arch +# https://github.com/avocado-framework/avocado/commit/7c67cc73ad30dc784f6a98abab3bfd5c5fd05ece +Patch0: python-avocado-67.0-vmimage-host-arch.patch +# Patch upstream PyYAML versions, part 1 +# https://github.com/avocado-framework/avocado/commit/c60f0ae859e0df4ac748ddc2e5cc32207679c538 +Patch1: python-avocado-67.0-yaml-versions-1.patch +# Patch upstream PyYAML versions, part 2 +# https://github.com/avocado-framework/avocado/commit/8be7c4fb325aa875e7d752975d61cd89f9239e7b +Patch2: python-avocado-67.0-yaml-versions-2.patch BuildRequires: procps-ng BuildRequires: kmod @@ -74,14 +81,13 @@ BuildRequires: python2-docutils BuildRequires: python2-mock BuildRequires: python2-psutil BuildRequires: python2-requests -BuildRequires: python2-resultsdb_api BuildRequires: python2-setuptools BuildRequires: python2-six BuildRequires: python2-sphinx %if 0%{?fedora} > 27 || 0%{?rhel} > 7 -BuildRequires: python2-pystache +BuildRequires: python2-jinja2 %else -BuildRequires: pystache +BuildRequires: python-jinja2 %endif %if 0%{?fedora} >= 29 BuildRequires: python2-fabric3 @@ -102,17 +108,22 @@ BuildRequires: python-stevedore # See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal BuildRequires: python2-pycdlib %endif +%if (0%{?fedora} && 0%{?fedora} <= 29) || (0%{?rhel} && 0%{?rhel} <= 7) +# Python2 binary packages are being removed +# See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal +BuildRequires: python2-resultsdb_api +%endif %endif %if %{with python3} BuildRequires: python3-aexpect BuildRequires: python3-devel BuildRequires: python3-docutils +BuildRequires: python3-jinja2 BuildRequires: python3-lxml BuildRequires: python3-mock BuildRequires: python3-psutil BuildRequires: python3-pycdlib -BuildRequires: python3-pystache BuildRequires: python3-requests BuildRequires: python3-resultsdb_api BuildRequires: python3-setuptools @@ -125,16 +136,26 @@ BuildRequires: python3-fabric3 %endif %if 0%{?with_tests} +BuildRequires: genisoimage +BuildRequires: libcdio BuildRequires: perl-Test-Harness +BuildRequires: psmisc +%if 0%{?fedora} >= 30 || 0%{?rhel} > 7 +BuildRequires: glibc-all-langpacks +%endif %if %{with python2} -BuildRequires: python2-yaml %if 0%{?fedora} >= 27 || 0%{?rhel} > 7 BuildRequires: python2-libvirt +BuildRequires: python2-netifaces +BuildRequires: python2-yaml %else BuildRequires: libvirt-python +BuildRequires: python-netifaces +BuildRequires: python-yaml %endif %endif %if %{with python3} +BuildRequires: python3-netifaces BuildRequires: python3-yaml %if 0%{?fedora} >= 27 || 0%{?rhel} > 7 BuildRequires: python3-libvirt @@ -151,12 +172,20 @@ these days a framework) to perform automated testing. %prep %setup -q -n %{srcname}-%{gitref} -%patch0 +%patch0 -p1 +%patch1 -p1 +%patch2 -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 sed -e "s/'libvirt-python'//" -i optional_plugins/runner_vm/setup.py - +%if 0%{?rhel} && 0%{?rhel} <= 7 +sed -e "s/'six>=1.10.0'/'six>=1.9.0'/" -i setup.py +sed -e "s/'PyYAML>=4.2b2'/'PyYAML>=3.10'/" -i optional_plugins/varianter_yaml_to_mux/setup.py +%endif +%if 0%{?fedora} && 0%{?fedora} < 29 +sed -e "s/'PyYAML>=4.2b2'/'PyYAML>=3.12'/" -i optional_plugins/varianter_yaml_to_mux/setup.py +%endif %build %if %{with python2} @@ -199,7 +228,9 @@ pushd optional_plugins/runner_docker popd pushd optional_plugins/resultsdb %if %{with python2} - %py2_build + %if (0%{?fedora} && 0%{?fedora} <= 29) || (0%{?rhel} && 0%{?rhel} <= 7) + %py2_build + %endif %endif %if %{with python3} %py3_build @@ -330,7 +361,9 @@ pushd optional_plugins/runner_docker popd pushd optional_plugins/resultsdb %if %{with python2} - %py2_install + %if (0%{?fedora} && 0%{?fedora} <= 29) || (0%{?rhel} && 0%{?rhel} <= 7) + %py2_install + %endif %endif %if %{with python3} %py3_install @@ -443,9 +476,11 @@ find %{buildroot}%{_docdir}/avocado -type f -name '*.py' -exec %{__chmod} -c -x pushd optional_plugins/runner_docker %{__python2} setup.py develop --user popd + %if (0%{?fedora} && 0%{?fedora} <= 29) || (0%{?rhel} && 0%{?rhel} <= 7) pushd optional_plugins/resultsdb %{__python2} setup.py develop --user popd + %endif pushd optional_plugins/varianter_yaml_to_mux %{__python2} setup.py develop --user popd @@ -642,9 +677,9 @@ Summary: Avocado HTML report plugin %{?python_provide:%python_provide python2-%{pkgname}-plugins-output-html} Requires: python2-%{pkgname} == %{version}-%{release} %if 0%{?fedora} > 27 || 0%{?rhel} > 7 -Requires: python2-pystache +Requires: python2-jinja2 %else -Requires: pystache +Requires: python-jinja2 %endif %description -n python2-%{pkgname}-plugins-output-html @@ -662,7 +697,7 @@ arbitrary filesystem location. Summary: Avocado HTML report plugin %{?python_provide:%python_provide python3-%{pkgname}-plugins-output-html} Requires: python3-%{pkgname} == %{version}-%{release} -Requires: python3-pystache +Requires: python3-jinja2 %description -n python3-%{pkgname}-plugins-output-html Adds to avocado the ability to generate an HTML report at every job results @@ -791,6 +826,7 @@ be previously installed on the container. %if %{with python2} +%if (0%{?fedora} && 0%{?fedora} <= 29) || (0%{?rhel} && 0%{?rhel} <= 7) %package -n python2-%{pkgname}-plugins-resultsdb Summary: Avocado plugin to propagate job results to ResultsDB %{?python_provide:%python_provide python2-%{pkgname}-plugins-resultsdb} @@ -806,6 +842,7 @@ server. %{python2_sitelib}/avocado_framework_plugin_resultsdb-%{version}-py%{python2_version}.egg-info %config(noreplace) %{_sysconfdir}/avocado/conf.d/resultsdb.conf %endif +%endif %if %{with python3} %package -n python3-%{pkgname}-plugins-resultsdb @@ -830,7 +867,11 @@ server. Summary: Avocado plugin to generate variants out of yaml files %{?python_provide:%python_provide python2-%{pkgname}-plugins-varianter-yaml-to-mux} Requires: python2-%{pkgname} == %{version}-%{release} +%if 0%{?fedora} >= 27 || 0%{?rhel} > 7 Requires: python2-yaml +%else +Requires: python-yaml +%endif %description -n python2-%{pkgname}-plugins-varianter-yaml-to-mux Can be used to produce multiple test variants with test parameters @@ -1096,6 +1137,14 @@ Again Shell code (and possibly other similar shells). %changelog +* 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 diff --git a/sources b/sources index 20f3cd5..5548de1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (avocado-66.0.tar.gz) = 6eaebce65fc5ea86875e461213ef237c3b580f8c6539dc50a343996e43723485ff6db767e9a11b45cc6ed0eeb0678b3ef13056d8fcb7f5f94457ac2261f55f1a +SHA512 (avocado-67.0.tar.gz) = 434c1557be5c23a0f159523b79012ee0226332116b3eae4a3c3dd202cb7442c12ee370d47cb136d5d6d33306427170d93d70097064c3545906eb9288f130e924