pulp_smash.tests.rpm.api_v2.test_schedule_sync

Location: Pulp SmashAPI Documentationpulp_smash.tests.rpm.api_v2.test_schedule_sync

Test the API’s schedule functionality for repository syncronization.

This module assumes that the tests in pulp_smash.tests.platform.api_v2.test_repository hold true.

class pulp_smash.tests.rpm.api_v2.test_schedule_sync.CreateFailureTestCase(methodName='runTest')

Establish 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.

class pulp_smash.tests.rpm.api_v2.test_schedule_sync.CreateRepoMixin

Provide 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.

class pulp_smash.tests.rpm.api_v2.test_schedule_sync.CreateSuccessTestCase(methodName='runTest')

Establish 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:

  1. Create a repository with a valid feed
  2. Schedule sync to run every 30 seconds
test_enabled()

Verify the enabled attribute in the response.

test_status_code()

Assert the response has an HTTP 201 status code.

test_total_run_count()

Verify the total_run_count attribute in the response.

class pulp_smash.tests.rpm.api_v2.test_schedule_sync.ReadUpdateDeleteTestCase(methodName='runTest')

Establish that we can read, update and delete schedules.

This test case assumes the assertions in CreateSuccessTestCase hold 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.

class pulp_smash.tests.rpm.api_v2.test_schedule_sync.ScheduledSyncTestCase(methodName='runTest')

Establish that sync runs according to the specified schedule.

This test case assumes the assertions in CreateSuccessTestCase and ReadUpdateDeleteTestCase hold true.

classmethod setUpClass()

Create a schedule to sync the repo, verify the total_run_count.

Do the following:

  1. Create a repository with a valid feed
  2. Schedule sync to run every 30 seconds
  3. 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.