From 1ec53e8e38f9fc9382ad5064517ec9a06989f959 Mon Sep 17 00:00:00 2001 From: Martin Krizek Date: Thu, 21 Nov 2024 18:34:11 +0100 Subject: [PATCH] New change as create_repo has been rewritten in 2.18 --- .../setup_rpm_repo/library/create_repo.py | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/test/integration/targets/setup_rpm_repo/library/create_repo.py b/test/integration/targets/setup_rpm_repo/library/create_repo.py index 5b04e8e66c6..1f74840a16a 100644 --- a/test/integration/targets/setup_rpm_repo/library/create_repo.py +++ b/test/integration/targets/setup_rpm_repo/library/create_repo.py @@ -12,15 +12,17 @@ from ansible.module_utils.common.respawn import has_respawned, probe_interpreter HAS_RPMFLUFF = True can_use_rpm_weak_deps = None try: - from rpmfluff import SimpleRpmBuild, GeneratedSourceFile, make_gif + from rpmfluff import SimpleRpmBuild, GeneratedSourceFile, make_gif, expectedArch from rpmfluff import YumRepoBuild except ImportError: try: from rpmfluff.make import make_gif from rpmfluff.sourcefile import GeneratedSourceFile from rpmfluff.rpmbuild import SimpleRpmBuild + from rpmfluff.utils import expectedArch from rpmfluff.yumrepobuild import YumRepoBuild except ImportError: + expectedArch = None # define here to avoid NameError as it is used on top level in SPECS HAS_RPMFLUFF = False can_use_rpm_weak_deps = None @@ -34,25 +36,27 @@ if HAS_RPMFLUFF: pass -RPM = namedtuple('RPM', ['name', 'version', 'release', 'epoch', 'recommends', 'file', 'arch']) +RPM = namedtuple('RPM', ['name', 'version', 'release', 'epoch', 'recommends', 'file', 'arch', 'binary']) SPECS = [ - RPM('dinginessentail', '1.0', '1', None, None, None, None), - RPM('dinginessentail', '1.0', '2', '1', None, None, None), - RPM('dinginessentail', '1.1', '1', '1', None, None, None), - RPM('dinginessentail-olive', '1.0', '1', None, None, None, None), - RPM('dinginessentail-olive', '1.1', '1', None, None, None, None), - RPM('landsidescalping', '1.0', '1', None, None, None, None), - RPM('landsidescalping', '1.1', '1', None, None, None, None), - RPM('dinginessentail-with-weak-dep', '1.0', '1', None, ['dinginessentail-weak-dep'], None, None), - RPM('dinginessentail-weak-dep', '1.0', '1', None, None, None, None), - RPM('noarchfake', '1.0', '1', None, None, None, 'noarch'), - RPM('provides_foo_a', '1.0', '1', None, None, 'foo.gif', 'noarch'), - RPM('provides_foo_b', '1.0', '1', None, None, 'foo.gif', 'noarch'), - RPM('number-11-name', '11.0', '1', None, None, None, None), - RPM('number-11-name', '11.1', '1', None, None, None, None), - RPM('epochone', '1.0', '1', '1', None, None, "noarch"), - RPM('epochone', '1.1', '1', '1', None, None, "noarch"), + RPM('dinginessentail', '1.0', '1', None, None, None, None, None), + RPM('dinginessentail', '1.0', '2', '1', None, None, None, None), + RPM('dinginessentail', '1.1', '1', '1', None, None, None, None), + RPM('dinginessentail-olive', '1.0', '1', None, None, None, None, None), + RPM('dinginessentail-olive', '1.1', '1', None, None, None, None, None), + RPM('landsidescalping', '1.0', '1', None, None, None, None, None), + RPM('landsidescalping', '1.1', '1', None, None, None, None, None), + RPM('dinginessentail-with-weak-dep', '1.0', '1', None, ['dinginessentail-weak-dep'], None, None, None), + RPM('dinginessentail-weak-dep', '1.0', '1', None, None, None, None, None), + RPM('noarchfake', '1.0', '1', None, None, None, 'noarch', None), + RPM('provides_foo_a', '1.0', '1', None, None, 'foo.gif', 'noarch', None), + RPM('provides_foo_b', '1.0', '1', None, None, 'foo.gif', 'noarch', None), + RPM('number-11-name', '11.0', '1', None, None, None, None, None), + RPM('number-11-name', '11.1', '1', None, None, None, None, None), + RPM('epochone', '1.0', '1', '1', None, None, "noarch", None), + RPM('epochone', '1.1', '1', '1', None, None, "noarch", None), + RPM('provides-binary', '1.0', '1', '1', None, None, expectedArch, '/usr/sbin/package-name'), + RPM('package-name', '1.0', '1', '1', None, None, "noarch", None), ] @@ -84,7 +88,7 @@ def create_repo(arch='x86_64'): pkgs.append(pkg) repo = YumRepoBuild(pkgs) - repo.make(arch, 'noarch') + repo.make(arch, 'noarch', expectedArch) for pkg in pkgs: pkg.clean()