From b9b5cf896356e2f1e01d67ed7a6d262cc5803c58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Wed, 24 Jul 2024 16:00:34 +0200 Subject: [PATCH] frontend: use the same repofile for all CentOS Stream versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nikola Forró --- frontend/coprs_frontend/coprs/helpers.py | 3 +++ frontend/coprs_frontend/tests/test_helpers.py | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/frontend/coprs_frontend/coprs/helpers.py b/frontend/coprs_frontend/coprs/helpers.py index c6645eab2..b717c02a1 100644 --- a/frontend/coprs_frontend/coprs/helpers.py +++ b/frontend/coprs_frontend/coprs/helpers.py @@ -346,6 +346,9 @@ def generate_repo_url(mock_chroot, url, arch=None): if mock_chroot.os_release == "fedora": os_version = "$releasever" + if mock_chroot.os_release == "centos-stream": + os_version = "$releasever" + if mock_chroot.os_release == "opensuse-leap": os_version = "$releasever" diff --git a/frontend/coprs_frontend/tests/test_helpers.py b/frontend/coprs_frontend/tests/test_helpers.py index 121bfccea..bf2df8694 100644 --- a/frontend/coprs_frontend/tests/test_helpers.py +++ b/frontend/coprs_frontend/tests/test_helpers.py @@ -79,6 +79,16 @@ def test_generate_repo_url(self): dict(args=(m3, https_url, 'ppc64le'), expected="https://example.com/path/rhel7-7.1-ppc64le/")]) + m4 = deepcopy(mock_chroot) + m4.os_release = "centos-stream" + m4.os_version = "9" + + test_sets.extend([ + dict(args=(m4, http_url), + expected="http://example.com/path/centos-stream-$releasever-$basearch/"), + dict(args=(m4, https_url), + expected="https://example.com/path/centos-stream-$releasever-$basearch/")]) + app.config["USE_HTTPS_FOR_RESULTS"] = True for test_set in test_sets: result = generate_repo_url(*test_set["args"])