Sync with upstream release 63.0. (BZ#1602175)

Include upstream patches needed to build for Rawhide.
This commit is contained in:
Merlin Mathesius 2018-07-23 13:08:47 -05:00
commit 549ac485c4
7 changed files with 198 additions and 37 deletions

1
.gitignore vendored
View file

@ -9,3 +9,4 @@
/avocado-52.1.tar.gz
/avocado-61.0.tar.gz
/avocado-62.0.tar.gz
/avocado-63.0.tar.gz

View file

@ -1,19 +0,0 @@
diff -ru ../avocado-62.0.ORIG/optional_plugins/runner_remote/setup.py ./optional_plugins/runner_remote/setup.py
--- ../avocado-62.0.ORIG/optional_plugins/runner_remote/setup.py 2018-06-12 12:06:21.000000000 -0500
+++ ./optional_plugins/runner_remote/setup.py 2018-06-13 10:11:28.610118149 -0500
@@ -13,12 +13,13 @@
# Copyright: Red Hat Inc. 2017
# Author: Cleber Rosa <crosa@redhat.com>
-import sys
+import distro
from setuptools import setup, find_packages
-if sys.version_info[0] == 3:
+if distro.linux_distribution()[0] == 'Fedora' and \
+ distro.linux_distribution()[1] >= '29':
fabric = 'Fabric3<2.0.0'
else:
fabric = 'fabric<2.0.0'

61
avocado-63.0-pep479.patch Normal file
View file

@ -0,0 +1,61 @@
From 023e3186f6577d3292941c4634ca04effef1e713 Mon Sep 17 00:00:00 2001
From: Cleber Rosa <crosa@redhat.com>
Date: Fri, 20 Jul 2018 14:41:54 -0400
Subject: [PATCH] PEP479: do not raise StopIteration
Raising StopIteration gets translated to a RuntimeError in Python 3.7.
The same behavior can be achieved by 'return' from generators.
Reference: https://github.com/avocado-framework/avocado/issues/2721
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
avocado/core/tree.py | 2 +-
.../varianter_yaml_to_mux/avocado_varianter_yaml_to_mux/mux.py | 8 +++++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/avocado/core/tree.py b/avocado/core/tree.py
index 36b6629f8..2406b39a7 100644
--- a/avocado/core/tree.py
+++ b/avocado/core/tree.py
@@ -274,7 +274,7 @@ def iter_parents(self):
node = self.parent
while True:
if node is None:
- raise StopIteration
+ return
yield node
node = node.parent
diff --git a/optional_plugins/varianter_yaml_to_mux/avocado_varianter_yaml_to_mux/mux.py b/optional_plugins/varianter_yaml_to_mux/avocado_varianter_yaml_to_mux/mux.py
index a7e6272cb..d6a6cf28e 100644
--- a/optional_plugins/varianter_yaml_to_mux/avocado_varianter_yaml_to_mux/mux.py
+++ b/optional_plugins/varianter_yaml_to_mux/avocado_varianter_yaml_to_mux/mux.py
@@ -73,7 +73,7 @@ def _iter_mux_leaves(node):
try:
node = queue.popleft()
except IndexError:
- raise StopIteration
+ return
def __iter__(self):
"""
@@ -101,7 +101,10 @@ def iter_variants(self):
pools.append([pool])
variants = itertools.product(*pools)
while True:
- yield list(itertools.chain(*next(variants)))
+ try:
+ yield list(itertools.chain(*next(variants)))
+ except StopIteration:
+ return
@staticmethod
def _valid_variant(variant):
@@ -310,7 +313,6 @@ def iteritems(self):
""" Slower implementation with the use of __getitem__ """
for key in iterkeys(self):
yield key, self[key]
- raise StopIteration
class Control(object): # Few methods pylint: disable=R0903

View file

@ -0,0 +1,36 @@
From 9b2db940621dd8fa75b38db54a704be7a9ab0062 Mon Sep 17 00:00:00 2001
From: Cleber Rosa <crosa@redhat.com>
Date: Fri, 20 Jul 2018 17:30:57 -0400
Subject: [PATCH] selftests/functional/test_basic.py: prevent unversioned
Python
`examples/tests/simplewarning.sh` calls a generic avocado command,
which gets added to the path by the test code. That generic avocado
command is `scripts/avocado`, from the source repository, which
contains the unversioned `/usr/bin/env python`.
Under some environments, such as Fedora >= 29, there may be no
unversioned Python binary. Let's respect the UNITTEST_AVOCADO_CMD
environment variable, and add the the directory containting that
binary to the PATH.
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
selftests/functional/test_basic.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/selftests/functional/test_basic.py b/selftests/functional/test_basic.py
index 7b7edbada..1f26f9db2 100644
--- a/selftests/functional/test_basic.py
+++ b/selftests/functional/test_basic.py
@@ -730,7 +730,9 @@ def test_simplewarning(self):
simplewarning.sh uses the avocado-bash-utils
"""
# simplewarning.sh calls "avocado" without specifying a path
- os.environ['PATH'] += ":" + os.path.join(basedir, 'scripts')
+ # let's add the path that was defined at the global module
+ # scope here
+ os.environ['PATH'] += ":" + os.path.dirname(AVOCADO)
# simplewarning.sh calls "avocado exec-path" which hasn't
# access to an installed location for the libexec scripts
os.environ['PATH'] += ":" + os.path.join(basedir, 'libexec')

View file

@ -0,0 +1,77 @@
From d86a844a5fb92d9de6f224a7c44903ffb5cba5ca Mon Sep 17 00:00:00 2001
From: Merlin Mathesius <mmathesi@redhat.com>
Date: Tue, 17 Jul 2018 16:55:34 -0500
Subject: [PATCH] Fix scripts to explicitly use proper version of Python.
Signed-off-by: Merlin Mathesius <mmathesi@redhat.com>
---
selftests/functional/test_skiptests.py | 4 ++--
selftests/functional/test_utils.py | 8 ++++----
selftests/run | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/selftests/functional/test_skiptests.py b/selftests/functional/test_skiptests.py
index f82ad610e..70ecdc10a 100644
--- a/selftests/functional/test_skiptests.py
+++ b/selftests/functional/test_skiptests.py
@@ -127,7 +127,7 @@ def test_skip_decorators(self):
def test_skip_setup(self):
os.chdir(basedir)
- cmd_line = ['./scripts/avocado',
+ cmd_line = [AVOCADO,
'run',
'--sysinfo=off',
'--job-results-dir',
@@ -141,7 +141,7 @@ def test_skip_setup(self):
def test_skip_teardown(self):
os.chdir(basedir)
- cmd_line = ['./scripts/avocado',
+ cmd_line = [AVOCADO,
'run',
'--sysinfo=off',
'--job-results-dir',
diff --git a/selftests/functional/test_utils.py b/selftests/functional/test_utils.py
index 33fbd5334..8b74a546f 100644
--- a/selftests/functional/test_utils.py
+++ b/selftests/functional/test_utils.py
@@ -20,7 +20,7 @@
stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP |
stat.S_IROTH | stat.S_IXOTH)
-FAKE_VMSTAT_CONTENTS = """#!/usr/bin/env python
+FAKE_VMSTAT_CONTENTS = """#!{python}
import time
import random
import signal
@@ -115,13 +115,13 @@ def start(self):
if __name__ == '__main__':
vmstat = FakeVMStat(interval=float(sys.argv[1]))
vmstat.start()
-"""
+""".format(python=sys.executable)
-FAKE_UPTIME_CONTENTS = """#!/usr/bin/env python
+FAKE_UPTIME_CONTENTS = """#!{python}
if __name__ == '__main__':
print("17:56:34 up 8:06, 7 users, load average: 0.26, 0.20, 0.21")
-"""
+""".format(python=sys.executable)
class ProcessTest(unittest.TestCase):
diff --git a/selftests/run b/selftests/run
index 0a165ccb4..bd2639446 100755
--- a/selftests/run
+++ b/selftests/run
@@ -59,7 +59,7 @@ class MyResult(unittest.TextTestResult):
stdout=subprocess.PIPE,
stderr=subprocess.PIPE).communicate()
# ... and check whether some dirs were left behind
- dir_check = subprocess.Popen([CHECK_TMP_DIRS], stdout=subprocess.PIPE,
+ dir_check = subprocess.Popen([sys.executable, CHECK_TMP_DIRS], stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
if dir_check.wait():
raise AssertionError("Test %s left some tmp files behind:\n%s"

View file

@ -8,16 +8,18 @@
# Settings used for build from snapshots.
%if 0%{?rel_build}
%global gitref %{version}
%global gittar %{srcname}-%{version}.tar.gz
%else
%if ! 0%{?commit:1}
%global commit c6ac5529063018ca6df308f8495c71697747e255
%global commit ac8d94ee762f4e8ff71a5cae1ddf3019f46b0595
%endif
%if ! 0%{?commit_date:1}
%global commit_date 20180612
%global commit_date 20180717
%endif
%global shortcommit %(c=%{commit};echo ${c:0:8})
%global gitrel .%{commit_date}git%{shortcommit}
%global gitref %{commit}
%global gittar %{srcname}-%{shortcommit}.tar.gz
%endif
@ -40,7 +42,7 @@
%endif
Name: python-%{pkgname}
Version: 62.0
Version: 63.0
Release: 1%{?gitrel}%{?dist}
Summary: Framework with tools and libraries for Automated Testing
Group: Development/Tools
@ -50,13 +52,16 @@ Group: Development/Tools
# Other files: GPLv2 and GPLv2+
License: GPLv2 and MIT
URL: http://avocado-framework.github.io/
%if 0%{?rel_build}
Source0: https://github.com/avocado-framework/%{srcname}/archive/%{version}.tar.gz#/%{gittar}
%else
Source0: https://github.com/avocado-framework/%{srcname}/archive/%{commit}.tar.gz#/%{gittar}
%endif
# fabric has been renamed to Fabric3 in Rawhide
Patch0: avocado-62.0-rawhide-fabric-renamed.patch
Source0: https://github.com/avocado-framework/%{srcname}/archive/%{gitref}.tar.gz#/%{gittar}
# Fix scripts to explicitly use proper version of Python
# From upstream commit d86a844a5fb92d9de6f224a7c44903ffb5cba5ca
Patch0: avocado-63.0-selftest-python-version.patch
# PEP479: do not raise StopIteration
# From upstream commit 023e3186f6577d3292941c4634ca04effef1e713
Patch1: avocado-63.0-pep479.patch
# Fix scripts to avoid using unversioned Python
# From upstream commit 9b2db940621dd8fa75b38db54a704be7a9ab0062
Patch2: avocado-63.0-selftest-python-version-2.patch
BuildArch: noarch
BuildRequires: procps-ng
@ -65,7 +70,6 @@ BuildRequires: kmod
%if %{with python2}
BuildRequires: python2-aexpect
BuildRequires: python2-devel
BuildRequires: python2-distro
BuildRequires: python2-docutils
BuildRequires: python2-mock
BuildRequires: python2-psutil
@ -96,7 +100,6 @@ BuildRequires: python-stevedore
%if %{with python3}
BuildRequires: python3-aexpect
BuildRequires: python3-devel
BuildRequires: python3-distro
BuildRequires: python3-docutils
BuildRequires: python3-lxml
BuildRequires: python3-mock
@ -135,12 +138,10 @@ these days a framework) to perform automated testing.
%prep
%if 0%{?rel_build}
%setup -q -n %{srcname}-%{version}
%else
%setup -q -n %{srcname}-%{commit}
%endif
%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
@ -962,6 +963,10 @@ Again Shell code (and possibly other similar shells).
%changelog
* Mon Jul 23 2018 Merlin Mathesius <mmathesi@redhat.com> - 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 <mmathesi@redhat.com> - 62.0-1
- Sync with upstream release 62.0. (BZ#1590572)
- Correct libvirt dependency for EPEL7/RHEL7

View file

@ -1 +1 @@
SHA512 (avocado-62.0.tar.gz) = d65c372dc4f320df7158c0b108c547fa12c57c9b901c0de693226fd10f361f011f5dc46d3ae04cfbf8e15fe1ac37a01d70734ec7b01154edef5105e0a64409e3
SHA512 (avocado-63.0.tar.gz) = 747f7192aff3ddb2682a46cabcfe710840d54f561168110c28da4a89f44cb7d64f8395c7d0ed652a65705e09629a8aac0a2e125c183c6422625f32481fa127bb