Location: Pulp SmashAPI Documentationpulp_smash.constants

Values usable by multiple test modules.

pulp_smash.constants.CALL_REPORT_KEYS = frozenset({'result', 'spawned_tasks', 'error'})

See: Call Report.

pulp_smash.constants.CONSUMERS_ACTIONS_CONTENT_REGENERATE_APPLICABILITY_PATH = '/pulp/api/v2/consumers/actions/content/regenerate_applicability/'

See: Content Applicability.

pulp_smash.constants.CONSUMERS_CONTENT_APPLICABILITY_PATH = '/pulp/api/v2/consumers/content/applicability/'

See: Content Applicability.

pulp_smash.constants.CONSUMERS_PATH = '/pulp/api/v2/consumers/'

See: Consumer APIs.

pulp_smash.constants.CONTENT_SOURCES_PATH = '/etc/pulp/content/sources/conf.d'

See: Content Sources.

pulp_smash.constants.CONTENT_UNITS_PATH = '/pulp/api/v2/content/units/'

See: Search for Units.

pulp_smash.constants.CONTENT_UPLOAD_PATH = '/pulp/api/v2/content/uploads/'

See: Creating an Upload Request.

pulp_smash.constants.DOCKER_IMAGE_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/docker/busybox:latest.tar'

The URL to a Docker image as created by docker save.

pulp_smash.constants.DOCKER_UPSTREAM_NAME = 'dmage/manifest-list-test'

The name of a Docker repository.

This repository has several desireable properties:

  • It is available via both DOCKER_V1_FEED_URL and DOCKER_V2_FEED_URL.
  • It has a manifest list, where one entry has an architecture of amd64 and an os of linux. (The “latest” tag offers this.)
  • It is relatively small.

There are also several ways in which this repository is lacking:

  • This repository isn’t an official repository. It’s less trustworthy, and may be more likely to change with little or no notice.
  • It doesn’t have a manifest list, where no entries have an architecture of amd64 and an os of linux. (The “arm32v7” tag provides schema v1 content.)

One can get a high-level view of the content in this repository by executing:

curl --location --silent \
https://registry.hub.docker.com/v2/repositories/$this_constant/tags \
| python -m json.tool
pulp_smash.constants.DOCKER_V1_FEED_URL = 'https://index.docker.io'

The URL to a V1 Docker registry.

This URL can be used as the “feed” property of a Pulp Docker registry.

pulp_smash.constants.DOCKER_V2_FEED_URL = 'https://registry-1.docker.io'

The URL to a V2 Docker registry.

This URL can be used as the “feed” property of a Pulp Docker registry.

pulp_smash.constants.DRPM = 'drpms/test-alpha-1.1-1_1.1-2.noarch.drpm'

The path to a DRPM file in one of the DRPM repositories.

This path may be joined with DRPM_SIGNED_FEED_URL or DRPM_UNSIGNED_FEED_URL.

pulp_smash.constants.DRPM_SIGNED_FEED_COUNT = 4

The number of packages available at DRPM_SIGNED_FEED_URL.

pulp_smash.constants.DRPM_SIGNED_FEED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/drpm-signed/'

The URL to a signed DRPM repository.

pulp_smash.constants.DRPM_SIGNED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/drpm-signed/drpms/test-alpha-1.1-1_1.1-2.noarch.drpm'

The URL to a DRPM file.


pulp_smash.constants.DRPM_UNSIGNED_FEED_COUNT = 4

The number of packages available at DRPM_UNSIGNED_FEED_URL.

pulp_smash.constants.DRPM_UNSIGNED_FEED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/drpm-unsigned/'

The URL to an unsigned DRPM repository.

pulp_smash.constants.DRPM_UNSIGNED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/drpm-unsigned/drpms/test-alpha-1.1-1_1.1-2.noarch.drpm'

The URL to a unsigned DRPM file.


pulp_smash.constants.ERROR_KEYS = frozenset({'http_status', 'error', 'error_message', 'exception', '_href', 'traceback'})

See: Exception Handling.

No href field should be present. See Issue #1310.

pulp_smash.constants.FILE_FEED_COUNT = 3

The number of packages available at FILE_FEED_URL.

pulp_smash.constants.FILE_FEED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/file/'

The URL to a file repository.

pulp_smash.constants.FILE_MIXED_FEED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/file-mixed/'

The URL to a file repository containing invalid and valid entries.

pulp_smash.constants.FILE_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/file/1.iso'

The URL to an ISO file at FILE_FEED_URL.

pulp_smash.constants.GROUP_CALL_REPORT_KEYS = frozenset({'group_id', '_href'})

