pulp_2_tests.tests.rpm.api_v2.test_unassociate¶
Location: Pulp 2 Tests → Tests → pulp_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:
- Note the repository’s
last_unit_removed
field. - Sleep for at least one second.
- Remove a unit of type
type_id
from the repository. - 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 thatlast_unit_removed
increments.- Note the repository’s
-
do_test
(feed, type_ids)¶ Remove units from a repo and make assertions about it.
Do the following:
- Create and sync a repository with the given
feed
. - For each type ID in
type_ids
, remove a content unit of that type from the repository. Seedo_remove_unit()
. - 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.
- Remove a non-existent unit from the repository. Assert that the
last_unit_removed
timestamp was not updated.
- Create and sync a repository with the given
-
get_repo_last_unit_removed
(repo)¶ Get the repository’s
last_unit_removed
attribute.
-
setUp
()¶ Set variables used by each test case.
-
-
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:
- Create a repository.
- Add a content unit to the repository. Publish the repository.
- Unassociate the content unit and repository. Publish the repository.
Verify that:
- The
last_unit_added
,last_unit_removed
andlast_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:
- Create and sync an RPM repository.
- Unassociate some RPMs from the repository created on the previous step.
- 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.