pulp_2_tests.tests.puppet.api_v2.test_sync_publish¶
Location: Pulp 2 Tests → Tests → pulp_2_tests.tests.puppet.api_v2.test_sync_publish
Test the API endpoints for puppet repositories.
-
class
pulp_2_tests.tests.puppet.api_v2.test_sync_publish.
CreateTestCase
(methodName='runTest')¶ Bases:
unittest.case.TestCase
Create two puppet repos, with and without feed URLs respectively.
-
classmethod
setUpClass
()¶ Create two puppet repositories, with and without feed URLs.
-
classmethod
tearDownClass
()¶ Delete all resources named by
resources
.
-
test_id_notes
()¶ Validate the
id
andnotes
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.
-
classmethod
-
class
pulp_2_tests.tests.puppet.api_v2.test_sync_publish.
PublishTestCase
(methodName='runTest')¶ Bases:
unittest.case.TestCase
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 repo, publish and download.
Create two puppet repositories, both without feeds. Upload a 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.
-
classmethod
tearDownClass
()¶ Delete all resources named by
resources
.
-
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.
-
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_2_tests.tests.puppet.api_v2.test_sync_publish.
SyncInvalidFeedTestCase
(methodName='runTest')¶ Bases:
unittest.case.TestCase
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.
-
classmethod
tearDownClass
()¶ Delete all resources named by
resources
.
-
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.
-
classmethod
-
class
pulp_2_tests.tests.puppet.api_v2.test_sync_publish.
SyncNoFeedTestCase
(methodName='runTest')¶ Bases:
unittest.case.TestCase
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 such as without an internal tracebacks. This test targets Pulp #2628.
-
test_all
()¶ Create and sync a puppet repository with no feed.
-
-
class
pulp_2_tests.tests.puppet.api_v2.test_sync_publish.
SyncValidFeedTestCase
(methodName='runTest')¶ Bases:
unittest.case.TestCase
Create and sync puppet repositories with valid feeds.
-
test_matching_query
()¶ Sync a repository with a query that matches units.
Assert that:
- None of the sync tasks has an error message.
- Searching for module
pulp_2_tests.constants.PUPPET_MODULE_2
yields one result. - The synced-in module can be downloaded.
-
test_non_matching_query
()¶ Sync a repository with a query that doesn’t match any units.
Assert that:
- None of the sync tasks has an error message.
- Searching for module
pulp_2_tests.constants.PUPPET_MODULE_2
yields no results.
-
-
class
pulp_2_tests.tests.puppet.api_v2.test_sync_publish.
SyncValidManifestFeedTestCase
(methodName='runTest')¶ Bases:
unittest.case.TestCase
A valid Puppet manifest should sync correctly.
-
classmethod
setUpClass
()¶ Create repository with the feed pointing to a valid manifest.
-
classmethod
tearDownClass
()¶ Delete all resources named by
resources
.
-
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.
-
classmethod
-
class
pulp_2_tests.tests.puppet.api_v2.test_sync_publish.
UploadPuppetModuleTestCase
(methodName='runTest')¶ Bases:
unittest.case.TestCase
Test upload puppet modules are working as expected.
-
test_upload_modules_with_extra_files
()¶ Test upload puppet modules with extraneous files are successfull.
Specifically, this method does the following:
- Create a puppet repo.
- Upload
PUPPET_MODULE_EXTRANEOUS_FILE
which has extraneous files to the repo. - Verify the repo upload is successful.
This test case targets:
-