pulp_2_tests.tests.rpm.api_v2.test_modular_errata

Location: Pulp 2 TestsTestspulp_2_tests.tests.rpm.api_v2.test_modular_errata

Tests that perform actions over modular Errata repositories.

class pulp_2_tests.tests.rpm.api_v2.test_modular_errata.ManageModularErrataTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Manage Modular Errata content testcase.

This test targets the following issues:

classmethod setUpClass()

Create class wide variables.

test_collection_field()

Test the collection field in the update info.

This test provides the following:

  1. Check whether all the modules in the published repo contains a collection field.
  2. Check whether the collection field has proper name. The collection name computation is as below.

The collection name is created using the information from fixtures that is stored in a set {<errata-id>:<module-name>}.

First, the set information is used in computing a set collections_from_fixtures that maps the repo_id to the collection-name.

The collection-name set is computed using the logic <repo-id>_<index>_<module-name>. The module name is default and the index is 0 for ursine RPMs.

The set is created using set-comprehension and x-path. After creating the set, it appears as in the example below.

collections_from_fixtures = {
    'RHEA..1' : 'repo_id_1_duck',
    'RHEA..2' : 'repo_id_2_duck',
    'RHEA..3' : 'repo_id_0_default'
}

This set is compared against the collection-name from the published repo’s updateinfo.

test_copy_errata()

Test whether Errata modules are copied.

This Test does the following:

  1. It creates, syncs, and publishes a modules rpm repository.
  2. Creates another repo with no feed.
  3. Recursively copies an errata from one repo to another.
  4. Checks whether the errata information in the new repo is correct.
test_sync_publish_update_info()

Test sync,publish of Modular RPM repo and checks the update info.

This testcase reads the updateinfo of the repository that is published and compares that against the updateinfo.xml present in the feed url.

Steps involved:

  1. Create a repository with feed url containing modules.
  2. The repository should have a distributor to publish it.
  3. Once the repository is created, it is synced and published.
  4. Get the updateinfo from the repodata of the published repo.
  5. Compare this against the update_info.xml in the fixtures repo.
test_upload_errata()

Upload errata and check whether it got published in the repo.

This test does the following:

  1. Create and sync a repo with RPM_WITH_MODULES_FEED_URL.
  2. Upload a custom modular erratum to the repo. The custom module erratum is obtained from _get_erratum(). Make sure that the erratum uploaded has a corresponding module in the feed url.
  3. Publish the repo after uploading the custom erratum.
  4. Verify whether the uploaded erratum is present in the published repo and also contains the modules in it.