pulp_2_tests.tests.rpm.api_v2.test_copy

Location: Pulp 2 TestsTestspulp_2_tests.tests.rpm.api_v2.test_copy

Test cases that copy content units.

class pulp_2_tests.tests.rpm.api_v2.test_copy.CopyConservativeTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Test recursive and recursive_conservative flags during copy.

RPM packages used in this test case:

chimpanzee
├── squirrel
│   ├── camel
│   └── fox
└── walrus

chimpanzee has dependencies: squirrel and walrus RPM packages. squirrel has dependencies: camel and fox RPM packages.

walrus package has 2 different versions: 0.71 and 5.21.

This test targets the following issues:

copy_units(recursive, recursive_conservative, old_dependency)

Copy units using recursive and recursive_conservative.

pytestmark = [Mark(name='recursive_conservative', args=(), kwargs={})]
classmethod setUpClass()

Create class-wide variables.

test_norecursive_conservative_dependency()

Non-recursive, conservative, with old dependency.

Do the following:

  1. Copy chimpanzee RPM package from repository A to B using: recursive as False, recursive_conservative as True, and an older version of walrus package is present on the repo B before the copy.
  2. Assert that total number of RPM of units is equal to 5, and the walrus package version is equal to 0.71.
test_norecursive_noconservative_nodependency()

Non-recursive, non-conservative, and no old dependency.

Do the following:

  1. Copy chimpanzee RPM package from repository A to B using: recursive as False, recursive_conservative as False, and no older version of walrus package is present on the repo B before the copy.
  2. Assert that total number of RPM of units copied is equal to 1.
test_recursive_conservative_dependency()

Recursive, conservative and with old dependency.

Do the following:

  1. Copy chimpanzee RPM package from repository A to B using: recursive as True, recursive_conservative as True, and an older version of walrus package is present on the repo B before the copy.
  2. Assert that total number of RPM of units is equal to 5 and the walrus package version is equal to 0.71.
test_recursive_conservative_nodependency()

Recursive, conservative, and no old dependency.

Do the following:

  1. Copy chimpanzee RPM package from repository A to B using: recursive as True, recursive_conservative as True, and no older version of walrus package is present on the repo B before the copy.
  2. Assert that total number of RPM of units copied is equal to 5, and the walrus package version is equal to 5.21.
test_recursive_noconservative_dependency()

Recursive, non-conservative, and walrus-0.71 on B.

Do the following:

  1. Copy chimpanzee RPM package from repository A to B using: recursive as True, recursive_conservative as False, and an older version of walrus package is present on the repo B before the copy.
  2. Assert that total number of RPM of units copied is equal to 6, and the walrus package version is equal to both 5.21 and 0.71.

Additional permutation added as --recursive should ensure the latest version of the RPM is also copied.

test_recursive_noconservative_nodependency()

Recursive, non-conservative, and no old dependency.

Do the following:

  1. Copy chimpanzee RPM package from repository A to B using: recursive as True, recursive_conservative as False, and no older version of walrus package is present on the repo B before the copy.
  2. Assert that total number of RPM of units copied is equal to 5, and the walrus package version is equal to 5.21.
class pulp_2_tests.tests.rpm.api_v2.test_copy.CopyErrataRecursiveTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Test that recursive copy of erratas copies RPM packages.

pytestmark = [Mark(name='recursive_conservative', args=(), kwargs={})]
test_all()

Test that recursive copy of erratas copies RPM packages.

This test targets the following issues:

Do the following:

  1. Create and sync a repository with errata, and RPM packages.
  2. Create second repository.
  3. Copy units from from first repository to second repository using recursive as true, and filter type_id as erratum.
  4. Assert that RPM packages were copied.
class pulp_2_tests.tests.rpm.api_v2.test_copy.CopyYumMetadataFileTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Test the copy of metadata units between repos.

pytestmark = [Mark(name='recursive_conservative', args=(), kwargs={})]
test_all()

Test whether metadata copied between repos are independent.

This test targets the following issues:

Do the following:

  1. Create and sync a repository containing yum_repo_metadata_file.
  2. Create another repo and copy yum metadata from first repo to second repo.
  3. Publish repo 2.
  4. Remove the metadata units from the first repo. Delete orphan packages.
  5. Publish repo 2 again and check whether the metadata is present in the second repo still.
class pulp_2_tests.tests.rpm.api_v2.test_copy.MtimeTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Test whether copied files retain their original mtime.

test_all()

Test whether copied files retain their original mtime.

This test targets the following issues:

Do the following:

  1. Create, sync and publish a repository, with generate_sqlite set to true.
  2. Get the mtime of the sqlite files.
  3. Upload an RPM package into the repository, and sync the repository.
  4. Get the mtime of the sqlite files again. Verify that the mtimes are the same.
class pulp_2_tests.tests.rpm.api_v2.test_copy.MultipleSourceRepositoriesRecursiveCopyTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Test multiple source repositories recursive copy.

Repository 1 is a modular repository. There are 2 RPM dependencies missing from repository 1. stork and shark RPMS.

Repository 2 is non-modular repository and has the RPMS stork and shark missing from repository 1.

[walrus-0.71] - Module - repository 1 ├── walrus - RPM - repository 1

└── whale - RPM present on repository 1
├── shark - RPM present on repository 2 └── stork - RPM present on repository 2

This test targets the following issues:

create_sync_repo(feed)

Create and sync a repository given a feed.

pytestmark = [Mark(name='recursive_conservative', args=(), kwargs={})]
classmethod setUpClass()

Create class-wide variables.

test_additional_repos_copy_one_destination()

Multiple source repositories recursive copy - one repo destination.

  1. Copy walrus - 0.71 module to repository 3, and all the dependencies RPMS should be solved and copied as well.
test_additional_repos_copy_two_destinations()

Multiple source repositories recursive copy - two repos destination.

  1. Copy walrus - 0.71 module to repository 3 and the dependencies present on the repository 1 will be copied as well. The other dependencies present on the repository 2, shark and stork will be copied to the repository 4.
test_additional_repos_errata()

Copy errata using additional repos as source.

Copy errata RHEA-2012:0059 from repository 1 to repository 3. Repository 1 does not have the package kangaroo-0.3-1.noarch.rpm required by the errata. This package is present on the repository 2. Pulp should copy the errata and solve the dependency chain for repository 3.