Location: Pulp SmashAPI Documentationpulp_smash.tests.pulp2.rpm.api_v2.test_content_applicability

Tests for Pulp’s content applicability feature.

class pulp_smash.tests.pulp2.rpm.api_v2.test_content_applicability.BasicTestCase(methodName='runTest')

Perform simple applicability generation tasks.

classmethod setUpClass()

Create and sync a repository.

The regular test methods that run after this can create consumers that bind to this repository.

classmethod tearDownClass()

Delete the repository created by setUpClass().


Verify content isn’t made available when appropriate.

Do the same as test_positive(), except that both packages’ versions are equal to what’s offered by the repository.


Verify content is made available when appropriate.

Specifically, do the following:

  1. Create a consumer.
  2. Bind the consumer to the repository created in setUpClass().
  3. Create a consumer profile where:
    • two packages are installed,
    • both packages’ versions are lower than what’s offered by the repository,
    • one of the corresponding packages in the repository has an applicable erratum, and
    • the other corresponding package in the repository doesn’t have an applicable erratum.
  4. Regenerate applicability for the consumer.
  5. Fetch applicability for the consumer. Verify that both packages are listed as eligible for an upgrade.
pulp_smash.tests.pulp2.rpm.api_v2.test_content_applicability.CONTENT_APPLICABILITY_REPORT_SCHEMA = {'$schema': 'http://json-schema.org/schema#', 'description': 'Derived from: http://docs.pulpproject.org/dev-guide/integration/rest-api/consumer/applicability.html#query-content-applicability', 'items': {'properties': {'applicability': {'properties': {'rpm': {'items': {'type': 'string'}, 'type': 'array'}, 'erratum': {'items': {'type': 'string'}, 'type': 'array'}}, 'type': 'object'}, 'consumers': {'items': {'type': 'string'}, 'type': 'array'}}, 'type': 'object'}, 'title': 'Content Applicability Report', 'type': 'array'}

A schema for a content applicability report for a consumer.

pulp_smash.tests.pulp2.rpm.api_v2.test_content_applicability.RPM_WITHOUT_ERRATUM_METADATA = mappingproxy({'vendor': None, 'name': 'camel', 'arch': 'noarch', 'epoch': '0', 'release': 1, 'version': '0.1'})

Metadata for an RPM without an associated erratum.

pulp_smash.tests.pulp2.rpm.api_v2.test_content_applicability.RPM_WITH_ERRATUM_METADATA = mappingproxy({'vendor': None, 'name': 'bear', 'arch': 'noarch', 'epoch': '0', 'release': 1, 'version': '4.1'})

Metadata for an RPM with an associated erratum.