pulp_2_tests.tests.rpm.api_v2.test_iso_crud

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

Test CRUD for ISO RPM repositories.

class pulp_2_tests.tests.rpm.api_v2.test_iso_crud.AddImporterDistributorTestCase(*args, **kwargs)

Bases: pulp_smash.pulp2.utils.BaseAPITestCase

Add an importer and a distributor to an existing untyped repository.

See:

classmethod setUpClass()

Create a repository and add an importer and distributor to it.

Do the following:

  1. Create a repository.
  2. Read the repository’s importers and distributors.
  3. Add an importer and distributor to the repo.
  4. Re-read the repository’s importers and distributors.
test_add_distributor()

Check the HTTP status code for adding a distributor.

test_add_importer()

Check the HTTP status code for adding an importer.

test_after()

Verify the repository ends up with one importer and distributor.

test_before()

Verify the repository has no importer or distributors initially.

class pulp_2_tests.tests.rpm.api_v2.test_iso_crud.CreateTestCase(*args, **kwargs)

Bases: pulp_smash.pulp2.utils.BaseAPITestCase

Create an ISO RPM repo with an importer and distributor.

classmethod setUpClass()

Create an ISO RPM repo with an importer and distributor.

test_attributes()

Assert the created repository has the requested attributes.

test_headers_location()

Assert the response’s Location header is correct.

The Location may be either an absolute or relative URL. See pulp_2_tests.tests.platform.api_v2.test_repository.CreateSuccessTestCase.test_location_header().

test_status_code()

Assert the response has an HTTP 201 status code.

class pulp_2_tests.tests.rpm.api_v2.test_iso_crud.ISOUpdateTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Verify how ISO repos handles changes in content already in Pulp.

check_checksums(units_pre, units_post)

Assert the checksums in units_pre and units_post are disjoint.

check_names(units_pre, units_post)

Assert that the names in units_pre and units_post are equal.

test_all()

Verify how ISO repos handles changes in content already in Pulp.

The main goal of this test is to verify how ISO repository handles updates in content already in Pulp.

For this test two different feed urls will be used. These urls contain the same amount of units, the units have the same type and name in both urls, but different content thereafter different checksum values. To recreate this dynamic scenario of change. After the repository is synced for the first time the feed url is updated, and the repository is synced again.

This test targets the following issues:

Do the following:

  1. Create and sync an ISO repository.
  2. Update the repository’s feed URL, and sync it. This simulates a change in the contents of the source ISOs.
  3. Assert that number of units remain the same, but the content has changed.
class pulp_2_tests.tests.rpm.api_v2.test_iso_crud.PulpManifestTestCase(*args, **kwargs)

Bases: pulp_smash.pulp2.utils.BaseAPITestCase

Ensure ISO repo properly handles PULP_MANIFEST information.

static parse_pulp_manifest(feed_url)

Parse PULP_MANIFEST information from feed_url/PULP_MANIFEST.

Parameters:feed_url – The URL for the file feed. It will be joined with /PULP_MANIFEST in order to find the PULP_MANIFEST file.
Returns:A list of dicts mapping each PULP_MANIFEST row. The dict contains the keys name, checksum and size which represent the PULP_MANIFEST data.
test_invalid_file_feed()

Create and sync a ISO repo from an invalid file feed.

Assert that the sync fails with the information that some units were not available.

test_valid_file_feed()

Create and sync a ISO repo from a file feed.

Assert that the number of units synced is the same as PULP_MANIFEST lists.

class pulp_2_tests.tests.rpm.api_v2.test_iso_crud.ReadUpdateDeleteTestCase(*args, **kwargs)

Bases: pulp_smash.pulp2.utils.BaseAPITestCase

Establish that we can interact with typed repositories as expected.

classmethod setUpClass()

Create three repositories and read, update and delete them.

test_read()

Assert that the “read” call returns correct attributes.

test_read_distributors()

Assert each read w/distributors contains info about distributors.

test_read_importers()

Assert each read with importers contains info about importers.

test_status_code()

Assert each response has a correct HTTP status code.