pulp_2_tests.tests.rpm.api_v2.test_service_resiliency

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

Test the resiliency of Pulp’s services.

Pulp is designed to be resilient. It should be possible for a service to disappear and reappear, with the only consequence being slower processing of tasks. This module has tests for Pulp’s resilience in the face of such issues.

class pulp_2_tests.tests.rpm.api_v2.test_service_resiliency.MissingWorkersTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Test that Pulp deals well with missing workers.

When executed, this test case will do the following:

  1. Ensure there is only one Pulp worker.
  2. Create a repository. Let its feed reference a large repository. (For example, EPEL.)
  3. Start a sync. Immediately restart the pulp_workers service. (It’s important that pulp_workers be restarted, not started and stopped. For details, see Pulp #2835.) This should cause the first sync to abort.
  4. Update the repository. Let its feed reference a small repository. (For example, pulp_2_tests.constants.RPM_UNSIGNED_FEED_URL.)
  5. Start a sync. Verify that it completes. If Pulp #2835 still affects Pulp, then the worker will be broken, and the sync will never start.
setUp()

Ensure there is only one Pulp worker.

tearDown()

Reset the number of Pul pworkers, and reset Pulp.

Reset Pulp because test_all() may break Pulp.

test_all()

Test that Pulp deals well with missing workers.

class pulp_2_tests.tests.rpm.api_v2.test_service_resiliency.TaskDispatchTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Test whether httpd dispatches a task while the broker is down.

test_all()

Test whether httpd dispatches a task while the broker is down.

This test targets the following issues:

This test does the following:

  1. Create a repository.
  2. Stop the AMQP broker. (Also, schedule it to be re-started later!)
  3. Sync the repository, ignore any errors that are returned when doing so, and assert that no tasks are left in the waiting state.