Sync with upstream release 68.0.

Signed-off-by: Merlin Mathesius <mmathesi@redhat.com>
This commit is contained in:
Merlin Mathesius 2019-02-24 14:44:06 -06:00
commit fc19652d5e
6 changed files with 24 additions and 214 deletions

1
.gitignore vendored
View file

@ -14,3 +14,4 @@
/avocado-65.0.tar.gz
/avocado-66.0.tar.gz
/avocado-67.0.tar.gz
/avocado-68.0.tar.gz

View file

@ -1,59 +0,0 @@
From 7c67cc73ad30dc784f6a98abab3bfd5c5fd05ece Mon Sep 17 00:00:00 2001
From: Cleber Rosa <crosa@redhat.com>
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 <crosa@redhat.com>
---
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)

View file

@ -1,53 +0,0 @@
From c60f0ae859e0df4ac748ddc2e5cc32207679c538 Mon Sep 17 00:00:00 2001
From: Caio Carrara <ccarrara@redhat.com>
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 <ccarrara@redhat.com>
---
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 <crosa@redhat.com>
+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": [

View file

@ -1,71 +0,0 @@
From 8be7c4fb325aa875e7d752975d61cd89f9239e7b Mon Sep 17 00:00:00 2001
From: Cleber Rosa <crosa@redhat.com>
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 <crosa@redhat.com>
---
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 <crosa@redhat.com>
-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}

View file

@ -12,10 +12,10 @@
%global gittar %{srcname}-%{version}.tar.gz
%else
%if ! 0%{?commit:1}
%global commit 1fe02ba801b3e76bb5a6b141b6272e8180bea49d
%global commit ed7a0e2eb1f5b568c2a77a6e11917efb24d6aa8d
%endif
%if ! 0%{?commit_date:1}
%global commit_date 20181217
%global commit_date 20190213
%endif
%global shortcommit %(c=%{commit};echo ${c:0:8})
%global gitrel .%{commit_date}git%{shortcommit}
@ -48,8 +48,17 @@
%global with_python3_fabric 0
%endif
# Python2 binary packages are being removed
# See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
# python2-resultsdb_api package has been removed in F30
%if %{with python2} && ( (0%{?fedora} && 0%{?fedora} <= 29) || (0%{?rhel} && 0%{?rhel} <= 7) )
%global with_python2_resultsdb 1
%else
%global with_python2_resultsdb 0
%endif
Name: python-%{pkgname}
Version: 67.0
Version: 68.0
Release: 1%{?gitrel}%{?dist}
Summary: Framework with tools and libraries for Automated Testing
Group: Development/Tools
@ -61,15 +70,6 @@ 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 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
@ -108,9 +108,7 @@ 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
%if %{with_python2_resultsdb}
BuildRequires: python2-resultsdb_api
%endif
%endif
@ -172,9 +170,6 @@ these days a framework) to perform automated testing.
%prep
%setup -q -n %{srcname}-%{gitref}
%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
@ -227,10 +222,8 @@ pushd optional_plugins/runner_docker
%endif
popd
pushd optional_plugins/resultsdb
%if %{with python2}
%if (0%{?fedora} && 0%{?fedora} <= 29) || (0%{?rhel} && 0%{?rhel} <= 7)
%py2_build
%endif
%if %{with_python2_resultsdb}
%py2_build
%endif
%if %{with python3}
%py3_build
@ -360,10 +353,8 @@ pushd optional_plugins/runner_docker
%endif
popd
pushd optional_plugins/resultsdb
%if %{with python2}
%if (0%{?fedora} && 0%{?fedora} <= 29) || (0%{?rhel} && 0%{?rhel} <= 7)
%py2_install
%endif
%if %{with_python2_resultsdb}
%py2_install
%endif
%if %{with python3}
%py3_install
@ -476,7 +467,7 @@ 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)
%if %{with_python2_resultsdb}
pushd optional_plugins/resultsdb
%{__python2} setup.py develop --user
popd
@ -825,8 +816,7 @@ be previously installed on the container.
%endif
%if %{with python2}
%if (0%{?fedora} && 0%{?fedora} <= 29) || (0%{?rhel} && 0%{?rhel} <= 7)
%if %{with_python2_resultsdb}
%package -n python2-%{pkgname}-plugins-resultsdb
Summary: Avocado plugin to propagate job results to ResultsDB
%{?python_provide:%python_provide python2-%{pkgname}-plugins-resultsdb}
@ -842,7 +832,6 @@ 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
@ -1137,6 +1126,9 @@ Again Shell code (and possibly other similar shells).
%changelog
* Fri Feb 22 2019 Merlin Mathesius <mmathesi@redhat.com> - 68.0-1
- Sync with upstream release 68.0.
* Thu Jan 31 2019 Merlin Mathesius <mmathesi@redhat.com> - 67.0-1
- Sync with upstream release 67.0.
- genisoimage, libcdio, and psmisc added as build deps so iso9660 tests run.

View file

@ -1 +1 @@
SHA512 (avocado-67.0.tar.gz) = 434c1557be5c23a0f159523b79012ee0226332116b3eae4a3c3dd202cb7442c12ee370d47cb136d5d6d33306427170d93d70097064c3545906eb9288f130e924
SHA512 (avocado-68.0.tar.gz) = 31375d97d43c4498d51038f8fc8100d86d25361dab1f78de68e006edd66073a65058ea64c2c0e3c3dc755eebe45247c41a8175b444d97f4967dab268fe158a96