pulp_2_tests.tests.rpm.api_v2.test_schedule_sync¶
Location: Pulp 2 Tests → Tests → pulp_2_tests.tests.rpm.api_v2.test_schedule_sync
Test the API’s schedule functionality for repository syncronization.
-
class
pulp_2_tests.tests.rpm.api_v2.test_schedule_sync.CreateFailureTestCase(*args, **kwargs)¶ Bases:
pulp_2_tests.tests.rpm.api_v2.test_schedule_sync.CreateRepoMixin,pulp_smash.pulp2.utils.BaseAPITestCaseEstablish that schedules are not created in documented scenarios.
-
classmethod
setUpClass()¶ Intentionally fail at creating several sync schedules for a repo.
Each schedule tests a different failure scenario.
-
test_status_code()¶ Assert that each response has the expected HTTP status code.
-
classmethod
-
class
pulp_2_tests.tests.rpm.api_v2.test_schedule_sync.CreateRepoMixin¶ Bases:
objectProvide a method for creating a repository.
-
classmethod
create_repo()¶ Create a semi-random RPM repository with a valid RPM feed URL.
Add this repository’s href to
cls.resources. Return a two-tuple of(href, importer_type_id). This method requires a server config,cls.cfg, and a set,cls.resources.
-
classmethod
-
class
pulp_2_tests.tests.rpm.api_v2.test_schedule_sync.CreateSuccessTestCase(*args, **kwargs)¶ Bases:
pulp_2_tests.tests.rpm.api_v2.test_schedule_sync.CreateRepoMixin,pulp_smash.pulp2.utils.BaseAPITestCaseEstablish that we can create a schedule to sync the repository.
-
classmethod
setUpClass()¶ Create an RPM repo with a valid feed, create a schedule to sync it.
Do the following:
- Create a repository with a valid feed
- Schedule sync to run every 30 seconds
-
test_enabled()¶ Verify the
enabledattribute in the response.
-
test_status_code()¶ Assert the response has an HTTP 201 status code.
-
test_total_run_count()¶ Verify the
total_run_countattribute in the response.
-
classmethod
-
class
pulp_2_tests.tests.rpm.api_v2.test_schedule_sync.ReadUpdateDeleteTestCase(*args, **kwargs)¶ Bases:
pulp_2_tests.tests.rpm.api_v2.test_schedule_sync.CreateRepoMixin,pulp_smash.pulp2.utils.BaseAPITestCaseEstablish that we can read, update and delete schedules.
This test case assumes the assertions in
CreateSuccessTestCasehold true.-
classmethod
setUpClass()¶ Create three schedules and read, update and delete them.
-
test_delete()¶ Assert the “delete” response body is null.
-
test_read_many()¶ Assert the “read_many” response body contains all schedule hrefs.
-
test_read_one()¶ Assert the “read_one” response contains the correct attributes.
-
test_status_code()¶ Assert each response has a correct HTTP status code.
-
test_update()¶ Assert the “update” response body has the correct attributes.
-
classmethod
-
class
pulp_2_tests.tests.rpm.api_v2.test_schedule_sync.ScheduledSyncTestCase(*args, **kwargs)¶ Bases:
pulp_2_tests.tests.rpm.api_v2.test_schedule_sync.CreateRepoMixin,pulp_smash.pulp2.utils.BaseAPITestCaseEstablish that sync runs according to the specified schedule.
This test case assumes the assertions in
CreateSuccessTestCaseandReadUpdateDeleteTestCasehold true.-
classmethod
setUpClass()¶ Create a schedule to sync the repo, verify the
total_run_count.Do the following:
- Create a repository with a valid feed
- Schedule sync to run every 30 seconds
- Wait for 40 seconds and read the schedule to get the number of “sync” runs.
-
test_consecutive_failures()¶ Assert the sync encountered no consecutive failures.
-
classmethod