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.ForceSyncTestCase(methodName='runTest')

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

Test whether one can force Pulp to perform a full sync.

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

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

Test whether one can force Pulp to perform a full sync.

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.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.