Skip to content

Commit

Permalink
Create constants for docker feed URLs
Browse files Browse the repository at this point in the history
Create two new constants:

* DOCKER_V1_FEED_URL
* DOCKER_V2_FEED_URL

Use these new constants as appropriate. Test suite results both before
and after this change:

    =========  ==========  ==================
    Pulp Ver.  Num. Tests  Test Suite Results
    =========  ==========  ==================
    2.7        6           OK (skipped=3)
    dev (2.8)  12          OK (skipped=1)
    =========  ==========  ==================

Related to #123, "Reverse dockerhub feeds v1 and v2"
  • Loading branch information
Ichimonji10 committed Feb 18, 2016
1 parent c6308d4 commit d93de79
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
12 changes: 12 additions & 0 deletions pulp_smash/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
http://pulp.readthedocs.org/en/latest/dev-guide/integration/rest-api/content/upload.html#creating-an-upload-request
"""

DOCKER_V1_FEED_URL = 'https://index.docker.io'
"""The URL to a V1 Docker registry.
This URL can be used as the "feed" property of a Pulp Docker registry.
"""

DOCKER_V2_FEED_URL = 'https://registry-1.docker.io'
"""The URL to a V2 Docker registry.
This URL can be used as the "feed" property of a Pulp Docker registry.
"""

ERROR_KEYS = frozenset((
'_href',
'error',
Expand Down
7 changes: 4 additions & 3 deletions pulp_smash/tests/docker/cli/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from packaging.version import Version

from pulp_smash import cli, config, selectors, utils
from pulp_smash.constants import DOCKER_V1_FEED_URL, DOCKER_V2_FEED_URL

_CREATE_COMMAND = (
'pulp-admin docker repo create '
Expand Down Expand Up @@ -64,7 +65,7 @@ def setUpClass(cls):
"""Create and sync a docker repository with a v1 registry."""
super(SyncV1TestCase, cls).setUpClass()
kwargs = {
'feed': 'https://index.docker.io', # v1 feed
'feed': DOCKER_V1_FEED_URL,
'repo_id': cls.repo_id,
'upstream_name': _UPSTREAM_NAME,
}
Expand All @@ -86,7 +87,7 @@ def setUpClass(cls):
if cls.cfg.version < Version('2.8'):
raise unittest2.SkipTest('These tests require Pulp 2.8 or above.')
kwargs = {
'feed': 'https://registry-1.docker.io', # v2 feed
'feed': DOCKER_V2_FEED_URL,
'repo_id': cls.repo_id,
'upstream_name': _UPSTREAM_NAME,
}
Expand All @@ -108,7 +109,7 @@ def setUpClass(cls):
if cls.cfg.version < Version('2.8'):
raise unittest2.SkipTest('These tests require Pulp 2.8 or above.')
kwargs = {
'feed': 'https://registry-1.docker.io', # v2 feed
'feed': DOCKER_V2_FEED_URL,
'repo_id': cls.repo_id,
'upstream_name': 'busybox',
}
Expand Down

0 comments on commit d93de79

Please sign in to comment.