Skip to content

Commit

Permalink
Add puppet tests for syncing and publishing with puppet_distributor with
Browse files Browse the repository at this point in the history
Tests in this commit check following pulp functionality:

* It is possible to create two puppet repos, with and without feedURLs respectively
  (CreateTestCase),
* Create repo with valid feed and run sync ends without errors for both
  valid and invalid query (SyncValidFeedTestCase),
* Create repo with invalid feed and run sync ends with error
  (SyncInvalidFeedTestCase),
* Following steps finish without errors (PublishTestCase)
  * Create two repositories: foo and bar.
  * upload custom puppet module to foo,
  * copy foo to bar and publish both,
  * query pulp server for modules using all query formats supported by given pulp version
  * download modules from their expected locations on pulp server file system,
  * verify integrity of downloaded modules.

Sample output tested on machine with RedHat 7.1 and pulp 2.7 installed:
$ python -m unittest2 -v pulp_smash.tests.puppet.api_v2.test_sync_publish
test_id_notes (pulp_smash.tests.puppet.api_v2.test_sync_publish.CreateTestCase)
Validate the ``id`` and ``notes`` attributes for each repo. ... ok
test_importer_config (pulp_smash.tests.puppet.api_v2.test_sync_publish.CreateTestCase)
Validate the ``config`` attribute of each importer. ... ok
test_importer_type_id (pulp_smash.tests.puppet.api_v2.test_sync_publish.CreateTestCase)
Validate the ``importer_type_id`` attribute of each importer. ... ok
test_number_importers (pulp_smash.tests.puppet.api_v2.test_sync_publish.CreateTestCase)
Each repository should have only one importer. ... ok
test_call_reports_keys (pulp_smash.tests.puppet.api_v2.test_sync_publish.PublishTestCase)
Verify each call report has the correct keys. ... ok
test_call_reports_values (pulp_smash.tests.puppet.api_v2.test_sync_publish.PublishTestCase)
Verify no call report contains any errors. ... ok
test_sanity (pulp_smash.tests.puppet.api_v2.test_sync_publish.PublishTestCase)
Verify we collected a correct set of response bodies. ... ok
test_search_units (pulp_smash.tests.puppet.api_v2.test_sync_publish.PublishTestCase)
Verify the two repositories have the same units. ... ok
test_status_codes (pulp_smash.tests.puppet.api_v2.test_sync_publish.PublishTestCase)
Verify the HTTP status code of each server response. ... ok
test_units_integrity (pulp_smash.tests.puppet.api_v2.test_sync_publish.PublishTestCase)
Verify integrity of modules downloaded from pulp server. ... ok
test_upload (pulp_smash.tests.puppet.api_v2.test_sync_publish.PublishTestCase)
Verify the response body for uploading module. ... ok
test_upload_free (pulp_smash.tests.puppet.api_v2.test_sync_publish.PublishTestCase)
Verify  the response body for ending an upload request. ... ok
test_upload_malloc (pulp_smash.tests.puppet.api_v2.test_sync_publish.PublishTestCase)
Verify the response body for starting an upload request. ... ok
test_error_details (pulp_smash.tests.puppet.api_v2.test_sync_publish.SyncInvalidFeedTestCase)
Assert each task's progress report contains error details. ... ok
test_number_tasks (pulp_smash.tests.puppet.api_v2.test_sync_publish.SyncInvalidFeedTestCase)
Assert that only one task was spawned. ... ok
test_start_sync_code (pulp_smash.tests.puppet.api_v2.test_sync_publish.SyncInvalidFeedTestCase)
Assert the call to sync a repository returns an HTTP 202. ... ok
test_task_error (pulp_smash.tests.puppet.api_v2.test_sync_publish.SyncInvalidFeedTestCase)
Assert each task's "error" field is non-null. ... ok
test_task_traceback (pulp_smash.tests.puppet.api_v2.test_sync_publish.SyncInvalidFeedTestCase)
Assert each task's "traceback" field is non-null. ... ok
test_start_sync_code (pulp_smash.tests.puppet.api_v2.test_sync_publish.SyncValidFeedTestCase)
Assert the call to sync each repository returns an HTTP 202. ... ok
test_task_error (pulp_smash.tests.puppet.api_v2.test_sync_publish.SyncValidFeedTestCase)
Assert each task's "error" field is null. ... ok
test_task_progress_report (pulp_smash.tests.puppet.api_v2.test_sync_publish.SyncValidFeedTestCase)
Assert no task's progress report contains error details. ... ok
test_task_traceback (pulp_smash.tests.puppet.api_v2.test_sync_publish.SyncValidFeedTestCase)
Assert each task's "traceback" field is null. ... ok

----------------------------------------------------------------------
Ran 22 tests in 41.743s

OK
  • Loading branch information
Peter Lacko committed Dec 8, 2015
1 parent 76b4e04 commit 3ac369c
Show file tree
Hide file tree
Showing 6 changed files with 731 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/api/pulp_smash.tests.puppet.api_v2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
`pulp_smash.tests.puppet.api_v2`
=============================

Location: :doc:`/index` → :doc:`/api` → :doc:`/api/pulp_smash.tests.puppet.api_v2`

.. automodule:: pulp_smash.tests.puppet.api_v2
7 changes: 7 additions & 0 deletions docs/api/pulp_smash.tests.puppet.api_v2.test_sync_publish.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
`pulp_smash.tests.puppet.api_v2.test_sync_publish`
===============================================

Location: :doc:`/index` → :doc:`/api` →
:doc:`/api/pulp_smash.tests.puppet.api_v2.test_sync_publish`

.. automodule:: pulp_smash.tests.puppet.api_v2.test_sync_publish
6 changes: 6 additions & 0 deletions docs/api/pulp_smash.tests.puppet.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
`pulp_smash.tests.puppet`
======================

Location: :doc:`/index` → :doc:`/api` → :doc:`/api/pulp_smash.tests.puppet`

.. automodule:: pulp_smash.tests.puppet
3 changes: 3 additions & 0 deletions pulp_smash/tests/puppet/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# coding=utf-8
"""Functional tests for Pulp's Puppet plugin."""
from __future__ import unicode_literals
3 changes: 3 additions & 0 deletions pulp_smash/tests/puppet/api_v2/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# coding=utf-8
"""Tests that communicate with the server via the v2 API."""
from __future__ import unicode_literals
Loading

0 comments on commit 3ac369c

Please sign in to comment.