pulp_2_tests.tests.rpm.api_v2.test_content_applicability¶
Location: Pulp 2 Tests → Tests → pulp_2_tests.tests.rpm.api_v2.test_content_applicability
Tests for Pulp’s content applicability feature.
-
class
pulp_2_tests.tests.rpm.api_v2.test_content_applicability.
BasicTestCase
(methodName='runTest')¶ Bases:
unittest.case.TestCase
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()
.
-
test_negative
()¶ 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.
-
test_positive
()¶ Verify content is made available when appropriate.
Specifically, do the following:
- Create a consumer.
- Bind the consumer to the repository created in
setUpClass()
. - 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.
- Regenerate applicability for the consumer.
- Fetch applicability for the consumer. Verify that both packages are listed as eligible for an upgrade.
-
classmethod
-
pulp_2_tests.tests.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': {'erratum': {'items': {'type': 'string'}, 'type': 'array'}, 'modulemd': {'items': {'type': 'string'}, 'type': 'array'}, 'rpm': {'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.
Schema now includes modulemd profiles:
-
pulp_2_tests.tests.rpm.api_v2.test_content_applicability.
RPM_WITHOUT_ERRATUM_METADATA
= mappingproxy({'name': 'camel', 'epoch': '0', 'version': '0.1', 'release': 1, 'arch': 'noarch', 'vendor': None})¶ Metadata for an RPM without an associated erratum.
-
pulp_2_tests.tests.rpm.api_v2.test_content_applicability.
RPM_WITH_ERRATUM_METADATA
= mappingproxy({'name': 'bear', 'epoch': '0', 'version': '4.1', 'release': 1, 'arch': 'noarch', 'vendor': None})¶ Metadata for an RPM with an associated erratum.