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 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