Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRPM removal, SRPM fix #14675

Merged
merged 2 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion robottelo/constants/repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
CUSTOM_RPM_SHA = 'https://fixtures.pulpproject.org/rpm-with-sha/'
CUSTOM_RPM_SHA_512 = 'https://fixtures.pulpproject.org/rpm-with-sha-512/'
FAKE_5_YUM_REPO = 'https://rplevka.fedorapeople.org/fakerepo01/'
FAKE_YUM_DRPM_REPO = 'https://fixtures.pulpproject.org/drpm-signed/'
FAKE_YUM_MISSING_REPO = 'https://fixtures.pulpproject.org/missing-repo/'
FAKE_YUM_SRPM_REPO = 'https://fixtures.pulpproject.org/srpm-signed/'
FAKE_YUM_SRPM_DUPLICATE_REPO = 'https://fixtures.pulpproject.org/srpm-duplicate/'
FAKE_YUM_MD5_REPO = 'https://fixtures.pulpproject.org/rpm-with-md5/'
Expand Down
2 changes: 1 addition & 1 deletion tests/foreman/api/test_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def long_running_task(target_sat):
def fake_yum_repo(target_sat):
"""Create a fake YUM repo. Delete it afterwards."""
repo = target_sat.api.Repository(
content_type='yum', url=repo_constants.FAKE_YUM_DRPM_REPO
content_type='yum', url=repo_constants.FAKE_YUM_MISSING_REPO
).create()

yield repo
Expand Down
15 changes: 4 additions & 11 deletions tests/foreman/api/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ def repo_options_custom_product(request, module_org, module_target_sat):
return options


@pytest.fixture
def env(module_org, module_target_sat):
"""Create a new puppet environment."""
return module_target_sat.api.Environment(organization=[module_org]).create()


@pytest.fixture
def repo(repo_options, module_target_sat):
"""Create a new repository."""
Expand Down Expand Up @@ -2098,7 +2092,7 @@ class TestSRPMRepository:
@pytest.mark.upgrade
@pytest.mark.tier2
def test_positive_srpm_upload_publish_promote_cv(
self, module_org, env, repo, module_target_sat
self, module_org, module_lce, repo, module_target_sat
):
"""Upload SRPM to repository, add repository to content view
and publish, promote content view
Expand Down Expand Up @@ -2132,7 +2126,6 @@ def test_positive_srpm_upload_publish_promote_cv(

@pytest.mark.upgrade
@pytest.mark.tier2
@pytest.mark.skip('Uses deprecated SRPM repository')
@pytest.mark.skipif(
(not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url'
)
Expand All @@ -2141,7 +2134,7 @@ def test_positive_srpm_upload_publish_promote_cv(
**datafactory.parametrized({'fake_srpm': {'url': repo_constants.FAKE_YUM_SRPM_REPO}}),
indirect=True,
)
def test_positive_repo_sync_publish_promote_cv(self, module_org, env, repo, target_sat):
def test_positive_repo_sync_publish_promote_cv(self, module_org, module_lce, repo, target_sat):
"""Synchronize repository with SRPMs, add repository to content view
and publish, promote content view

Expand All @@ -2165,8 +2158,8 @@ def test_positive_repo_sync_publish_promote_cv(self, module_org, env, repo, targ
>= 3
)

cv.version[0].promote(data={'environment_ids': env.id, 'force': False})
assert len(target_sat.api.Srpms().search(query={'environment_id': env.id})) == 3
cv.version[0].promote(data={'environment_ids': module_lce.id, 'force': False})
assert len(target_sat.api.Srpms().search(query={'environment_id': module_lce.id})) >= 3


class TestSRPMRepositoryIgnoreContent:
Expand Down
88 changes: 0 additions & 88 deletions tests/foreman/cli/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
CUSTOM_FILE_REPO,
CUSTOM_RPM_SHA,
FAKE_5_YUM_REPO,
FAKE_YUM_DRPM_REPO,
FAKE_YUM_MD5_REPO,
FAKE_YUM_SRPM_REPO,
)
Expand Down Expand Up @@ -2529,93 +2528,6 @@ def test_positive_sync_publish_promote_cv(self, repo, module_org, target_sat):
assert lce['id'] in [lc['id'] for lc in cv['lifecycle-environments']]


