Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
Add pulp version required to run sha512 tests
Browse files Browse the repository at this point in the history
Add the minimum Pulp version required in order to run sha512 tests. Pulp 2.18.

ref:#4007
https://pulp.plan.io/issues/4007
  • Loading branch information
kersom authored and Kersom committed Nov 19, 2018
1 parent d362f83 commit f5d5275
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pulp_2_tests/tests/rpm/api_v2/test_sync_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ def test_publish(self):


class SyncSha512RPMPackageTestCase(unittest.TestCase):
"""Test whether user can sync content from RPM repo with sha512 checksum."""
"""Test whether user can sync RPM repo with sha512 checksum."""

def test_all(self):
"""Test whether RPM repo with sha512 checksum is synced correctly.
Expand All @@ -453,6 +453,8 @@ def test_all(self):
<https://pulp.plan.io/issues/4007>`_.
"""
cfg = config.get_config()
if cfg.pulp_version < Version('2.18'):
raise unittest.SkipTest('This test requires Pulp 2.18 or newer.')
client = api.Client(cfg, api.json_handler)
body = gen_repo(
importer_config={'feed': RPM_SHA_512_FEED_URL},
Expand All @@ -462,6 +464,7 @@ def test_all(self):
self.addCleanup(client.delete, repo['_href'])
sync_repo(cfg, repo)
repo = client.get(repo['_href'], params={'details': True})

# retrieving the published repo
xml_element = get_repodata_repomd_xml(cfg, repo['distributors'][0])
xpath = (
Expand All @@ -474,4 +477,8 @@ def test_all(self):
for element in xml_element.findall(xpath)
}
self.assertEqual(checksum_type, {'sha512'}, checksum_type)
self.assertEqual(repo['content_unit_counts']['rpm'], RPM_UNSIGNED_FEED_COUNT)
self.assertEqual(
repo['content_unit_counts']['rpm'],
RPM_UNSIGNED_FEED_COUNT,
repo['content_unit_counts']['rpm'],
)

0 comments on commit f5d5275

Please sign in to comment.