pulp_2_tests.tests.rpm.api_v2.test_sync_publish

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

Tests that sync and publish RPM repositories.

For information on repository sync and publish operations, see Synchronization and Publication.

class pulp_2_tests.tests.rpm.api_v2.test_sync_publish.ChangeFeedTestCase(*args, **kwargs)

Bases: pulp_smash.pulp2.utils.BaseAPITestCase

Sync a repository, change its feed, and sync it again.

Specifically, the test case procedure is as follows:

  1. Create three repositories — call them A, B and C.
  2. Populate repository A and B with identical content, and publish them.
  3. Set C’s feed to repository A. Sync and publish repository C.
  4. Set C’s feed to repository B. Sync and publish repository C.
  5. Download an RPM from repository C.

The entire procedure should succeed. This test case targets Pulp #1922.

create_sync_publish_repo(body)

Create, sync and publish a repository.

Also, schedule the repository for deletion.

Parameters:body – A dict of information to use when creating the repository.
Returns:A detailed dict of information about the repository.
get_feed(repo)

Build the feed to an RPM repository’s distributor.

test_all()

Sync a repository, change its feed, and sync it again.

class pulp_2_tests.tests.rpm.api_v2.test_sync_publish.ErrorReportTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Test whether an error report contains sufficient information.

test_all()

Test whether an error report contains sufficient information.

Do the following:

  1. Create and sync a repository using an invalid feed URL.
  2. Get a reference to the task containing error information.
  3. Assert that:
class pulp_2_tests.tests.rpm.api_v2.test_sync_publish.NonExistentRepoTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Perform actions on non-existent repositories.

This test targets Pulp Smash #157.

setUp()

Set variables used by each test case.

test_publish()

Publish a non-existent repository.

test_sync()

Sync a non-existent repository.

class pulp_2_tests.tests.rpm.api_v2.test_sync_publish.SyncDrpmRepoTestCase(*args, **kwargs)

Bases: pulp_2_tests.tests.rpm.api_v2.test_sync_publish.SyncRepoBaseTestCase

Test one can create and sync an RPM repository with an DRPM feed.

static get_feed_url()

Return an DRPM repository feed URL.

class pulp_2_tests.tests.rpm.api_v2.test_sync_publish.SyncInParallelTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Sync several repositories in parallel.

test_all()

Sync several repositories in parallel.

Specifically, do the following:

  1. Create several repositories. Ensure each repository has an importer whose feed references a repository containing one or more errata.
  2. Sync each repository. Assert each sync completed successfully.
  3. Get a summary of information about each repository, and assert the repo has an appropriate number of errata.

Pulp #2721 describes how a race condition can occur when multiple repos with identical errata are synced at the same time. This test case attempts to trigger that race condition.

class pulp_2_tests.tests.rpm.api_v2.test_sync_publish.SyncInvalidMetadataTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Sync various repositories with invalid metadata.

When a repository with invalid metadata is encountered, Pulp should gracefully fail. This test case targets Pulp #1287.

do_test(feed_url)

Implement the logic described by each of the test* methods.

classmethod tearDownClass()

Delete orphan content units.

test_incomplete_filelists()

Sync a repository with an incomplete filelists.xml file.

test_incomplete_other()

Sync a repository with an incomplete other.xml file.

test_missing_filelists()

Sync a repository that’s missing its filelists.xml file.

test_missing_other()

Sync a repository that’s missing its other.xml file.

test_missing_primary()

Sync a repository that’s missing its primary.xml file.

class pulp_2_tests.tests.rpm.api_v2.test_sync_publish.SyncRepoBaseTestCase(*args, **kwargs)

Bases: pulp_smash.pulp2.utils.BaseAPITestCase

A parent class for repository syncronization test cases.

get_feed_url() should be overridden by concrete child classes. This method’s response is used when setting the repository’s importer feed URL.

static get_feed_url()

Return an RPM repository feed URL. Should be overridden.

Raises:NotImplementedError if not overridden by a child class.
classmethod setUpClass()

Create an RPM repository with a valid feed and sync it.

test_start_sync_code()

Assert the call to sync a repository returns an HTTP 202.

test_task_progress_report()

Assert no task’s progress report contains error details.

Other assertions about the final state of each task are handled by the client’s response handler. (For more information, see the source of pulp_smash.api.safe_handler.)

class pulp_2_tests.tests.rpm.api_v2.test_sync_publish.SyncRpmRepoTestCase(*args, **kwargs)

Bases: pulp_2_tests.tests.rpm.api_v2.test_sync_publish.SyncRepoBaseTestCase

Test one can create and sync an RPM repository with an RPM feed.

static get_feed_url()

Return an RPM repository feed URL.

test_no_change_in_second_sync()

Verify that syncing a second time has no changes.

If the repository have not changed then Pulp must state that anything was changed when doing a second sync.

test_unit_count_on_repo()

Verify that the sync added the correct number of units to the repo.

Read the repository and examine its content_unit_counts attribute. Compare these attributes to metadata from the remote repository. Expected values are currently hard-coded into this test.

class pulp_2_tests.tests.rpm.api_v2.test_sync_publish.SyncSrpmRepoTestCase(*args, **kwargs)

Bases: pulp_2_tests.tests.rpm.api_v2.test_sync_publish.SyncRepoBaseTestCase

Test one can create and sync an RPM repository with an SRPM feed.

static get_feed_url()

Return an SRPM repository feed URL.