pulp_smash.tests.rpm.cli.test_copy_units

Location: Pulp SmashAPI Documentationpulp_smash.tests.rpm.cli.test_copy_units

Tests that copy units from one repository to another.

class pulp_smash.tests.rpm.cli.test_copy_units.CopyLangpacksTestCase(methodName='runTest')

Copy langpacks from one repository to another.

This test case verifies that it is possible to use the pulp-admin rpm repo copy langpacks command to copy langpacks from one repository to another. See Pulp Smash #255.

test_all()

Copy langpacks from one repository to another.

Assert that:

  • pulp-admin does not produce any errors.
  • A non-zero number of langpacks are present in the target repository.
class pulp_smash.tests.rpm.cli.test_copy_units.CopyRecursiveTestCase(methodName='runTest')

Recursively copy a “chimpanzee” unit from one repository to another.

This test case verifies that it is possible to use the pulp-admin rpm repo copy command to recursively copy units from one repository to another. See Pulp Smash #107.

test_all()

Recursively copy a “chimpanzee” unit from one repository to another.

“chimpanzee” depends on “walrus,” and there are multiple versions of “walrus” in the source repository. Verify that one “walrus” unit has been copied to the target repository, and that the newer one has been copied.

class pulp_smash.tests.rpm.cli.test_copy_units.CopyTestCase(methodName='runTest')

Copy a “chimpanzee” unit from one repository to another.

This test case verifies that it is possible to use the pulp-admin rpm repo copy command to copy a single unit from one repository to another.

test_all()

Copy a “chimpanzee” unit from one repository to another.

Verify that only the “chimpanzee” unit is in the target repository.

class pulp_smash.tests.rpm.cli.test_copy_units.UpdateRpmTestCase(methodName='runTest')

Update an RPM in a repository and on a host.

Do the following:

  1. Create two repositories. Populate the first, and leave the second empty.
  2. Pick an RPM with at least two versions.
  3. Copy the older version of the RPM from the first repository to the second, and publish the second repository.
  4. Pick a host system capable of installing RPMs. (By default, this is the system hosting Pulp.) Make it add the second repository as a source of packages, and make it install the RPM.
  5. Copy the newer version of the RPM from the first repository to the second, and publish the second repository.
  6. Make the host install the newer RPM with yum update rpm_name, or a similar command.

This test case targets Pulp Smash #311.

test_all()

Update an RPM in a repository and on a host.

class pulp_smash.tests.rpm.cli.test_copy_units.UtilsMixin

A mixin providing useful tools to unittest subclasses.

Any class inheriting from this mixin must also inherit from unittest.TestCase or a compatible clone.

create_repo(cfg)

Create a repository and schedule it for deletion.

Parameters:cfg (pulp_smash.config.PulpSmashConfig) – The Pulp system on which to create a repository.
Returns:The repository’s ID.
pulp_smash.tests.rpm.cli.test_copy_units.gen_yum_config_file(cfg, repositoryid, **kwargs)

Generate a yum configuration file and write it to /etc/yum.repos.d/.

Generate a yum configuration file containing a single repository section, and write it to /etc/yum.repos.d/{repositoryid}.repo.

Parameters:
  • cfg (pulp_smash.config.PulpSmashConfig) – The system on which to create a yum configuration file.
  • repositoryid – The section’s repositoryid. Used when naming the configuration file and populating the brackets at the head of the file. For details, see yum.conf(5).
  • kwargs – Section options. Each kwarg corresponds to one option. For details, see yum.conf(5).
Returns:

The path to the yum configuration file.

pulp_smash.tests.rpm.cli.test_copy_units.setUpModule()

Possibly skip tests. Create and sync an RPM repository.

Skip tests in this module if the RPM plugin is not installed on the target Pulp server. Then create an RPM repository with a feed and sync it. Test cases may copy data from this repository but should not change it.

pulp_smash.tests.rpm.cli.test_copy_units.tearDownModule()

Delete the repository created by setUpModule.