@pytest.mark.skip_if_open("BZ:1682951")
class TestDRPMRepository:
"""Tests specific to using repositories containing delta RPMs."""

@pytest.mark.tier2
@pytest.mark.skip("Uses deprecated DRPM repository")
@pytest.mark.parametrize(
'repo_options', **parametrized([{'url': FAKE_YUM_DRPM_REPO}]), indirect=True
)
def test_positive_sync(self, repo, module_org, module_product, target_sat):
"""Synchronize repository with DRPMs

:id: a645966c-750b-40ef-a264-dc3bb632b9fd

:parametrized: yes

:expectedresults: drpms can be listed in repository
"""
target_sat.cli.Repository.synchronize({'id': repo['id']})
result = target_sat.execute(
f"ls /var/lib/pulp/published/yum/https/repos/{module_org.label}/Library"
f"/custom/{module_product.label}/{repo['label']}/drpms/ | grep .drpm"
)
assert result.status == 0
assert result.stdout

@pytest.mark.tier2
@pytest.mark.skip("Uses deprecated DRPM repository")
@pytest.mark.parametrize(
'repo_options', **parametrized([{'url': FAKE_YUM_DRPM_REPO}]), indirect=True
)
def test_positive_sync_publish_cv(self, repo, module_org, module_product, target_sat):
"""Synchronize repository with DRPMs, add repository to content view
and publish content view

:id: 014bfc80-4622-422e-a0ec-755b1d9f845e

:parametrized: yes

:expectedresults: drpms can be listed in content view
"""
target_sat.cli.Repository.synchronize({'id': repo['id']})
cv = target_sat.cli_factory.make_content_view({'organization-id': module_org.id})
target_sat.cli.ContentView.add_repository({'id': cv['id'], 'repository-id': repo['id']})
target_sat.cli.ContentView.publish({'id': cv['id']})
result = target_sat.execute(
f"ls /var/lib/pulp/published/yum/https/repos/{module_org.label}/content_views/"
f"{cv['label']}/1.0/custom/{module_product.label}/{repo['label']}/drpms/ | grep .drpm"
)
assert result.status == 0
assert result.stdout

@pytest.mark.tier2
@pytest.mark.upgrade
@pytest.mark.skip("Uses deprecated DRPM repository")
@pytest.mark.parametrize(
'repo_options', **parametrized([{'url': FAKE_YUM_DRPM_REPO}]), indirect=True
)
def test_positive_sync_publish_promote_cv(self, repo, module_org, module_product, target_sat):
"""Synchronize repository with DRPMs, add repository to content view,
publish and promote content view to lifecycle environment

:id: a01cb12b-d388-4902-8532-714f4e28ec56

:parametrized: yes

:expectedresults: drpms can be listed in content view in proper
lifecycle environment
"""
lce = target_sat.cli_factory.make_lifecycle_environment({'organization-id': module_org.id})
target_sat.cli.Repository.synchronize({'id': repo['id']})
cv = target_sat.cli_factory.make_content_view({'organization-id': module_org.id})
target_sat.cli.ContentView.add_repository({'id': cv['id'], 'repository-id': repo['id']})
target_sat.cli.ContentView.publish({'id': cv['id']})
content_view = target_sat.cli.ContentView.info({'id': cv['id']})
cvv = content_view['versions'][0]
target_sat.cli.ContentView.version_promote(
{'id': cvv['id'], 'to-lifecycle-environment-id': lce['id']}
)
result = target_sat.execute(
f"ls /var/lib/pulp/published/yum/https/repos/{module_org.label}/{lce['label']}"
f"/{cv['label']}/custom/{module_product.label}/{repo['label']}/drpms/ | grep .drpm"
)
assert result.status == 0
assert result.stdout


class TestFileRepository:
"""Specific tests for File Repositories"""

Expand Down
Loading