diff --git a/0001-pungi-Fix-tests-on-non-x86_64-arches.patch b/0001-pungi-Fix-tests-on-non-x86_64-arches.patch new file mode 100644 index 00000000..5e3c461a --- /dev/null +++ b/0001-pungi-Fix-tests-on-non-x86_64-arches.patch @@ -0,0 +1,36 @@ +From 3c1e2fba662cd635b20d2daf2c5acacfee407876 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Wed, 16 Nov 2016 09:20:10 +0100 +Subject: [PATCH] pungi: Fix tests on non-x86_64 arches +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If the test did not specify an arch explicitly, it fell back on whatever +arch the current machine has. This was causing failures when building +RPM. + +Signed-off-by: Lubomír Sedlář +--- + tests/test_pungi.py | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/tests/test_pungi.py b/tests/test_pungi.py +index a3297e7..d770d2a 100644 +--- a/tests/test_pungi.py ++++ b/tests/test_pungi.py +@@ -65,6 +65,11 @@ class TestPungi(unittest.TestCase): + p.write_kickstart(self.ks, repos, groups, packages, prepopulate=prepopulate, + multilib_whitelist=multilib_whitelist) + kwargs.setdefault('cache_dir', self.tmp_dir) ++ # Unless the test specifies an arch, we need to default to x86_64. ++ # Otherwise the arch of current machine will be used, which will cause ++ # failure most of the time. ++ kwargs.setdefault('arch', 'x86_64') ++ + p.run_pungi(self.ks, self.tmp_dir, 'DP', **kwargs) + with open(self.out, "r") as f: + pkg_map = p.get_packages(f.read()) +-- +2.7.4 + diff --git a/0002-pungi-Fix-incorrectly-skipped-tests.patch b/0002-pungi-Fix-incorrectly-skipped-tests.patch new file mode 100644 index 00000000..bee99c11 --- /dev/null +++ b/0002-pungi-Fix-incorrectly-skipped-tests.patch @@ -0,0 +1,33 @@ +From b7813d34ac8e7986fbf2e8b1e4fc35427655ee8a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= +Date: Wed, 16 Nov 2016 09:43:19 +0100 +Subject: [PATCH 2/2] pungi: Fix incorrectly skipped tests +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The test was not correctly being skipped in Koji build, causing build +failure. + +Signed-off-by: Lubomír Sedlář +--- + tests/test_pungi.py | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/tests/test_pungi.py b/tests/test_pungi.py +index d770d2a..a519ddf 100644 +--- a/tests/test_pungi.py ++++ b/tests/test_pungi.py +@@ -776,8 +776,7 @@ class TestPungi(unittest.TestCase): + "dummy-glibc-debuginfo-common-2.14-5.x86_64.rpm", + ]) + +- # This test is broken. +- @unittest.skip ++ @unittest.skip('This test is broken') + def test_bash_multilib_nogreedy(self): + packages = [ + "dummy-bash.+", +-- +2.7.4 + diff --git a/pungi.spec b/pungi.spec index 4eb3c48e..28cd987b 100644 --- a/pungi.spec +++ b/pungi.spec @@ -7,6 +7,9 @@ Group: Development/Tools License: GPLv2 URL: https://pagure.io/pungi Source0: https://pagure.io/releases/%{name}/%{name}-%{version}.tar.bz2 +# These patches are added here to fix running tests. They are proposed in upstream as well. +Patch0: 0001-pungi-Fix-tests-on-non-x86_64-arches.patch +Patch1: 0002-pungi-Fix-incorrectly-skipped-tests.patch BuildRequires: python-nose, python-nose-cov, python-mock BuildRequires: python-devel, python-setuptools, python2-productmd @@ -55,6 +58,8 @@ A tool to create anaconda based installation trees/isos of a set of rpms. %prep %setup -q +%patch0 -p1 +%patch1 -p1 %build %{__python} setup.py build