pulp_2_tests.tests.rpm.cli.test_sync

Location: Pulp 2 TestsTestspulp_2_tests.tests.rpm.cli.test_sync

Tests that sync RPM repositories.

class pulp_2_tests.tests.rpm.cli.test_sync.ForceSyncDuplicateSRPMFailure(methodName='runTest')

Bases: unittest.case.TestCase

Test a sync with –srpm skip does not fail.

This test case targets Pulp #4459.

The test procedure is as follows:

  1. Create and sync a repository containing duplicate SRPMs with –skip
  2. Sync the repository. Verify there are no SRPMs in the repository following the sync by catching the raise.
  3. Create and sync an SRPM repository with –skip.
  4. Sync the repository. Verify there are no SRPMs in the repository following the sync by catching the raise.
  • SRPM_DUPLICATE_FEED_URL: test fixture with duplicate SRPMs used to retest the initial failure when used with --skip.
  • SRPM_RICH_WEAK_FEED_URL: test fixture with non-duplicated SRPMs used to verify basic functionality of the --skip feature .

Both test fixtures consist only of SRPMS. Each will raise an expected exception in not finding any SRPMs.

do_test(unit_type, feed)

Test whether Pulp can sync with –srpm skip.

setUp()

Delete orphan content units.

classmethod setUpClass()

Create class-wide config.

test_srpm_duplicate()

Test a sync on Pulp using –skip srpm.

test_srpm_noduplicate()

Test a sync on Pulp using –skip srpm.

class pulp_2_tests.tests.rpm.cli.test_sync.ForceSyncTestCase(methodName='runTest')

Bases: pulp_2_tests.tests.rpm.cli.test_sync._BaseTestCase

Test a forced full sync on Pulp.

This test case targets Pulp #1982 , Pulp #4409 and Pulp Smash #353. The test procedure is as follows:

  1. Create and sync a repository.
  2. Remove some number of units from /var/lib/pulp/content/units/ sub-directory. Verify they are missing.
  3. Sync the repository. Verify the units are still missing.
  4. Sync the repository with --force-full true. Verify all units are present.

This test case has added distribution units and could be expanded to other unit types.

classmethod setUpClass()

Create class-wide config.

test_distribution_content_units()

Test a forced full sync on Pulp.

Using the tuple to target distribution units and looking for the .img extension, respectively.

The test fixture includes kickstart information as well as the use of a PULP_DISTRIBUTION.xml file to target additional files not listed in [.]treeinfo. In this example, the isolinux/ directory is added which contains additional .img files for the test.

For more information about distribution units and the test fixture, see Pulp #4409.

test_rpm_content_units()

Test a forced full sync on Pulp.

Using the tuple to target rpms units and looking for the .rpm extension, respectively.

class pulp_2_tests.tests.rpm.cli.test_sync.RemovedContentTestCase(methodName='runTest')

Bases: pulp_2_tests.tests.rpm.cli.test_sync._BaseTestCase

Test whether Pulp can re-sync content into a repository.

This test case targets Pulp #1775 and the corresponding Pulp Smash issue, Pulp Smash #243.

  1. Create and sync a repository. Select a content unit.
  2. Delete the content unit from the repository, and verify it’s absent.
  3. Sync the repository, and verify that the content unit is present.
test_all()

Test whether Pulp can re-sync content into a repository.

pulp_2_tests.tests.rpm.cli.test_sync.get_rpm_names(cfg, repo_id)

Get a list of names of all packages in a repository.

Parameters:
  • cfg – Information about a Pulp deployment.
  • repo_id – A RPM repository ID.
Returns:

The names of all modules in a repository, as an list.

pulp_2_tests.tests.rpm.cli.test_sync.list_units(cfg, unit_type)

Return a list of units in /var/lib/pulp/content/units/.

The unit type can be a number of different types.

Examples are: * distribution * rpm * srpm * drpm * modulemd * modulemd_defaults

This method should be extensible to take any unit_type and operate as required.

pulp_2_tests.tests.rpm.cli.test_sync.setUpModule()

Execute pulp-admin login and reset Pulp.

For RemovedContentTestCase to function correctly, we require that all of the content units on Pulp’s filesystem belong to the repository created by that test case. Resetting Pulp guarantees that this is so. Ideally, all test cases would clean up after themselves so that no resets are necessary.

pulp_2_tests.tests.rpm.cli.test_sync.sync_repo(cfg, repo_id, force_sync=False)

Sync an RPM repository.

Parameters:
  • cfg – Information about a Pulp deployment.
  • repo_id – A RPM repository ID.
  • repo_id – A boolean flag to denote if is a force-full sync.
Returns:

A pulp_smash.cli.CompletedProcess.