See: Group Call Report.

pulp_smash.constants.LOGIN_KEYS = frozenset({'certificate', 'key'})

See: User Certificates.

pulp_smash.constants.LOGIN_PATH = '/pulp/api/v2/actions/login/'

See: Authentication.

pulp_smash.constants.ORPHANS_PATH = 'pulp/api/v2/content/orphans/'

See: Orphaned Content.

pulp_smash.constants.OSTREE_BRANCHES = ['rawhide', 'stable']

A branch in OSTREE_FEED. See OSTree Importer Configuration.

pulp_smash.constants.OSTREE_FEED = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/ostree/small/'

The URL to a URL of OSTree branches. See OSTree Importer Configuration.

pulp_smash.constants.PLUGIN_TYPES_PATH = '/pulp/api/v2/plugins/types/'

See: Retrieve All Content Unit Types.

pulp_smash.constants.PULP_FIXTURES_BASE_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/'

A URL at which generated pulp fixtures are hosted.

pulp_smash.constants.PULP_FIXTURES_KEY_ID = '269d9d98'

The 32-bit ID of the public key used to sign various fixture files.

To calculate a new key ID, find the public key used by Pulp Fixtures (it should be in the Pulp Fixtures source code repository) and use GnuPG to examine it:

$ gpg "$public_key_file"
pub   rsa2048 2016-08-05 [SC]
uid           Pulp QE
sub   rsa2048 2016-08-05 [E]

The last 32 bits (8 characters) of the key ID are what Pulp wants — in this example, 269D9D98.

pulp_smash.constants.PULP_SERVICES = {'pulp_resource_manager', 'pulp_celerybeat', 'pulp_workers', 'httpd'}

Core Pulp services.

There are services beyond just these that Pulp depends on in order to function correctly. For example, an AMQP broker such as RabbitMQ or Qpid is integral to Pulp’s functioning. However, if resetting Pulp (such as in pulp_smash.utils.reset_pulp()), this is the set of services that should be restarted.

pulp_smash.constants.PUPPET_FEED_2 = 'http://forge.puppetlabs.com'

The URL to a repository of Puppet modules.

pulp_smash.constants.PUPPET_MODULE_1 = {'version': '0.1.0', 'name': 'dummypuppet', 'author': 'pulpqe'}

Information about a Puppet module available via Pulp Fixtures.

pulp_smash.constants.PUPPET_MODULE_2 = {'version': '1.0.0', 'name': 'pulp', 'author': 'pulp'}

Information about a Puppet module available at PUPPET_FEED_2.

pulp_smash.constants.PUPPET_MODULE_URL_1 = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/puppet/pulpqe-dummypuppet.tar.gz'

The URL to a Puppet module module available via Pulp Fixtures.

Test cases that require a single module should use this URL, and test cases that require a feed should use PUPPET_MODULE_URL_2. Doing so shifts load away from the Puppet Forge.

Why do both URLs exist? Because simulating the Puppet Forge’s behaviour is unreasonably hard.

Pulp Fixtures is designed to create data that can be hosted by a simple HTTP server, such as python3 -m http.server. A dynamic API, such as the Puppet Forge API, cannot be simulated. We could create a static tree of files, where that tree of files is the same as what the Puppet Forge would provide in response to a certain HTTP GET request. However:

  • The Puppet Forge API will inevitably change over time as bugs are fixed and features are added. This will make a static facsimile of the Puppet Forge API outdated. This is more than a mere inconvenience: outdated information is also confusing!
  • Without an in-depth understanding of each and every file the Puppet Forge yields, it is probable that static fixtures will be wrong from the get-go.
pulp_smash.constants.PUPPET_MODULE_URL_2 = 'http://forge.puppetlabs.com/v3/files/pulp-pulp-1.0.0.tar.gz'

The URL to a Puppet module available at PUPPET_FEED_2.

pulp_smash.constants.PUPPET_QUERY_2 = 'pulp-pulp-1.0.0'

A query that can be used to search for Puppet modules.

Built from PUPPET_MODULE_2.

Though the Puppet Forge API supports a variety of search types, Pulp only supports the ability to search for modules. As a result, it is impossible to create a Puppet repository and sync only an exact module or set of modules. This query intentionally returns a small number of Puppet modules. A query which selected a large number of modules would produce tests that took a long time and abused the free Puppet Forge service.

Beware that the Pulp API takes given Puppet queries and uses them to construct URL queries verbatim. Thus, if the user gives a query of “foo bar”, the following URL is constructed:

