pulp_2_tests.tests.rpm.api_v2.test_unassociate

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

Test Unassociating Content Units from a Repository for RPM.

class pulp_2_tests.tests.rpm.api_v2.test_unassociate.RemoveUnitsTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Remove units of various types from a synced repository.

do_remove_unit(type_id, repo)

Remove a content unit from the repository.

Do the following:

  1. Note the repository’s last_unit_removed field.
  2. Sleep for at least one second.
  3. Remove a unit of type type_id from the repository.
  4. Note the repository’s last_unit_removed field.

When the first unit is removed, assert that last_unit_removed changes from null to a non-null value. When each subsequent unit is removed, assert that last_unit_removed increments.

do_test(feed, type_ids)

Remove units from a repo and make assertions about it.

Do the following:

  1. Create and sync a repository with the given feed.
  2. For each type ID in type_ids, remove a content unit of that type from the repository. See do_remove_unit().
  3. Assert the correct units are still in the repository. The repository should have all the units that were originally synced into the repository, minus those that have been removed.
  4. Remove a non-existent unit from the repository. Assert that the last_unit_removed timestamp was not updated.
get_repo_last_unit_removed(repo)

Get the repository’s last_unit_removed attribute.

setUp()

Set variables used by each test case.

test_drpm()

Un-associate units from a DRPM repo. See do_test().

test_rpm()

Un-associate units from a RPM repo. See do_test().

test_srpm()

Un-associate units from a SRPM repo. See do_test().

class pulp_2_tests.tests.rpm.api_v2.test_unassociate.RepublishTestCase(*args, **kwargs)

Bases: pulp_smash.pulp2.utils.BaseAPITestCase

Repeatedly publish a repository, with different content each time.

Specifically, do the following:

  1. Create a repository.
  2. Add a content unit to the repository. Publish the repository.
  3. Unassociate the content unit and repository. Publish the repository.

Verify that:

  • The last_unit_added, last_unit_removed and last_publish timestamps are correct.
  • The content unit in question is only available when associated with the repository.
get_repo()

Get detailed information about the repository.

classmethod setUpClass()

Create a repository.

classmethod tearDownClass()

Remove the created repository and any orphans.

test_01_add_unit()

Add a content unit to the repository. Publish the repository.

test_02_find_unit()

Search for the content unit. Assert it is available.

test_03_unassociate_unit()

Unassociate the unit from the repository. Publish the repository.

test_04_find_unit()

Search for the content unit. Assert it isn’t available.

class pulp_2_tests.tests.rpm.api_v2.test_unassociate.SelectiveAssociateTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Ensure Pulp only associate needed content.

Test steps:

  1. Create and sync an RPM repository.
  2. Unassociate some RPMs from the repository created on the previous step.
  3. Sync the repository again and check if only the missing units were associated.

See Pulp #2457

test_all()

Check if Pulp only associate missing repo content.

pulp_2_tests.tests.rpm.api_v2.test_unassociate.setUpModule()

Maybe skip this module of tests.