pulp_2_tests.tests.rpm.api_v2.test_package_paths

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

Tests that sync repositories whose packages are in varying locations.

The packages in a repository may be in the root of a repository, like so:

repository
├── bear-4.1-1.noarch.rpm
├── camel-0.1-1.noarch.rpm
├── …
└── repodata
    ├── b83f17e552fa7a86f75811147251b4cc4f411eacfde5a187375d-primary.xml.gz
    ├── 5ec9512bc0461c579aebd3fe6d89133db5255cc1e15d529a20-other.sqlite.bz2
    └── …

However, the files in the repodata/ directory specify the paths to each file included in a repository. Consequently, other layouts are possible, like so:

repository
├── packages
│   └── keep-going
│       ├── bear-4.1-1.noarch.rpm
│       ├── camel-0.1-1.noarch.rpm
│       └── …
└── repodata
    ├── b83f17e552fa7a86f75811147251b4cc4f411eacfde5a187375d-primary.xml.gz
    ├── 5ec9512bc0461c579aebd3fe6d89133db5255cc1e15d529a20-other.sqlite.bz2
    └── …

The tests in this module verify that Pulp can correctly handle these situations.

class pulp_2_tests.tests.rpm.api_v2.test_package_paths.ReuseContentTestCase(methodName='runTest')

Bases: unittest.case.TestCase

Sync two repositories with identical content but differing layouts.

If two repositories have some identical content, then Pulp should be able to re-use that content. This is true even if the content is placed in differing locations in the two repositories. Do the following:

  1. Create a pair of repositories. Give the two repositories a download policy of either on demand or background. (One of these download policies must be used to ensure that the Pulp streamer is used.) Give the two repositories differing feeds, where the feeds reference a pair of repositories with some identical content and differing layouts.
  2. Sync each of the repositories.
  3. Publish each of the repositories.
  4. Fetch an identical content unit from each of the two repositories.

This test targets Pulp #2354.

create_repo(cfg, feed, download_policy)

Create an RPM repository with the given feed and download policy.

Also, schedule the repository for deletion at the end of the current test. Return a detailed dict of information about the just-created repository.

test_all()

Sync two repositories w/identical content but differing layouts.