In an attempt to avoid this error, this query is encoded before being submitted to Pulp.

pulp_smash.constants.PYTHON_EGG_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/python-pypi/packages/3a/e3/a6954c4134a899c0006515fbd40208922572947e960b35d0d19fd5a1b3d0/shelf-reader-0.1.tar.gz'

The URL to a Python egg at PYTHON_PYPI_FEED_URL.

pulp_smash.constants.PYTHON_PYPI_FEED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/python-pypi/'

The URL to the PyPI Python repository.

pulp_smash.constants.PYTHON_WHEEL_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/python-pypi/packages/77/e0/2156a3da94ee16466a5936394caf7e89873a9b46eed72a9912bc90e42dbf/shelf_reader-0.1-py2-none-any.whl'

The URL to a Python egg at PYTHON_PYPI_FEED_URL.

pulp_smash.constants.REPOSITORY_EXPORT_DISTRIBUTOR = 'export_distributor'

A distributor_type_id to export a repository.

See: Export Distributors.

pulp_smash.constants.REPOSITORY_GROUP_EXPORT_DISTRIBUTOR = 'group_export_distributor'

A distributor_type_id to export a repository group.

See: Export Distributors.

pulp_smash.constants.REPOSITORY_GROUP_PATH = '/pulp/api/v2/repo_groups/'

See: Repository Group APIs

pulp_smash.constants.REPOSITORY_PATH = '/pulp/api/v2/repositories/'

See: Repository APIs.

pulp_smash.constants.RPM = 'bear-4.1-1.noarch.rpm'

The name of an RPM file. See pulp_smash.constants.RPM_SIGNED_URL.

pulp_smash.constants.RPM2 = 'camel-0.1-1.noarch.rpm'

The name of an RPM. See pulp_smash.constants.RPM2_UNSIGNED_URL.

pulp_smash.constants.RPM2_UNSIGNED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-unsigned/camel-0.1-1.noarch.rpm'

The URL to an unsigned RPM file.


pulp_smash.constants.RPM_ALT_LAYOUT_FEED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-alt-layout/'

The URL to a signed RPM repository. See RPM_SIGNED_URL.

pulp_smash.constants.RPM_DATA = mappingproxy({'epoch': '0', 'version': '4.1', 'metadata': {'size': {'package': 1846, 'installed': 42}, 'files': {'file': ['/tmp/bear.txt'], 'dir': []}, 'summary': 'A dummy package of bear', 'description': 'A dummy package of bear', 'license': 'GPLv2', 'sourcerpm': 'bear-4.1-1.src.rpm', 'release': '1', 'group': 'Internet/Applications'}, 'vendor': None, 'release': '1', 'name': 'bear', 'arch': 'noarch'})

Metadata for an RPM with an associated erratum.

The metadata tags that may be present in an RPM may be printed with:

rpm --querytags

Metadata for an RPM can be printed with a command like the following:

for tag in name epoch version release arch vendor; do
    echo "$(rpm -qp bear-4.1-1.noarch.rpm --qf "%{$tag}")"

There are three ways to measure the size of an RPM:

installed size
The size of all the regular files in the payload.
archive size
The uncompressed size of the payload, including necessary CPIO headers.
package size
The actual size of an RPM file, as returned by stat --format='%s' .

For more information, see the Fedora documentation on RPM headers.

pulp_smash.constants.RPM_ERRATUM_COUNT = 4

The number of errata listed in RPM_ERRATUM_URL.

pulp_smash.constants.RPM_ERRATUM_ID = 'RHEA-2012:0058'

The ID of an erratum.

The package contained on this erratum is defined by pulp_smash.constants.RPM_ERRATUM_RPM_NAME and the erratum is present on repository which feed is pulp_smash.constants.RPM_SIGNED_FEED_URL.

pulp_smash.constants.RPM_ERRATUM_RPM_NAME = 'gorilla'

The name of the RPM named by pulp_smash.constants.RPM_ERRATUM_ID.

pulp_smash.constants.RPM_ERRATUM_URL = 'https://repos.fedorapeople.org/repos/pulp/pulp/fixtures/rpm-erratum/erratum.json'

The URL to an JSON erratum file for an RPM repository.


This erratum is also used by several of the RPM repositories referenced in this module.

pulp_smash.constants.RPM_INCOMPLETE_FILELISTS_FEED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-incomplete-filelists/'

The URL to a repository with an incomplete filelists.xml file.

pulp_smash.constants.RPM_INCOMPLETE_OTHER_FEED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-incomplete-other/'

The URL to a repository with an incomplete other.xml file.

