From c96d35cb70c18187bd2f69b1ae4c35a5bb06c7eb Mon Sep 17 00:00:00 2001 From: Tobias Grigo Date: Mon, 21 Sep 2026 10:31:59 +0200 Subject: [PATCH] Add a regression test ensuring that architecture all packages exist --- pulp_deb/tests/functional/api/test_publish.py | 34 +++++++++++++++++++ pulp_deb/tests/functional/constants.py | 1 + 2 files changed, 35 insertions(+) diff --git a/pulp_deb/tests/functional/api/test_publish.py b/pulp_deb/tests/functional/api/test_publish.py index d27cb3b66..be53a1924 100644 --- a/pulp_deb/tests/functional/api/test_publish.py +++ b/pulp_deb/tests/functional/api/test_publish.py @@ -18,6 +18,7 @@ DEB_FIXTURE_FLAT_REPOSITORY_NAME, DEB_FIXTURE_METADATA_UPDATE_REPOSITORY_NAME, DEB_FIXTURE_MISSING_ARCHITECTURE_REPOSITORY_NAME, + DEB_FIXTURE_MIXED_REPOSITORY_NAME, DEB_FIXTURE_SINGLE_DIST, DEB_FIXTURE_VARIANT_REPOSITORY_NAME, DEB_PACKAGE_INDEX_NAME, @@ -853,6 +854,39 @@ def parse_package_index(pkg_idx): return packages +@pytest.mark.parallel +def test_publish_architecture_all_package_index( + create_publication_and_verify_repo_version, + deb_distribution_factory, + download_content_unit, +): + """Test that architecture all packages are preserved when publishing.""" + remote_args = { + "distributions": "muspelheim", + "components": "nidavellir", + "architectures": "amd64", + } + + publication, _, _, _ = create_publication_and_verify_repo_version( + remote_args=remote_args, + publication_args=DEB_PUBLICATION_ARGS_ONLY_STRUCTURED, + remote_name=DEB_FIXTURE_MIXED_REPOSITORY_NAME, + ) + + distribution = deb_distribution_factory(publication) + base_path = distribution.to_dict()["base_path"] + + package_index = download_content_unit( + base_path, + "dists/muspelheim/nidavellir/binary-all/Packages", + ) + packages = list(deb822.Packages.iter_paragraphs(package_index, use_apt_pkg=False)) + + assert packages + assert {package["Package"] for package in packages} == {"regin"} + assert {package["Architecture"] for package in packages} == {"all"} + + @pytest.mark.parallel def test_publish_architecture_variant_package_indices( create_publication_and_verify_repo_version, diff --git a/pulp_deb/tests/functional/constants.py b/pulp_deb/tests/functional/constants.py index 5fe530f69..607e03792 100644 --- a/pulp_deb/tests/functional/constants.py +++ b/pulp_deb/tests/functional/constants.py @@ -38,6 +38,7 @@ def _clean_dict(d): DEB_FIXTURE_UPDATE_REPOSITORY_NAME = "/debian-update/" DEB_FIXTURE_INVALID_REPOSITORY_NAME = "/debian-invalid/" DEB_FIXTURE_FLAT_REPOSITORY_NAME = "/debian-flat/" +DEB_FIXTURE_MIXED_REPOSITORY_NAME = "/debian-mixed/" DEB_FIXTURE_VARIANT_REPOSITORY_NAME = "/debian-variant/" DEB_FIXTURE_BASE = "/" DEB_FIXTURE_COMPLEX_REPOSITORY_NAME = "/debian-complex-dists"