pulp_2_tests.tests.rpm.api_v2.test_republish

Location: Pulp 2 TestsTestspulp_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.TestCase

Check 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_repodata and remove_old_repodata_threshold options, which control for how long old metadata is retained. Each test in this test case does the following:

  1. Create a repository. Ensure the distributor has several interesting settings, including generate_sqlite being true.
  2. Upload an RPM, publish the repo, and count the number of metadata files. Assert that there are metadata files.
  3. 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_repodata to true, and the threshold at default.

Assert there are more metadata files after the second publish.

test_cleanup_disabled()

Set remove_old_repodata to false, and the threshold to 0.

Assert that there are more metadata files after the second publish.

test_cleanup_later()

Set remove_old_repodata to true, and the threshold to 3600.

Assert there are more metadata files after the second publish.

test_cleanup_now()

Set remove_old_repodata to 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.

class pulp_2_tests.tests.rpm.api_v2.test_republish.UnassociateTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Republish a repository after removing content.

Specifically, this test case does the following:

  1. Create, populate and publish a repository.
  2. Pick a content unit from the repository and verify it can be downloaded.
  3. 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.