pulp_2_tests.tests.rpm.api_v2.test_repository_layout¶
Location: Pulp 2 Tests → Tests → pulp_2_tests.tests.rpm.api_v2.test_repository_layout
Tests for the published repository layout.
Starting with Pulp 2.12, YUM distributor must publish repositories using the
layout where the packages are published to into Packages/<first_letter>
where <first_letter> is the first letter of a given RPM package. For
example, the bear.rpm package will be published into
Packages/b/bear.rpm. For more information, see Pulp issue #1976.
Old versions of Pulp uses the old layout where all repository’s packages were
published on the root of the repository directory not inside the
Packages/<first_letter> subdirectory.
-
class
pulp_2_tests.tests.rpm.api_v2.test_repository_layout.RepositoryLayoutTestCase(*args, **kwargs)¶ Bases:
pulp_smash.pulp2.utils.BaseAPITestCaseTest the YUM distributor publishing repository layout.
-
test_all()¶ Do not use the
packages_directoryoption.Create a distributor with default options, and use it to publish the repository. Verify packages end up in the current directory, relative to the published repository’s root. (This same directory contains the
repodatadirectory, and it may be changed by setting the distributor’srelative_url.)
-
-
pulp_2_tests.tests.rpm.api_v2.test_repository_layout.get_file_hrefs(repomd_xml)¶ Return the href of each file in a
repomd.xmlfile.Parameters: repomd_xml – An xml.etree.ElementTreeobject representing the root of arepomd.xmldocument.Returns: An iterable of hrefs, with each href as a string.
-
pulp_2_tests.tests.rpm.api_v2.test_repository_layout.get_package_hrefs(primary_xml)¶ Return the href of each package in a
primary.xmlfile.Parameters: primary_xml – An xml.etree.ElementTreeobject representing the root of aprimary.xmldocument.Returns: An iterable of hrefs, with each href as a string.
-
pulp_2_tests.tests.rpm.api_v2.test_repository_layout.get_parse_repodata_primary_xml(cfg, distributor)¶ Fetch, decompress, parse and return a
repodata/…primary.xml.gzfile.Parameters: - cfg – Information about the Pulp deployment being targeted.
- distributor – Information about a distributor. It should be a dict
containing at least
{'config': {'relative_url': …}}.
Returns: An
xml.etree.ElementTreeobject.
-
pulp_2_tests.tests.rpm.api_v2.test_repository_layout.get_parse_repodata_xml(cfg, distributor, file_path)¶ Fetch, parse and return an XML file from a
repodatadirectory.Parameters: - cfg – Information about the Pulp deployment being targeted.
- distributor – Information about a distributor. It should be a dict
containing at least
{'config': {'relative_url': …}}. - file_path – The path to an XML file, relative to the distributor’s
relative URL. For example:
repodata/repomd.xml.
Returns: The XML document, parsed as an
xml.etree.ElementTreeobject.