pulp_2_tests.tests.rpm.api_v2.test_republish¶
Location: Pulp 2 Tests → Tests → pulp_2_tests.tests.rpm.api_v2.test_republish
Tests that re-publish repositories.
-
class
pulp_2_tests.tests.rpm.api_v2.test_republish.RemoveOldRepodataTestCase(methodName='runTest')¶ Bases:
unittest.case.TestCaseCheck whether old repodata is removed when it should be.
According to Pulp #2788, Pulp will retain unnecessary metadata files from previous publishes. This can be problematic for long-lived repositories, as they will eventually be filled with gobs and gobs of unnecessary data. The fix is to introduce the
remove_old_repodataandremove_old_repodata_thresholdoptions, which control for how long old metadata is retained. Each test in this test case does the following:- Create a repository. Ensure the distributor has several interesting
settings, including
generate_sqlitebeing true. - Upload an RPM, publish the repo, and count the number of metadata files. Assert that there are metadata files.
- Do it again. Either assert that there are more metadata files or that there are the same number of metadata files, depending on the distributor settings.
-
do_test(distributor_config_update)¶ Implement most of the test logic.
-
classmethod
setUpClass()¶ Set class-wide variables.
-
test_cleanup_default()¶ Set
remove_old_repodatato true, and the threshold at default.Assert there are more metadata files after the second publish.
-
test_cleanup_disabled()¶ Set
remove_old_repodatato false, and the threshold to 0.Assert that there are more metadata files after the second publish.
-
test_cleanup_later()¶ Set
remove_old_repodatato true, and the threshold to 3600.Assert there are more metadata files after the second publish.
-
test_cleanup_now()¶ Set
remove_old_repodatato true, and the threshold to 0.Assert that there are the same number of metadata files after the second publish. This test targets Pulp #3816.
- Create a repository. Ensure the distributor has several interesting
settings, including
-
class
pulp_2_tests.tests.rpm.api_v2.test_republish.UnassociateTestCase(methodName='runTest')¶ Bases:
unittest.case.TestCaseRepublish a repository after removing content.
Specifically, this test case does the following:
- Create, populate and publish a repository.
- Pick a content unit from the repository and verify it can be downloaded.
- Remove the content unit from the repository, and re-publish it, and verify that it can’t be downloaded.
-
test_all()¶ Republish a repository after removing content.