pulp_smash.tests.pulp2.rpm.api_v2.test_unavailable_checksum

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

Tests that publish repositories with unavailable checksum types.

class pulp_smash.tests.pulp2.rpm.api_v2.test_unavailable_checksum.UnavailableChecksumTestCase(methodName='runTest')

Publish a lazily-synced repository with unavailable checksum types.

do_test(feed, type_id)

Publish a repository with an invalid checksum.

Do the following:

  1. Create and sync repository of type type_id and with the given feed. Ensure the repository’s importer has a deferred/lazy download policy.
  2. Determine which checksum type the units in the repository use. (As of this writing, Pulp can handle md5, sha1 and sha256 checksum types.)
  3. Publish the repository with checksum types different from what the units in the repository use. Assert the publish fails.

This test targets Pulp Smash #287.

test_drpm()

Publish a DRPM repo. See do_test().

test_rpm()

Publish a RPM repo. See do_test().

test_srpm()

Publish a SRPM repo. See do_test().

class pulp_smash.tests.pulp2.rpm.api_v2.test_unavailable_checksum.UpdatedChecksumTestCase(methodName='runTest')

Ensure that the updated checksum_type is present on the repo metadata.

Do the following:

  1. Create, sync and publish a repository with checksum type “sha256”.

  2. After that several XML files - part of repodata will be inspected.

    primary.xml

    Assert that the given checksum type is the only one present.

    filelists.xml and other.xml

    Assert that the length of pkgid is according to the given checksum type.

    prestodelta.xml

    Assert that the given checksum type is the only one present.

    For sha256 the length of pkgid should be 64 hex digits, and for sha1 the length should be 40 hex digits. For DRPM repositories the prestodelta.xml will be inspected as well.

  3. Update the checksum type to “sha1”, and use option force_full set as True. force_full will force a complete re-publish to happen. Re-publish the repository.

  4. All aforementioned assertions performed on the step 2 will be executed again to assure that new checksum type was updating properly.

This test targets Pulp Smash #286.

do_test(feed)

Verify checksum_type is updated on the repo metadata.

test_drpm()

Verify updated checksum in a DRPM repo. See do_test().

test_rpm()

Verify update checksum in a RPM repo. See do_test().

test_srpm()

Verify updated checksum in a SRPM repo. See do_test().

verify_filelists_xml(cfg, distributor, checksum_type)

Verify a published repo’s filelists.xml uses the given checksum.

verify_other_xml(cfg, distributor, checksum_type)

Verify a published repo’s other.xml uses the given checksum.

verify_pkgid_len(pkgid_len, checksum_type)

Perform assertion based on the given checksum type.

Based on the checksum type provided different assertions will be performed over the length of pkgid.

verify_presto_delta_xml(cfg, distributor, checksum_type)

Verify a published repo’s prestodelta.xml uses given checksum.

verify_primary_xml(cfg, distributor, checksum_type)

Verify a published repo’s primary.xml uses the given checksum.