diff --git a/tests/foreman/ui/test_contentview.py b/tests/foreman/ui/test_contentview.py index dbfba961ed5..d15b2b41b47 100644 --- a/tests/foreman/ui/test_contentview.py +++ b/tests/foreman/ui/test_contentview.py @@ -15,7 +15,12 @@ from fauxfactory import gen_string import pytest -from robottelo.constants import FAKE_FILE_NEW_NAME, REPOS, DataFile +from robottelo.config import settings +from robottelo.constants import ( + FAKE_FILE_NEW_NAME, + REPOS, + DataFile, +) @pytest.mark.tier2 @@ -147,3 +152,71 @@ def test_file_cv_display(session, target_sat, module_org, module_product): file_values = session.file.read_cv_table(FAKE_FILE_NEW_NAME) assert len(file_values) == 1 assert file_values[0]['Name'] == cv.name + + +# @pytest.mark.upgrade +@pytest.mark.tier2 +def test_positive_delete_cv_promoted_to_multi_env( + session, + module_target_sat, + module_org, + target_sat, +): + """Delete the published content view and the version promoted to multiple + environments. + + :id: f16f2db5-7f5b-4ebb-863e-6c18ff745ce4 + + :steps: + 1. Create a yum repo on satellite + 2. Create a content view and add the repository + 3. Publish the content view, creates "Version 1.0" + 4. Promote the "Version 1.0" to multiple environments Library -> DEV + 5. Delete the promoted content view version + 6. Publish and promote a new "Version 1.0" to multiple environments + 7. Delete the content view + + :expectedresults: + 5. Deleting the promoted CVV, removed the CV from multiple environments. + 7. Deleting the CV with promoted CVV, removed the CV from multiple environments. + + :CaseImportance: High + """ + VERSION = 'Version 1.0' + repo = target_sat.cli_factory.RepositoryCollection( + repositories=[target_sat.cli_factory.YumRepository(url=settings.repos.yum_0.url)] + ) + repo.setup(module_org.id) + cv, lce = repo.setup_content_view(module_org.id) + repo_name = repo.repos_info[0]['name'] + + with target_sat.ui_session() as session: + # session.location.select(loc_name=DEFAULT_LOC) + session.organization.select(org_name=module_org.name) + cv_info = session.contentview_new.search(cv['name'])[0] + assert cv_info['Latest version'] == VERSION, ( + f'Latest version for CV {cv["name"]}: {cv_info["Latest version"]},' + f' does not match expected: {VERSION}.' + ) + cvv_values = session.contentview_new.read_cv(cv['name'], VERSION) + assert lce['name'] in cvv_values['Environments'] + # read UI info from repo table in CVV + repo_info = session.contentview_new.read_version_table(cv['name'], VERSION, 'repositories') + assert ( + repo_name == repo_info[0]['Name'] + ), 'Repositories tab for CVV shows incorrect repo name.' + # read UI info from LCE of the CVV + lce_values = session.lifecycleenvironment.read(lce['name']) + assert len(lce_values['content_views']['resources']) == 1 + assert ( + cv['name'] == lce_values['content_views']['resources'][0]['Name'] + ), f'Environment {lce["name"]}, does not show expected CVV {cv["name"]}, contained within.' + # delete the CVV, try searching for it, then delete the ContentView itself + session.contentview_new.click_version_dropdown(cv['name'], VERSION, 'Delete') + # session.contentview.remove_version(cv['name'], VERSION, False, [ENVIRONMENT, lce['name']]) + cv = session.contentview_new.search(cv['name'], VERSION)[0] + """assert lce['name'] not in cv['Environments'] + assert 'Library' not in cv['Environments']""" + session.contentview.delete(cv['name']) + lce_values = session.lifecycleenvironment.read(lce['name']) + assert cv not in lce_values['content_views']['resources'] diff --git a/tests/foreman/ui/test_contentview_old.py b/tests/foreman/ui/test_contentview_old.py index 5fab0249b10..73c017ac59a 100644 --- a/tests/foreman/ui/test_contentview_old.py +++ b/tests/foreman/ui/test_contentview_old.py @@ -1219,6 +1219,7 @@ def test_positive_promote_composite_with_custom_content( assert f'Promoted to {lce.name}' in result['Status'] +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.run_in_one_thread @pytest.mark.tier2 def test_positive_publish_rh_content_with_errata_by_date_filter( @@ -1342,6 +1343,7 @@ def test_positive_remove_cv_version_from_default_env( assert ENVIRONMENT not in cvv['Environments'] +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier2 @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') def test_positive_remove_promoted_cv_version_from_default_env( @@ -1389,6 +1391,7 @@ def test_positive_remove_promoted_cv_version_from_default_env( assert cvv['yum_repositories']['table'][0]['Name'] +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier2 def test_positive_remove_qe_promoted_cv_version_from_default_env( session, module_target_sat, module_org, target_sat @@ -1445,6 +1448,7 @@ def test_positive_remove_qe_promoted_cv_version_from_default_env( assert all(item in cvv_table[0]['Environments'] for item in [dev_lce.name, qe_lce.name]) +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier2 @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') @pytest.mark.parametrize( @@ -1518,6 +1522,7 @@ def test_positive_remove_cv_version_from_env( assert all(item in cvv['Environments'] for item in [ENVIRONMENT, dev_lce.name, qe_lce.name]) +<<<<<<< HEAD @pytest.mark.upgrade @pytest.mark.tier2 @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') @@ -1564,6 +1569,8 @@ def test_positive_delete_cv_promoted_to_multi_env( assert cv not in lce_values['content_views']['resources'] +======= +>>>>>>> 4c11a74b4 (CV_old upgrade case brought into new UI) @pytest.mark.tier2 @pytest.mark.upgrade def test_positive_delete_composite_version(session, module_target_sat, module_org, target_sat): @@ -1814,6 +1821,7 @@ def test_positive_add_package_filter(session, module_target_sat, module_org, tar assert expected_packages == actual_packages +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier3 def test_positive_add_package_inclusion_filter_and_publish( session, module_target_sat, module_org, target_sat @@ -1861,6 +1869,7 @@ def test_positive_add_package_inclusion_filter_and_publish( assert not packages[0]['Name'] +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier3 def test_positive_add_package_exclusion_filter_and_publish( session, module_target_sat, module_org, target_sat @@ -1908,6 +1917,7 @@ def test_positive_add_package_exclusion_filter_and_publish( assert not packages[0]['Name'] +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier3 @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') def test_positive_remove_package_from_exclusion_filter( @@ -1957,6 +1967,7 @@ def test_positive_remove_package_from_exclusion_filter( assert packages[0]['Name'] == package_name +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier3 def test_positive_update_inclusive_filter_package_version( session, module_target_sat, module_org, target_sat @@ -2022,6 +2033,7 @@ def test_positive_update_inclusive_filter_package_version( assert packages[0]['Version'] == '5.21' +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier3 def test_positive_update_exclusive_filter_package_version( session, module_target_sat, module_org, target_sat @@ -2087,6 +2099,7 @@ def test_positive_update_exclusive_filter_package_version( assert packages[0]['Version'] == '0.71' +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier3 @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') def test_positive_add_all_security_errata_by_date_range_filter( @@ -2247,6 +2260,7 @@ def test_positive_promote_with_rh_custom_spin(session, module_target_sat, target assert f'Promoted to {lce.name}' in result['Status'] +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier3 @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') def test_positive_add_all_security_errata_by_id_filter(session, module_target_sat, module_org): @@ -2294,6 +2308,7 @@ def test_positive_add_all_security_errata_by_id_filter(session, module_target_sa ) +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier3 def test_positive_add_errata_filter(session, module_target_sat, module_org, target_sat): """add errata to content views filter @@ -2331,6 +2346,7 @@ def test_positive_add_errata_filter(session, module_target_sat, module_org, targ } +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier3 @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') def test_positive_add_module_stream_filter(session, module_target_sat, module_org, target_sat): @@ -2406,6 +2422,7 @@ def test_positive_add_package_group_filter(session, module_target_sat, module_or assert cvf['content_tabs']['assigned'][0]['Name'] == package_group +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier3 @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') def test_positive_update_filter_affected_repos(session, module_target_sat, module_org, target_sat): @@ -2712,6 +2729,7 @@ def test_positive_rh_mixed_content_end_to_end( assert session.contentview.search_version(cv_name, VERSION)[0]['Version'] != VERSION +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier3 @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') def test_positive_errata_inc_update_list_package(session, module_target_sat, target_sat): @@ -2771,6 +2789,7 @@ def test_positive_errata_inc_update_list_package(session, module_target_sat, tar assert set(result[4:]).issubset(packages) +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier3 @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') def test_positive_composite_child_inc_update( @@ -2937,6 +2956,7 @@ def test_positive_module_stream_end_to_end(session, module_target_sat, module_or assert session.contentview.search(cv_name)[0]['Name'] != cv_name +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier3 @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') def test_positive_search_module_streams_in_content_view( @@ -3297,6 +3317,7 @@ def test_negative_non_readonly_user_actions(module_org, test_name, target_sat): assert 'Navigation failed to reach [All]' in str(context.value) +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier2 @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') def test_positive_conservative_solve_dependencies( @@ -3376,6 +3397,7 @@ def test_positive_conservative_solve_dependencies( assert not package[0]['Name'] +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier2 def test_positive_conservative_dep_solving_with_multiversion_packages( session, module_org, target_sat @@ -3446,6 +3468,7 @@ def test_positive_conservative_dep_solving_with_multiversion_packages( assert package[0]['Version'] == '0.71' +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier2 @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') def test_positive_depsolve_with_module_errata(session, module_target_sat, module_org, target_sat): @@ -3523,6 +3546,7 @@ def test_positive_depsolve_with_module_errata(session, module_target_sat, module assert result['errata']['table'][0]['Errata ID'] == settings.repos.yum_10.errata[0] +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier2 def test_positive_filter_by_pkg_group_name(session, module_target_sat, module_org, target_sat): """Publish a filtered version of a Content View, filtering on the package group's name. @@ -3563,6 +3587,7 @@ def test_positive_filter_by_pkg_group_name(session, module_target_sat, module_or assert expected_packages == [pkg['Name'] for pkg in result['rpm_packages']['table']] +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier3 def test_positive_inc_update_should_not_fail(session, module_target_sat, module_org): """Incremental update after removing a package should not give a 400 error code @@ -3620,6 +3645,7 @@ def test_positive_inc_update_should_not_fail(session, module_target_sat, module_ assert packages[0]['Name'] == package1_name +@pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier2 def test_positive_no_duplicate_key_violate_unique_constraint_using_filters( session, module_entitlement_manifest_org, target_sat