pulp_2_tests.tests.rpm.api_v2.test_unavailable_checksum¶
Location: Pulp 2 Tests → Tests → pulp_2_tests.tests.rpm.api_v2.test_unavailable_checksum
Tests that publish repositories with unavailable checksum types.
-
class
pulp_2_tests.tests.rpm.api_v2.test_unavailable_checksum.
UnavailableChecksumTestCase
(methodName='runTest')¶ Bases:
unittest.case.TestCase
Publish a lazily-synced repository with unavailable checksum types.
-
do_test
(feed, type_id)¶ Publish a repository with an invalid checksum.
Do the following:
- Create and sync repository of type
type_id
and with the given feed. Ensure the repository’s importer has a deferred/lazy download policy. - Determine which checksum type the units in the repository use. (As of this writing, Pulp can handle md5, sha1 and sha256 checksum types.)
- 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.
- Create and sync repository of type
-
classmethod
setUpClass
()¶ Delete orphan files.
This is necessary to assure that the content unit is not already present in Pulp with a different checksum type. See Pulp #4157.
-
-
class
pulp_2_tests.tests.rpm.api_v2.test_unavailable_checksum.
UpdatedChecksumTestCase
(methodName='runTest')¶ Bases:
unittest.case.TestCase
Ensure that the updated
checksum_type
is present on the repo metadata.Do the following:
Create, sync and publish a repository with checksum type “sha256”.
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
andother.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 ofpkgid
should be 64 hex digits, and forsha1
the length should be 40 hex digits. For DRPM repositories theprestodelta.xml
will be inspected as well.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.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.
-
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.