pulp_smash.tests.rpm.api_v2.test_sync_publish

Location: Pulp SmashAPI Documentationpulp_smash.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_smash.tests.rpm.api_v2.test_sync_publish.ChangeFeedTestCase(methodName='runTest')

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_smash.tests.rpm.api_v2.test_sync_publish.SyncDrpmRepoTestCase(methodName='runTest')

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_smash.tests.rpm.api_v2.test_sync_publish.SyncInParallelTestCase(methodName='runTest')

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_smash.tests.rpm.api_v2.test_sync_publish.SyncInvalidFeedTestCase(methodName='runTest')

Create and sync an RPM repository with an invalid feed.

The sync should complete with errors reported.

classmethod setUpClass()

Create class-wide variables.

test_01_set_up()

Create and sync an RPM repository with an invalid feed.

test_02_task_error()

Assert each task’s “error” field is non-null.

Also, assert each error has a useful “description” field. For each error that is present, its “description” field should not be the (vague) string “Unsupported scheme: ”. This test targets Pulp #1376.

test_02_task_traceback()

Assert each task’s “traceback” field is non-null.

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

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_smash.tests.rpm.api_v2.test_sync_publish.SyncRepoBaseTestCase(methodName='runTest')

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_smash.tests.rpm.api_v2.test_sync_publish.SyncRpmRepoTestCase(methodName='runTest')

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_smash.tests.rpm.api_v2.test_sync_publish.SyncSrpmRepoTestCase(methodName='runTest')

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

static get_feed_url()

Return an SRPM repository feed URL.