pulp_smash.tests.puppet.api_v2.test_sync_publish

Location: Pulp SmashAPI Documentationpulp_smash.tests.puppet.api_v2.test_sync_publish

Test the API endpoints for puppet repositories.

This module assumes that the tests in pulp_smash.tests.platform.api_v2.test_repository hold true. The following trees of assumptions are explored in this module:

It is possible to create an puppet repo with a feed. (CreateTestCase)
├── If a valid feed is given, the sync completes and no errors are
│   reported for both valid and ivalid query. (SyncValidFeedTestCase)
└── If an invalid feed is given, the sync completes and errors are
    reported. (SyncInvalidFeedTestCase)

It is possible to create an puppet repo without a feed. (CreateTestCase)
└── It is possible to upload an puppet module to a repository, copy the
    repository's content to a second repository, add distributor to
    both repositories, publish them and query modules back. Data integrity
    of modules queried from pulp server is preserved. (PublishTestCase)

Assertions not explored in this module include:

  • Given an puppet repository without a feed, sync requests fail.
  • It is not possible to create two puppet repos with the same relative URL.
  • It is possible to upload a directory of puppet modules to an repository.
  • It is possible to upload content and copy it into multiple repositories.
  • It is possible to get content into a repository via a sync and publish it.
  • Functionality of puppet_install_distributor which install puppet module on pulp server.
  • Functionality of puppet_file_distributor which makes puppet modules available in single directory on pulp server over HTTPS.
class pulp_smash.tests.puppet.api_v2.test_sync_publish.CreateTestCase(methodName='runTest')

Create two puppet repos, with and without feed URLs respectively.

classmethod setUpClass()

Create two puppet repositories, with and without feed URLs.

test_id_notes()

Validate the id and notes attributes for each repo.

test_importer_config()

Validate the config attribute of each importer.

test_importer_type_id()

Validate the importer_type_id attribute of each importer.

test_number_importers()

Each repository should have only one importer.

class pulp_smash.tests.puppet.api_v2.test_sync_publish.PublishTestCase(methodName='runTest')

Test repository syncing, publishing and data integrity.

Test uploading custom puppet module to repository, copying content between repositories, querying puppet modules from pulp server and integrity of downloaded modules. Three query formats are tested as are provided by different puppet versions:

  • puppet version <= 3.3
  • 3.3 < puppet version < 3.6
  • puppet version > 3.6
classmethod setUpClass()

Upload puppet module to a repo, copy it to another, publish and download.

Create two puppet repositories, both without feeds. Upload an module to the first repository. Copy its content to the second repository. Add distributors to the repositories, publish repositories and download modules back from them.

test_call_report_errors()

Verify each call report is error-free.

test_call_report_keys()

Verify each call report has a sane structure.

test_free()

Verify the response body for ending an upload.

Delete an Upload Request

test_malloc()

Verify the response body for creating an upload request.

test_publish_errors()

Verify publishing a call report doesn’t generate any errors.

test_publish_keys()

Verify publishing a repository generates a call report.

test_repo_units_consistency()

Verify the two puppet repositories have the same content units.

test_status_code()

Verify the HTTP status code of each server response.

test_unit_integrity()

Verify the integrity of the puppet modules downloaded from Pulp.

test_upload()

Verify the response body for uploading bits.

class pulp_smash.tests.puppet.api_v2.test_sync_publish.SyncInvalidFeedTestCase(methodName='runTest')

If an invalid feed is given a sync should complete with errors.

classmethod setUpClass()

Create a puppet repository with an invalid feed and sync it.

test_error_details()

Assert each task’s progress report contains error details.

test_number_tasks()

Assert only one task was spawned.

test_status_code()

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

test_task_error_traceback()

Assert the task’s “error” and “traceback” fields are non-null.

class pulp_smash.tests.puppet.api_v2.test_sync_publish.SyncNoFeedTestCase(methodName='runTest')

Create and sync a puppet repository with no feed.

At least one of the sync tasks should fail. The task should fail in a graceful manner, without e.g. an internal tracebacks. This test targets Pulp #2628.

test_all()

Create and sync a puppet repository with no feed.

class pulp_smash.tests.puppet.api_v2.test_sync_publish.SyncValidFeedTestCase(methodName='runTest')

Create and sync puppet repositories with valid feeds.

sync_repo(repo)

Sync a repository, and verify no tasks contain an error message.

test_matching_query()

Sync a repository with a query that matches units.

Assert that:

test_non_matching_query()

Sync a repository with a query that doesn’t match any units.

Assert that:

class pulp_smash.tests.puppet.api_v2.test_sync_publish.SyncValidManifestFeedTestCase(methodName='runTest')

A valid Puppet manifest should sync correctly.

classmethod setUpClass()

Create repository with the feed pointing to a valid manifest.

test_number_tasks()

Assert only one task was spawned.

test_status_code()

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

test_task_progress_report()

Assert each task’s progress report shows no errors.