From 8283f3614f9207e42afd7f25f91d2a574a954ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Wed, 4 Mar 2026 12:40:41 +0100 Subject: [PATCH 1/2] Install Behave from PyPI for ELN I'd like to start running tests on ELN as a precursor for RHEL 11 because we need to diverge RHEL 11 from Fedora (disabling modularity) and thus I want a test coverage. Adding Behave to a pip input file like this does not replace Behave we already install from RPM on Fedora. It's behaves as a fallback. (Behave as RPM will added later once ELN fixes rust compiler .) --- dnf-behave-tests/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/dnf-behave-tests/requirements.txt b/dnf-behave-tests/requirements.txt index fd2bf07df..0d678e6c4 100644 --- a/dnf-behave-tests/requirements.txt +++ b/dnf-behave-tests/requirements.txt @@ -1,2 +1,3 @@ +behave pexpect pyftpdlib From 23430f8a8b0004801483489a900bf4f0ad4a69df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Wed, 4 Mar 2026 14:10:11 +0100 Subject: [PATCH 2/2] Handle Fedora ELN as RHEL We compile the tested software according to %rhel RPM macro. To skip or condition tests correctly, we need to handle Fedora ELN as RHEL when evaluating behave tags. Old dection had these problems: distro.id() parses /etc/os-release. That file declares ELN in VARIANT constant, but distro.id() does not recognizes that (correctly because ELN is still a Fedora project). Also /etc/os-release does not contain the RHEL version. This patch overrides the distr.id() detection with querying RPM library for %rhel macro. The same what we use when building the software. --- dnf-behave-tests/common/lib/os_version.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dnf-behave-tests/common/lib/os_version.py b/dnf-behave-tests/common/lib/os_version.py index 6e76286e9..753aae14a 100644 --- a/dnf-behave-tests/common/lib/os_version.py +++ b/dnf-behave-tests/common/lib/os_version.py @@ -1,13 +1,22 @@ # -*- coding: utf-8 -*- import distro +import rpm def detect_os_version(): os_id = distro.id() + major_version = distro.major_version() # treat centos as RHEL in context of scenario tag matching if os_id == "centos": os_id = "rhel" - return os_id + "__" + distro.major_version() + # Treat anything that defines non-empty "rhel" RPM macro as RHEL. + # That's especially needed to handle Fedora ELN as RHEL. + rhel_macro_version = int(rpm.expandMacro("0%{?rhel}")) + if rhel_macro_version > 0: + os_id = "rhel" + major_version = str(rhel_macro_version) + + return os_id + "__" + major_version