diff --git a/robottelo/constants/repos.py b/robottelo/constants/repos.py index a0b2a8adeec..9d968a3830b 100644 --- a/robottelo/constants/repos.py +++ b/robottelo/constants/repos.py @@ -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/' diff --git a/tests/foreman/api/test_notifications.py b/tests/foreman/api/test_notifications.py index 5ed5c940678..37a14ab726d 100644 --- a/tests/foreman/api/test_notifications.py +++ b/tests/foreman/api/test_notifications.py @@ -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 diff --git a/tests/foreman/api/test_repository.py b/tests/foreman/api/test_repository.py index f42c33f86c7..ac43bef83f8 100644 --- a/tests/foreman/api/test_repository.py +++ b/tests/foreman/api/test_repository.py @@ -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.""" @@ -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 @@ -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' ) @@ -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 @@ -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: diff --git a/tests/foreman/cli/test_repository.py b/tests/foreman/cli/test_repository.py index db04dfd3305..4a70086781f 100644 --- a/tests/foreman/cli/test_repository.py +++ b/tests/foreman/cli/test_repository.py @@ -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, ) @@ -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"""