pulp_smash.constants.RPM_MIRRORLIST_BAD = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-mirrorlist-bad'

The URL to a mirrorlist file containing only invalid entries.

pulp_smash.constants.RPM_MIRRORLIST_GOOD = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-mirrorlist-good'

The URL to a mirrorlist file containing only valid entries.

pulp_smash.constants.RPM_MIRRORLIST_LARGE = 'https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=x86_64'

A mirrorlist referencing a large RPM repository.

pulp_smash.constants.RPM_MIRRORLIST_MIXED = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-mirrorlist-mixed'

The URL to a mirrorlist file containing invalid and valid entries.

pulp_smash.constants.RPM_MISSING_FILELISTS_FEED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-missing-filelists/'

A repository that’s missing its filelists.xml file.

pulp_smash.constants.RPM_MISSING_OTHER_FEED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-missing-other/'

A repository that’s missing its other.xml file.

pulp_smash.constants.RPM_MISSING_PRIMARY_FEED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-missing-primary/'

A repository that’s missing its primary.xml file.

pulp_smash.constants.RPM_NAMESPACES = {'metadata/rpm': 'http://linux.duke.edu/metadata/rpm', 'metadata/common': 'http://linux.duke.edu/metadata/common', 'metadata/repo': 'http://linux.duke.edu/metadata/repo'}

Namespaces used by XML-based RPM metadata.

Many of the XML files generated by the createrepo utility make use of these namespaces. Some of the files that use these namespaces are listed below:

Used by repodata/primary.xml.
Used by repodata/repomd.xml.
Used by repodata/repomd.xml.
pulp_smash.constants.RPM_PKGLISTS_UPDATEINFO_FEED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-pkglists-updateinfo/'

A repository whose updateinfo file has multiple <pkglist> sections.

pulp_smash.constants.RPM_SIGNED_FEED_COUNT = 32

The number of packages available at RPM_SIGNED_FEED_URL.

pulp_smash.constants.RPM_SIGNED_FEED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-signed/'

The URL to a signed RPM repository. See RPM_SIGNED_URL.

pulp_smash.constants.RPM_SIGNED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-signed/bear-4.1-1.noarch.rpm'

The URL to an RPM file.


pulp_smash.constants.RPM_UNSIGNED_FEED_COUNT = 32

The number of packages available at RPM_UNSIGNED_FEED_URL.

pulp_smash.constants.RPM_UNSIGNED_FEED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-unsigned/'

The URL to an unsigned RPM repository. See RPM_SIGNED_URL.

pulp_smash.constants.RPM_UNSIGNED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-unsigned/bear-4.1-1.noarch.rpm'

The URL to an unsigned RPM file.


pulp_smash.constants.RPM_WITH_NON_ASCII_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-with-non-ascii/rpm-with-non-ascii-1-1.fc25.noarch.rpm'

The URL to an RPM with non-ascii metadata in its header.

pulp_smash.constants.RPM_WITH_NON_UTF_8_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-with-non-utf-8/rpm-with-non-utf-8-1-1.fc25.noarch.rpm'

The URL to an RPM with non-UTF-8 metadata in its header.

pulp_smash.constants.RPM_WITH_PULP_DISTRIBUTION_FEED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-with-pulp-distribution/'

The URL to a RPM repository with a PULP_DISTRIBUTION.xml file.

pulp_smash.constants.SRPM = 'test-srpm02-1.0-1.src.rpm'

An SRPM file at pulp_smash.constants.SRPM_SIGNED_FEED_URL.

pulp_smash.constants.SRPM_SIGNED_FEED_COUNT = 3

The number of packages available at SRPM_SIGNED_FEED_URL.

pulp_smash.constants.SRPM_SIGNED_FEED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/srpm-signed/'

The URL to a signed SRPM repository.

pulp_smash.constants.SRPM_SIGNED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/srpm-signed/test-srpm02-1.0-1.src.rpm'

The URL to an SRPM file.


pulp_smash.constants.SRPM_UNSIGNED_FEED_COUNT = 3

The number of packages available at SRPM_UNSIGNED_FEED_COUNT.

pulp_smash.constants.SRPM_UNSIGNED_FEED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/srpm-unsigned/'

The URL to an unsigned SRPM repository.

pulp_smash.constants.SRPM_UNSIGNED_URL = 'https://repos.fedorapeople.org/pulp/pulp/fixtures/srpm-unsigned/test-srpm02-1.0-1.src.rpm'

The URL to an unsigned SRPM file.


pulp_smash.constants.USER_PATH = '/pulp/api/v2/users/'

See: User APIs.