pulp_smash.tests.pulp2.rpm.api_v2.test_upload_publish

Location: Pulp SmashAPI Documentationpulp_smash.tests.pulp2.rpm.api_v2.test_upload_publish

Tests that upload to and publish RPM repositories.

For information on repository upload and publish operations, see Uploading Content and Publication.

class pulp_smash.tests.pulp2.rpm.api_v2.test_upload_publish.UploadDrpmTestCase(methodName='runTest')

Test whether one can upload a DRPM into a repository.

Specifically, this method does the following:

  1. Create a yum repository.
  2. Upload a DRPM into the repository.
  3. Search for all content units in the repository.

This test case targets Pulp Smash #336

test_all()

Import a DRPM into a repository and search it for content units.

class pulp_smash.tests.pulp2.rpm.api_v2.test_upload_publish.UploadDrpmTestCaseWithCheckSumType(*args, **kwargs)

Test whether one can upload a DRPM into a repository.

Pulp issue #2627 caused uploading to fail when “checksumtype” was specified.

This test case targets Pulp Smash #585

classmethod setUpClass()

Import a DRPM into a repository and search it for content units.

Specifically, this method does the following:

  1. Create a yum repository.
  2. Upload a DRPM into the repository with “checksumtype” set to
    “sha256”
  3. Search for all content units in the repository.
test_all()

Test that uploading DRPM with checksumtype specified works.

class pulp_smash.tests.pulp2.rpm.api_v2.test_upload_publish.UploadInvalidRPMTestCase(methodName='runTest')

Test that upload fails and error is raised when upload invalid RPM.

test_all()

Test whether one invalid RPM upload fails and produces error details.

This test targets the following issues.

Do the following:

  1. Create a RPM repository.
  2. Upload an invalid RPM to repository. Assert that upload fails, and that the returned error contains a descriptive message.
  3. Verify that the repository contains no RPMs.
class pulp_smash.tests.pulp2.rpm.api_v2.test_upload_publish.UploadRpmTestCase(*args, **kwargs)

Test whether one can upload, associate and publish RPMs.

The test procedure is as follows:

  1. Create a pair of repositories.
  2. Upload an RPM to the first repository, and publish it.
  3. Copy the RPM to the second repository, and publish it.
classmethod setUpClass()

Create a pair of RPM repositories.

classmethod tearDownClass()

Clean up resources created during the test.

test_01_upload_publish()

Upload an RPM to the first repository, and publish it.

Execute verify_repo_search() and verify_repo_download().

test_02_copy_publish()

Copy and RPM from the first repo to the second, and publish it.

Execute verify_repo_search() and verify_repo_download().

test_03_compare_repos()

Verify the two repositories contain the same content unit.

verify_repo_download(repo)

Download pulp_smash.constants.RPM from the given repo.

Verify that it is exactly equal to the one uploaded earlier.

Search for units in the given repo.

Verify that only one content unit is in repo, and that several of its metadata attributes are correct. This test targets Pulp #2365 and Pulp #2754

class pulp_smash.tests.pulp2.rpm.api_v2.test_upload_publish.UploadSrpmTestCase(*args, **kwargs)

Test whether one can upload a SRPM into a repository.

This test case targets Pulp Smash #402

classmethod setUpClass()

Import a SRPM into a repository and search it for content units.

Specifically, this method does the following:

  1. Create a yum repository.
  2. Upload a SRPM into the repository.
  3. Search for all content units in the repository.
test_srpm_file_name_is_correct()

Test if SRPM extracted correct metadata for creating filename.

test_srpm_uploaded_successfully()

Test if SRPM has been uploaded successfully.

test_status_code_units()

Verify the HTTP status code for repo units response.

class pulp_smash.tests.pulp2.rpm.api_v2.test_upload_publish.UploadedDrpmChecksumTypeTestCase(methodName='runTest')

Verify uploaded DRPMs have checksums of the requested type.

test_all()

Verify uploaded DRPMs have checksums of the requested type.

Specifically, this method does the following:

  1. Create a yum repository.
  2. Upload a DRPM into the repository with “checksumtype” set to “md5”.
  3. Assert that “checksumtype” was set to “md5”.
  4. Assert that checksum value was calculated according to “md5”.

This test targets:

class pulp_smash.tests.pulp2.rpm.api_v2.test_upload_publish.VendorInfoTestCase(methodName='runTest')

Test whether the vendor info is present in case of sync and upload.

This tests case targets the following issues:

do_test(repo)

Verify that the given repo has an RPM with vendor data.

Perform the following checks:

  • Search repo for RPMs and filter with a valid unit license. Assert that one search result is returned, and that it has vendor metadata.
  • Search repo for RPMs and filter with a valid unit vendor. Assert that one search result is returned, and that it has vendor metadata.
  • Search repo for RPMs and filter with an invalid unit license. Assert that no search results are returned.
  • Search repo for RPMs and filter with an invalid unit vendor. Assert that no search results are returned.

The license-based searches serve as a sanity check. They show that the search syntax is correct.

classmethod setUpClass()

Create class-wide variables.

test_sync()

Test whether Pulp recognizes a synced RPM’s vendor information.

Create a repository, sync in an RPM with a non-null vendor, and perform several checks. See do_test().

test_upload()

Test whether Pulp recognizes an uploaded RPM’s vendor information.

Create a repository, upload an RPM with a non-null vendor, and perform several checks. See do_test().