From 3a8d82b72a52ff92ce7b865fa1c42ebf583cad12 Mon Sep 17 00:00:00 2001 From: Samuel Bible Date: Mon, 11 Dec 2023 13:04:54 -0600 Subject: [PATCH 01/93] Fix missing api param in target_sat call in SyncPlan test (#13370) --- tests/foreman/api/test_syncplan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/foreman/api/test_syncplan.py b/tests/foreman/api/test_syncplan.py index 566d06d692..dec71b6b9c 100644 --- a/tests/foreman/api/test_syncplan.py +++ b/tests/foreman/api/test_syncplan.py @@ -837,7 +837,7 @@ def test_positive_synchronize_rh_product_past_sync_date( ) product = target_sat.api.Product(name=PRDS['rhel'], organization=org).search()[0] repo = target_sat.api.Repository(id=repo_id).read() - sync_plan = target_sat.SyncPlan( + sync_plan = target_sat.api.SyncPlan( organization=org, enabled=True, interval='hourly', From 2809bdb4018fc00974b1144f53d4fdd416e74eb3 Mon Sep 17 00:00:00 2001 From: Peter Ondrejka Date: Mon, 11 Dec 2023 15:33:28 +0100 Subject: [PATCH 02/93] fixed api audit tests --- tests/foreman/api/test_audit.py | 66 +++++++++++++++++---------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/tests/foreman/api/test_audit.py b/tests/foreman/api/test_audit.py index 1aa9c28cc4..1eff8e5e59 100644 --- a/tests/foreman/api/test_audit.py +++ b/tests/foreman/api/test_audit.py @@ -39,7 +39,7 @@ def test_positive_create_by_type(target_sat): :CaseImportance: Medium """ for entity_item in [ - {'entity': target_sat.api.Architecture()}, + {'entity': target_sat.api.Architecture(), 'entity_type': 'architecture'}, { 'entity': target_sat.api.AuthSourceLDAP(), 'entity_type': 'auth_source', @@ -51,15 +51,16 @@ def test_positive_create_by_type(target_sat): 'entity_type': 'compute_resource', 'value_template': '{entity.name} (Libvirt)', }, - {'entity': target_sat.api.Domain()}, - {'entity': target_sat.api.Host()}, - {'entity': target_sat.api.HostGroup()}, + {'entity': target_sat.api.Domain(), 'entity_type': 'domain'}, + {'entity': target_sat.api.Host(), 'entity_type': 'host'}, + {'entity': target_sat.api.HostGroup(), 'entity_type': 'hostgroup'}, { 'entity': target_sat.api.Image( compute_resource=target_sat.api.LibvirtComputeResource().create() - ) + ), + 'entity_type': 'image', }, - {'entity': target_sat.api.Location()}, + {'entity': target_sat.api.Location(), 'entity_type': 'location'}, {'entity': target_sat.api.Media(), 'entity_type': 'medium'}, { 'entity': target_sat.api.OperatingSystem(), @@ -67,14 +68,19 @@ def test_positive_create_by_type(target_sat): 'value_template': '{entity.name} {entity.major}', }, {'entity': target_sat.api.PartitionTable(), 'entity_type': 'ptable'}, - {'entity': target_sat.api.Role()}, + {'entity': target_sat.api.Role(), 'entity_type': 'role'}, { 'entity': target_sat.api.Subnet(), + 'entity_type': 'subnet', 'value_template': '{entity.name} ({entity.network}/{entity.cidr})', }, {'entity': target_sat.api.ProvisioningTemplate(), 'entity_type': 'provisioning_template'}, - {'entity': target_sat.api.User(), 'value_template': '{entity.login}'}, - {'entity': target_sat.api.UserGroup()}, + { + 'entity': target_sat.api.User(), + 'value_template': '{entity.login}', + 'entity_type': 'user', + }, + {'entity': target_sat.api.UserGroup(), 'entity_type': 'usergroup'}, {'entity': target_sat.api.ContentView(), 'entity_type': 'katello/content_view'}, {'entity': target_sat.api.LifecycleEnvironment(), 'entity_type': 'katello/kt_environment'}, {'entity': target_sat.api.ActivationKey(), 'entity_type': 'katello/activation_key'}, @@ -86,10 +92,11 @@ def test_positive_create_by_type(target_sat): }, ]: created_entity = entity_item['entity'].create() - entity_type = entity_item.get('entity_type', created_entity.__class__.__name__.lower()) value_template = entity_item.get('value_template', '{entity.name}') entity_value = value_template.format(entity=created_entity) - audits = target_sat.api.Audit().search(query={'search': f'type={entity_type}'}) + audits = target_sat.api.Audit().search( + query={'search': f'type={entity_item["entity_type"]}'} + ) entity_audits = [entry for entry in audits if entry.auditable_name == entity_value] assert entity_audits, ( f'audit not found by name "{entity_value}" for entity: ' @@ -114,21 +121,19 @@ def test_positive_update_by_type(target_sat): :CaseImportance: Medium """ for entity in [ - target_sat.api.Architecture(), - target_sat.api.Domain(), - target_sat.api.HostGroup(), - target_sat.api.Location(), - target_sat.api.Role(), - target_sat.api.UserGroup(), + {'entity': target_sat.api.Architecture(), 'entity_type': 'architecture'}, + {'entity': target_sat.api.Domain(), 'entity_type': 'domain'}, + {'entity': target_sat.api.HostGroup(), 'entity_type': 'hostgroup'}, + {'entity': target_sat.api.Location(), 'entity_type': 'location'}, + {'entity': target_sat.api.Role(), 'entity_type': 'role'}, + {'entity': target_sat.api.UserGroup(), 'entity_type': 'usergroup'}, ]: - created_entity = entity.create() + created_entity = entity['entity'].create() name = created_entity.name new_name = gen_string('alpha') created_entity.name = new_name created_entity = created_entity.update(['name']) - audits = target_sat.api.Audit().search( - query={'search': f'type={created_entity.__class__.__name__.lower()}'} - ) + audits = target_sat.api.Audit().search(query={'search': f'type={entity["entity_type"]}'}) entity_audits = [entry for entry in audits if entry.auditable_name == name] assert entity_audits, f'audit not found by name "{name}"' audit = entity_audits[0] @@ -151,19 +156,16 @@ def test_positive_delete_by_type(target_sat): :CaseImportance: Medium """ for entity in [ - target_sat.api.Architecture(), - target_sat.api.Domain(), - target_sat.api.Host(), - target_sat.api.HostGroup(), - target_sat.api.Location(), - target_sat.api.Role(), - target_sat.api.UserGroup(), + {'entity': target_sat.api.Architecture(), 'entity_type': 'architecture'}, + {'entity': target_sat.api.Domain(), 'entity_type': 'domain'}, + {'entity': target_sat.api.HostGroup(), 'entity_type': 'hostgroup'}, + {'entity': target_sat.api.Location(), 'entity_type': 'location'}, + {'entity': target_sat.api.Role(), 'entity_type': 'role'}, + {'entity': target_sat.api.UserGroup(), 'entity_type': 'usergroup'}, ]: - created_entity = entity.create() + created_entity = entity['entity'].create() created_entity.delete() - audits = target_sat.api.Audit().search( - query={'search': f'type={created_entity.__class__.__name__.lower()}'} - ) + audits = target_sat.api.Audit().search(query={'search': f'type={entity["entity_type"]}'}) entity_audits = [entry for entry in audits if entry.auditable_name == created_entity.name] assert entity_audits, f'audit not found by name "{created_entity.name}"' audit = entity_audits[0] From a32647357f86d3f63fa25c4ff17d35cfef09c307 Mon Sep 17 00:00:00 2001 From: Samuel Bible Date: Tue, 12 Dec 2023 00:44:38 -0600 Subject: [PATCH 03/93] Automation for BZ 2119112 - subpaths field is mandatory while creating ACS in the UI (#13369) Add test checking that subpath field isn't mandatory --- tests/foreman/ui/test_acs.py | 54 ++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/tests/foreman/ui/test_acs.py b/tests/foreman/ui/test_acs.py index 8abe9e70c7..b6daa63f50 100644 --- a/tests/foreman/ui/test_acs.py +++ b/tests/foreman/ui/test_acs.py @@ -64,6 +64,60 @@ def acs_setup(class_target_sat, class_sca_manifest_org): return class_target_sat, class_sca_manifest_org +@pytest.mark.tier2 +def test_acs_subpath_not_required(acs_setup): + """ + This test verifies that the subpath field isn't mandatory for ACS creation. + + :id: 232d944a-a7c1-4387-ab01-7e20b2bbebfa + + :steps: + 1. Create an ACS of each type where subpath field is present in the UI + + :expectedresults: + Subpath field isn't required in the creation of any ACS where it's present, + so ACS should all create successfully + + :BZ: 2119112 + + :customerscenario: True + """ + class_target_sat, class_sca_manifest_org = acs_setup + + with class_target_sat.ui_session() as session: + session.organization.select(org_name=class_sca_manifest_org.name) + + # Create an ACS of each configturation that displays the subpath field in UI + session.acs.create_new_acs( + custom_type=True, + content_type='yum', + name=gen_string('alpha'), + capsules_to_add=class_target_sat.hostname, + use_http_proxies=True, + base_url='https://test.com', + none_auth=True, + ) + + session.acs.create_new_acs( + custom_type=True, + content_type='file', + name=gen_string('alpha'), + capsules_to_add=class_target_sat.hostname, + use_http_proxies=True, + base_url='https://test.com', + none_auth=True, + ) + + session.acs.create_new_acs( + rhui_type=True, + name=gen_string('alpha'), + capsules_to_add=class_target_sat.hostname, + use_http_proxies=True, + base_url='https://rhui-server.example.com/pulp/content', + none_auth=True, + ) + + class TestAllAcsTypes: """ Test class insuring fixture is ran once before From 9a8c0d924cfcaf927f575aeabe80db65aefb9e7a Mon Sep 17 00:00:00 2001 From: Omkar Khatavkar Date: Tue, 12 Dec 2023 12:28:00 +0530 Subject: [PATCH 04/93] fixing the prt comment copy to cherry-pick branch (#13362) --- .github/workflows/auto_cherry_pick.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/auto_cherry_pick.yml b/.github/workflows/auto_cherry_pick.yml index a64c015aee..324b0f1e86 100644 --- a/.github/workflows/auto_cherry_pick.yml +++ b/.github/workflows/auto_cherry_pick.yml @@ -77,11 +77,12 @@ jobs: - name: Add Parent PR's PRT comment to Auto_Cherry_Picked PR's id: add-parent-prt-comment if: ${{ always() && steps.cherrypick.outcome == 'success' }} - run: | - curl -X POST -H "Authorization: token ${{ secrets.CHERRYPICK_PAT }}" \ - -H "Accept: application/vnd.github.v3+json" \ - "https://api.github.com/repos/${{ github.repository }}/issues/${{ steps.cherrypick.outputs.number }}/comments" \ - -d "{\"body\":\"${{ needs.find-the-parent-prt-comment.outputs.prt_comment }}\"}" + uses: thollander/actions-comment-pull-request@v2 + with: + message: | + ${{ needs.find-the-parent-prt-comment.outputs.prt_comment }} + pr_number: ${{ steps.cherrypick.outputs.number }} + GITHUB_TOKEN: ${{ secrets.CHERRYPICK_PAT }} - name: is autoMerging enabled for Auto CherryPicked PRs ? if: ${{ always() && steps.cherrypick.outcome == 'success' && contains(github.event.pull_request.labels.*.name, 'AutoMerge_Cherry_Picked') }} From fdb5232a32bbc15ab30f59d9044ba41b6b206741 Mon Sep 17 00:00:00 2001 From: Gaurav Talreja Date: Tue, 12 Dec 2023 12:34:54 +0530 Subject: [PATCH 05/93] Remove LCE option from register helper and assert in form test (#13341) Signed-off-by: Gaurav Talreja --- robottelo/hosts.py | 4 ---- tests/foreman/ui/test_host.py | 1 - 2 files changed, 5 deletions(-) diff --git a/robottelo/hosts.py b/robottelo/hosts.py index 0e2d8b19de..b4e4fdcc0c 100644 --- a/robottelo/hosts.py +++ b/robottelo/hosts.py @@ -699,7 +699,6 @@ def register( setup_insights=False, setup_remote_execution=True, setup_remote_execution_pull=False, - lifecycle_environment=None, operating_system=None, packages=None, repo=None, @@ -721,7 +720,6 @@ def register( :param setup_insights: Install and register Insights client, requires OS repo. :param setup_remote_execution: Copy remote execution SSH key. :param setup_remote_execution_pull: Deploy pull provider client on host - :param lifecycle_environment: Lifecycle environment. :param operating_system: Operating system. :param packages: A list of packages to install on the host when registered. :param repo: Repository to be added before the registration is performed, supply url. @@ -760,8 +758,6 @@ def register( elif target is not None and target.__class__.__name__ not in ['Capsule', 'Satellite']: raise ValueError('Global registration method can be used with Satellite/Capsule only') - if lifecycle_environment is not None: - options['lifecycle-environment-id'] = lifecycle_environment.id if operating_system is not None: options['operatingsystem-id'] = operating_system.id if hostgroup is not None: diff --git a/tests/foreman/ui/test_host.py b/tests/foreman/ui/test_host.py index 6f45992086..242e7f6a62 100644 --- a/tests/foreman/ui/test_host.py +++ b/tests/foreman/ui/test_host.py @@ -1320,7 +1320,6 @@ def test_global_registration_form_populate( ) assert hg_name in cmd['general']['host_group'] assert module_ak_with_cv.name in cmd['general']['activation_key_helper'] - assert module_lce.name in cmd['advanced']['life_cycle_env_helper'] assert constants.FAKE_0_CUSTOM_PACKAGE in cmd['advanced']['install_packages_helper'] session.organization.select(org_name=new_org.name) From 8c2375d9eeaa86fb1bb5849a194a22a33e0886a5 Mon Sep 17 00:00:00 2001 From: Vladimir Sedmik Date: Mon, 11 Dec 2023 14:27:34 +0100 Subject: [PATCH 06/93] Update yum repo for ACSes --- robottelo/constants/repos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/robottelo/constants/repos.py b/robottelo/constants/repos.py index bf54b5518b..9738894a68 100644 --- a/robottelo/constants/repos.py +++ b/robottelo/constants/repos.py @@ -2,7 +2,7 @@ PULP_FIXTURE_ROOT = 'https://fixtures.pulpproject.org/' PULP_SUBPATHS_COMBINED = { - 'yum': ['rpm-zchunk/', 'rpm-modular/'], + 'yum': ['rpm-zstd-metadata/', 'rpm-modular/'], 'file': ['file-large/', 'file-many/'], } CUSTOM_3RD_PARTY_REPO = 'http://repo.calcforge.org/fedora/21/x86_64/' From 257ec7d716ef91c3743fd2669aac7d71f3a8d536 Mon Sep 17 00:00:00 2001 From: Shweta Singh Date: Tue, 12 Dec 2023 13:27:01 +0530 Subject: [PATCH 07/93] Added SCA enabled manifest in activation key and removed duplicate fixture (#13082) Using SCA enabled manifest in activation key --- pytest_fixtures/component/activationkey.py | 9 +++-- tests/foreman/api/test_registration.py | 38 +++++++++++++--------- tests/foreman/cli/test_registration.py | 13 ++++---- tests/foreman/ui/test_host.py | 29 ++--------------- 4 files changed, 35 insertions(+), 54 deletions(-) diff --git a/pytest_fixtures/component/activationkey.py b/pytest_fixtures/component/activationkey.py index 9981d60f13..fa7b53d018 100644 --- a/pytest_fixtures/component/activationkey.py +++ b/pytest_fixtures/component/activationkey.py @@ -6,13 +6,12 @@ @pytest.fixture(scope='module') -def module_activation_key(module_entitlement_manifest_org, module_target_sat): +def module_activation_key(module_sca_manifest_org, module_target_sat): """Create activation key using default CV and library environment.""" activation_key = module_target_sat.api.ActivationKey( - auto_attach=True, - content_view=module_entitlement_manifest_org.default_content_view.id, - environment=module_entitlement_manifest_org.library.id, - organization=module_entitlement_manifest_org, + content_view=module_sca_manifest_org.default_content_view.id, + environment=module_sca_manifest_org.library.id, + organization=module_sca_manifest_org, ).create() return activation_key diff --git a/tests/foreman/api/test_registration.py b/tests/foreman/api/test_registration.py index f29da4c8e7..dab85fa620 100644 --- a/tests/foreman/api/test_registration.py +++ b/tests/foreman/api/test_registration.py @@ -30,9 +30,9 @@ @pytest.mark.e2e @pytest.mark.no_containers def test_host_registration_end_to_end( - module_org, + module_entitlement_manifest_org, module_location, - module_ak_with_synced_repo, + module_activation_key, module_target_sat, module_capsule_configured, rhel_contenthost, @@ -50,9 +50,10 @@ def test_host_registration_end_to_end( :customerscenario: true """ + org = module_entitlement_manifest_org command = module_target_sat.api.RegistrationCommand( - organization=module_org, - activation_keys=[module_ak_with_synced_repo.name], + organization=org, + activation_keys=[module_activation_key.name], location=module_location, ).create() @@ -66,13 +67,13 @@ def test_host_registration_end_to_end( # Update module_capsule_configured to include module_org/module_location nc = module_capsule_configured.nailgun_smart_proxy - module_target_sat.api.SmartProxy(id=nc.id, organization=[module_org]).update(['organization']) + module_target_sat.api.SmartProxy(id=nc.id, organization=[org]).update(['organization']) module_target_sat.api.SmartProxy(id=nc.id, location=[module_location]).update(['location']) command = module_target_sat.api.RegistrationCommand( smart_proxy=nc, - organization=module_org, - activation_keys=[module_ak_with_synced_repo.name], + organization=org, + activation_keys=[module_activation_key.name], location=module_location, force=True, ).create() @@ -92,7 +93,11 @@ def test_host_registration_end_to_end( @pytest.mark.tier3 @pytest.mark.rhel_ver_match('[^6]') def test_positive_allow_reregistration_when_dmi_uuid_changed( - module_org, rhel_contenthost, target_sat, module_ak_with_synced_repo, module_location + module_sca_manifest_org, + rhel_contenthost, + target_sat, + module_activation_key, + module_location, ): """Register a content host with a custom DMI UUID, unregistering it, change the DMI UUID, and re-registering it again @@ -109,10 +114,11 @@ def test_positive_allow_reregistration_when_dmi_uuid_changed( """ uuid_1 = str(uuid.uuid1()) uuid_2 = str(uuid.uuid4()) + org = module_sca_manifest_org target_sat.execute(f'echo \'{{"dmi.system.uuid": "{uuid_1}"}}\' > /etc/rhsm/facts/uuid.facts') command = target_sat.api.RegistrationCommand( - organization=module_org, - activation_keys=[module_ak_with_synced_repo.name], + organization=org, + activation_keys=[module_activation_key.name], location=module_location, ).create() result = rhel_contenthost.execute(command) @@ -121,8 +127,8 @@ def test_positive_allow_reregistration_when_dmi_uuid_changed( assert result.status == 0 target_sat.execute(f'echo \'{{"dmi.system.uuid": "{uuid_2}"}}\' > /etc/rhsm/facts/uuid.facts') command = target_sat.api.RegistrationCommand( - organization=module_org, - activation_keys=[module_ak_with_synced_repo.name], + organization=org, + activation_keys=[module_activation_key.name], location=module_location, ).create() result = rhel_contenthost.execute(command) @@ -131,7 +137,7 @@ def test_positive_allow_reregistration_when_dmi_uuid_changed( def test_positive_update_packages_registration( module_target_sat, - module_entitlement_manifest_org, + module_sca_manifest_org, module_location, rhel8_contenthost, module_activation_key, @@ -144,7 +150,7 @@ def test_positive_update_packages_registration( :CaseLevel: Component """ - org = module_entitlement_manifest_org + org = module_sca_manifest_org command = module_target_sat.api.RegistrationCommand( organization=org, location=module_location, @@ -164,7 +170,7 @@ def test_positive_update_packages_registration( @pytest.mark.no_containers def test_positive_rex_interface_for_global_registration( module_target_sat, - module_entitlement_manifest_org, + module_sca_manifest_org, module_location, rhel8_contenthost, module_activation_key, @@ -188,7 +194,7 @@ def test_positive_rex_interface_for_global_registration( add_interface_command = f'ip link add eth1 type dummy;ifconfig eth1 hw ether {mac_address};ip addr add {ip}/24 brd + dev eth1 label eth1:1;ip link set dev eth1 up' result = rhel8_contenthost.execute(add_interface_command) assert result.status == 0 - org = module_entitlement_manifest_org + org = module_sca_manifest_org command = module_target_sat.api.RegistrationCommand( organization=org, location=module_location, diff --git a/tests/foreman/cli/test_registration.py b/tests/foreman/cli/test_registration.py index 50102ae2c0..25b8c0a213 100644 --- a/tests/foreman/cli/test_registration.py +++ b/tests/foreman/cli/test_registration.py @@ -27,9 +27,9 @@ @pytest.mark.e2e @pytest.mark.no_containers def test_host_registration_end_to_end( - module_org, + module_entitlement_manifest_org, module_location, - module_ak_with_synced_repo, + module_activation_key, module_target_sat, module_capsule_configured, rhel_contenthost, @@ -47,8 +47,9 @@ def test_host_registration_end_to_end( :customerscenario: true """ + org = module_entitlement_manifest_org result = rhel_contenthost.register( - module_org, module_location, module_ak_with_synced_repo.name, module_target_sat + org, module_location, [module_activation_key.name], module_target_sat ) rc = 1 if rhel_contenthost.os_version.major == 6 else 0 @@ -62,14 +63,14 @@ def test_host_registration_end_to_end( module_target_sat.cli.Capsule.update( { 'name': module_capsule_configured.hostname, - 'organization-ids': module_org.id, + 'organization-ids': org.id, 'location-ids': module_location.id, } ) result = rhel_contenthost.register( - module_org, + org, module_location, - module_ak_with_synced_repo.name, + [module_activation_key.name], module_capsule_configured, force=True, ) diff --git a/tests/foreman/ui/test_host.py b/tests/foreman/ui/test_host.py index 242e7f6a62..9ea2cd736d 100644 --- a/tests/foreman/ui/test_host.py +++ b/tests/foreman/ui/test_host.py @@ -34,7 +34,6 @@ ANY_CONTEXT, DEFAULT_CV, DEFAULT_LOC, - DEFAULT_SUBSCRIPTION_NAME, ENVIRONMENT, FAKE_1_CUSTOM_PACKAGE, FAKE_7_CUSTOM_PACKAGE, @@ -97,30 +96,6 @@ def module_global_params(module_target_sat): global_parameter.delete() -@pytest.fixture(scope='module') -def module_activation_key(module_entitlement_manifest_org, module_target_sat): - """Create activation key using default CV and library environment.""" - activation_key = module_target_sat.api.ActivationKey( - auto_attach=True, - content_view=module_entitlement_manifest_org.default_content_view.id, - environment=module_entitlement_manifest_org.library.id, - organization=module_entitlement_manifest_org, - ).create() - - # Find the 'Red Hat Employee Subscription' and attach it to the activation key. - for subs in module_target_sat.api.Subscription( - organization=module_entitlement_manifest_org - ).search(): - if subs.name == DEFAULT_SUBSCRIPTION_NAME: - # 'quantity' must be 1, not subscription['quantity']. Greater - # values produce this error: 'RuntimeError: Error: Only pools - # with multi-entitlement product subscriptions can be added to - # the activation key with a quantity greater than one.' - activation_key.add_subscriptions(data={'quantity': 1, 'subscription_id': subs.id}) - break - return activation_key - - @pytest.fixture def tracer_install_host(rex_contenthost, target_sat): """Sets up a contenthost with katello-host-tools-tracer enabled, @@ -2421,7 +2396,7 @@ def test_positive_tracer_enable_reload(tracer_install_host, target_sat): def test_positive_host_registration_with_non_admin_user( test_name, - module_entitlement_manifest_org, + module_sca_manifest_org, module_location, target_sat, rhel8_contenthost, @@ -2437,7 +2412,7 @@ def test_positive_host_registration_with_non_admin_user( :CaseLevel: Component """ user_password = gen_string('alpha') - org = module_entitlement_manifest_org + org = module_sca_manifest_org role = target_sat.api.Role(organization=[org]).create() user_permissions = { From 41a91567fb61579ed1ad0b451fa655c27c5bcddf Mon Sep 17 00:00:00 2001 From: vijay sawant Date: Tue, 12 Dec 2023 16:50:33 +0530 Subject: [PATCH 08/93] add automation coverage for BZ 2161993 (#13266) --- robottelo/constants/__init__.py | 1 + tests/foreman/cli/test_repository.py | 87 ++++++++++++++++++++++ tests/foreman/data/ant-7.7.7-1.noarch.rpm | Bin 0 -> 7340 bytes 3 files changed, 88 insertions(+) create mode 100644 tests/foreman/data/ant-7.7.7-1.noarch.rpm diff --git a/robottelo/constants/__init__.py b/robottelo/constants/__init__.py index 9fbcf32a9c..2c37946448 100644 --- a/robottelo/constants/__init__.py +++ b/robottelo/constants/__init__.py @@ -1992,3 +1992,4 @@ class DataFile(Box): SNIPPET_DATA_FILE = DATA_DIR.joinpath(SNIPPET_DATA_FILE) PARTITION_SCRIPT_DATA_FILE = DATA_DIR.joinpath(PARTITION_SCRIPT_DATA_FILE) OS_TEMPLATE_DATA_FILE = DATA_DIR.joinpath(OS_TEMPLATE_DATA_FILE) + FAKE_3_YUM_REPO_RPMS_ANT = DATA_DIR.joinpath(FAKE_3_YUM_REPO_RPMS[0]) diff --git a/tests/foreman/cli/test_repository.py b/tests/foreman/cli/test_repository.py index 440dd4f128..d1f434ce01 100644 --- a/tests/foreman/cli/test_repository.py +++ b/tests/foreman/cli/test_repository.py @@ -32,6 +32,7 @@ CUSTOM_FILE_REPO_FILES_COUNT, CUSTOM_LOCAL_FOLDER, DOWNLOAD_POLICIES, + FAKE_3_YUM_REPO_RPMS, MIRRORING_POLICIES, OS_TEMPLATE_DATA_FILE, REPO_TYPE, @@ -3390,3 +3391,89 @@ def test_positive_syncable_yum_format_repo_import(target_sat, module_org): ) assert repodata['content-counts']['packages'] != 0 assert repodata['sync']['status'] == 'Success' + + +@pytest.mark.rhel_ver_list([9]) +def test_positive_install_uploaded_rpm_on_host( + target_sat, rhel_contenthost, function_org, function_lce +): + """Verify that uploaded rpm successfully install on content host + + :id: 8701782e-2d1e-41b7-a9dc-07325bfeaf1c + + :steps: + 1. Create product, custom repo and upload rpm into repo + 2. Create CV, add repo into it & publish CV + 3. Upload package on to the satellite, rename it then upload it into repo + 4. Register host with satellite and install rpm on it + + :expectedresults: rpm should install successfully + + :customerscenario: true + + :BZ: 2161993 + """ + product = target_sat.cli_factory.make_product({'organization-id': function_org.id}) + repo = target_sat.cli_factory.make_repository( + { + 'content-type': 'yum', + 'name': gen_string('alpha', 5), + 'product-id': product['id'], + } + ) + target_sat.cli.Repository.synchronize({'id': repo['id']}) + sync_status = target_sat.cli.Repository.info({'id': repo['id']})['sync']['status'] + assert sync_status == 'Success', f'Failed to sync {repo["name"]} repo' + + # Upload package + target_sat.put( + local_path=DataFile.FAKE_3_YUM_REPO_RPMS_ANT, + remote_path=f"/tmp/{FAKE_3_YUM_REPO_RPMS[0]}", + ) + # Rename uploaded package name + rpm_new_name = f'{gen_string(str_type="alpha", length=5)}.rpm' + target_sat.execute(f"mv /tmp/{FAKE_3_YUM_REPO_RPMS[0]} /tmp/{rpm_new_name}") + + result = target_sat.cli.Repository.upload_content( + { + 'name': repo['name'], + 'organization': repo['organization'], + 'path': f"/tmp/{rpm_new_name}", + 'product-id': repo['product']['id'], + } + ) + assert f"Successfully uploaded file {rpm_new_name}" == result[0]['message'] + queryinfo = target_sat.execute(f"rpm -q /tmp/{rpm_new_name}") + + content_view = target_sat.cli_factory.make_content_view( + {'organization-id': function_org.id, 'name': gen_string('alpha', 5)} + ) + target_sat.cli.ContentView.add_repository( + {'id': content_view['id'], 'repository-id': repo['id']} + ) + target_sat.cli.ContentView.publish({'id': content_view['id']}) + content_view = target_sat.cli.ContentView.info({'id': content_view['id']}) + target_sat.cli.ContentView.version_promote( + {'id': content_view['versions'][0]['id'], 'to-lifecycle-environment-id': function_lce.id} + ) + activation_key = target_sat.cli_factory.make_activation_key( + { + 'organization-id': function_org.id, + 'lifecycle-environment-id': function_lce.id, + 'content-view-id': content_view['id'], + } + ) + target_sat.cli.ActivationKey.content_override( + {'id': activation_key.id, 'content-label': repo.content_label, 'value': 'true'} + ) + assert ( + rhel_contenthost.register(function_org, None, activation_key.name, target_sat).status == 0 + ) + assert ( + rhel_contenthost.execute(f'yum install -y {FAKE_3_YUM_REPO_RPMS[0].split("-")[0]}').status + == 0 + ) + installed_package_name = rhel_contenthost.execute( + f'rpm -q {FAKE_3_YUM_REPO_RPMS[0].split("-")[0]}' + ) + assert installed_package_name.stdout == queryinfo.stdout diff --git a/tests/foreman/data/ant-7.7.7-1.noarch.rpm b/tests/foreman/data/ant-7.7.7-1.noarch.rpm new file mode 100644 index 0000000000000000000000000000000000000000..70d588254b9e91c173ac906b4f32224b1f4217b7 GIT binary patch literal 7340 zcmeHMe{38_6`u2*6DM)NQA-*(iE=GLNl^Fhc5nA~H?1L#-8ils+r%!h(bj|Sw%CZPT`xt?5}I&2qs4Gxcpsqk&fw}^91?mda6{ssvSD>yyU4j311*$obnVFdf zK?ulc5Hcrkl7ndi|Q-a?p_(i}3)D41To(1RX6#OrMXve+b{L_GF?-%?kAkIH1_&b1T|D53O3VyHP z{}lXSjVEw!tf&dZB`_9KRgVddb0f!`651C6qW?33F9Jk;&I*p_1|IvC;Fxy;|Ja1! z9~Jf!f}_Uh|FYoM*D!|Xg7YRm1_<#DI4`b$10eV}tOkTc%3jpF@CaKTpzyCe9`f)@o}EqDY7>o?;2i|bbe9~68P5YE$x zap0HOE9_4T`P&OFp7)W9LR3>$sjhL^GPAOyF-z7>rZUT7j;d15O#@P(OxLsAR<)dx z$xusG98KmLckG;I5oU9nWteS3E>z}<0~5)LZBSEH6iPFy3fa&c18^v3imF*Aw`}Tg zP0uhntJ{R|td#)=#WWlyGg&pMV>v1_Of%$|s*I|pW}1+wH8jOC zG;QudYkhcr*Gk~~5&4kKoUC^$3|J~Cmk8X$?_2OGG2e6C{95R)gAHuJi?|6kvv6)r zSHd7|xnA0$Vd38*VD_SGt?lqj<$#AFw>P;(-b+h7Tt|crM>^d+52I^i{dBzO)2eg0 znU3=QfIIHkdm+Ny9S-e-P0i-;v#Cr>i~=7n2Pq$L<_ETvXG{wBx)CdIa1YCzg>BU%;J)F3 zrvq*mXe2-?(7@&%w<867EBXAk)kA~wOE5M%oN+?yl zy{>0V5w(iA8?kv-gqL*o2yiSgFlP=YtnB(^Y#-6Z-6YlaELHC-DevJm{y)p?`+$yd z+XZ<*u5r>n(9zwUj5xdo8~sY)aj88|T`w6HI6StH1#UUIC3(#&$;aT?RZl>8sT|=~ zzy~V0ezk0^K~p7iB!gru%g8#mW9aa^jt)N&@r>q}@XL>(D;eFOSzXs`Mb%|aRb5kT zOEy*8p*fy4G`Ozt8?gGFQv2U*X6BtEz+2wc_YG}_JK>FgG=Hao+!VtLylZHE$Loo0 zF|v~^Tl`vreKS}dt+#r5R-OCfqWkXu`QoK7`>%X;&ytmsPwl#Q{DI!)|iIB?rl4GYRT~3 z+g^M7yOpH}{=WIqE%#47=QY2e$QR;YzIf%wM^Bu4F!?zx8%|CGKs}H$1 z?v$?_JAU{~-;T2jR`2@R6JLtGA$@$!sC;ZK+q3_+KehC(oZk89M0VXB2Ml-c_1IrK zhpwFbLg5Fw19#19{>t_fcb|DN*fI3kSMNO8c>3{) Date: Mon, 11 Dec 2023 15:06:58 -0500 Subject: [PATCH 09/93] Fixes for CV Tests --- tests/foreman/api/test_contentview.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tests/foreman/api/test_contentview.py b/tests/foreman/api/test_contentview.py index f2015bd11c..602f397846 100644 --- a/tests/foreman/api/test_contentview.py +++ b/tests/foreman/api/test_contentview.py @@ -138,8 +138,8 @@ def test_positive_subscribe_host( }, organization=module_org.id, ).create() - assert host.content_facet_attributes['content_view_id'] == class_cv.id - assert host.content_facet_attributes['lifecycle_environment_id'] == module_lce.id + assert host.content_facet_attributes['content_view']['id'] == class_cv.id + assert host.content_facet_attributes['lifecycle_environment']['id'] == module_lce.id assert class_cv.read().content_host_count == 1 @pytest.mark.tier2 @@ -491,7 +491,9 @@ def test_positive_publish_composite_multiple_content_multiple( composite=True, organization=module_org, ).create() - self.add_content_views_to_composite(composite_cv, module_org, random.randint(2, 3)) + self.add_content_views_to_composite( + module_target_sat, composite_cv, module_org, random.randint(2, 3) + ) for i in range(random.randint(2, 3)): composite_cv.publish() @@ -613,7 +615,9 @@ def test_positive_promote_composite_multiple_content_once( composite=True, organization=module_org, ).create() - self.add_content_views_to_composite(composite_cv, module_org, random.randint(2, 3)) + self.add_content_views_to_composite( + module_target_sat, composite_cv, module_org, random.randint(2, 3) + ) composite_cv.publish() composite_cv.read().version[0].promote(data={'environment_ids': module_lce.id}) composite_cv = composite_cv.read() @@ -642,7 +646,9 @@ def test_positive_promote_composite_multiple_content_multiple( composite=True, organization=module_org, ).create() - self.add_content_views_to_composite(composite_cv, module_org, random.randint(2, 3)) + self.add_content_views_to_composite( + module_target_sat, composite_cv, module_org, random.randint(2, 3) + ) composite_cv.publish() composite_cv = composite_cv.read() @@ -754,7 +760,9 @@ def test_composite_content_view_with_same_repos(self, module_org, target_sat): for content_view, package in [(content_view_1, 'camel'), (content_view_2, 'cow')]: content_view.repository = [repo] content_view.update(['repository']) - content_view_info = apply_package_filter(content_view, repo, package, inclusion=False) + content_view_info = apply_package_filter( + content_view, repo, package, target_sat, inclusion=False + ) assert content_view_info.package_count == 35 # create composite content view with these two published content views @@ -803,7 +811,7 @@ def test_ccv_audit_scenarios(self, module_org, target_sat): composite_cv.publish() assert not composite_cv.read().needs_publish # Add some content_views to the composite view - self.add_content_views_to_composite(composite_cv, module_org, 2) + self.add_content_views_to_composite(target_sat, composite_cv, module_org, 2) # Needs_publish should be set to True when a component CV is added/removed assert composite_cv.read().needs_publish composite_cv.publish() From 55fc8731de8c73929f5eb3befe484ab00c73420f Mon Sep 17 00:00:00 2001 From: Gaurav Talreja Date: Wed, 13 Dec 2023 12:33:40 +0530 Subject: [PATCH 10/93] Bump EL8, EL9 versions in leapp upgrade test (#13411) Signed-off-by: Gaurav Talreja --- tests/foreman/cli/test_leapp_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/foreman/cli/test_leapp_client.py b/tests/foreman/cli/test_leapp_client.py index a6d547f531..550a1b662a 100644 --- a/tests/foreman/cli/test_leapp_client.py +++ b/tests/foreman/cli/test_leapp_client.py @@ -27,8 +27,8 @@ synced_repos = pytest.StashKey[dict] RHEL7_VER = '7.9' -RHEL8_VER = '8.8' -RHEL9_VER = '9.2' +RHEL8_VER = '8.9' +RHEL9_VER = '9.3' RHEL_REPOS = { 'rhel7_server': { From 8083bd19698dadf2ebccf599aa451be5e1025780 Mon Sep 17 00:00:00 2001 From: Peter Ondrejka Date: Wed, 13 Dec 2023 10:35:27 +0100 Subject: [PATCH 11/93] cli location test fixes (#13406) --- tests/foreman/cli/test_location.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/foreman/cli/test_location.py b/tests/foreman/cli/test_location.py index 98a38c6a32..021c3e0971 100644 --- a/tests/foreman/cli/test_location.py +++ b/tests/foreman/cli/test_location.py @@ -35,7 +35,7 @@ def _cleanup(): def _location(request, target_sat, options=None): - location = target_sat.cli_factory.make_location(options=options) + location = target_sat.cli_factory.make_location(options) @request.addfinalizer def _cleanup(): @@ -156,14 +156,15 @@ def test_positive_create_update_delete(self, request, target_sat): description = gen_string('utf8') subnet = _subnet(request, target_sat) domains = [_domain(request, target_sat) for _ in range(0, 2)] - host_groups = [_host_group(request) for _ in range(0, 3)] - medium = _medium(request) - compute_resource = _compute_resource(request) - template = _template(request) - user = _user(request) + host_groups = [_host_group(request, target_sat) for _ in range(0, 3)] + medium = _medium(request, target_sat) + compute_resource = _compute_resource(request, target_sat) + template = _template(request, target_sat) + user = _user(request, target_sat) location = _location( request, + target_sat, { 'description': description, 'subnet-ids': subnet['id'], @@ -231,7 +232,7 @@ def test_positive_create_with_parent(self, request, target_sat): """ parent_location = _location(request, target_sat) - location = _location(request, {'parent-id': parent_location['id']}) + location = _location(request, target_sat, {'parent-id': parent_location['id']}) assert location['parent'] == parent_location['name'] @pytest.mark.tier1 @@ -344,7 +345,7 @@ def test_positive_update_parent(self, request, target_sat): :CaseImportance: High """ parent_location = _location(request, target_sat) - location = _location(request, {'parent-id': parent_location['id']}) + location = _location(request, target_sat, {'parent-id': parent_location['id']}) parent_location_2 = _location(request, target_sat) target_sat.cli.Location.update({'id': location['id'], 'parent-id': parent_location_2['id']}) @@ -366,7 +367,7 @@ def test_negative_update_parent_with_child(self, request, target_sat): :CaseImportance: High """ parent_location = _location(request, target_sat) - location = _location(request, {'parent-id': parent_location['id']}) + location = _location(request, target_sat, {'parent-id': parent_location['id']}) # set parent as child with pytest.raises(CLIReturnCodeError): From 274ae499d6e4bfdc1689a737e917a76190d6e2d1 Mon Sep 17 00:00:00 2001 From: Shubham Ganar <67952129+shubhamsg199@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:20:58 +0530 Subject: [PATCH 12/93] Fix libvirt/ec2 compute resource tests (#13408) Signed-off-by: Shubham Ganar --- robottelo/host_helpers/cli_factory.py | 2 -- .../cli/test_computeresource_libvirt.py | 26 +++++++++++++++---- tests/foreman/cli/test_location.py | 7 ++++- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/robottelo/host_helpers/cli_factory.py b/robottelo/host_helpers/cli_factory.py index de871298d4..3a4fd4e627 100644 --- a/robottelo/host_helpers/cli_factory.py +++ b/robottelo/host_helpers/cli_factory.py @@ -179,8 +179,6 @@ def create_object(cli_object, options, values=None, credentials=None): }, 'compute_resource': { 'name': gen_alphanumeric, - 'provider': 'Libvirt', - 'url': 'qemu+tcp://localhost:16509/system', }, 'org': {'_redirect': 'org_with_credentials'}, 'org_with_credentials': { diff --git a/tests/foreman/cli/test_computeresource_libvirt.py b/tests/foreman/cli/test_computeresource_libvirt.py index 470398747e..91baee553d 100644 --- a/tests/foreman/cli/test_computeresource_libvirt.py +++ b/tests/foreman/cli/test_computeresource_libvirt.py @@ -242,7 +242,13 @@ def test_positive_create_with_loc(libvirt_url, module_target_sat): :CaseLevel: Integration """ location = module_target_sat.cli_factory.make_location() - comp_resource = module_target_sat.cli_factory.compute_resource({'location-ids': location['id']}) + comp_resource = module_target_sat.cli_factory.compute_resource( + { + 'location-ids': location['id'], + 'provider': FOREMAN_PROVIDERS['libvirt'], + 'url': libvirt_url, + } + ) assert len(comp_resource['locations']) == 1 assert comp_resource['locations'][0] == location['name'] @@ -263,7 +269,11 @@ def test_positive_create_with_locs(libvirt_url, module_target_sat): locations_amount = random.randint(3, 5) locations = [module_target_sat.cli_factory.make_location() for _ in range(locations_amount)] comp_resource = module_target_sat.cli_factory.compute_resource( - {'location-ids': [location['id'] for location in locations]} + { + 'location-ids': [location['id'] for location in locations], + 'provider': FOREMAN_PROVIDERS['libvirt'], + 'url': libvirt_url, + } ) assert len(comp_resource['locations']) == locations_amount for location in locations: @@ -310,7 +320,9 @@ def test_negative_create_with_same_name(libvirt_url, module_target_sat): :CaseLevel: Component """ - comp_res = module_target_sat.cli_factory.compute_resource() + comp_res = module_target_sat.cli_factory.compute_resource( + {'provider': FOREMAN_PROVIDERS['libvirt'], 'url': libvirt_url} + ) with pytest.raises(CLIReturnCodeError): module_target_sat.cli.ComputeResource.create( { @@ -339,7 +351,9 @@ def test_positive_update_name(libvirt_url, options, module_target_sat): :parametrized: yes """ - comp_res = module_target_sat.cli_factory.compute_resource() + comp_res = module_target_sat.cli_factory.compute_resource( + {'provider': FOREMAN_PROVIDERS['libvirt'], 'url': libvirt_url} + ) options.update({'name': comp_res['name']}) # update Compute Resource module_target_sat.cli.ComputeResource.update(options) @@ -369,7 +383,9 @@ def test_negative_update(libvirt_url, options, module_target_sat): :parametrized: yes """ - comp_res = module_target_sat.cli_factory.compute_resource() + comp_res = module_target_sat.cli_factory.compute_resource( + {'provider': FOREMAN_PROVIDERS['libvirt'], 'url': libvirt_url} + ) with pytest.raises(CLIReturnCodeError): module_target_sat.cli.ComputeResource.update(dict({'name': comp_res['name']}, **options)) result = module_target_sat.cli.ComputeResource.info({'id': comp_res['id']}) diff --git a/tests/foreman/cli/test_location.py b/tests/foreman/cli/test_location.py index 021c3e0971..4779bf9373 100644 --- a/tests/foreman/cli/test_location.py +++ b/tests/foreman/cli/test_location.py @@ -101,7 +101,12 @@ def _cleanup(): def _compute_resource(request, target_sat): - compute_resource = target_sat.cli_factory.compute_resource() + compute_resource = target_sat.cli_factory.compute_resource( + { + 'provider': 'Libvirt', + 'url': 'qemu+tcp://localhost:16509/system', + } + ) @request.addfinalizer def _cleanup(): From eb4c4e77fe48da5bca037199570946020a5de1b6 Mon Sep 17 00:00:00 2001 From: Jameer Pathan <21165044+jameerpathan111@users.noreply.github.com> Date: Wed, 13 Dec 2023 14:22:45 +0100 Subject: [PATCH 13/93] SAT-21433: Enable and sync rhel8_bos repo for rhc tests (#13400) Enable and sync rhel8_bos repo for rhc tests --- tests/foreman/ui/test_rhc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/foreman/ui/test_rhc.py b/tests/foreman/ui/test_rhc.py index 57095979bc..36d3d64875 100644 --- a/tests/foreman/ui/test_rhc.py +++ b/tests/foreman/ui/test_rhc.py @@ -86,9 +86,12 @@ def fixture_setup_rhc_satellite( repo2_id = module_target_sat.api_factory.enable_sync_redhat_repo( constants.REPOS['rhel7'], module_rhc_org.id ) + repo3_id = module_target_sat.api_factory.enable_sync_redhat_repo( + constants.REPOS['rhel8_bos'], module_rhc_org.id + ) # Add repos to Content view content_view = module_target_sat.api.ContentView( - organization=module_rhc_org, repository=[repo1_id, repo2_id] + organization=module_rhc_org, repository=[repo1_id, repo2_id, repo3_id] ).create() content_view.publish() # Create Activation key From c406a3d5e68bb1e7d2da9e140e7bb4385453efa8 Mon Sep 17 00:00:00 2001 From: Peter Ondrejka Date: Wed, 13 Dec 2023 16:18:20 +0100 Subject: [PATCH 14/93] users and roles test fixes (#13433) --- tests/foreman/api/test_permission.py | 18 ++++---- tests/foreman/api/test_role.py | 61 +++++++++++++++++----------- tests/foreman/cli/test_role.py | 2 +- 3 files changed, 48 insertions(+), 33 deletions(-) diff --git a/tests/foreman/api/test_permission.py b/tests/foreman/api/test_permission.py index 011db9a403..62fae40802 100644 --- a/tests/foreman/api/test_permission.py +++ b/tests/foreman/api/test_permission.py @@ -261,7 +261,7 @@ def set_taxonomies(self, entity, organization=None, location=None): 'entity_cls', **parametrized([entities.Architecture, entities.Domain, entities.ActivationKey]), ) - def test_positive_check_create(self, entity_cls, class_org, class_location): + def test_positive_check_create(self, entity_cls, class_org, class_location, target_sat): """Check whether the "create_*" role has an effect. :id: e4c92365-58b7-4538-9d1b-93f3cf51fbef @@ -278,14 +278,14 @@ def test_positive_check_create(self, entity_cls, class_org, class_location): """ with pytest.raises(HTTPError): entity_cls(self.cfg).create() - self.give_user_permission(_permission_name(entity_cls, 'create')) + self.give_user_permission(_permission_name(entity_cls, 'create'), target_sat) new_entity = self.set_taxonomies(entity_cls(self.cfg), class_org, class_location) # Entities with both org and loc require # additional permissions to set them. fields = {'organization', 'location'} if fields.issubset(set(new_entity.get_fields())): - self.give_user_permission('assign_organizations') - self.give_user_permission('assign_locations') + self.give_user_permission('assign_organizations', target_sat) + self.give_user_permission('assign_locations', target_sat) new_entity = new_entity.create_json() entity_cls(id=new_entity['id']).read() # As admin user. @@ -294,7 +294,7 @@ def test_positive_check_create(self, entity_cls, class_org, class_location): 'entity_cls', **parametrized([entities.Architecture, entities.Domain, entities.ActivationKey]), ) - def test_positive_check_read(self, entity_cls, class_org, class_location): + def test_positive_check_read(self, entity_cls, class_org, class_location, target_sat): """Check whether the "view_*" role has an effect. :id: 55689121-2646-414f-beb1-dbba5973c523 @@ -312,7 +312,7 @@ def test_positive_check_read(self, entity_cls, class_org, class_location): new_entity = new_entity.create() with pytest.raises(HTTPError): entity_cls(self.cfg, id=new_entity.id).read() - self.give_user_permission(_permission_name(entity_cls, 'read')) + self.give_user_permission(_permission_name(entity_cls, 'read'), target_sat) entity_cls(self.cfg, id=new_entity.id).read() @pytest.mark.upgrade @@ -321,7 +321,7 @@ def test_positive_check_read(self, entity_cls, class_org, class_location): 'entity_cls', **parametrized([entities.Architecture, entities.Domain, entities.ActivationKey]), ) - def test_positive_check_delete(self, entity_cls, class_org, class_location): + def test_positive_check_delete(self, entity_cls, class_org, class_location, target_sat): """Check whether the "destroy_*" role has an effect. :id: 71365147-51ef-4602-948f-78a5e78e32b4 @@ -339,7 +339,7 @@ def test_positive_check_delete(self, entity_cls, class_org, class_location): new_entity = new_entity.create() with pytest.raises(HTTPError): entity_cls(self.cfg, id=new_entity.id).delete() - self.give_user_permission(_permission_name(entity_cls, 'delete')) + self.give_user_permission(_permission_name(entity_cls, 'delete'), target_sat) entity_cls(self.cfg, id=new_entity.id).delete() with pytest.raises(HTTPError): new_entity.read() # As admin user @@ -376,7 +376,7 @@ def test_positive_check_update(self, entity_cls, class_org, class_location, targ update_entity = entity_cls(self.cfg, id=new_entity.id, name=name) with pytest.raises(HTTPError): update_entity.update(['name']) - self.give_user_permission(_permission_name(entity_cls, 'update')) + self.give_user_permission(_permission_name(entity_cls, 'update'), target_sat) # update() calls read() under the hood, which triggers # permission error if entity_cls is target_sat.api.ActivationKey: diff --git a/tests/foreman/api/test_role.py b/tests/foreman/api/test_role.py index 1fc5ae8906..df0bc67771 100644 --- a/tests/foreman/api/test_role.py +++ b/tests/foreman/api/test_role.py @@ -90,7 +90,7 @@ def create_org_admin_role(self, target_sat, name=None, orgs=None, locs=None): return target_sat.api.Role(id=org_admin['role']['id']).read() return target_sat.api.Role(id=org_admin['id']).read() - def create_org_admin_user(self, role_taxos, user_taxos, target_sat): + def create_org_admin_user(self, target_sat, role_taxos, user_taxos): """Helper function to create an Org Admin user by assigning org admin role and assign taxonomies to Role and User @@ -526,7 +526,7 @@ def test_positive_create_org_admin_from_clone(self, target_sat): default_org_admin = target_sat.api.Role().search( query={'search': 'name="Organization admin"'} ) - org_admin = self.create_org_admin_role() + org_admin = self.create_org_admin_role(target_sat) default_filters = target_sat.api.Role(id=default_org_admin[0].id).read().filters orgadmin_filters = target_sat.api.Role(id=org_admin.id).read().filters assert len(default_filters) == len(orgadmin_filters) @@ -550,7 +550,7 @@ def test_positive_create_cloned_role_with_taxonomies(self, role_taxonomies, targ :CaseImportance: Critical """ org_admin = self.create_org_admin_role( - orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] + target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] ) org_admin = target_sat.api.Role(id=org_admin.id).read() assert role_taxonomies['org'].id == org_admin.organization[0].id @@ -578,7 +578,9 @@ def test_negative_access_entities_from_org_admin( :CaseLevel: System """ - user = self.create_org_admin_user(role_taxos=role_taxonomies, user_taxos=filter_taxonomies) + user = self.create_org_admin_user( + target_sat, role_taxos=role_taxonomies, user_taxos=filter_taxonomies + ) domain = self.create_domain( orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] ) @@ -609,7 +611,9 @@ def test_negative_access_entities_from_user( :CaseLevel: System """ - user = self.create_org_admin_user(role_taxos=role_taxonomies, user_taxos=filter_taxonomies) + user = self.create_org_admin_user( + target_sat, role_taxos=role_taxonomies, user_taxos=filter_taxonomies + ) domain = self.create_domain( orgs=[filter_taxonomies['org'].id], locs=[filter_taxonomies['loc'].id] ) @@ -973,7 +977,7 @@ def test_positive_user_group_users_access_as_org_admin(self, role_taxonomies, ta :CaseLevel: System """ org_admin = self.create_org_admin_role( - orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] + target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] ) userone_login = gen_string('alpha') userone_pass = gen_string('alphanumeric') @@ -1081,7 +1085,7 @@ def test_negative_assign_org_admin_to_user_group( :CaseLevel: System """ org_admin = self.create_org_admin_role( - orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] + target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] ) user_one = self.create_simple_user(target_sat, filter_taxos=filter_taxonomies) user_two = self.create_simple_user(target_sat, filter_taxos=filter_taxonomies) @@ -1123,7 +1127,7 @@ def test_negative_assign_taxonomies_by_org_admin( :CaseLevel: Integration """ org_admin = self.create_org_admin_role( - orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] + target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] ) # Creating resource dom_name = gen_string('alpha') @@ -1168,7 +1172,7 @@ def test_positive_remove_org_admin_role(self, role_taxonomies, target_sat): :CaseImportance: Critical """ org_admin = self.create_org_admin_role( - orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] + target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] ) user_login = gen_string('alpha') user_pass = gen_string('alphanumeric') @@ -1204,7 +1208,9 @@ def test_positive_taxonomies_control_to_superadmin_with_org_admin( :CaseLevel: Integration """ - user = self.create_org_admin_user(role_taxos=role_taxonomies, user_taxos=role_taxonomies) + user = self.create_org_admin_user( + target_sat, role_taxos=role_taxonomies, user_taxos=role_taxonomies + ) sc = self.user_config(user, target_sat) # Creating resource dom_name = gen_string('alpha') @@ -1247,7 +1253,9 @@ def test_positive_taxonomies_control_to_superadmin_without_org_admin( :CaseLevel: Integration """ - user = self.create_org_admin_user(role_taxos=role_taxonomies, user_taxos=role_taxonomies) + user = self.create_org_admin_user( + target_sat, role_taxos=role_taxonomies, user_taxos=role_taxonomies + ) sc = self.user_config(user, target_sat) # Creating resource dom_name = gen_string('alpha') @@ -1293,7 +1301,7 @@ def test_negative_create_roles_by_org_admin(self, role_taxonomies, target_sat): create new role """ org_admin = self.create_org_admin_role( - orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] + target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] ) user_login = gen_string('alpha') user_pass = gen_string('alphanumeric') @@ -1333,7 +1341,9 @@ def test_negative_modify_roles_by_org_admin(self, role_taxonomies, target_sat): :expectedresults: Org Admin should not have permissions to update existing roles """ - user = self.create_org_admin_user(role_taxos=role_taxonomies, user_taxos=role_taxonomies) + user = self.create_org_admin_user( + target_sat, role_taxos=role_taxonomies, user_taxos=role_taxonomies + ) test_role = target_sat.api.Role().create() sc = self.user_config(user, target_sat) test_role = target_sat.api.Role(sc, id=test_role.id).read() @@ -1360,7 +1370,7 @@ def test_negative_admin_permissions_to_org_admin(self, role_taxonomies, target_s :CaseLevel: Integration """ org_admin = self.create_org_admin_role( - orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] + target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] ) user_login = gen_string('alpha') user_pass = gen_string('alphanumeric') @@ -1407,7 +1417,7 @@ def test_positive_create_user_by_org_admin(self, role_taxonomies, target_sat): :CaseLevel: Integration """ org_admin = self.create_org_admin_role( - orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] + target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] ) user_login = gen_string('alpha') user_pass = gen_string('alphanumeric') @@ -1460,7 +1470,9 @@ def test_positive_access_users_inside_org_admin_taxonomies(self, role_taxonomies :CaseLevel: Integration """ - user = self.create_org_admin_user(role_taxos=role_taxonomies, user_taxos=role_taxonomies) + user = self.create_org_admin_user( + target_sat, role_taxos=role_taxonomies, user_taxos=role_taxonomies + ) test_user = self.create_simple_user(filter_taxos=role_taxonomies) sc = self.user_config(user, target_sat) try: @@ -1498,7 +1510,7 @@ def test_positive_create_nested_location(self, role_taxonomies, target_sat): location=[role_taxonomies['loc']], ).create() org_admin = self.create_org_admin_role( - orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] + target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] ) user.role = [org_admin] user = user.update(['role']) @@ -1532,7 +1544,9 @@ def test_negative_access_users_outside_org_admin_taxonomies( :CaseLevel: Integration """ - user = self.create_org_admin_user(role_taxos=role_taxonomies, user_taxos=role_taxonomies) + user = self.create_org_admin_user( + target_sat, role_taxos=role_taxonomies, user_taxos=role_taxonomies + ) test_user = self.create_simple_user(filter_taxos=filter_taxonomies) sc = self.user_config(user, target_sat) with pytest.raises(HTTPError): @@ -1557,7 +1571,7 @@ def test_negative_create_taxonomies_by_org_admin(self, role_taxonomies, target_s 1. Org Admin should not have access to create organizations 2. Org Admin should have access to create locations """ - org_admin = self.create_org_admin_role(orgs=[role_taxonomies['org'].id]) + org_admin = self.create_org_admin_role(target_sat, orgs=[role_taxonomies['org'].id]) user_login = gen_string('alpha') user_pass = gen_string('alphanumeric') user = target_sat.api.User( @@ -1603,7 +1617,7 @@ def test_positive_access_all_global_entities_by_org_admin( :expectedresults: Org Admin should have access to all the global target_sat.api in any taxonomies """ - org_admin = self.create_org_admin_role(orgs=[role_taxonomies['org'].id]) + org_admin = self.create_org_admin_role(target_sat, orgs=[role_taxonomies['org'].id]) user_login = gen_string('alpha') user_pass = gen_string('alphanumeric') user = target_sat.api.User( @@ -1658,7 +1672,7 @@ def test_negative_access_entities_from_ldap_org_admin( :CaseAutomation: Automated """ org_admin = self.create_org_admin_role( - orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] + target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] ) # Creating Domain resource in same taxonomies as Org Admin role to access later domain = self.create_domain( @@ -1705,7 +1719,7 @@ def test_negative_access_entities_from_ldap_user( :CaseAutomation: Automated """ org_admin = self.create_org_admin_role( - orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] + target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] ) # Creating Domain resource in different taxonomies to access later domain = self.create_domain(orgs=[module_org.id], locs=[module_location.id]) @@ -1753,6 +1767,7 @@ def test_positive_assign_org_admin_to_ldap_user_group( group_name = gen_string("alpha") password = gen_string("alpha") org_admin = self.create_org_admin_role( + target_sat, orgs=[create_ldap['authsource'].organization[0].id], locs=[create_ldap['authsource'].location[0].id], ) @@ -1815,7 +1830,7 @@ def test_negative_assign_org_admin_to_ldap_user_group( group_name = gen_string("alpha") password = gen_string("alpha") org_admin = self.create_org_admin_role( - orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] + target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] ) # Creating Domain resource in same taxonomies as Org Admin role to access later domain = self.create_domain( diff --git a/tests/foreman/cli/test_role.py b/tests/foreman/cli/test_role.py index 034d395b60..11474b42f1 100644 --- a/tests/foreman/cli/test_role.py +++ b/tests/foreman/cli/test_role.py @@ -150,7 +150,7 @@ def test_negative_list_filters_without_parameters(self, module_target_sat): :BZ: 1296782 """ - with pytest.raises(CLIReturnCodeError, CLIDataBaseError) as err: + with pytest.raises(CLIReturnCodeError) as err: module_target_sat.cli.Role.filters() if isinstance(err.type, CLIDataBaseError): pytest.fail(err) From 447f218f742a3b2751ae59e378d41a1ef288381d Mon Sep 17 00:00:00 2001 From: vsedmik <46570670+vsedmik@users.noreply.github.com> Date: Wed, 13 Dec 2023 19:39:06 +0100 Subject: [PATCH 15/93] Fix host-collections tests (#13442) --- tests/foreman/cli/test_hostcollection.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/foreman/cli/test_hostcollection.py b/tests/foreman/cli/test_hostcollection.py index a7710f79fc..91bf5c4f56 100644 --- a/tests/foreman/cli/test_hostcollection.py +++ b/tests/foreman/cli/test_hostcollection.py @@ -30,15 +30,13 @@ ) -def _make_fake_host_helper(module_org, module_target_sat): +def _make_fake_host_helper(module_org, sat): """Make a new fake host""" - library = module_target_sat.cli.LifecycleEnvironment.info( + library = sat.cli.LifecycleEnvironment.info( {'organization-id': module_org.id, 'name': ENVIRONMENT} ) - default_cv = module_target_sat.cli.ContentView.info( - {'organization-id': module_org.id, 'name': DEFAULT_CV} - ) - return module_target_sat.cli_factory.make_fake_host( + default_cv = sat.cli.ContentView.info({'organization-id': module_org.id, 'name': DEFAULT_CV}) + return sat.cli_factory.make_fake_host( { 'content-view-id': default_cv['id'], 'lifecycle-environment-id': library['id'], @@ -262,7 +260,7 @@ def test_positive_host_collection_host_pagination(module_org, module_target_sat) {'organization-id': module_org.id} ) host_ids = ','.join( - _make_fake_host_helper((module_org)['id'] for _ in range(2)), module_target_sat + _make_fake_host_helper(module_org, module_target_sat)['id'] for _ in range(2) ) module_target_sat.cli.HostCollection.add_host( {'host-ids': host_ids, 'id': host_collection['id']} @@ -316,7 +314,7 @@ def test_positive_register_host_ak_with_host_collection(module_org, module_ak_wi :CaseLevel: System """ - host_info = _make_fake_host_helper(module_org) + host_info = _make_fake_host_helper(module_org, target_sat) hc = target_sat.cli_factory.make_host_collection({'organization-id': module_org.id}) target_sat.cli.ActivationKey.add_host_collection( From a364a44b0b76b4e65accaaa82210d64e1bdccc74 Mon Sep 17 00:00:00 2001 From: David Moore <109112035+damoore044@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:49:29 -0500 Subject: [PATCH 16/93] [Comp-Eval] CLI::test_errata Refactor (#13288) * Updating cli-errata standards * RHEL8 for errata_host fixture --- tests/foreman/cli/test_errata.py | 404 +++++++++++++++---------------- 1 file changed, 202 insertions(+), 202 deletions(-) diff --git a/tests/foreman/cli/test_errata.py b/tests/foreman/cli/test_errata.py index 2d40c40363..0b4b3a37f5 100644 --- a/tests/foreman/cli/test_errata.py +++ b/tests/foreman/cli/test_errata.py @@ -34,10 +34,8 @@ FAKE_4_CUSTOM_PACKAGE_NAME, FAKE_5_CUSTOM_PACKAGE, PRDS, - REAL_0_ERRATA_ID, REAL_4_ERRATA_CVES, REAL_4_ERRATA_ID, - REAL_RHEL7_0_2_PACKAGE_NAME, REPOS, REPOSET, ) @@ -93,6 +91,7 @@ ) TIMESTAMP_FMT = '%Y-%m-%d %H:%M' +TIMESTAMP_FMT_S = '%Y-%m-%d %H:%M:%S' PSUTIL_RPM = 'python2-psutil-5.6.7-1.el7.x86_64.rpm' @@ -105,9 +104,9 @@ @pytest.fixture(scope='module') -def orgs(): +def orgs(module_target_sat): """Create and return a list of three orgs.""" - return [entities.Organization().create() for _ in range(3)] + return [module_target_sat.api.Organization().create() for _ in range(3)] @pytest.fixture(scope='module') @@ -116,7 +115,7 @@ def products_with_repos(orgs, module_target_sat): products = [] # Create one product for each org, and a second product for the last org. for org, params in zip(orgs + orgs[-1:], REPOS_WITH_ERRATA): - product = entities.Product(organization=org).create() + product = module_target_sat.api.Product(organization=org).create() # Replace the organization entity returned by create(), which contains only the id, # with the one we already have. product.organization = org @@ -172,7 +171,7 @@ def custom_repo( def hosts(request): """Deploy hosts via broker.""" num_hosts = getattr(request, 'param', 2) - with Broker(nick='rhel7', host_class=ContentHost, _count=num_hosts) as hosts: + with Broker(nick='rhel8', host_class=ContentHost, _count=num_hosts) as hosts: if not isinstance(hosts, list) or len(hosts) != num_hosts: pytest.fail('Failed to provision the expected number of hosts.') yield hosts @@ -208,12 +207,13 @@ def register_hosts( @pytest.fixture -def errata_hosts(register_hosts): +def errata_hosts(register_hosts, target_sat): """Ensure that rpm is installed on host.""" for host in register_hosts: # Enable all custom and rh repositories. host.execute(r'subscription-manager repos --enable \*') host.execute(r'yum-config-manager --enable \*') + host.add_rex_key(satellite=target_sat) # Remove all packages. for errata in REPO_WITH_ERRATA['errata']: # Remove package if present, old or new. @@ -259,6 +259,43 @@ def host_collection( return host_collection +def start_and_wait_errata_recalculate(sat, host): + """Helper to find any in-progress errata applicability task and wait_for completion. + Otherwise, schedule errata recalculation, wait for the task. + Find the successful completed task(s). + + :param sat: Satellite instance to check for task(s) + :param host: ContentHost instance to schedule errata recalculate + + """ + # Find any in-progress task for this host + search = "label = Actions::Katello::Applicability::Hosts::BulkGenerate and result = pending" + applicability_task_running = sat.cli.Task.list_tasks({'search': search}) + # No task in progress, invoke errata recalculate + if len(applicability_task_running) == 0: + sat.cli.Host.errata_recalculate({'host-id': host.nailgun_host.id}) + host.run('subscription-manager repos') + # Note time check for later wait_for_tasks include 30s margin of safety + timestamp = (datetime.utcnow() - timedelta(seconds=30)).strftime(TIMESTAMP_FMT_S) + # Wait for upload profile event (in case Satellite system is slow) + sat.wait_for_tasks( + search_query=( + 'label = Actions::Katello::Applicability::Hosts::BulkGenerate' + f' and started_at >= "{timestamp}"' + ), + search_rate=15, + max_tries=10, + ) + # Find the successful finished task(s) + search = ( + "label = Actions::Katello::Applicability::Hosts::BulkGenerate" + " and result = success" + f" and started_at >= '{timestamp}'" + ) + applicability_task_success = sat.cli.Task.list_tasks({'search': search}) + assert applicability_task_success, f'No successful task found by search: {search}' + + def is_rpm_installed(host, rpm=None): """Return whether the specified rpm is installed. @@ -361,22 +398,13 @@ def cv_publish_promote(sat, cv, org, lce, force=False): :param lce: lifecycle environment :type lce: entities.LifecycleEnvironment """ - sat.cli.ContentView.publish({'id': cv.id}) - sat.cli.ContentView.info({'id': cv.id})['versions'][-1] - sat.cli.ContentView.version_promote( - { - 'id': cv.id, - 'organization': org, - 'lifecycle-environment-ids': lce.id, - } - ) - cv = cv.read() - cvv_id = sorted(cvv.id for cvv in cv.version)[-1] + sat.cli.ContentView.publish({'id': cv.id, 'organization': org}) + # Sort CV Version results by --id, grab last version (latest) + cvv_id = sorted(cvv['id'] for cvv in sat.cli.ContentView.info({'id': cv.id})['versions'])[-1] sat.cli.ContentView.version_promote( { 'id': cvv_id, 'organization': org, - 'content-view-id': cv.id, 'to-lifecycle-environment-id': lce.id, 'force': force, } @@ -434,9 +462,6 @@ def test_positive_install_by_host_collection_and_org( """ errata_id = REPO_WITH_ERRATA['errata'][0]['id'] - for host in errata_hosts: - host.add_rex_key(satellite=target_sat) - if filter_by_hc == 'id': host_collection_query = f'host_collection_id = {host_collection["id"]}' elif filter_by_hc == 'name': @@ -671,19 +696,10 @@ def test_install_errata_to_one_host( # Remove the package on first host to remove need for errata. result = errata_hosts[0].execute(f'yum erase -y {errata["package_name"]}') assert result.status == 0, f'Failed to erase the rpm: {result.stdout}' - # Add ssh keys + for host in errata_hosts: - host.add_rex_key(satellite=target_sat) - target_sat.cli.Host.errata_recalculate({'host-id': host.nailgun_host.id}) - timestamp = (datetime.utcnow() - timedelta(minutes=1)).strftime(TIMESTAMP_FMT) - target_sat.wait_for_tasks( - search_query=( - 'label = Actions::Katello::Applicability::Hosts::BulkGenerate' - f' and started_at >= "{timestamp}"' - ), - search_rate=15, - max_tries=10, - ) + start_and_wait_errata_recalculate(target_sat, host) + assert not is_rpm_installed( errata_hosts[0], rpm=errata['package_name'] ), 'Package should not be installed on host.' @@ -735,8 +751,8 @@ def test_positive_list_affected_chosts_by_erratum_restrict_flag( # Uninstall package so that only the first errata applies. for host in errata_hosts: host.execute(f'yum erase -y {REPO_WITH_ERRATA["errata"][1]["package_name"]}') - host.execute('subscription-manager repos') - target_sat.cli.Host.errata_recalculate({'host-id': host.nailgun_host.id}) + start_and_wait_errata_recalculate(target_sat, host) + # Create list of uninstallable errata. errata = REPO_WITH_ERRATA['errata'][0] uninstallable = REPO_WITH_ERRATA['errata_ids'].copy() @@ -748,7 +764,7 @@ def test_positive_list_affected_chosts_by_erratum_restrict_flag( 'organization-id': module_entitlement_manifest_org.id, 'per-page': PER_PAGE_LARGE, } - errata_ids = get_errata_ids(param) + errata_ids = get_errata_ids(target_sat, param) assert errata_ids, 'No installable errata found' assert errata['id'] in errata_ids, 'Errata not found in list of installable errata' assert not set(uninstallable) & set(errata_ids), 'Unexpected errata found' @@ -760,7 +776,7 @@ def test_positive_list_affected_chosts_by_erratum_restrict_flag( 'organization-id': module_entitlement_manifest_org.id, 'per-page': PER_PAGE_LARGE, } - errata_ids = get_errata_ids(param) + errata_ids = get_errata_ids(target_sat, param) assert set(REPO_WITH_ERRATA['errata_ids']).issubset( errata_ids ), 'Errata not found in list of installable errata' @@ -771,7 +787,7 @@ def test_positive_list_affected_chosts_by_erratum_restrict_flag( 'organization-id': module_entitlement_manifest_org.id, 'per-page': PER_PAGE_LARGE, } - errata_ids = get_errata_ids(param) + errata_ids = get_errata_ids(target_sat, param) assert errata['id'] in errata_ids, 'Errata not found in list of applicable errata' # Check search of errata is not affected by applicable=0 restrict flag @@ -780,7 +796,7 @@ def test_positive_list_affected_chosts_by_erratum_restrict_flag( 'organization-id': module_entitlement_manifest_org.id, 'per-page': PER_PAGE_LARGE, } - errata_ids = get_errata_ids(param) + errata_ids = get_errata_ids(target_sat, param) assert set(REPO_WITH_ERRATA['errata_ids']).issubset( errata_ids ), 'Errata not found in list of applicable errata' @@ -828,7 +844,7 @@ def cleanup(): 'organization-id': module_entitlement_manifest_org.id, 'per-page': PER_PAGE_LARGE, } - errata_ids = get_errata_ids(param) + errata_ids = get_errata_ids(target_sat, param) assert errata['id'] not in errata_ids, 'Errata not found in list of installable errata' # Check errata still applicable @@ -837,7 +853,7 @@ def cleanup(): 'organization-id': module_entitlement_manifest_org.id, 'per-page': PER_PAGE_LARGE, } - errata_ids = get_errata_ids(param) + errata_ids = get_errata_ids(target_sat, param) assert errata['id'] in errata_ids, 'Errata not found in list of applicable errata' @@ -847,7 +863,6 @@ def test_host_errata_search_commands( module_entitlement_manifest_org, module_cv, module_lce, - host_collection, errata_hosts, target_sat, ): @@ -874,11 +889,8 @@ def test_host_errata_search_commands( :expectedresults: The hosts are correctly listed for security and bugfix advisories. """ - # note time for later wait_for_tasks include 2 mins margin of safety. - timestamp = (datetime.utcnow() - timedelta(minutes=2)).strftime(TIMESTAMP_FMT) errata = REPO_WITH_ERRATA['errata'] - # Update package on first host so that the security advisory doesn't apply. result = errata_hosts[0].execute(f'yum update -y {errata[0]["new_package"]}') assert result.status == 0, 'Failed to install rpm' @@ -888,17 +900,7 @@ def test_host_errata_search_commands( assert result.status == 0, 'Failed to install rpm' for host in errata_hosts: - timestamp = (datetime.utcnow() - timedelta(minutes=1)).strftime(TIMESTAMP_FMT) - target_sat.cli.Host.errata_recalculate({'host-id': host.nailgun_host.id}) - # Wait for upload profile event (in case Satellite system slow) - target_sat.wait_for_tasks( - search_query=( - 'label = Actions::Katello::Applicability::Hosts::BulkGenerate' - f' and started_at >= "{timestamp}"' - ), - search_rate=20, - max_tries=10, - ) + start_and_wait_errata_recalculate(target_sat, host) # Step 1: Search for hosts that require bugfix advisories result = target_sat.cli.Host.list( @@ -1065,7 +1067,7 @@ def test_positive_list_filter_by_org_sort_by_date( @pytest.mark.tier3 -def test_positive_list_filter_by_product_id(products_with_repos): +def test_positive_list_filter_by_product_id(target_sat, products_with_repos): """Filter errata by product id :id: 7d06950a-c058-48b3-a384-c3565cbd643f @@ -1079,7 +1081,7 @@ def test_positive_list_filter_by_product_id(products_with_repos): params = [ {'product-id': product.id, 'per-page': PER_PAGE_LARGE} for product in products_with_repos ] - errata_ids = get_errata_ids(*params) + errata_ids = get_errata_ids(target_sat, *params) check_errata(errata_ids) @@ -1089,7 +1091,7 @@ def test_positive_list_filter_by_product_id(products_with_repos): 'filter_by_org', ['id', 'name', 'label'], ids=('org_id', 'org_name', 'org_label') ) def test_positive_list_filter_by_product_and_org( - products_with_repos, filter_by_product, filter_by_org + target_sat, products_with_repos, filter_by_product, filter_by_org ): """Filter errata by product id and Org id @@ -1122,7 +1124,7 @@ def test_positive_list_filter_by_product_and_org( params.append(param) - errata_ids = get_errata_ids(*params) + errata_ids = get_errata_ids(target_sat, *params) check_errata(errata_ids) @@ -1154,7 +1156,7 @@ def test_negative_list_filter_by_product_name(products_with_repos, module_target @pytest.mark.parametrize( 'filter_by_org', ['id', 'name', 'label'], ids=('org_id', 'org_name', 'org_label') ) -def test_positive_list_filter_by_org(products_with_repos, filter_by_org): +def test_positive_list_filter_by_org(target_sat, products_with_repos, filter_by_org): """Filter errata by org id, name, or label. :id: de7646be-7ac8-4dbe-8cc3-6959808d78fa @@ -1181,7 +1183,7 @@ def test_positive_list_filter_by_org(products_with_repos, filter_by_org): params.append(param) - errata_ids = get_errata_ids(*params) + errata_ids = get_errata_ids(target_sat, *params) check_errata(errata_ids, by_org=True) @@ -1248,7 +1250,7 @@ def test_positive_check_errata_dates(module_entitlement_manifest_org, module_tar :BZ: 1695163 """ - product = entities.Product(organization=module_entitlement_manifest_org).create() + product = module_target_sat.api.Product(organization=module_entitlement_manifest_org).create() repo = module_target_sat.cli_factory.make_repository( {'content-type': 'yum', 'product-id': product.id, 'url': REPO_WITH_ERRATA['url']} ) @@ -1282,7 +1284,7 @@ def rh_repo_module_manifest(module_entitlement_manifest_org, module_target_sat): releasever=None, ) # Sync step because repo is not synced by default - rh_repo = entities.Repository(id=rh_repo_id).read() + rh_repo = module_target_sat.api.Repository(id=rh_repo_id).read() rh_repo.sync() return rh_repo @@ -1315,36 +1317,98 @@ def new_module_ak(module_entitlement_manifest_org, rh_repo_module_manifest, defa @pytest.fixture def errata_host( - module_entitlement_manifest_org, rhel7_contenthost_module, new_module_ak, target_sat + target_sat, + rhel8_contenthost, + module_entitlement_manifest_org, + module_lce_library, + new_module_ak, ): - """A RHEL77 Content Host that has applicable errata and registered to Library""" - # python-psutil is obsoleted by python2-psutil, so get older python2-psutil for errata test - rhel7_contenthost_module.run(f'rpm -Uvh {settings.repos.epel_repo.url}/{PSUTIL_RPM}') - rhel7_contenthost_module.install_katello_ca(target_sat) - rhel7_contenthost_module.register_contenthost( - module_entitlement_manifest_org.label, new_module_ak.name + """A RHEL8 Content Host that has applicable errata and registered to Library, using Global Registration.""" + org = module_entitlement_manifest_org + cv = target_sat.api.ContentView( + organization=org, + environment=[module_lce_library.id], + ).create() + target_sat.cli_factory.setup_org_for_a_custom_repo( + { + 'url': REPO_WITH_ERRATA['url'], + 'organization-id': org.id, + 'lifecycle-environment-id': module_lce_library.id, + 'activationkey-id': new_module_ak.id, + 'content-view-id': cv.id, + } ) - assert rhel7_contenthost_module.nailgun_host.read_json()['subscription_status'] == 0 - rhel7_contenthost_module.install_katello_host_tools() - rhel7_contenthost_module.add_rex_key(satellite=target_sat) - return rhel7_contenthost_module + rhel8_contenthost.register( + activation_keys=new_module_ak.name, + target=target_sat, + org=org, + loc=None, + ) + rhel8_contenthost.add_rex_key(satellite=target_sat) + assert rhel8_contenthost.subscribed + assert rhel8_contenthost.applicable_errata_count == 0 + + rhel8_contenthost.execute(r'yum-config-manager --enable \*') + rhel8_contenthost.execute(r'subscription-manager repos --enable \*') + for errata in REPO_WITH_ERRATA['errata']: + # Remove package if present, old or new. + package_name = errata['package_name'] + result = rhel8_contenthost.execute(f'yum erase -y {package_name}') + if result.status != 0: + pytest.fail(f'Failed to remove {package_name}: {result.stdout} {result.stderr}') + + # Install old package, so that errata apply. + old_package = errata['old_package'] + result = rhel8_contenthost.execute(f'yum install -y {old_package}') + if result.status != 0: + pytest.fail(f'Failed to install {old_package}: {result.stdout} {result.stderr}') + + start_and_wait_errata_recalculate(target_sat, rhel8_contenthost) + assert rhel8_contenthost.applicable_errata_count == 2 + + return rhel8_contenthost @pytest.fixture -def chost(module_entitlement_manifest_org, rhel7_contenthost_module, new_module_ak, target_sat): +def chost( + module_entitlement_manifest_org, + rhel7_contenthost, + module_lce_library, + new_module_ak, + target_sat, +): """A RHEL77 Content Host registered to Library that does not have applicable errata""" - rhel7_contenthost_module.install_katello_ca(target_sat) - rhel7_contenthost_module.register_contenthost( - module_entitlement_manifest_org.label, new_module_ak.name + module_cv = target_sat.api.ContentView( + organization=module_entitlement_manifest_org, + environment=[module_lce_library.id], + ).create() + target_sat.cli_factory.setup_org_for_a_custom_repo( + { + 'url': REPO_WITH_ERRATA['url'], + 'organization-id': module_entitlement_manifest_org.id, + 'lifecycle-environment-id': module_lce_library.id, + 'activationkey-id': new_module_ak.id, + 'content-view-id': module_cv.id, + } + ) + rhel7_contenthost.register( + activation_keys=new_module_ak.name, + target=target_sat, + org=module_entitlement_manifest_org, + loc=None, ) - assert rhel7_contenthost_module.nailgun_host.read_json()['subscription_status'] == 0 - rhel7_contenthost_module.install_katello_host_tools() - return rhel7_contenthost_module + assert rhel7_contenthost.subscribed + assert rhel7_contenthost.applicable_errata_count == 0 + assert rhel7_contenthost.nailgun_host.read_json()['subscription_status'] == 2 + rhel7_contenthost.execute(r'subscription-manager repos --enable \*') + rhel7_contenthost.execute(r'yum-config-manager --enable \*') @pytest.mark.tier2 @pytest.mark.no_containers -def test_apply_errata_using_default_content_view(errata_host, target_sat): +def test_apply_errata_using_default_content_view( + errata_host, module_entitlement_manifest_org, target_sat +): """Updating an applicable errata on a host attached to the default content view causes the errata to not be applicable. @@ -1362,9 +1426,11 @@ def test_apply_errata_using_default_content_view(errata_host, target_sat): :CaseImportance: High """ - # check that package errata is applicable + assert errata_host.applicable_errata_count > 0 + # Check that package errata is applicable + erratum_id = REPO_WITH_ERRATA['errata'][0]['id'] erratum = target_sat.cli.Host.errata_list( - {'host': errata_host.hostname, 'search': f'id = {REAL_0_ERRATA_ID}'} + {'host': errata_host.hostname, 'search': f'id = {erratum_id}'} ) assert len(erratum) == 1 assert erratum[0]['installable'] == 'true' @@ -1373,25 +1439,16 @@ def test_apply_errata_using_default_content_view(errata_host, target_sat): { 'feature': 'katello_errata_install', 'search-query': f'name = {errata_host.hostname}', - 'inputs': f"errata='{REAL_0_ERRATA_ID}'", - 'organization-id': f'{errata_host.nailgun_host.organization.id}', + 'inputs': f'errata={erratum[0]["erratum-id"]}', + 'organization-id': f'{module_entitlement_manifest_org.id}', } )[1]['id'] assert 'success' in result - timestamp = (datetime.utcnow() - timedelta(minutes=2)).strftime(TIMESTAMP_FMT) - target_sat.cli.Host.errata_recalculate({'host-id': errata_host.nailgun_host.id}) - target_sat.wait_for_tasks( - search_query=( - 'label = Actions::Katello::Applicability::Hosts::BulkGenerate' - f' and started_at >= "{timestamp}"' - ), - search_rate=15, - max_tries=10, - ) + start_and_wait_errata_recalculate(target_sat, errata_host) # Assert that the erratum is no longer applicable erratum = target_sat.cli.Host.errata_list( - {'host': errata_host.hostname, 'search': f'id = {REAL_0_ERRATA_ID}'} + {'host': errata_host.hostname, 'search': f'id = {erratum_id}'} ) assert len(erratum) == 0 @@ -1418,56 +1475,35 @@ def test_update_applicable_package_using_default_content_view(errata_host, targe :CaseImportance: High """ # check that package is applicable + package_name = REPO_WITH_ERRATA['errata'][0]['package_name'] applicable_packages = target_sat.cli.Package.list( { 'host-id': errata_host.nailgun_host.id, 'packages-restrict-applicable': 'true', - 'search': f'name={REAL_RHEL7_0_2_PACKAGE_NAME}', + 'search': f'name={package_name}', } ) - timestamp = (datetime.utcnow()).strftime(TIMESTAMP_FMT) - target_sat.cli.Host.errata_recalculate({'host-id': errata_host.nailgun_host.id}) - target_sat.wait_for_tasks( - search_query=( - 'label = Actions::Katello::Applicability::Hosts::BulkGenerate' - f' and started_at >= "{timestamp}"' - ), - search_rate=20, - max_tries=15, - ) + + start_and_wait_errata_recalculate(target_sat, errata_host) assert len(applicable_packages) == 1 - assert REAL_RHEL7_0_2_PACKAGE_NAME in applicable_packages[0]['filename'] + assert package_name in applicable_packages[0]['filename'] # Update package from Library, i.e. Default CV result = target_sat.cli.JobInvocation.create( { 'feature': 'katello_errata_install', 'search-query': f'name = {errata_host.hostname}', - 'inputs': f"errata='{REAL_0_ERRATA_ID}'", + 'inputs': f'errata={REPO_WITH_ERRATA["errata"][0]["id"]}', 'organization-id': f'{errata_host.nailgun_host.organization.id}', } )[1]['id'] assert 'success' in result - # note time for later wait_for_tasks include 2 mins margin of safety. - timestamp = (datetime.utcnow() - timedelta(minutes=2)).strftime(TIMESTAMP_FMT) - target_sat.cli.Host.errata_recalculate({'host-id': errata_host.nailgun_host.id}) - - # Wait for upload profile event (in case Satellite system slow) - target_sat.wait_for_tasks( - search_query=( - 'label = Actions::Katello::Applicability::Hosts::BulkGenerate' - f' and started_at >= "{timestamp}"' - ), - search_rate=30, - max_tries=10, - ) - + start_and_wait_errata_recalculate(target_sat, errata_host) # Assert that the package is no longer applicable - target_sat.cli.Host.errata_recalculate({'host-id': errata_host.nailgun_host.id}) applicable_packages = target_sat.cli.Package.list( { 'host-id': errata_host.nailgun_host.id, 'packages-restrict-applicable': 'true', - 'search': f'name={REAL_RHEL7_0_2_PACKAGE_NAME}', + 'search': f'name={package_name}', } ) assert len(applicable_packages) == 0 @@ -1496,51 +1532,42 @@ def test_downgrade_applicable_package_using_default_content_view(errata_host, ta :CaseImportance: High """ # Update package from Library, i.e. Default CV - errata_host.run(f'yum -y update {REAL_RHEL7_0_2_PACKAGE_NAME}') + errata_host.run(f'yum -y update {FAKE_2_CUSTOM_PACKAGE_NAME}') + start_and_wait_errata_recalculate(target_sat, errata_host) # Assert that the package is not applicable applicable_packages = target_sat.cli.Package.list( { 'host-id': errata_host.nailgun_host.id, 'packages-restrict-applicable': 'true', - 'search': f'name={REAL_RHEL7_0_2_PACKAGE_NAME}', + 'search': f'name={FAKE_2_CUSTOM_PACKAGE_NAME}', } ) assert len(applicable_packages) == 0 - # note time for later wait_for_tasks include 2 mins margin of safety. - # Downgrade package (we can't get it from Library, so get older one from EPEL) - errata_host.run(f'curl -O {settings.repos.epel_repo.url}/{PSUTIL_RPM}') - timestamp = (datetime.utcnow() - timedelta(minutes=2)).strftime(TIMESTAMP_FMT) - errata_host.run(f'yum -y downgrade {PSUTIL_RPM}') - target_sat.cli.Host.errata_recalculate({'host-id': errata_host.nailgun_host.id}) - # Wait for upload profile event (in case Satellite system slow) - target_sat.wait_for_tasks( - search_query=( - 'label = Actions::Katello::Applicability::Hosts::BulkGenerate' - f' and started_at >= "{timestamp}"' - ), - search_rate=15, - max_tries=10, - ) + + # Downgrade package + errata_host.run(f'yum -y downgrade {FAKE_1_CUSTOM_PACKAGE}') + start_and_wait_errata_recalculate(target_sat, errata_host) # check that package is applicable applicable_packages = target_sat.cli.Package.list( { 'host-id': errata_host.nailgun_host.id, 'packages-restrict-applicable': 'true', - 'search': f'name={REAL_RHEL7_0_2_PACKAGE_NAME}', + 'search': f'name={FAKE_2_CUSTOM_PACKAGE_NAME}', } ) assert len(applicable_packages) == 1 - assert REAL_RHEL7_0_2_PACKAGE_NAME in applicable_packages[0]['filename'] + assert FAKE_2_CUSTOM_PACKAGE_NAME in applicable_packages[0]['filename'] @pytest.mark.tier2 -def test_install_applicable_package_to_registerd_host(chost, target_sat): +def test_install_applicable_package_to_registerd_host(errata_host, target_sat): """Installing an older package to an already registered host should show the newer package and errata as applicable and installable. :id: 519bfe91-cf86-4d6e-94ef-aaf3e5d40a81 - :setup: Register a host to default org with Library + :setup: Register a host to default org with Library, + Remove the newer package version if present :steps: 1. Ensure package is not applicable @@ -1553,42 +1580,29 @@ def test_install_applicable_package_to_registerd_host(chost, target_sat): :CaseImportance: Medium """ + errata_host.run(f'yum -y remove {FAKE_2_CUSTOM_PACKAGE_NAME}') + start_and_wait_errata_recalculate(target_sat, errata_host) # Assert that the package is not applicable - target_sat.cli.Host.errata_recalculate({'host-id': chost.nailgun_host.id}) applicable_packages = target_sat.cli.Package.list( { - 'host-id': chost.nailgun_host.id, + 'host-id': errata_host.nailgun_host.id, 'packages-restrict-applicable': 'true', - 'search': f'name={REAL_RHEL7_0_2_PACKAGE_NAME}', + 'search': f'name={FAKE_2_CUSTOM_PACKAGE_NAME}', } ) assert len(applicable_packages) == 0 - # python-psutil is obsoleted by python2-psutil, so download older python2-psutil for this test - chost.run(f'curl -O {settings.repos.epel_repo.url}/{PSUTIL_RPM}') - # note time for later wait_for_tasks include 2 mins margin of safety. - timestamp = (datetime.utcnow() - timedelta(minutes=2)).strftime(TIMESTAMP_FMT) - chost.run(f'yum -y install {PSUTIL_RPM}') - # Wait for upload profile event (in case Satellite system slow) - target_sat.wait_for_tasks( - search_query=( - 'label = Actions::Katello::Applicability::Hosts::BulkGenerate' - f' and started_at >= "{timestamp}"' - ), - search_rate=15, - max_tries=10, - ) - target_sat.cli.Host.errata_recalculate({'host-id': chost.nailgun_host.id}) - + errata_host.run(f'yum -y install {FAKE_1_CUSTOM_PACKAGE}') + start_and_wait_errata_recalculate(target_sat, errata_host) # check that package is applicable applicable_packages = target_sat.cli.Package.list( { - 'host-id': chost.nailgun_host.id, + 'host-id': errata_host.nailgun_host.id, 'packages-restrict-applicable': 'true', - 'search': f'name={REAL_RHEL7_0_2_PACKAGE_NAME}', + 'search': f'name={FAKE_2_CUSTOM_PACKAGE_NAME}', } ) assert len(applicable_packages) == 1 - assert REAL_RHEL7_0_2_PACKAGE_NAME in applicable_packages[0]['filename'] + assert FAKE_2_CUSTOM_PACKAGE_NAME in applicable_packages[0]['filename'] @pytest.mark.tier2 @@ -1616,43 +1630,27 @@ def test_downgrading_package_shows_errata_from_library( :CaseImportance: High """ # Update package from Library, i.e. Default CV - errata_host.run(f'yum -y update {REAL_RHEL7_0_2_PACKAGE_NAME}') - # Assert that the package is not applicable + errata_host.run(f'yum -y install {FAKE_2_CUSTOM_PACKAGE}') + start_and_wait_errata_recalculate(target_sat, errata_host) applicable_packages = target_sat.cli.Package.list( { 'host-id': errata_host.nailgun_host.id, 'packages-restrict-applicable': 'true', - 'search': f'name={REAL_RHEL7_0_2_PACKAGE_NAME}', + 'search': f'name={FAKE_2_CUSTOM_PACKAGE_NAME}', } ) assert len(applicable_packages) == 0 - # note time for later wait_for_tasks include 2 mins margin of safety. - timestamp = (datetime.utcnow() - timedelta(minutes=2)).strftime(TIMESTAMP_FMT) - # Downgrade package (we can't get it from Library, so get older one from EPEL) - errata_host.run(f'curl -O {settings.repos.epel_repo.url}/{PSUTIL_RPM}') - errata_host.run(f'yum -y downgrade {PSUTIL_RPM}') - # Wait for upload profile event (in case Satellite system slow) - target_sat.cli.Host.errata_recalculate({'host-id': errata_host.nailgun_host.id}) - # Wait for upload profile event (in case Satellite system slow) - target_sat.wait_for_tasks( - search_query=( - 'label = Actions::Katello::Applicability::Hosts::BulkGenerate' - f' and started_at >= "{timestamp}"' - ), - search_rate=15, - max_tries=10, - ) - # check that errata is applicable + # Downgrade package + errata_host.run(f'yum -y downgrade {FAKE_1_CUSTOM_PACKAGE}') + start_and_wait_errata_recalculate(target_sat, errata_host) param = { 'errata-restrict-applicable': 1, - 'organization-id': module_manifest_org.id, 'per-page': PER_PAGE_LARGE, } - errata_ids = get_errata_ids(param) - assert REAL_0_ERRATA_ID in errata_ids + errata_ids = get_errata_ids(target_sat, param) + assert settings.repos.yum_6.errata[2] in errata_ids -@pytest.mark.skip_if_open('BZ:1785146') @pytest.mark.tier2 def test_errata_list_by_contentview_filter(module_entitlement_manifest_org, module_target_sat): """Hammer command to list errata should take filter ID into consideration. @@ -1674,16 +1672,18 @@ def test_errata_list_by_contentview_filter(module_entitlement_manifest_org, modu :BZ: 1785146 """ - product = entities.Product(organization=module_entitlement_manifest_org).create() + product = module_target_sat.api.Product(organization=module_entitlement_manifest_org).create() repo = module_target_sat.cli_factory.make_repository( {'content-type': 'yum', 'product-id': product.id, 'url': REPO_WITH_ERRATA['url']} ) module_target_sat.cli.Repository.synchronize({'id': repo['id']}) - lce = entities.LifecycleEnvironment(organization=module_entitlement_manifest_org).create() - cv = entities.ContentView( + lce = module_target_sat.api.LifecycleEnvironment( + organization=module_entitlement_manifest_org + ).create() + cv = module_target_sat.api.ContentView( organization=module_entitlement_manifest_org, repository=[repo['id']] ).create() - cv_publish_promote(cv, module_entitlement_manifest_org, lce) + cv_publish_promote(module_target_sat, cv, module_entitlement_manifest_org, lce) errata_count = len( module_target_sat.cli.Erratum.list( { @@ -1692,11 +1692,11 @@ def test_errata_list_by_contentview_filter(module_entitlement_manifest_org, modu } ) ) - cvf = entities.ErratumContentViewFilter(content_view=cv, inclusion=True).create() - errata_id = entities.Errata().search( + cvf = module_target_sat.api.ErratumContentViewFilter(content_view=cv, inclusion=True).create() + errata_id = module_target_sat.api.Errata().search( query={'search': f'errata_id="{settings.repos.yum_9.errata[0]}"'} )[0] - entities.ContentViewFilterRule(content_view_filter=cvf, errata=errata_id).create() + module_target_sat.api.ContentViewFilterRule(content_view_filter=cvf, errata=errata_id).create() cv.publish() cv_version_info = cv.read().version[1].read() errata_count_cvf = len( From 5c241b613f44144b10fec2e9ce9db89a2ca2f400 Mon Sep 17 00:00:00 2001 From: Peter Ondrejka Date: Thu, 14 Dec 2023 08:07:44 +0100 Subject: [PATCH 17/93] cli org test fixes (#13399) --- tests/foreman/cli/test_organization.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/foreman/cli/test_organization.py b/tests/foreman/cli/test_organization.py index a34bea5f7f..9b2b3893c8 100644 --- a/tests/foreman/cli/test_organization.py +++ b/tests/foreman/cli/test_organization.py @@ -153,7 +153,7 @@ def test_positive_create_with_system_admin_user(module_target_sat): org_name = gen_string('alpha') module_target_sat.cli_factory.user({'login': login, 'password': password}) module_target_sat.cli.User.add_role({'login': login, 'role': 'System admin'}) - module_target_sat.cli_factory.make_org({'user': login, 'password': password, 'name': org_name}) + module_target_sat.cli_factory.make_org({'users': login, 'name': org_name}) result = module_target_sat.cli.Org.info({'name': org_name}) assert result['name'] == org_name @@ -536,7 +536,6 @@ def test_positive_add_and_remove_locations(module_org, module_target_sat): {'location': locations[1]['name'], 'name': module_org.name} ) org_info = module_target_sat.cli.Org.info({'id': module_org.id}) - assert len(org_info['locations']) == 2, "Failed to add locations" assert locations[0]['name'] in org_info['locations'] assert locations[1]['name'] in org_info['locations'] module_target_sat.cli.Org.remove_location( From 3fa442f374e3c3ea9a73d69c6826376a57ea114e Mon Sep 17 00:00:00 2001 From: David Moore <109112035+damoore044@users.noreply.github.com> Date: Thu, 14 Dec 2023 02:31:00 -0500 Subject: [PATCH 18/93] [RFE] Check RHEL Lifecycle status in ContentHost UI (#13162) * Check RHEL Lifecycle status in ContentHost UI * Finish extension for RHEL lifecycle status * Intermittent prt failures for search, errata install --- tests/foreman/ui/test_contenthost.py | 68 ++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 5 deletions(-) diff --git a/tests/foreman/ui/test_contenthost.py b/tests/foreman/ui/test_contenthost.py index 4ca6059dfd..28ea37df06 100644 --- a/tests/foreman/ui/test_contenthost.py +++ b/tests/foreman/ui/test_contenthost.py @@ -102,6 +102,34 @@ def run_remote_command_on_content_host(command, vm_module_streams): return result +def get_supported_rhel_versions(): + """Helper to get the supported base rhel versions for contenthost. + return: a list of integers + """ + return [ + ver for ver in settings.supportability.content_hosts.rhel.versions if isinstance(ver, int) + ] + + +def get_rhel_lifecycle_support(rhel_version): + """Helper to get what the Lifecycle Support Status should be, + based on provided rhel version. + :param rhel_version: integer of the current base rhel version + :return: string with the expected status of rhel version support + """ + rhels = sorted(get_supported_rhel_versions(), reverse=True) + rhel_lifecycle_status = 'Unknown' + if rhel_version not in rhels: + return rhel_lifecycle_status + elif rhels.index(rhel_version) <= 1: + rhel_lifecycle_status = 'Full support' + elif rhels.index(rhel_version) == 2: + rhel_lifecycle_status = 'Approaching end of maintenance support' + elif rhels.index(rhel_version) >= 3: + rhel_lifecycle_status = 'End of maintenance support' + return rhel_lifecycle_status + + @pytest.mark.e2e @pytest.mark.tier3 @pytest.mark.parametrize( @@ -120,12 +148,28 @@ def run_remote_command_on_content_host(command, vm_module_streams): indirect=True, ) @pytest.mark.no_containers -def test_positive_end_to_end(session, default_location, module_repos_collection_with_manifest, vm): +def test_positive_end_to_end( + vm, + session, + module_org, + default_location, + module_repos_collection_with_manifest, +): """Create all entities required for content host, set up host, register it as a content host, read content host details, install package and errata. :id: f43f2826-47c1-4069-9c9d-2410fd1b622c + :setup: Register a rhel7 vm as a content host. Import repos + collection and associated manifest. + + :steps: + 1. Install some outdated version for an applicable package + 2. In legacy Host UI, find the host status and rhel lifecycle status + 3. Using legacy ContentHost UI, find the chost and relevant details + 4. Install the errata, check legacy ContentHost UI and the updated package + 5. Delete the content host, then try to find it + :expectedresults: content host details are the same as expected, package and errata installation are successful @@ -135,13 +179,24 @@ def test_positive_end_to_end(session, default_location, module_repos_collection_ :CaseImportance: Critical """ + # Read rhel distro param, determine what rhel lifecycle status should be + _distro = module_repos_collection_with_manifest.distro + host_rhel_version = None + if _distro.startswith('rhel'): + host_rhel_version = int(_distro[4:]) + rhel_status = get_rhel_lifecycle_support(host_rhel_version if not None else 0) + result = vm.run(f'yum -y install {FAKE_1_CUSTOM_PACKAGE}') assert result.status == 0 startdate = datetime.utcnow().strftime('%m/%d/%Y') + with session: session.location.select(default_location.name) + session.organization.select(module_org.name) # Ensure content host is searchable - assert session.contenthost.search(vm.hostname)[0]['Name'] == vm.hostname + found_chost = session.contenthost.search(f'{vm.hostname}') + assert found_chost, f'Search for contenthost by name: "{vm.hostname}", returned no results.' + assert found_chost[0]['Name'] == vm.hostname chost = session.contenthost.read( vm.hostname, widget_names=['details', 'provisioning_details', 'subscriptions'] ) @@ -182,6 +237,11 @@ def test_positive_end_to_end(session, default_location, module_repos_collection_ assert startdate in custom_sub['Expires'] else: assert startdate in custom_sub['Starts'] + # Ensure host status and details show correct RHEL lifecycle status + host_status = session.host.host_status(vm.hostname) + host_rhel_lcs = session.contenthost.read(vm.hostname, widget_names=['permission_denied']) + assert rhel_status in host_rhel_lcs['permission_denied'] + assert rhel_status in host_status # Update description new_description = gen_string('alpha') session.contenthost.update(vm.hostname, {'details.description': new_description}) @@ -196,9 +256,7 @@ def test_positive_end_to_end(session, default_location, module_repos_collection_ packages = session.contenthost.search_package(vm.hostname, FAKE_0_CUSTOM_PACKAGE_NAME) assert packages[0]['Installed Package'] == FAKE_0_CUSTOM_PACKAGE # Install errata - result = session.contenthost.install_errata( - vm.hostname, settings.repos.yum_6.errata[2], install_via='rex' - ) + result = session.contenthost.install_errata(vm.hostname, FAKE_1_ERRATA_ID) assert result['overview']['hosts_table'][0]['Status'] == 'success' # Ensure errata installed packages = session.contenthost.search_package(vm.hostname, FAKE_2_CUSTOM_PACKAGE_NAME) From c740d61536d47ce1ac732e726b6519a9dd24a1f1 Mon Sep 17 00:00:00 2001 From: Gaurav Talreja Date: Thu, 14 Dec 2023 13:15:45 +0530 Subject: [PATCH 19/93] Add test coverage for provisioning with fips_enabled (#12695) Signed-off-by: Gaurav Talreja --- tests/foreman/api/test_provisioning.py | 139 ++++++++++++++++++ .../foreman/api/test_provisioningtemplate.py | 47 ++++++ 2 files changed, 186 insertions(+) diff --git a/tests/foreman/api/test_provisioning.py b/tests/foreman/api/test_provisioning.py index f28e1d1273..b0760d3ff1 100644 --- a/tests/foreman/api/test_provisioning.py +++ b/tests/foreman/api/test_provisioning.py @@ -25,6 +25,7 @@ from robottelo.config import settings from robottelo.logging import logger from robottelo.utils.installer import InstallerCommand +from robottelo.utils.issue_handlers import is_open def _read_log(ch, pattern): @@ -441,3 +442,141 @@ def test_rhel_httpboot_provisioning( # assert that the host is subscribed and consumes # subsctiption provided by the activation key assert provisioning_host.subscribed, 'Host is not subscribed' + + +@pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True) +@pytest.mark.on_premises_provisioning +@pytest.mark.rhel_ver_match('[^6]') +def test_rhel_pxe_provisioning_fips_enabled( + request, + module_provisioning_sat, + module_sca_manifest_org, + module_location, + provisioning_host, + pxe_loader, + module_provisioning_rhel_content, + provisioning_hostgroup, + module_lce_library, + module_default_org_view, +): + """Provision a host with host param fips_enabled set to true + + :id: 9e016e1d-757a-48e7-9159-131bb65dc4ef + + :steps: + 1. Configure satellite for provisioning + 2. Provision a host with host param fips_enabled + 3. Check that resulting host is registered to Satellite + 4. Check host is subscribed to Satellite + + :expectedresults: + 1. Provisioning with host param fips_enabled is successful + 2. Host installs right version of RHEL + 3. Satellite is able to run REX job on the fips_enabled host + 4. Host is registered to Satellite and subscription status is 'Success' + + :parametrized: yes + + :BZ: 2240076 + """ + sat = module_provisioning_sat.sat + host_mac_addr = provisioning_host._broker_args['provisioning_nic_mac_addr'] + # Verify password hashing algorithm SHA256 is set in OS used for provisioning + assert module_provisioning_rhel_content.os.password_hash == 'SHA256' + + host = sat.api.Host( + hostgroup=provisioning_hostgroup, + organization=module_sca_manifest_org, + location=module_location, + name=gen_string('alpha').lower(), + mac=host_mac_addr, + operatingsystem=module_provisioning_rhel_content.os, + subnet=module_provisioning_sat.subnet, + host_parameters_attributes=[ + { + 'name': 'remote_execution_connect_by_ip', + 'value': 'true', + 'parameter_type': 'boolean', + }, + {'name': 'fips_enabled', 'value': 'true', 'parameter_type': 'boolean'}, + ], + build=True, # put the host in build mode + ).create(create_missing=False) + # Clean up the host to free IP leases on Satellite. + # broker should do that as a part of the teardown, putting here just to make sure. + request.addfinalizer(host.delete) + # Start the VM, do not ensure that we can connect to SSHD + provisioning_host.power_control(ensure=False) + + # TODO: Implement Satellite log capturing logic to verify that + # all the events are captured in the logs. + + # Host should do call back to the Satellite reporting + # the result of the installation. Wait until Satellite reports that the host is installed. + wait_for( + lambda: host.read().build_status_label != 'Pending installation', + timeout=1500, + delay=10, + ) + host = host.read() + assert host.build_status_label == 'Installed' + + # Change the hostname of the host as we know it already. + # In the current infra environment we do not support + # addressing hosts using FQDNs, falling back to IP. + provisioning_host.hostname = host.ip + # Host is not blank anymore + provisioning_host.blank = False + + # Wait for the host to be rebooted and SSH daemon to be started. + provisioning_host.wait_for_connection() + + # Perform version check and check if root password is properly updated + host_os = host.operatingsystem.read() + expected_rhel_version = f'{host_os.major}.{host_os.minor}' + + if int(host_os.major) >= 9: + assert ( + provisioning_host.execute( + 'echo -e "\nPermitRootLogin yes" >> /etc/ssh/sshd_config; systemctl restart sshd' + ).status + == 0 + ) + host_ssh_os = sat.execute( + f'sshpass -p {settings.provisioning.host_root_password} ' + 'ssh -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -o PasswordAuthentication=yes ' + f'-o UserKnownHostsFile=/dev/null root@{provisioning_host.hostname} cat /etc/redhat-release' + ) + assert host_ssh_os.status == 0 + assert ( + expected_rhel_version in host_ssh_os.stdout + ), f'The installed OS version differs from the expected version {expected_rhel_version}' + + # Verify FIPS is enabled on host after provisioning is completed sucessfully + if int(host_os.major) >= 8: + result = provisioning_host.execute('fips-mode-setup --check') + fips_status = 'FIPS mode is disabled' if is_open('BZ:2240076') else 'FIPS mode is enabled' + assert fips_status in result.stdout + else: + result = provisioning_host.execute('cat /proc/sys/crypto/fips_enabled') + assert (0 if is_open('BZ:2240076') else 1) == int(result.stdout) + + # Run a command on the host using REX to verify that Satellite's SSH key is present on the host + template_id = ( + sat.api.JobTemplate().search(query={'search': 'name="Run Command - Script Default"'})[0].id + ) + job = sat.api.JobInvocation().run( + data={ + 'job_template_id': template_id, + 'inputs': { + 'command': f'subscription-manager config | grep "hostname = {sat.hostname}"' + }, + 'search_query': f"name = {host.name}", + 'targeting_type': 'static_query', + }, + ) + assert job['result'] == 'success', 'Job invocation failed' + + # assert that the host is subscribed and consumes + # subsctiption provided by the activation key + assert provisioning_host.subscribed, 'Host is not subscribed' diff --git a/tests/foreman/api/test_provisioningtemplate.py b/tests/foreman/api/test_provisioningtemplate.py index 40e25e696a..ba0574489b 100644 --- a/tests/foreman/api/test_provisioningtemplate.py +++ b/tests/foreman/api/test_provisioningtemplate.py @@ -640,3 +640,50 @@ def test_positive_template_check_rex_snippet( in rex_snippet ) assert ssh_key in rex_snippet + + @pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True) + def test_positive_template_check_fips_enabled( + self, + module_sync_kickstart_content, + module_target_sat, + module_sca_manifest_org, + module_location, + module_default_org_view, + module_lce_library, + default_architecture, + default_partitiontable, + ): + """Read provision/PXE templates, verify fips packages to install and kernel cmdline option + fips=1, set by kickstart_kernel_options snippet while using host param fips_enabled + is rendered correctly + + :id: 065ef48f-bec5-4535-8be7-d8527fa21565 + + :expectedresults: Rendered template should contain correct FIPS packages and boot parameter + set by snippet while using host param fips_enabled for rhel host + + :parametrized: yes + """ + host_params = [{'name': 'fips_enabled', 'value': 'true', 'parameter_type': 'boolean'}] + host = module_target_sat.api.Host( + organization=module_sca_manifest_org, + location=module_location, + name=gen_string('alpha').lower(), + operatingsystem=module_sync_kickstart_content.os, + architecture=default_architecture, + domain=module_sync_kickstart_content.domain, + root_pass=settings.provisioning.host_root_password, + ptable=default_partitiontable, + content_facet_attributes={ + 'content_source_id': module_target_sat.nailgun_smart_proxy.id, + 'content_view_id': module_default_org_view.id, + 'lifecycle_environment_id': module_lce_library.id, + }, + host_parameters_attributes=host_params, + ).create() + render = host.read_template(data={'template_kind': 'provision'})['template'] + assert 'dracut-fips' in render + assert '-prelink' in render + for kind in ['PXELinux', 'PXEGrub', 'PXEGrub2', 'iPXE', 'kexec']: + render = host.read_template(data={'template_kind': kind})['template'] + assert 'fips=1' in render From 5fac78b29ae8e5a189de455385e9c591c329b5af Mon Sep 17 00:00:00 2001 From: Jameer Pathan <21165044+jameerpathan111@users.noreply.github.com> Date: Wed, 13 Dec 2023 14:22:45 +0100 Subject: [PATCH 20/93] Fix test failures from cli.factory refactor --- tests/foreman/cli/test_repository.py | 64 ++++++++++++++-------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/tests/foreman/cli/test_repository.py b/tests/foreman/cli/test_repository.py index d1f434ce01..1ca398b9ff 100644 --- a/tests/foreman/cli/test_repository.py +++ b/tests/foreman/cli/test_repository.py @@ -2553,8 +2553,8 @@ def test_positive_sync_ansible_collection(self, repo, module_target_sat): :parametrized: yes """ - module_target_sat.cli_factory.Repository.synchronize({'id': repo['id']}) - repo = module_target_sat.cli_factory.Repository.info({'id': repo['id']}) + module_target_sat.cli.Repository.synchronize({'id': repo['id']}) + repo = module_target_sat.cli.Repository.info({'id': repo['id']}) assert repo['sync']['status'] == 'Success' @pytest.mark.tier2 @@ -2586,8 +2586,8 @@ def test_positive_export_ansible_collection(self, repo, module_org, target_sat): """ import_org = target_sat.cli_factory.make_org() - target_sat.cli_factory.Repository.synchronize({'id': repo['id']}) - repo = target_sat.cli_factory.Repository.info({'id': repo['id']}) + target_sat.cli.Repository.synchronize({'id': repo['id']}) + repo = target_sat.cli.Repository.info({'id': repo['id']}) assert repo['sync']['status'] == 'Success' # export result = target_sat.cli.ContentExport.completeLibrary({'organization-id': module_org.id}) @@ -2603,15 +2603,15 @@ def test_positive_export_ansible_collection(self, repo, module_org, target_sat): {'name': 'Import-Library', 'organization-label': import_org['label']} ) assert cv['description'] == 'Content View used for importing into library' - prods = target_sat.cli_factory.Product.list({'organization-id': import_org['id']}) - prod = target_sat.cli_factory.Product.info( + prods = target_sat.cli.Product.list({'organization-id': import_org['id']}) + prod = target_sat.cli.Product.info( {'id': prods[0]['id'], 'organization-id': import_org['id']} ) ac_content = [ cont for cont in prod['content'] if cont['content-type'] == 'ansible_collection' ] assert len(ac_content) > 0 - repo = target_sat.cli_factory.Repository.info( + repo = target_sat.cli.Repository.info( {'name': ac_content[0]['repo-name'], 'product-id': prod['id']} ) result = target_sat.execute(f'curl {repo["published-at"]}') @@ -2646,8 +2646,8 @@ def test_positive_sync_ansible_collection_from_satellite(self, repo, target_sat) """ import_org = target_sat.cli_factory.make_org() - target_sat.cli_factory.Repository.synchronize({'id': repo['id']}) - repo = target_sat.cli_factory.Repository.info({'id': repo['id']}) + target_sat.cli.Repository.synchronize({'id': repo['id']}) + repo = target_sat.cli.Repository.info({'id': repo['id']}) assert repo['sync']['status'] == 'Success' published_url = repo['published-at'] # sync from different org @@ -2664,8 +2664,8 @@ def test_positive_sync_ansible_collection_from_satellite(self, repo, target_sat) [{ name: theforeman.operations, version: "0.1.0"}]}', } ) - target_sat.cli_factory.Repository.synchronize({'id': repo_2['id']}) - repo_2_status = target_sat.cli_factory.Repository.info({'id': repo_2['id']}) + target_sat.cli.Repository.synchronize({'id': repo_2['id']}) + repo_2_status = target_sat.cli.Repository.info({'id': repo_2['id']}) assert repo_2_status['sync']['status'] == 'Success' @@ -2689,8 +2689,8 @@ def test_positive_sync_publish_promote_cv(self, repo, module_org, target_sat): lifecycle environment """ lce = target_sat.cli_factory.make_lifecycle_environment({'organization-id': module_org.id}) - target_sat.cli_factory.Repository.synchronize({'id': repo['id']}) - synced_repo = target_sat.cli_factory.Repository.info({'id': repo['id']}) + target_sat.cli.Repository.synchronize({'id': repo['id']}) + synced_repo = target_sat.cli.Repository.info({'id': repo['id']}) assert synced_repo['sync']['status'].lower() == 'success' assert synced_repo['content-counts']['packages'] == '35' cv = target_sat.cli_factory.make_content_view({'organization-id': module_org.id}) @@ -2724,7 +2724,7 @@ def test_positive_sync(self, repo, module_org, module_product, target_sat): :expectedresults: drpms can be listed in repository """ - target_sat.cli_factory.Repository.synchronize({'id': repo['id']}) + 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" @@ -2747,7 +2747,7 @@ def test_positive_sync_publish_cv(self, repo, module_org, module_product, target :expectedresults: drpms can be listed in content view """ - target_sat.cli_factory.Repository.synchronize({'id': repo['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']}) @@ -2776,7 +2776,7 @@ def test_positive_sync_publish_promote_cv(self, repo, module_org, module_product lifecycle environment """ lce = target_sat.cli_factory.make_lifecycle_environment({'organization-id': module_org.id}) - target_sat.cli_factory.Repository.synchronize({'id': repo['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']}) @@ -3012,7 +3012,7 @@ def test_positive_upload_file_to_file_repo(self, repo_options, repo, target_sat) local_path=DataFile.RPM_TO_UPLOAD, remote_path=f"/tmp/{RPM_TO_UPLOAD}", ) - result = target_sat.cli_factory.Repository.upload_content( + result = target_sat.cli.Repository.upload_content( { 'name': repo['name'], 'organization': repo['organization'], @@ -3021,7 +3021,7 @@ def test_positive_upload_file_to_file_repo(self, repo_options, repo, target_sat) } ) assert f"Successfully uploaded file '{RPM_TO_UPLOAD}'" in result[0]['message'] - repo = target_sat.cli_factory.Repository.info({'id': repo['id']}) + repo = target_sat.cli.Repository.info({'id': repo['id']}) assert repo['content-counts']['files'] == '1' filesearch = entities.File().search( query={"search": f"name={RPM_TO_UPLOAD} and repository={repo['name']}"} @@ -3077,7 +3077,7 @@ def test_positive_remove_file(self, repo, target_sat): local_path=DataFile.RPM_TO_UPLOAD, remote_path=f"/tmp/{RPM_TO_UPLOAD}", ) - result = target_sat.cli_factory.Repository.upload_content( + result = target_sat.cli.Repository.upload_content( { 'name': repo['name'], 'organization': repo['organization'], @@ -3086,13 +3086,13 @@ def test_positive_remove_file(self, repo, target_sat): } ) assert f"Successfully uploaded file '{RPM_TO_UPLOAD}'" in result[0]['message'] - repo = target_sat.cli_factory.Repository.info({'id': repo['id']}) + repo = target_sat.cli.Repository.info({'id': repo['id']}) assert int(repo['content-counts']['files']) > 0 files = target_sat.cli.File.list({'repository-id': repo['id']}) - target_sat.cli_factory.Repository.remove_content( + target_sat.cli.Repository.remove_content( {'id': repo['id'], 'ids': [file_['id'] for file_ in files]} ) - repo = target_sat.cli_factory.Repository.info({'id': repo['id']}) + repo = target_sat.cli.Repository.info({'id': repo['id']}) assert repo['content-counts']['files'] == '0' @pytest.mark.tier2 @@ -3130,8 +3130,8 @@ def test_positive_remote_directory_sync(self, repo, module_target_sat): :expectedresults: entire directory is synced over http """ - module_target_sat.cli_factory.Repository.synchronize({'id': repo['id']}) - repo = module_target_sat.cli_factory.Repository.info({'id': repo['id']}) + module_target_sat.cli.Repository.synchronize({'id': repo['id']}) + repo = module_target_sat.cli.Repository.info({'id': repo['id']}) assert repo['sync']['status'] == 'Success' assert repo['content-counts']['files'] == '2' @@ -3168,8 +3168,8 @@ def test_positive_file_repo_local_directory_sync(self, repo, target_sat): f'wget -P {CUSTOM_LOCAL_FOLDER} -r -np -nH --cut-dirs=5 -R "index.html*" ' f'{CUSTOM_FILE_REPO}' ) - target_sat.cli_factory.Repository.synchronize({'id': repo['id']}) - repo = target_sat.cli_factory.Repository.info({'id': repo['id']}) + target_sat.cli.Repository.synchronize({'id': repo['id']}) + repo = target_sat.cli.Repository.info({'id': repo['id']}) assert int(repo['content-counts']['files']) > 1 @pytest.mark.tier2 @@ -3208,8 +3208,8 @@ def test_positive_symlinks_sync(self, repo, target_sat): ) target_sat.execute(f'ln -s {CUSTOM_LOCAL_FOLDER} /{gen_string("alpha")}') - target_sat.cli_factory.Repository.synchronize({'id': repo['id']}) - repo = target_sat.cli_factory.Repository.info({'id': repo['id']}) + target_sat.cli.Repository.synchronize({'id': repo['id']}) + repo = target_sat.cli.Repository.info({'id': repo['id']}) assert int(repo['content-counts']['files']) > 1 @pytest.mark.tier2 @@ -3242,7 +3242,7 @@ def test_file_repo_contains_only_newer_file(self, repo_options, repo, target_sat """ text_file_name = f'test-{gen_string("alpha", 5)}.txt'.lower() target_sat.execute(f'echo "First File" > /tmp/{text_file_name}') - result = target_sat.cli_factory.Repository.upload_content( + result = target_sat.cli.Repository.upload_content( { 'name': repo['name'], 'organization': repo['organization'], @@ -3251,7 +3251,7 @@ def test_file_repo_contains_only_newer_file(self, repo_options, repo, target_sat } ) assert f"Successfully uploaded file '{text_file_name}'" in result[0]['message'] - repo = target_sat.cli_factory.Repository.info({'id': repo['id']}) + repo = target_sat.cli.Repository.info({'id': repo['id']}) # Assert there is only one file assert repo['content-counts']['files'] == '1' filesearch = entities.File().search( @@ -3260,7 +3260,7 @@ def test_file_repo_contains_only_newer_file(self, repo_options, repo, target_sat assert text_file_name == filesearch[0].name # Create new version of the file by changing the text target_sat.execute(f'echo "Second File" > /tmp/{text_file_name}') - result = target_sat.cli_factory.Repository.upload_content( + result = target_sat.cli.Repository.upload_content( { 'name': repo['name'], 'organization': repo['organization'], @@ -3269,7 +3269,7 @@ def test_file_repo_contains_only_newer_file(self, repo_options, repo, target_sat } ) assert f"Successfully uploaded file '{text_file_name}'" in result[0]['message'] - repo = target_sat.cli_factory.Repository.info({'id': repo['id']}) + repo = target_sat.cli.Repository.info({'id': repo['id']}) # Assert there is still only one file assert repo['content-counts']['files'] == '1' filesearch = entities.File().search( From 0452011e7ba6e6cf5499b3520883405425eb1786 Mon Sep 17 00:00:00 2001 From: vsedmik <46570670+vsedmik@users.noreply.github.com> Date: Fri, 15 Dec 2023 09:58:28 +0100 Subject: [PATCH 21/93] Get rid of deprecated mirror-on-sync (#13425) --- tests/foreman/cli/test_satellitesync.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/foreman/cli/test_satellitesync.py b/tests/foreman/cli/test_satellitesync.py index 7fed3bd158..0251b4901e 100644 --- a/tests/foreman/cli/test_satellitesync.py +++ b/tests/foreman/cli/test_satellitesync.py @@ -499,7 +499,7 @@ def class_export_entities(module_org, module_target_sat): exporting_repo = module_target_sat.cli_factory.make_repository( { 'name': exporting_repo_name, - 'mirror-on-sync': 'no', + 'mirroring-policy': 'mirror_content_only', 'download-policy': 'immediate', 'product-id': product['id'], } @@ -1273,7 +1273,7 @@ def test_postive_export_cv_with_mixed_content_repos( { 'name': gen_string('alpha'), 'download-policy': 'immediate', - 'mirror-on-sync': 'no', + 'mirroring-policy': 'mirror_content_only', 'product-id': product['id'], } ) From e77ef86a636cb30fd6304ba5bbafc47c67ee52e7 Mon Sep 17 00:00:00 2001 From: Vladimir Sedmik Date: Fri, 8 Dec 2023 12:17:51 +0100 Subject: [PATCH 22/93] Add UI test for Capsule Content Counts --- tests/foreman/ui/test_capsulecontent.py | 237 ++++++++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 tests/foreman/ui/test_capsulecontent.py diff --git a/tests/foreman/ui/test_capsulecontent.py b/tests/foreman/ui/test_capsulecontent.py new file mode 100644 index 0000000000..6d1f30bd95 --- /dev/null +++ b/tests/foreman/ui/test_capsulecontent.py @@ -0,0 +1,237 @@ +"""Capsule-Content related tests being run through UI. + +:Requirement: Capsule-Content + +:CaseAutomation: Automated + +:CaseLevel: System + +:CaseComponent: Capsule-Content + +:team: Phoenix-content + +:TestType: Functional + +:CaseImportance: High + +:Upstream: No +""" +import pytest + +from robottelo.config import settings +from robottelo.constants import DEFAULT_CV +from robottelo.constants.repos import ANSIBLE_GALAXY, CUSTOM_FILE_REPO + + +@pytest.fixture(scope='module', autouse=True) +def capsule_default_org(module_target_sat, module_capsule_configured, default_org): + """Add new Capsule to the Default Organization""" + module_target_sat.cli.Capsule.update( + { + 'name': module_capsule_configured.hostname, + 'organization-ids': default_org.id, + } + ) + + +@pytest.mark.parametrize( + 'repos_collection', + [ + { + 'distro': 'rhel8', + 'YumRepository': {'url': settings.repos.module_stream_1.url}, + 'FileRepository': {'url': CUSTOM_FILE_REPO}, + 'DockerRepository': { + 'url': 'https://quay.io', + 'upstream_name': 'libpod/testimage', + }, + 'AnsibleRepository': { + 'url': ANSIBLE_GALAXY, + 'requirements': [ + {'name': 'theforeman.foreman', 'version': '2.1.0'}, + {'name': 'theforeman.operations', 'version': '0.1.0'}, + ], + }, + } + ], + indirect=True, +) +def test_positive_content_counts_for_mixed_cv( + target_sat, + module_capsule_configured, + repos_collection, + function_org, + function_lce, + function_lce_library, +): + """Verify the content counts for a mixed-content CV + + :id: b150f813-ae98-452b-9ad2-7f4ea88277c9 + + :parametrized: yes + + :setup: + 1. A content view with repos of all content types + published into CVV and promoted to an LCE. + + :steps: + 1. Assign the Capsule with the LCE where the setup CVV is promoted to. + 2. Check the capsule lists correct LCE and CV names but no content counts before sync. + 3. Sync the Capsule and get the content counts again. + 4. Get the content counts from Satellite side and compare them with Capsule. + 5. Refresh the counts and check the Counts update task was triggered. + 6. Remove the LCEs from Capsule and ensure they are not listed anymore. + + :expectedresults: + 1. Capsule returns 'N/A' for content counts until it is synced. + 2. After sync the content counts from Capsule match those from Satellite. + 3. Update counts task can be triggered from the UI. + 4. After LCE removal content counts are not listed anymore. + """ + repos_collection.setup_content(function_org.id, function_lce.id, upload_manifest=False) + cv_id = repos_collection.setup_content_data['content_view']['id'] + cv = target_sat.api.ContentView(id=cv_id).read() + cvv = cv.version[-1].read() + lces = [function_lce.name, function_lce_library.name] + + with target_sat.ui_session() as session: + session.capsule.edit( + module_capsule_configured.hostname, add_organizations=[function_org.name] + ) + session.organization.select(org_name=function_org.name) + + # Assign the Capsule with the LCE where the setup CVV is promoted to. + session.capsule.edit( + module_capsule_configured.hostname, + add_lces=lces, + ) + + # Check the capsule lists correct LCE and CV names but no content counts before sync. + details = session.capsule.read_details(module_capsule_configured.hostname) + assert set(lces) == set(details['content']), 'Wrong LCEs listed' + assert function_lce.name in details['content'], 'Assigned LCE not listed' + + for lce in lces: + assert cv.name in details['content'][lce], 'Assigned CV not listed' + assert ( + 'N/A' in details['content'][lce]['top_row_content']['Last sync'] + ), 'LCE should be marked as unsynced' + + assert ( + details['content'][lce][cv.name]['mid_row_content']['Version'] + == f'Version {cvv.version}' + ), 'CV version does not match' + assert not details['content'][lce][cv.name]['mid_row_content'][ + 'Synced' + ], 'CV should not be marked as synced' + + repos_details = details['content'][lce][cv.name]['expanded_repo_details'][1:] + assert all( + [repo[1] == repo[2] == 'N/A' for repo in repos_details] + ), 'Expected all content counts as N/A' + + if lce == 'Library': + # Library should contain the Default Org View too + assert DEFAULT_CV in details['content'][lce], 'Default Org View not listed' + + assert ( + details['content'][lce][DEFAULT_CV]['mid_row_content']['Version'] + == 'Version 1.0' + ), 'CV version does not match' + assert not details['content'][lce][DEFAULT_CV]['mid_row_content'][ + 'Synced' + ], 'CV should not be marked as synced' + + repos_details = details['content'][lce][DEFAULT_CV]['expanded_repo_details'][1:] + assert all( + [repo[1] == repo[2] == 'N/A' for repo in repos_details] + ), 'Expected all content counts as N/A' + + # Sync the Capsule and get the content counts again. + session.capsule.optimized_sync(module_capsule_configured.hostname) + target_sat.wait_for_tasks( + search_query='label = Actions::Katello::CapsuleContent::Sync', + search_rate=10, + max_tries=10, + ) + target_sat.wait_for_tasks( + search_query='label = Actions::Katello::CapsuleContent::UpdateContentCounts', + search_rate=5, + max_tries=5, + ) + details = session.capsule.read_details(module_capsule_configured.hostname) + + # Get the content counts from Satellite side and compare them with Capsule. + sat_repos = [target_sat.api.Repository(id=repo.id).read() for repo in cvv.repository] + for lce in lces: + assert ( + 'ago' in details['content'][lce]['top_row_content']['Last sync'] + ), 'LCE should be marked as synced' + assert details['content'][lce][cv.name]['mid_row_content'][ + 'Synced' + ], 'CV should be marked as synced' + repos_details = details['content'][lce][cv.name]['expanded_repo_details'][1:] + + for s_repo in sat_repos: + c_repo = next(r for r in repos_details if r[0] == s_repo.name) + assert c_repo, 'Repository not listed' + if s_repo.content_type == 'yum': + assert ( + f'{s_repo.content_counts["rpm"]} Packages' in c_repo + ), 'RPMs count does not match' + assert ( + f'{s_repo.content_counts["erratum"]} Errata' in c_repo + ), 'Errata count does not match' + assert ( + f'{s_repo.content_counts["package_group"]} Package groups' in c_repo + ), 'Package groups count does not match' + # assert ( + # f'{s_repo.content_counts["module_stream"]} Module streams' in c_repo + # ), 'Module streams count does not match' + elif s_repo.content_type == 'file': + assert ( + f'{s_repo.content_counts["file"]} Files' in c_repo + ), 'Files count does not match' + elif s_repo.content_type == 'docker': + assert ( + f'{s_repo.content_counts["docker_tag"]} Container tags' in c_repo + ), 'Container tags count does not match' + assert ( + f'{s_repo.content_counts["docker_manifest"]} Container manifests' in c_repo + ), 'Container manifests count does not match' + # assert ( + # f'{s_repo.content_counts["docker_manifest_list"]} Container manifest lists' + # in c_repo + # ), 'Container manifest lists count does not match' + elif s_repo.content_type == 'ansible_collection': + assert ( + f'{s_repo.content_counts["ansible_collection"]} Ansible collections' + in c_repo + ), 'Ansible collections count does not match' + + # Refresh the counts and check the Counts update task was triggered. + for lce in lces: + t1 = target_sat.api.ForemanTask().search( + query={ + 'search': 'label = Actions::Katello::CapsuleContent::UpdateContentCounts', + 'per_page': '1000', + } + ) + session.capsule.refresh_lce_counts(module_capsule_configured.hostname, lce_name=lce) + target_sat.wait_for_tasks( + search_query='label = Actions::Katello::CapsuleContent::UpdateContentCounts', + search_rate=5, + max_tries=5, + ) + t2 = target_sat.api.ForemanTask().search( + query={ + 'search': 'label = Actions::Katello::CapsuleContent::UpdateContentCounts', + 'per_page': '1000', + } + ) + assert len(t2) == len(t1) + 1, 'Update CC task was not triggered' + + # Remove the LCEs from Capsule and ensure they are not listed anymore. + session.capsule.edit(module_capsule_configured.hostname, remove_all_lces=True) + details = session.capsule.read_details(module_capsule_configured.hostname) + assert 'content' not in details.keys(), 'Content still listed for removed LCEs' From e8adbf6c421f81cb90d999e53a92c58517d7251c Mon Sep 17 00:00:00 2001 From: Radek Mynar Date: Thu, 7 Dec 2023 13:29:25 +0100 Subject: [PATCH 23/93] default foreman cache changed from file to redis --- tests/foreman/installer/test_installer.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/foreman/installer/test_installer.py b/tests/foreman/installer/test_installer.py index 2ff6321d68..c8268fd388 100644 --- a/tests/foreman/installer/test_installer.py +++ b/tests/foreman/installer/test_installer.py @@ -1385,7 +1385,7 @@ def sat_non_default_install(module_sat_ready_rhels): installer_args = [ 'scenario satellite', f'foreman-initial-admin-password {settings.server.admin_password}', - 'foreman-rails-cache-store type:redis', + 'foreman-rails-cache-store type:file', 'foreman-proxy-content-pulpcore-hide-guarded-distributions false', ] install_satellite(module_sat_ready_rhels[1], installer_args) @@ -1467,8 +1467,8 @@ def test_foreman_rails_cache_store(sat_non_default_install): :id: 379a2fe8-1085-4a7f-8ac3-24c421412f12 :steps: - 1. Install Satellite. - 2. Verify that foreman-redis package is installed. + 1. Install Satellite with option foreman-rails-cache-store type:file + 2. Verify that foreman-redis package is not installed. 3. Check /etc/foreman/settings.yaml :CaseImportance: Medium @@ -1478,9 +1478,9 @@ def test_foreman_rails_cache_store(sat_non_default_install): :BZ: 2063717, 2165092 """ # Verify foreman-rails-cache-store option works - assert sat_non_default_install.execute('rpm -q foreman-redis').status == 0 + assert sat_non_default_install.execute('rpm -q foreman-redis').status == 1 settings_file = sat_non_default_install.load_remote_yaml_file(FOREMAN_SETTINGS_YML) - assert settings_file.rails_cache_store.type == 'redis' + assert settings_file.rails_cache_store.type == 'file' @pytest.mark.e2e @@ -1796,8 +1796,14 @@ def test_satellite_installation(installer_satellite): 2. satellite-installer runs successfully 3. no unexpected errors in logs 4. satellite-maintain health check runs successfully + 5. redis is set as default foreman cache :CaseImportance: Critical """ common_sat_install_assertions(installer_satellite) + + # Verify foreman-redis is installed and set as default cache for rails + assert installer_satellite.execute('rpm -q foreman-redis').status == 0 + settings_file = installer_satellite.load_remote_yaml_file(FOREMAN_SETTINGS_YML) + assert settings_file.rails_cache_store.type == 'redis' From e17e37bf7dcada129ef65e95544f5c2020b3e1ee Mon Sep 17 00:00:00 2001 From: Cole Higgins Date: Fri, 15 Dec 2023 11:35:06 -0500 Subject: [PATCH 24/93] Removing old errata tests --- tests/foreman/cli/test_errata.py | 122 ++----------------------------- 1 file changed, 6 insertions(+), 116 deletions(-) diff --git a/tests/foreman/cli/test_errata.py b/tests/foreman/cli/test_errata.py index 0b4b3a37f5..e5e0a57814 100644 --- a/tests/foreman/cli/test_errata.py +++ b/tests/foreman/cli/test_errata.py @@ -491,70 +491,11 @@ def test_positive_install_by_host_collection_and_org( @pytest.mark.tier3 -def test_negative_install_by_hc_id_without_errata_info( - module_entitlement_manifest_org, host_collection, errata_hosts, target_sat -): - """Attempt to install an erratum on a host collection by host collection id but no errata info - specified. - - :id: 3635698d-4f09-4a60-91ea-1957e5949750 - - :Setup: Errata synced on satellite server. - - :Steps: host-collection erratum install --id --organization-id - - - :expectedresults: Error message thrown. - - :CaseImportance: Low - - :CaseLevel: System - """ - with pytest.raises(CLIReturnCodeError, match="Error: Option '--errata' is required"): - target_sat.cli.HostCollection.erratum_install( - { - 'id': host_collection['id'], - 'organization-id': module_entitlement_manifest_org.id, - } - ) - - -@pytest.mark.tier3 -def test_negative_install_by_hc_name_without_errata_info( - module_entitlement_manifest_org, host_collection, errata_hosts, target_sat -): - """Attempt to install an erratum on a host collection by host collection name but no errata - info specified. - - :id: 12d78bca-efd1-407a-9bd3-f989c2bda6a8 - - :Setup: Errata synced on satellite server. - - :Steps: host-collection erratum install --name --organization-id - - - :expectedresults: Error message thrown. - - :CaseImportance: Low - - :CaseLevel: System - """ - with pytest.raises(CLIReturnCodeError, match="Error: Option '--errata' is required"): - target_sat.cli.HostCollection.erratum_install( - { - 'name': host_collection['name'], - 'organization-id': module_entitlement_manifest_org.id, - } - ) - - -@pytest.mark.tier3 -def test_negative_install_without_hc_info( +def test_negative_install_erratum_on_host_collection( module_entitlement_manifest_org, host_collection, module_target_sat ): - """Attempt to install an erratum on a host collection without specifying host collection info. - This test only works with two or more host collections (BZ#1928281). - We have the one from the fixture, just need to create one more at the start of the test. + """Attempt to install an erratum on a host collection + This functionality was removed with katello-agent :id: 753d36f0-d19b-494d-a247-ce2d61c4cf74 @@ -563,9 +504,7 @@ def test_negative_install_without_hc_info( :Steps: host-collection erratum install --errata --organization-id - :expectedresults: Error message thrown. - - :BZ: 1928281 + :expectedresults: Error message thrown. Not supported. Use the remote execution equivalent :CaseImportance: Low @@ -574,63 +513,14 @@ def test_negative_install_without_hc_info( module_target_sat.cli_factory.make_host_collection( {'organization-id': module_entitlement_manifest_org.id} ) - with pytest.raises(CLIReturnCodeError): + with pytest.raises(CLIReturnCodeError) as error: module_target_sat.cli.HostCollection.erratum_install( { 'organization-id': module_entitlement_manifest_org.id, 'errata': [REPO_WITH_ERRATA['errata'][0]['id']], } ) - - -@pytest.mark.tier3 -def test_negative_install_by_hc_id_without_org_info( - module_entitlement_manifest_org, host_collection, module_target_sat -): - """Attempt to install an erratum on a host collection by host collection id but without - specifying any org info. - - :id: b7d32bb3-9c5f-452b-b421-f8e9976ca52c - - :Setup: Errata synced on satellite server. - - :Steps: host-collection erratum install --errata --id - - :expectedresults: Error message thrown. - - :CaseImportance: Low - - :CaseLevel: System - """ - with pytest.raises(CLIReturnCodeError, match='Error: Could not find organization'): - module_target_sat.cli.HostCollection.erratum_install( - {'id': host_collection['id'], 'errata': [REPO_WITH_ERRATA['errata'][0]['id']]} - ) - - -@pytest.mark.tier3 -def test_negative_install_by_hc_name_without_org_info( - module_entitlement_manifest_org, host_collection, module_target_sat -): - """Attempt to install an erratum on a host collection by host collection name but without - specifying any org info. - - :id: 991f5b61-a4d1-444c-8a21-8ffe48e83f76 - - :Setup: Errata synced on satellite server. - - :Steps: host-collection erratum install --errata --name - - :expectedresults: Error message thrown. - - :CaseImportance: Low - - :CaseLevel: System - """ - with pytest.raises(CLIReturnCodeError, match='Error: Could not find organization'): - module_target_sat.cli.HostCollection.erratum_install( - {'name': host_collection['name'], 'errata': [REPO_WITH_ERRATA['errata'][0]['id']]} - ) + assert 'Not supported. Use the remote execution equivalent' in error.value.stderr @pytest.mark.tier3 From f415a64309100985bdea8fe0818bf30a3bdb0c22 Mon Sep 17 00:00:00 2001 From: Shubham Ganar <67952129+shubhamsg199@users.noreply.github.com> Date: Mon, 18 Dec 2023 17:22:12 +0530 Subject: [PATCH 25/93] Fix discovery rule tests (#13426) Signed-off-by: Shubham Ganar --- tests/foreman/api/test_discoveryrule.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/foreman/api/test_discoveryrule.py b/tests/foreman/api/test_discoveryrule.py index 9420c01cf8..6bdde9728b 100644 --- a/tests/foreman/api/test_discoveryrule.py +++ b/tests/foreman/api/test_discoveryrule.py @@ -165,7 +165,7 @@ def test_positive_update_and_provision_with_rule_priority( @pytest.mark.tier3 def test_positive_multi_provision_with_rule_limit( - module_target_sat, module_discovery_hostgroup, discovery_location, discovery_org + request, module_target_sat, module_discovery_hostgroup, discovery_location, discovery_org ): """Create a discovery rule with certain host limit and try to provision more than the passed limit @@ -177,13 +177,12 @@ def test_positive_multi_provision_with_rule_limit( :CaseImportance: High """ - for _ in range(2): - discovered_host = module_target_sat.api_factory.create_discovered_host() - + discovered_host1 = module_target_sat.api_factory.create_discovered_host() + discovered_host2 = module_target_sat.api_factory.create_discovered_host() rule = module_target_sat.api.DiscoveryRule( max_count=1, hostgroup=module_discovery_hostgroup, - search_=f'name = {discovered_host["name"]}', + search_=f'name = {discovered_host1["name"]}', location=[discovery_location], organization=[discovery_org], priority=1000, @@ -192,6 +191,10 @@ def test_positive_multi_provision_with_rule_limit( assert '1 discovered hosts were provisioned' in result['message'] # Delete discovery rule - rule.delete() - with pytest.raises(HTTPError): - rule.read() + @request.addfinalizer + def _finalize(): + rule.delete() + module_target_sat.api.Host(id=discovered_host1['id']).delete() + module_target_sat.api.DiscoveredHost(id=discovered_host2['id']).delete() + with pytest.raises(HTTPError): + rule.read() From dc75f2af691d7547f5fc6d3d7ac9327a80edacca Mon Sep 17 00:00:00 2001 From: Shubham Ganar <67952129+shubhamsg199@users.noreply.github.com> Date: Mon, 18 Dec 2023 17:22:36 +0530 Subject: [PATCH 26/93] Add Closedloop BZ#2153548 (#13466) Add closedloop BZ#2153548 Signed-off-by: Shubham Ganar --- tests/foreman/api/test_provisioning.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/foreman/api/test_provisioning.py b/tests/foreman/api/test_provisioning.py index b0760d3ff1..cf2227625b 100644 --- a/tests/foreman/api/test_provisioning.py +++ b/tests/foreman/api/test_provisioning.py @@ -185,6 +185,11 @@ def test_rhel_pxe_provisioning( ) assert job['result'] == 'success', 'Job invocation failed' + # check if katello-ca-consumer is not used while host registration + assert provisioning_host.execute('rpm -qa |grep katello-ca-consumer').status == 1 + assert ( + 'katello-ca-consumer' not in provisioning_host.execute('cat /root/install.post.log').stdout + ) # assert that the host is subscribed and consumes # subsctiption provided by the activation key assert provisioning_host.subscribed, 'Host is not subscribed' From 7ecb7d43f6ce2ecc929b28f4451cebcd5c978cac Mon Sep 17 00:00:00 2001 From: Griffin Sullivan <48397354+Griffin-Sullivan@users.noreply.github.com> Date: Mon, 18 Dec 2023 08:28:48 -0500 Subject: [PATCH 27/93] Change yum config to dnf (#13379) --- tests/foreman/maintain/test_health.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/foreman/maintain/test_health.py b/tests/foreman/maintain/test_health.py index 3793dad8b0..313c2d89fe 100644 --- a/tests/foreman/maintain/test_health.py +++ b/tests/foreman/maintain/test_health.py @@ -320,8 +320,8 @@ def _finalize(): @pytest.mark.include_capsule -def test_positive_health_check_validate_yum_config(sat_maintain): - """Verify validate-yum-config +def test_positive_health_check_validate_dnf_config(sat_maintain): + """Verify validate-dnf-config :id: b50c8866-6175-4286-8106-561945726023 @@ -329,26 +329,26 @@ def test_positive_health_check_validate_yum_config(sat_maintain): :steps: 1. configure yum exclude. - 2. Run satellite-maintain health check --label validate-yum-config + 2. Run satellite-maintain health check --label validate-dnf-config 3. Assert that excluded packages are listed in output. 4. remove yum exclude configured in step 1. - :expectedresults: validate-yum-config should work. + :expectedresults: validate-dnf-config should work. :BZ: 1669498 :customerscenario: true """ - file = '/etc/yum.conf' - yum_exclude = 'exclude=cat*' - failure_message = 'Unset this configuration as it is risky while yum update or upgrade!' - sat_maintain.execute(f'sed -i "$ a {yum_exclude}" {file}') - result = sat_maintain.cli.Health.check(options={'label': 'validate-yum-config'}) + file = '/etc/dnf/dnf.conf' + dnf_exclude = 'exclude=cat*' + failure_message = 'Unset this configuration as it is risky while dnf update or upgrade!' + sat_maintain.execute(f'sed -i "$ a {dnf_exclude}" {file}') + result = sat_maintain.cli.Health.check(options={'label': 'validate-dnf-config'}) assert result.status == 1 - assert yum_exclude in result.stdout + assert dnf_exclude in result.stdout assert failure_message in result.stdout - sat_maintain.execute(f'sed -i "/{yum_exclude}/d" {file}') - result = sat_maintain.cli.Health.check(options={'label': 'validate-yum-config'}) + sat_maintain.execute(f'sed -i "/{dnf_exclude}/d" {file}') + result = sat_maintain.cli.Health.check(options={'label': 'validate-dnf-config'}) assert result.status == 0 assert 'FAIL' not in result.stdout From 21ddb7f2fb8fa87ed9e1ca34db8ace83816e38bf Mon Sep 17 00:00:00 2001 From: Adarsh dubey Date: Tue, 19 Dec 2023 16:36:59 +0530 Subject: [PATCH 28/93] Audit: Check for Default values on Global Registration Template (#13460) * Audit: Check for Default values on Global Registration Template * mend * mend * mend * mend * mend * mend * mend * mend --- tests/foreman/ui/test_registration.py | 57 +++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 tests/foreman/ui/test_registration.py diff --git a/tests/foreman/ui/test_registration.py b/tests/foreman/ui/test_registration.py new file mode 100644 index 0000000000..1af25fe7a4 --- /dev/null +++ b/tests/foreman/ui/test_registration.py @@ -0,0 +1,57 @@ +"""Tests for registration. + +:Requirement: Registration + +:CaseLevel: Acceptance + +:CaseComponent: Registration + +:CaseAutomation: Automated + +:CaseImportance: Critical + +:Team: Rocket + +:TestType: Functional + +:Upstream: No +""" +from robottelo.utils.datafactory import gen_string + + +def test_positive_verify_default_values_for_global_registration( + module_target_sat, + default_org, +): + """Check for all the Default values pre-populated in the global registration template + + :id: 34122bf3-ae23-47ca-ba3d-da0653d8fd33 + + :expectedresults: Default fields in the form should be auto-populated + e.g. organization, location, rex, insights setup, etc + + :CaseLevel: Component + + :steps: + 1. Check for the default values in the global registration template + """ + module_target_sat.cli_factory.make_activation_key( + {'organization-id': default_org.id, 'name': gen_string('alpha')} + ) + with module_target_sat.ui_session() as session: + cmd = session.host.get_register_command( + full_read=True, + ) + assert cmd['general']['organization'] == 'Default Organization' + assert cmd['general']['location'] == 'Default Location' + assert cmd['general']['capsule'] == 'Nothing to select.' + assert cmd['general']['operating_system'] == '' + assert cmd['general']['host_group'] == 'Nothing to select.' + assert cmd['general']['insecure'] is False + assert cmd['advanced']['setup_rex'] == 'Inherit from host parameter (yes)' + assert cmd['advanced']['setup_insights'] == 'Inherit from host parameter (yes)' + assert cmd['advanced']['token_life_time'] == '4' + assert cmd['advanced']['rex_pull_mode'] == 'Inherit from host parameter (no)' + assert cmd['advanced']['update_packages'] is False + assert cmd['advanced']['ignore_error'] is False + assert cmd['advanced']['force'] is False From 4bbf2ebe6aed3df7a5511b431bdac25af9914db8 Mon Sep 17 00:00:00 2001 From: Shubham Ganar <67952129+shubhamsg199@users.noreply.github.com> Date: Tue, 19 Dec 2023 17:22:03 +0530 Subject: [PATCH 29/93] Component Audit: Check org and loc change on Global Registration form (#13480) Signed-off-by: Shubham Ganar --- tests/foreman/ui/test_registration.py | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tests/foreman/ui/test_registration.py b/tests/foreman/ui/test_registration.py index 1af25fe7a4..552b38aa6f 100644 --- a/tests/foreman/ui/test_registration.py +++ b/tests/foreman/ui/test_registration.py @@ -16,6 +16,8 @@ :Upstream: No """ +import pytest + from robottelo.utils.datafactory import gen_string @@ -55,3 +57,45 @@ def test_positive_verify_default_values_for_global_registration( assert cmd['advanced']['update_packages'] is False assert cmd['advanced']['ignore_error'] is False assert cmd['advanced']['force'] is False + + +@pytest.mark.tier2 +def test_positive_org_loc_change_for_registration( + module_activation_key, + module_org, + module_location, + target_sat, +): + """Changing the organization and location to check if correct org and loc is updated on the global registration page as well as in the command + + :id: e83ed6bc-ceae-4021-87fe-3ecde1cbf347 + + :expectedresults: organization and location is updated correctly on the global registration page as well as in the command. + + :CaseLevel: Component + + :CaseImportance: Medium + """ + new_org = target_sat.api.Organization().create() + new_loc = target_sat.api.Location().create() + target_sat.api.ActivationKey(organization=new_org).create() + with target_sat.ui_session() as session: + session.organization.select(org_name=module_org.name) + session.location.select(loc_name=module_location.name) + cmd = session.host.get_register_command() + expected_pairs = [ + f'organization_id={module_org.id}', + f'location_id={module_location.id}', + ] + for pair in expected_pairs: + assert pair in cmd + # changing the org and loc to check if correct org and loc is updated on the registration command + session.organization.select(org_name=new_org.name) + session.location.select(loc_name=new_loc.name) + cmd = session.host.get_register_command() + expected_pairs = [ + f'organization_id={new_org.id}', + f'location_id={new_loc.id}', + ] + for pair in expected_pairs: + assert pair in cmd From a506ec5885f52b38b7e86ab396e27dee97ae7d78 Mon Sep 17 00:00:00 2001 From: Griffin Sullivan Date: Wed, 13 Dec 2023 13:07:11 -0500 Subject: [PATCH 30/93] Use rsync to copy /var/lib/pulp after satellite-clone --- pytest_fixtures/component/repository.py | 13 +++++++++- tests/foreman/destructive/test_clone.py | 34 ++++++++++++++++--------- 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/pytest_fixtures/component/repository.py b/pytest_fixtures/component/repository.py index fd9ba01b88..6a1c43af10 100644 --- a/pytest_fixtures/component/repository.py +++ b/pytest_fixtures/component/repository.py @@ -4,7 +4,8 @@ from nailgun.entity_mixins import call_entity_method_with_timeout import pytest -from robottelo.constants import DEFAULT_ARCHITECTURE, PRDS, REPOS, REPOSET +from robottelo.config import settings +from robottelo.constants import DEFAULT_ARCHITECTURE, DEFAULT_ORG, PRDS, REPOS, REPOSET @pytest.fixture(scope='module') @@ -102,6 +103,16 @@ def module_repository(os_path, module_product, module_target_sat): return repo +@pytest.fixture +def custom_synced_repo(target_sat): + custom_repo = target_sat.api.Repository( + product=target_sat.api.Product(organization=DEFAULT_ORG).create(), + url=settings.repos.yum_0.url, + ).create() + custom_repo.sync() + return custom_repo + + def _simplify_repos(request, repos): """This is a helper function that transforms repos_collection related fixture parameters into a list that can be passed to robottelo.host_helpers.RepositoryMixins.RepositoryCollection diff --git a/tests/foreman/destructive/test_clone.py b/tests/foreman/destructive/test_clone.py index 60dfc31ca2..f29fd0d22c 100644 --- a/tests/foreman/destructive/test_clone.py +++ b/tests/foreman/destructive/test_clone.py @@ -29,7 +29,9 @@ @pytest.mark.e2e @pytest.mark.parametrize('backup_type', ['online', 'offline']) @pytest.mark.parametrize('skip_pulp', [False, True], ids=['include_pulp', 'skip_pulp']) -def test_positive_clone_backup(target_sat, sat_ready_rhel, backup_type, skip_pulp): +def test_positive_clone_backup( + target_sat, sat_ready_rhel, backup_type, skip_pulp, custom_synced_repo +): """Make an online/offline backup with/without pulp data of Satellite and clone it (restore it). :id: 5b9182d5-6789-4d2c-bcc3-6641b96ab277 @@ -45,13 +47,15 @@ def test_positive_clone_backup(target_sat, sat_ready_rhel, backup_type, skip_pul :parametrized: yes - :BZ: 2142514 + :BZ: 2142514, 2013776 :customerscenario: true """ rhel_version = sat_ready_rhel._v_major sat_version = 'stream' if target_sat.is_stream else target_sat.version + pulp_artifact_len = len(target_sat.execute('ls /var/lib/pulp/media/artifact').stdout) + # SATELLITE PART - SOURCE SERVER # Enabling and starting services assert target_sat.cli.Service.enable().status == 0 @@ -66,16 +70,6 @@ def test_positive_clone_backup(target_sat, sat_ready_rhel, backup_type, skip_pul assert backup_result.status == 0 sat_backup_dir = backup_result.stdout.strip().split()[-2] - if skip_pulp: - # Copying satellite pulp data to target RHEL - assert sat_ready_rhel.execute('mkdir -p /var/lib/pulp').status == 0 - assert ( - target_sat.execute( - f'''sshpass -p "{SSH_PASS}" scp -o StrictHostKeyChecking=no \ - -r /var/lib/pulp root@{sat_ready_rhel.hostname}:/var/lib/pulp/pulp''' - ).status - == 0 - ) # Copying satellite backup to target RHEL assert ( target_sat.execute( @@ -118,6 +112,22 @@ def test_positive_clone_backup(target_sat, sat_ready_rhel, backup_type, skip_pul cloned_sat = Satellite(sat_ready_rhel.hostname) assert cloned_sat.cli.Health.check().status == 0 + # If --skip-pulp-data make sure you can rsync /var/lib/pulp over per BZ#2013776 + if skip_pulp: + # Copying satellite pulp data to target RHEL + assert ( + target_sat.execute( + f'sshpass -p "{SSH_PASS}" rsync -e "ssh -o StrictHostKeyChecking=no" --archive --partial --progress --compress ' + f'/var/lib/pulp root@{sat_ready_rhel.hostname}:/var/lib/' + ).status + == 0 + ) + + # Make sure all of the pulp data that was on the original Satellite is on the clone + assert ( + len(sat_ready_rhel.execute('ls /var/lib/pulp/media/artifact').stdout) == pulp_artifact_len + ) + @pytest.mark.pit_server def test_positive_list_tasks(target_sat): From 0665208cc9de112ab04e72e7d330513019768997 Mon Sep 17 00:00:00 2001 From: vijaysawant Date: Thu, 14 Dec 2023 19:45:47 +0530 Subject: [PATCH 31/93] fix server config from user and role test module --- tests/foreman/api/test_role.py | 50 ++++++++++++++++++---------------- tests/foreman/api/test_user.py | 20 ++++++++------ 2 files changed, 38 insertions(+), 32 deletions(-) diff --git a/tests/foreman/api/test_role.py b/tests/foreman/api/test_role.py index df0bc67771..da880c71f5 100644 --- a/tests/foreman/api/test_role.py +++ b/tests/foreman/api/test_role.py @@ -587,7 +587,7 @@ def test_negative_access_entities_from_org_admin( sc = self.user_config(user, target_sat) # Getting the domain from user with pytest.raises(HTTPError): - target_sat.api.Domain(sc, id=domain.id).read() + target_sat.api.Domain(server_config=sc, id=domain.id).read() @pytest.mark.tier3 def test_negative_access_entities_from_user( @@ -620,7 +620,7 @@ def test_negative_access_entities_from_user( sc = self.user_config(user, target_sat) # Getting the domain from user with pytest.raises(HTTPError): - target_sat.api.Domain(sc, id=domain.id).read() + target_sat.api.Domain(server_config=sc, id=domain.id).read() @pytest.mark.tier2 def test_positive_override_cloned_role_filter(self, role_taxonomies, target_sat): @@ -1018,13 +1018,13 @@ def test_positive_user_group_users_access_as_org_admin(self, role_taxonomies, ta auth=(login, password), url=target_sat.url, verify=settings.server.verify_ca ) try: - target_sat.api.Domain(sc).search( + target_sat.api.Domain(server_config=sc).search( query={ 'organization-id': role_taxonomies['org'].id, 'location-id': role_taxonomies['loc'].id, } ) - target_sat.api.Subnet(sc).search( + target_sat.api.Subnet(server_config=sc).search( query={ 'organization-id': role_taxonomies['org'].id, 'location-id': role_taxonomies['loc'].id, @@ -1032,8 +1032,8 @@ def test_positive_user_group_users_access_as_org_admin(self, role_taxonomies, ta ) except HTTPError as err: pytest.fail(str(err)) - assert domain.id in [dom.id for dom in target_sat.api.Domain(sc).search()] - assert subnet.id in [sub.id for sub in target_sat.api.Subnet(sc).search()] + assert domain.id in [dom.id for dom in target_sat.api.Domain(server_config=sc).search()] + assert subnet.id in [sub.id for sub in target_sat.api.Subnet(server_config=sc).search()] @pytest.mark.tier3 def test_positive_user_group_users_access_contradict_as_org_admins(self): @@ -1098,7 +1098,7 @@ def test_negative_assign_org_admin_to_user_group( for user in [user_one, user_two]: sc = self.user_config(user, target_sat) with pytest.raises(HTTPError): - target_sat.api.Domain(sc, id=dom.id).read() + target_sat.api.Domain(server_config=sc, id=dom.id).read() @pytest.mark.tier2 def test_negative_assign_taxonomies_by_org_admin( @@ -1149,7 +1149,7 @@ def test_negative_assign_taxonomies_by_org_admin( auth=(user_login, user_pass), url=target_sat.url, verify=settings.server.verify_ca ) # Getting the domain from user1 - dom = target_sat.api.Domain(sc, id=dom.id).read() + dom = target_sat.api.Domain(server_config=sc, id=dom.id).read() dom.organization = [filter_taxonomies['org']] with pytest.raises(HTTPError): dom.update(['organization']) @@ -1319,7 +1319,7 @@ def test_negative_create_roles_by_org_admin(self, role_taxonomies, target_sat): role_name = gen_string('alpha') with pytest.raises(HTTPError): target_sat.api.Role( - sc, + server_config=sc, name=role_name, organization=[role_taxonomies['org']], location=[role_taxonomies['loc']], @@ -1346,7 +1346,7 @@ def test_negative_modify_roles_by_org_admin(self, role_taxonomies, target_sat): ) test_role = target_sat.api.Role().create() sc = self.user_config(user, target_sat) - test_role = target_sat.api.Role(sc, id=test_role.id).read() + test_role = target_sat.api.Role(server_config=sc, id=test_role.id).read() test_role.organization = [role_taxonomies['org']] test_role.location = [role_taxonomies['loc']] with pytest.raises(HTTPError): @@ -1386,7 +1386,7 @@ def test_negative_admin_permissions_to_org_admin(self, role_taxonomies, target_s auth=(user_login, user_pass), url=target_sat.url, verify=settings.server.verify_ca ) with pytest.raises(HTTPError): - target_sat.api.User(sc, id=1).read() + target_sat.api.User(server_config=sc, id=1).read() @pytest.mark.tier2 @pytest.mark.upgrade @@ -1435,7 +1435,7 @@ def test_positive_create_user_by_org_admin(self, role_taxonomies, target_sat): user_login = gen_string('alpha') user_pass = gen_string('alphanumeric') user = target_sat.api.User( - sc_user, + server_config=sc_user, login=user_login, password=user_pass, role=[org_admin.id], @@ -1476,7 +1476,7 @@ def test_positive_access_users_inside_org_admin_taxonomies(self, role_taxonomies test_user = self.create_simple_user(filter_taxos=role_taxonomies) sc = self.user_config(user, target_sat) try: - target_sat.api.User(sc, id=test_user.id).read() + target_sat.api.User(server_config=sc, id=test_user.id).read() except HTTPError as err: pytest.fail(str(err)) @@ -1518,7 +1518,9 @@ def test_positive_create_nested_location(self, role_taxonomies, target_sat): auth=(user_login, user_pass), url=target_sat.url, verify=settings.server.verify_ca ) name = gen_string('alphanumeric') - location = target_sat.api.Location(sc, name=name, parent=role_taxonomies['loc'].id).create() + location = target_sat.api.Location( + server_config=sc, name=name, parent=role_taxonomies['loc'].id + ).create() assert location.name == name @pytest.mark.tier2 @@ -1550,7 +1552,7 @@ def test_negative_access_users_outside_org_admin_taxonomies( test_user = self.create_simple_user(filter_taxos=filter_taxonomies) sc = self.user_config(user, target_sat) with pytest.raises(HTTPError): - target_sat.api.User(sc, id=test_user.id).read() + target_sat.api.User(server_config=sc, id=test_user.id).read() @pytest.mark.tier1 def test_negative_create_taxonomies_by_org_admin(self, role_taxonomies, target_sat): @@ -1586,11 +1588,11 @@ def test_negative_create_taxonomies_by_org_admin(self, role_taxonomies, target_s auth=(user_login, user_pass), url=target_sat.url, verify=settings.server.verify_ca ) with pytest.raises(HTTPError): - target_sat.api.Organization(sc, name=gen_string('alpha')).create() + target_sat.api.Organization(server_config=sc, name=gen_string('alpha')).create() if not is_open("BZ:1825698"): try: loc_name = gen_string('alpha') - loc = target_sat.api.Location(sc, name=loc_name).create() + loc = target_sat.api.Location(server_config=sc, name=loc_name).create() except HTTPError as err: pytest.fail(str(err)) assert loc_name == loc.name @@ -1643,7 +1645,7 @@ def test_positive_access_all_global_entities_by_org_admin( target_sat.api.Errata, target_sat.api.OperatingSystem, ]: - entity(sc).search() + entity(server_config=sc).search() except HTTPError as err: pytest.fail(str(err)) @@ -1684,7 +1686,7 @@ def test_negative_access_entities_from_ldap_org_admin( verify=settings.server.verify_ca, ) with pytest.raises(HTTPError): - target_sat.api.Architecture(sc).search() + target_sat.api.Architecture(server_config=sc).search() user = target_sat.api.User().search( query={'search': f"login={create_ldap['ldap_user_name']}"} )[0] @@ -1692,7 +1694,7 @@ def test_negative_access_entities_from_ldap_org_admin( user.update(['role']) # Trying to access the domain resource created in org admin role with pytest.raises(HTTPError): - target_sat.api.Domain(sc, id=domain.id).read() + target_sat.api.Domain(server_config=sc, id=domain.id).read() @pytest.mark.tier3 def test_negative_access_entities_from_ldap_user( @@ -1729,7 +1731,7 @@ def test_negative_access_entities_from_ldap_user( verify=settings.server.verify_ca, ) with pytest.raises(HTTPError): - target_sat.api.Architecture(sc).search() + target_sat.api.Architecture(server_config=sc).search() user = target_sat.api.User().search( query={'search': f"login={create_ldap['ldap_user_name']}"} )[0] @@ -1737,7 +1739,7 @@ def test_negative_access_entities_from_ldap_user( user.update(['role']) # Trying to access the Domain resource with pytest.raises(HTTPError): - target_sat.api.Domain(sc, id=domain.id).read() + target_sat.api.Domain(server_config=sc, id=domain.id).read() @pytest.mark.tier3 def test_positive_assign_org_admin_to_ldap_user_group( @@ -1800,7 +1802,7 @@ def test_positive_assign_org_admin_to_ldap_user_group( verify=settings.server.verify_ca, ) # Accessing the Domain resource - target_sat.api.Domain(sc, id=domain.id).read() + target_sat.api.Domain(server_config=sc, id=domain.id).read() @pytest.mark.tier3 def test_negative_assign_org_admin_to_ldap_user_group( @@ -1861,7 +1863,7 @@ def test_negative_assign_org_admin_to_ldap_user_group( ) # Trying to access the Domain resource with pytest.raises(HTTPError): - target_sat.api.Domain(sc, id=domain.id).read() + target_sat.api.Domain(server_config=sc, id=domain.id).read() class TestRoleSearchFilter: diff --git a/tests/foreman/api/test_user.py b/tests/foreman/api/test_user.py index 29442aa308..de78386805 100644 --- a/tests/foreman/api/test_user.py +++ b/tests/foreman/api/test_user.py @@ -420,8 +420,12 @@ def test_positive_table_preferences(self, module_target_sat): sc = ServerConfig( auth=(user.login, password), url=module_target_sat.url, verify=settings.server.verify_ca ) - module_target_sat.api.TablePreferences(sc, user=user, name=name, columns=columns).create() - table_preferences = module_target_sat.api.TablePreferences(sc, user=user).search() + module_target_sat.api.TablePreferences( + server_config=sc, user=user, name=name, columns=columns + ).create() + table_preferences = module_target_sat.api.TablePreferences( + server_config=sc, user=user + ).search() assert len(table_preferences) == 1 tp = table_preferences[0] assert hasattr(tp, 'name') @@ -732,7 +736,7 @@ def test_positive_ad_basic_no_roles(self, create_ldap, target_sat): verify=settings.server.verify_ca, ) with pytest.raises(HTTPError): - target_sat.api.Architecture(sc).search() + target_sat.api.Architecture(server_config=sc).search() @pytest.mark.tier3 @pytest.mark.upgrade @@ -783,7 +787,7 @@ def test_positive_access_entities_from_ldap_org_admin(self, create_ldap, module_ verify=settings.server.verify_ca, ) with pytest.raises(HTTPError): - module_target_sat.api.Architecture(sc).search() + module_target_sat.api.Architecture(server_config=sc).search() user = module_target_sat.api.User().search( query={'search': 'login={}'.format(create_ldap['ldap_user_name'])} )[0] @@ -800,7 +804,7 @@ def test_positive_access_entities_from_ldap_org_admin(self, create_ldap, module_ module_target_sat.api.Errata, module_target_sat.api.OperatingSystem, ]: - entity(sc).search() + entity(server_config=sc).search() @pytest.mark.run_in_one_thread @@ -865,7 +869,7 @@ def test_positive_ipa_basic_no_roles(self, create_ldap, target_sat): verify=settings.server.verify_ca, ) with pytest.raises(HTTPError): - target_sat.api.Architecture(sc).search() + target_sat.api.Architecture(server_config=sc).search() @pytest.mark.tier3 @pytest.mark.upgrade @@ -906,7 +910,7 @@ def test_positive_access_entities_from_ipa_org_admin(self, create_ldap, target_s verify=settings.server.verify_ca, ) with pytest.raises(HTTPError): - target_sat.api.Architecture(sc).search() + target_sat.api.Architecture(server_config=sc).search() user = target_sat.api.User().search( query={'search': 'login={}'.format(create_ldap['username'])} )[0] @@ -923,7 +927,7 @@ def test_positive_access_entities_from_ipa_org_admin(self, create_ldap, target_s target_sat.api.Errata, target_sat.api.OperatingSystem, ]: - entity(sc).search() + entity(server_config=sc).search() class TestPersonalAccessToken: From 48735b00ba4b7acbd983bd06e9f2342fbfa08163 Mon Sep 17 00:00:00 2001 From: Gaurav Talreja Date: Tue, 19 Dec 2023 19:44:37 +0530 Subject: [PATCH 32/93] Add negative tests for registration without AK (#13490) Signed-off-by: Gaurav Talreja --- tests/foreman/api/test_registration.py | 14 ++++++++++++++ tests/foreman/cli/test_registration.py | 17 +++++++++++++++++ tests/foreman/ui/test_registration.py | 22 ++++++++++++++++++++++ 3 files changed, 53 insertions(+) diff --git a/tests/foreman/api/test_registration.py b/tests/foreman/api/test_registration.py index dab85fa620..77fd856db1 100644 --- a/tests/foreman/api/test_registration.py +++ b/tests/foreman/api/test_registration.py @@ -20,6 +20,7 @@ from fauxfactory import gen_ipaddr, gen_mac import pytest +from requests import HTTPError from robottelo import constants from robottelo.config import settings @@ -213,3 +214,16 @@ def test_positive_rex_interface_for_global_registration( assert interface['execution'] is True assert interface['ip'] == ip assert interface['mac'] == mac_address + + +@pytest.mark.tier1 +def test_negative_global_registration_without_ak(module_target_sat): + """Attempt to register a host without ActivationKey + + :id: e48a6260-97e0-4234-a69c-77bbbcde85de + + :expectedresults: Generate command is disabled without ActivationKey + """ + with pytest.raises(HTTPError) as context: + module_target_sat.api.RegistrationCommand().create() + assert 'Missing activation key!' in context.value.response.text diff --git a/tests/foreman/cli/test_registration.py b/tests/foreman/cli/test_registration.py index 25b8c0a213..633fbf3be9 100644 --- a/tests/foreman/cli/test_registration.py +++ b/tests/foreman/cli/test_registration.py @@ -20,6 +20,7 @@ from robottelo.config import settings from robottelo.constants import CLIENT_PORT +from robottelo.exceptions import CLIReturnCodeError pytestmark = pytest.mark.tier1 @@ -171,3 +172,19 @@ def test_negative_register_twice(module_ak_with_cv, module_org, rhel_contenthost # host being already registered. assert result.status == 1 assert 'This system is already registered' in str(result.stderr) + + +@pytest.mark.tier1 +def test_negative_global_registration_without_ak(module_target_sat): + """Attempt to register a host without ActivationKey + + :id: e48a6260-97e0-4234-a69c-77bbbcde85df + + :expectedresults: Generate command is disabled without ActivationKey + """ + with pytest.raises(CLIReturnCodeError) as context: + module_target_sat.cli.HostRegistration.generate_command(options=None) + assert ( + 'Failed to generate registration command:\n Missing activation key!' + in context.value.message + ) diff --git a/tests/foreman/ui/test_registration.py b/tests/foreman/ui/test_registration.py index 552b38aa6f..b70bcb4187 100644 --- a/tests/foreman/ui/test_registration.py +++ b/tests/foreman/ui/test_registration.py @@ -16,10 +16,13 @@ :Upstream: No """ +from airgun.exceptions import DisabledWidgetError import pytest from robottelo.utils.datafactory import gen_string +pytestmark = pytest.mark.tier1 + def test_positive_verify_default_values_for_global_registration( module_target_sat, @@ -99,3 +102,22 @@ def test_positive_org_loc_change_for_registration( ] for pair in expected_pairs: assert pair in cmd + + +def test_negative_global_registration_without_ak( + module_target_sat, + module_org, + module_location, +): + """Attempt to register a host without ActivationKey + + :id: 34122bf3-ae23-47ca-ba3d-da0653d8fd36 + + :expectedresults: Generate command is disabled without ActivationKey + """ + with module_target_sat.ui_session() as session: + session.organization.select(org_name=module_org.name) + session.location.select(loc_name=module_location.name) + with pytest.raises(DisabledWidgetError) as context: + session.host.get_register_command() + assert 'Generate registration command button is disabled' in str(context.value) From f169757c65d1daa4e7e83ca81a4445dbfa2b406b Mon Sep 17 00:00:00 2001 From: Jitendra Yejare Date: Wed, 20 Dec 2023 00:05:10 +0530 Subject: [PATCH 33/93] Configurable Ignore list of markers test field in polarion tests (#13492) --- requirements.txt | 2 +- scripts/polarion-test-case-upload.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8737facd92..2cbd392b9b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ # Version updates managed by dependabot -betelgeuse==1.10.0 +betelgeuse==1.11.0 broker[docker]==0.4.1 cryptography==41.0.7 deepdiff==6.7.1 diff --git a/scripts/polarion-test-case-upload.sh b/scripts/polarion-test-case-upload.sh index 987a77d646..888bacb04f 100755 --- a/scripts/polarion-test-case-upload.sh +++ b/scripts/polarion-test-case-upload.sh @@ -74,6 +74,7 @@ TRANSFORM_CUSTOMERSCENARIO_VALUE = default_config._transform_to_lower DEFAULT_CUSTOMERSCENARIO_VALUE = 'false' DEFAULT_REQUIREMENT_TEAM_VALUE = None TRANSFORM_REQUIREMENT_TEAM_VALUE = default_config._transform_to_lower +MARKERS_IGNORE_LIST = ['parametrize', 'skip.*', 'usefixtures', 'rhel_ver_.*'] EOF set -x From 1f59e24c2f146a012428f577ba24ed4811d74b7b Mon Sep 17 00:00:00 2001 From: Vladimir Sedmik Date: Wed, 20 Dec 2023 11:39:53 +0100 Subject: [PATCH 34/93] Bring back changes reverted by #11544 --- tests/foreman/cli/test_satellitesync.py | 69 +------------------------ 1 file changed, 1 insertion(+), 68 deletions(-) diff --git a/tests/foreman/cli/test_satellitesync.py b/tests/foreman/cli/test_satellitesync.py index 0251b4901e..aa66074830 100644 --- a/tests/foreman/cli/test_satellitesync.py +++ b/tests/foreman/cli/test_satellitesync.py @@ -101,23 +101,6 @@ def function_import_org_with_manifest(target_sat, function_import_org): return function_import_org -@pytest.fixture(scope='class') -def docker_repo(module_target_sat, module_org): - product = module_target_sat.cli_factory.make_product({'organization-id': module_org.id}) - repo = module_target_sat.cli_factory.make_repository( - { - 'organization-id': module_org.id, - 'product-id': product['id'], - 'content-type': REPO_TYPE['docker'], - 'download-policy': 'immediate', - 'url': 'https://quay.io', - 'docker-upstream-name': 'quay/busybox', - } - ) - module_target_sat.cli.Repository.synchronize({'id': repo['id']}) - return repo - - @pytest.fixture(scope='module') def module_synced_custom_repo(module_target_sat, module_org, module_product): repo = module_target_sat.cli_factory.make_repository( @@ -1224,6 +1207,7 @@ def test_postive_export_cv_with_mixed_content_repos( :BZ: 1726457 :customerscenario: true + """ content_view = target_sat.cli_factory.make_content_view( {'organization-id': function_org.id} @@ -1253,57 +1237,6 @@ def test_postive_export_cv_with_mixed_content_repos( exported_packages = target_sat.cli.Package.list( {'content-view-version-id': exporting_cvv['id']} ) - product = target_sat.cli_factory.make_product( - { - 'organization-id': function_org.id, - 'name': gen_string('alpha'), - } - ) - nonyum_repo = target_sat.cli_factory.make_repository( - { - 'content-type': 'docker', - 'docker-upstream-name': 'quay/busybox', - 'organization-id': function_org.id, - 'product-id': product['id'], - 'url': CONTAINER_REGISTRY_HUB, - }, - ) - target_sat.cli.Repository.synchronize({'id': nonyum_repo['id']}) - yum_repo = target_sat.cli_factory.make_repository( - { - 'name': gen_string('alpha'), - 'download-policy': 'immediate', - 'mirroring-policy': 'mirror_content_only', - 'product-id': product['id'], - } - ) - target_sat.cli.Repository.synchronize({'id': yum_repo['id']}) - content_view = target_sat.cli_factory.make_content_view( - {'organization-id': function_org.id} - ) - # Add docker and yum repo - target_sat.cli.ContentView.add_repository( - { - 'id': content_view['id'], - 'organization-id': function_org.id, - 'repository-id': nonyum_repo['id'], - } - ) - target_sat.cli.ContentView.add_repository( - { - 'id': content_view['id'], - 'organization-id': function_org.id, - 'repository-id': yum_repo['id'], - } - ) - target_sat.cli.ContentView.publish({'id': content_view['id']}) - exporting_cv_id = target_sat.cli.ContentView.info({'id': content_view['id']}) - assert len(exporting_cv_id['versions']) == 1 - exporting_cvv_id = exporting_cv_id['versions'][0] - # check packages - exported_packages = target_sat.cli.Package.list( - {'content-view-version-id': exporting_cvv_id['id']} - ) assert len(exported_packages) # Verify export directory is empty assert target_sat.validate_pulp_filepath(function_org, PULP_EXPORT_DIR) == '' From bc2f2cb47f1d26caf45543e182507862a466e1cf Mon Sep 17 00:00:00 2001 From: Shubham Ganar <67952129+shubhamsg199@users.noreply.github.com> Date: Wed, 20 Dec 2023 17:54:58 +0530 Subject: [PATCH 35/93] Add Stubbed test for realm provisioning (#13524) Signed-off-by: Shubham Ganar --- tests/foreman/api/test_provisioning.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/foreman/api/test_provisioning.py b/tests/foreman/api/test_provisioning.py index cf2227625b..e4fb14b5a5 100644 --- a/tests/foreman/api/test_provisioning.py +++ b/tests/foreman/api/test_provisioning.py @@ -585,3 +585,24 @@ def test_rhel_pxe_provisioning_fips_enabled( # assert that the host is subscribed and consumes # subsctiption provided by the activation key assert provisioning_host.subscribed, 'Host is not subscribed' + + +@pytest.mark.stubbed +def test_rhel_provisioning_using_realm(): + """Provision a host using realm + + :id: 687e7d71-7e46-46d5-939b-4562f88c4598 + + :steps: + 1. Configure satellite for provisioning + 2. Configure Satellite for Realm support + 3. Provision a Host + 4. Check host is subscribed to Satellite + + :expectedresults: + 1. Provisioning via Realm is successful + 2. Check if the provisioned host is automatically registered to IdM + 3. Host installs right version of RHEL + 4. Satellite is able to run REX job on the host + 5. Host is registered to Satellite and subscription status is 'Success' + """ From 80e6ba456b9ae6f4b6171033975d5c94429b3acd Mon Sep 17 00:00:00 2001 From: Gaurav Talreja Date: Wed, 20 Dec 2023 18:36:24 +0530 Subject: [PATCH 36/93] Add coverage for rex pull mode provisioning snippet (#13518) Signed-off-by: Gaurav Talreja --- .../foreman/api/test_provisioningtemplate.py | 63 ++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/tests/foreman/api/test_provisioningtemplate.py b/tests/foreman/api/test_provisioningtemplate.py index ba0574489b..b154eaa4e8 100644 --- a/tests/foreman/api/test_provisioningtemplate.py +++ b/tests/foreman/api/test_provisioningtemplate.py @@ -581,7 +581,7 @@ def test_positive_template_check_rex_snippet( :steps: 1. Create a host by setting host params remote_execution_ssh_user, remote_execution_create_user, remote_execution_effective_user_method and remote_execution_ssh_keys - 2. Read the provision templete to verify host params + 2. Read the provision template to verify host params :expectedresults: The rendered template has the host params set and correct home directory permissions for the rex user. @@ -641,6 +641,67 @@ def test_positive_template_check_rex_snippet( ) assert ssh_key in rex_snippet + @pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True) + def test_positive_template_check_rex_pull_mode_snippet( + self, + module_sync_kickstart_content, + module_target_sat, + module_provisioning_capsule, + module_sca_manifest_org, + module_location, + module_default_org_view, + module_lce_library, + default_architecture, + default_partitiontable, + ): + """Read the provision template and verify the host params and REX pull mode snippet rendered correctly. + + :id: e5212c46-d269-4bce-8e03-9d00c086e69m + + :steps: + 1. Create a host by setting host param enable-remote-execution-pull/host_registration_remote_execution_pull + 2. Read the template to verify the host param and REX pull mode snippet for respective rhel hosts + + :expectedresults: The rendered template has the host params set and correct home directory permissions for the rex user + + :parametrized: yes + """ + host = module_target_sat.api.Host( + organization=module_sca_manifest_org, + location=module_location, + name=gen_string('alpha').lower(), + mac=gen_mac(multicast=False), + operatingsystem=module_sync_kickstart_content.os, + architecture=default_architecture, + domain=module_sync_kickstart_content.domain, + root_pass=settings.provisioning.host_root_password, + ptable=default_partitiontable, + host_parameters_attributes=[ + { + 'name': 'host_registration_remote_execution_pull', + 'value': True, + 'parameter_type': 'boolean', + }, + { + 'name': 'enable-remote-execution-pull', + 'value': True, + 'parameter_type': 'boolean', + }, + ], + ).create() + rex_snippet = host.read_template(data={'template_kind': 'provision'})['template'] + assert 'chmod +x /root/remote_execution_pull_setup.sh' in rex_snippet + + rex_snippet = host.read_template(data={'template_kind': 'host_init_config'})['template'] + assert 'Starting deployment of REX pull provider' in rex_snippet + pkg_manager = 'yum' if module_sync_kickstart_content.rhel_ver < 8 else 'dnf' + assert f'{pkg_manager} -y install foreman_ygg_worker' in rex_snippet + assert 'broker = ["mqtts://$SERVER_NAME:1883"]' in rex_snippet + assert 'systemctl try-restart yggdrasild' in rex_snippet + assert 'systemctl enable --now yggdrasild' in rex_snippet + assert 'yggdrasil status' in rex_snippet + assert 'Remote execution pull provider successfully configured!' in rex_snippet + @pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True) def test_positive_template_check_fips_enabled( self, From 8d0d3ff5633437599ba386ab432e7d6aad05ed39 Mon Sep 17 00:00:00 2001 From: Jitendra Yejare Date: Thu, 21 Dec 2023 14:25:08 +0530 Subject: [PATCH 37/93] Corrected Req for AuditLog (#13516) --- tests/foreman/api/test_audit.py | 2 +- tests/foreman/ui/test_audit.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/foreman/api/test_audit.py b/tests/foreman/api/test_audit.py index 1eff8e5e59..85bcec9bd7 100644 --- a/tests/foreman/api/test_audit.py +++ b/tests/foreman/api/test_audit.py @@ -1,6 +1,6 @@ """Tests for audit functionality. -:Requirement: Audit +:Requirement: AuditLog :CaseAutomation: Automated diff --git a/tests/foreman/ui/test_audit.py b/tests/foreman/ui/test_audit.py index ca506d2129..822f7bcb1b 100644 --- a/tests/foreman/ui/test_audit.py +++ b/tests/foreman/ui/test_audit.py @@ -1,6 +1,6 @@ """Test class for Audit UI -:Requirement: Audit +:Requirement: AuditLog :CaseAutomation: Automated From 5ecedf15e4a81a24a106ea881bd35abdc9202c78 Mon Sep 17 00:00:00 2001 From: Shubham Ganar <67952129+shubhamsg199@users.noreply.github.com> Date: Fri, 22 Dec 2023 02:44:32 +0530 Subject: [PATCH 38/93] Mark Provisioning tests for upgrade (#13542) Signed-off-by: Shubham Ganar --- tests/foreman/api/test_provisioning.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/foreman/api/test_provisioning.py b/tests/foreman/api/test_provisioning.py index e4fb14b5a5..081a5e0a04 100644 --- a/tests/foreman/api/test_provisioning.py +++ b/tests/foreman/api/test_provisioning.py @@ -65,6 +65,7 @@ def assert_host_logs(channel, pattern): @pytest.mark.e2e +@pytest.mark.upgrade @pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True) @pytest.mark.on_premises_provisioning @pytest.mark.rhel_ver_match('[^6]') @@ -196,6 +197,7 @@ def test_rhel_pxe_provisioning( @pytest.mark.e2e +@pytest.mark.upgrade @pytest.mark.parametrize('pxe_loader', ['ipxe'], indirect=True) @pytest.mark.on_premises_provisioning @pytest.mark.rhel_ver_match('[^6]') @@ -325,6 +327,7 @@ def test_rhel_ipxe_provisioning( @pytest.mark.skip_if_open("BZ:2242925") @pytest.mark.e2e +@pytest.mark.upgrade @pytest.mark.parametrize('pxe_loader', ['http_uefi'], indirect=True) @pytest.mark.on_premises_provisioning @pytest.mark.rhel_ver_match('[^6]') From d0c8193677bf71faa4c464811869136202fcbc33 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Dec 2023 22:18:27 -0500 Subject: [PATCH 39/93] Bump lewagon/wait-on-check-action from 1.3.1 to 1.3.3 (#13548) --- .github/workflows/auto_cherry_pick_merge.yaml | 2 +- .github/workflows/dependency_merge.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto_cherry_pick_merge.yaml b/.github/workflows/auto_cherry_pick_merge.yaml index 924bc9fccf..0f0e9e33b3 100644 --- a/.github/workflows/auto_cherry_pick_merge.yaml +++ b/.github/workflows/auto_cherry_pick_merge.yaml @@ -40,7 +40,7 @@ jobs: - name: Wait for other status checks to Pass id: waitforstatuschecks - uses: lewagon/wait-on-check-action@v1.3.1 + uses: lewagon/wait-on-check-action@v1.3.3 with: ref: ${{ github.head_ref }} repo-token: ${{ secrets.CHERRYPICK_PAT }} diff --git a/.github/workflows/dependency_merge.yml b/.github/workflows/dependency_merge.yml index be56def899..90aeb7a9bc 100644 --- a/.github/workflows/dependency_merge.yml +++ b/.github/workflows/dependency_merge.yml @@ -51,7 +51,7 @@ jobs: - name: Wait for other status checks to Pass id: waitforstatuschecks - uses: lewagon/wait-on-check-action@v1.3.1 + uses: lewagon/wait-on-check-action@v1.3.3 with: ref: ${{ github.head_ref }} repo-token: ${{ secrets.CHERRYPICK_PAT }} From bf97bdb2202c615281057b8f6707df9efe8fade2 Mon Sep 17 00:00:00 2001 From: vijay sawant Date: Fri, 22 Dec 2023 20:10:59 +0530 Subject: [PATCH 40/93] fix cli errata tests and update cli factory method (#13505) --- robottelo/host_helpers/cli_factory.py | 23 +++++++++++++---------- tests/foreman/cli/test_errata.py | 25 ++++++++++++------------- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/robottelo/host_helpers/cli_factory.py b/robottelo/host_helpers/cli_factory.py index 3a4fd4e627..7ff8eb086e 100644 --- a/robottelo/host_helpers/cli_factory.py +++ b/robottelo/host_helpers/cli_factory.py @@ -691,7 +691,7 @@ def _setup_org_for_a_rh_repo(self, options=None): 1. Checks if organization and lifecycle environment were given, otherwise creates new ones. - 2. Clones and uploads manifest. + 2. If manifest does not exist, clone and upload it. 3. Enables RH repo and synchronizes it. 4. Checks if content view was given, otherwise creates a new one and - adds the RH repo @@ -717,15 +717,13 @@ def _setup_org_for_a_rh_repo(self, options=None): env_id = self.make_lifecycle_environment({'organization-id': org_id})['id'] else: env_id = options['lifecycle-environment-id'] - # Clone manifest and upload it - with clone() as manifest: - self._satellite.put(manifest.path, manifest.name) - try: - self._satellite.cli.Subscription.upload( - {'file': manifest.name, 'organization-id': org_id} - ) - except CLIReturnCodeError as err: - raise CLIFactoryError(f'Failed to upload manifest\n{err.msg}') + # If manifest does not exist, clone and upload it + if len(self._satellite.cli.Subscription.exists({'organization-id': org_id})) == 0: + with clone() as manifest: + try: + self._satellite.upload_manifest(org_id, manifest.content) + except CLIReturnCodeError as err: + raise CLIFactoryError(f'Failed to upload manifest\n{err.msg}') # Enable repo from Repository Set try: self._satellite.cli.RepositorySet.enable( @@ -820,6 +818,11 @@ def _setup_org_for_a_rh_repo(self, options=None): ), } ) + # Override RHST product to true ( turned off by default in 6.14 ) + rhel_repo = self._satellite.cli.Repository.info({'id': rhel_repo['id']}) + self._satellite.cli.ActivationKey.content_override( + {'id': activationkey_id, 'content-label': rhel_repo['content-label'], 'value': 'true'} + ) return { 'activationkey-id': activationkey_id, 'content-view-id': cv_id, diff --git a/tests/foreman/cli/test_errata.py b/tests/foreman/cli/test_errata.py index e5e0a57814..d7a90b34c5 100644 --- a/tests/foreman/cli/test_errata.py +++ b/tests/foreman/cli/test_errata.py @@ -134,16 +134,14 @@ def products_with_repos(orgs, module_target_sat): @pytest.fixture(scope='module') -def rh_repo( - module_entitlement_manifest_org, module_lce, module_cv, module_ak_cv_lce, module_target_sat -): +def rh_repo(module_sca_manifest_org, module_lce, module_cv, module_ak_cv_lce, module_target_sat): """Add a subscription for the Satellite Tools repo to activation key.""" module_target_sat.cli_factory.setup_org_for_a_rh_repo( { 'product': PRDS['rhel'], 'repository-set': REPOSET['rhst7'], 'repository': REPOS['rhst7']['name'], - 'organization-id': module_entitlement_manifest_org.id, + 'organization-id': module_sca_manifest_org.id, 'content-view-id': module_cv.id, 'lifecycle-environment-id': module_lce.id, 'activationkey-id': module_ak_cv_lce.id, @@ -153,13 +151,13 @@ def rh_repo( @pytest.fixture(scope='module') def custom_repo( - module_entitlement_manifest_org, module_lce, module_cv, module_ak_cv_lce, module_target_sat + module_sca_manifest_org, module_lce, module_cv, module_ak_cv_lce, module_target_sat ): """Create custom repo and add a subscription to activation key.""" module_target_sat.cli_factory.setup_org_for_a_custom_repo( { 'url': REPO_WITH_ERRATA['url'], - 'organization-id': module_entitlement_manifest_org.id, + 'organization-id': module_sca_manifest_org.id, 'content-view-id': module_cv.id, 'lifecycle-environment-id': module_lce.id, 'activationkey-id': module_ak_cv_lce.id, @@ -377,7 +375,7 @@ def filter_sort_errata(sat, org, sort_by_date='issued', filter_by_org=None): # Build a sorted errata info list, which also contains the sort field. errata_internal_ids = [errata['id'] for errata in errata_list] sorted_errata_info = get_sorted_errata_info_by_id( - errata_internal_ids, sort_by=sort_by_date, sort_reversed=sort_reversed + sat, errata_internal_ids, sort_by=sort_by_date, sort_reversed=sort_reversed ) sort_field_values = [errata[sort_by_date] for errata in sorted_errata_info] @@ -933,7 +931,7 @@ def cleanup(): ids=('org_id', 'org_name', 'org_label', 'no_org_filter'), ) def test_positive_list_filter_by_org_sort_by_date( - module_entitlement_manifest_org, rh_repo, custom_repo, filter_by_org, sort_by_date + module_sca_manifest_org, rh_repo, custom_repo, filter_by_org, sort_by_date, module_target_sat ): """Filter by organization and sort by date. @@ -950,7 +948,8 @@ def test_positive_list_filter_by_org_sort_by_date( :expectedresults: Errata are filtered by org and sorted by date. """ filter_sort_errata( - module_entitlement_manifest_org, + sat=module_target_sat, + org=module_sca_manifest_org, sort_by_date=sort_by_date, filter_by_org=filter_by_org, ) @@ -1079,7 +1078,7 @@ def test_positive_list_filter_by_org(target_sat, products_with_repos, filter_by_ @pytest.mark.run_in_one_thread @pytest.mark.tier3 -def test_positive_list_filter_by_cve(module_entitlement_manifest_org, rh_repo, target_sat): +def test_positive_list_filter_by_cve(module_sca_manifest_org, rh_repo, target_sat): """Filter errata by CVE :id: 7791137c-95a7-4518-a56b-766a5680c5fb @@ -1094,7 +1093,7 @@ def test_positive_list_filter_by_cve(module_entitlement_manifest_org, rh_repo, t target_sat.cli.RepositorySet.enable( { 'name': REPOSET['rhva6'], - 'organization-id': module_entitlement_manifest_org.id, + 'organization-id': module_sca_manifest_org.id, 'product': PRDS['rhel'], 'releasever': '6Server', 'basearch': 'x86_64', @@ -1103,14 +1102,14 @@ def test_positive_list_filter_by_cve(module_entitlement_manifest_org, rh_repo, t target_sat.cli.Repository.synchronize( { 'name': REPOS['rhva6']['name'], - 'organization-id': module_entitlement_manifest_org.id, + 'organization-id': module_sca_manifest_org.id, 'product': PRDS['rhel'], } ) repository_info = target_sat.cli.Repository.info( { 'name': REPOS['rhva6']['name'], - 'organization-id': module_entitlement_manifest_org.id, + 'organization-id': module_sca_manifest_org.id, 'product': PRDS['rhel'], } ) From ff9a765adbf2ce5c0e9b2d69fc9f56d017ccd281 Mon Sep 17 00:00:00 2001 From: Shubham Ganar <67952129+shubhamsg199@users.noreply.github.com> Date: Tue, 26 Dec 2023 18:21:53 +0530 Subject: [PATCH 41/93] Add Capsule Provisioning test (#13241) Signed-off-by: Shubham Ganar Signed-off-by: Gaurav Talreja --- conftest.py | 1 + .../component/provision_capsule_pxe.py | 272 ++++++++++++++++++ pytest_plugins/fixture_markers.py | 1 + tests/foreman/api/test_provisioning.py | 125 ++++++++ 4 files changed, 399 insertions(+) create mode 100644 pytest_fixtures/component/provision_capsule_pxe.py diff --git a/conftest.py b/conftest.py index 234e3b9eaa..42682d7624 100644 --- a/conftest.py +++ b/conftest.py @@ -52,6 +52,7 @@ 'pytest_fixtures.component.provision_gce', 'pytest_fixtures.component.provision_libvirt', 'pytest_fixtures.component.provision_pxe', + 'pytest_fixtures.component.provision_capsule_pxe', 'pytest_fixtures.component.provision_vmware', 'pytest_fixtures.component.provisioning_template', 'pytest_fixtures.component.puppet', diff --git a/pytest_fixtures/component/provision_capsule_pxe.py b/pytest_fixtures/component/provision_capsule_pxe.py new file mode 100644 index 0000000000..4e3a3a2cf5 --- /dev/null +++ b/pytest_fixtures/component/provision_capsule_pxe.py @@ -0,0 +1,272 @@ +import ipaddress + +from box import Box +from broker import Broker +from fauxfactory import gen_string +from packaging.version import Version +import pytest + +from robottelo import constants +from robottelo.config import settings + + +@pytest.fixture(scope='module') +def capsule_provisioning_sat( + request, + module_target_sat, + module_sca_manifest_org, + module_location, + module_capsule_configured, +): + """ + This fixture sets up the Satellite for PXE provisioning. + It calls a workflow using broker to set up the network and to run satellite-installer. + It uses the artifacts from the workflow to create all the necessary Satellite entities + that are later used by the tests. + """ + # Assign org and loc + capsule = module_capsule_configured.nailgun_smart_proxy + capsule.location = [module_location] + capsule.update(['location']) + capsule.organization = [module_sca_manifest_org] + capsule.update(['organization']) + + provisioning_type = getattr(request, 'param', '') + sat = module_target_sat + provisioning_domain_name = f"{gen_string('alpha').lower()}.foo" + broker_data_out = Broker().execute( + workflow='configure-install-sat-provisioning-rhv', + artifacts='last', + target_vlan_id=settings.provisioning.vlan_id, + target_host=module_capsule_configured.name, + provisioning_dns_zone=provisioning_domain_name, + sat_version='stream' if sat.is_stream else sat.version, + deploy_scenario='capsule', + ) + + broker_data_out = Box(**broker_data_out['data_out']) + provisioning_interface = ipaddress.ip_interface(broker_data_out.provisioning_addr_ipv4) + provisioning_network = provisioning_interface.network + # TODO: investigate DNS setup issue on Satellite, + # we might need to set up Sat's DNS server as the primary one on the Sat host + provisioning_upstream_dns_primary = ( + broker_data_out.provisioning_upstream_dns.pop() + ) # There should always be at least one upstream DNS + provisioning_upstream_dns_secondary = ( + broker_data_out.provisioning_upstream_dns.pop() + if len(broker_data_out.provisioning_upstream_dns) + else None + ) + domain = sat.api.Domain( + location=[module_location], + organization=[module_sca_manifest_org], + dns=capsule.id, + name=provisioning_domain_name, + ).create() + + subnet = sat.api.Subnet( + location=[module_location], + organization=[module_sca_manifest_org], + network=str(provisioning_network.network_address), + mask=str(provisioning_network.netmask), + gateway=broker_data_out.provisioning_gw_ipv4, + from_=broker_data_out.provisioning_host_range_start, + to=broker_data_out.provisioning_host_range_end, + dns_primary=provisioning_upstream_dns_primary, + dns_secondary=provisioning_upstream_dns_secondary, + boot_mode='DHCP', + ipam='DHCP', + dhcp=capsule.id, + tftp=capsule.id, + template=capsule.id, + dns=capsule.id, + httpboot=capsule.id, + # discovery=capsule.id, + remote_execution_proxy=[capsule.id], + domain=[domain.id], + ).create() + + return Box( + sat=sat, + domain=domain, + subnet=subnet, + provisioning_type=provisioning_type, + broker_data=broker_data_out, + ) + + +@pytest.fixture(scope='module') +def capsule_provisioning_lce_sync_setup(module_capsule_configured, module_lce_library): + """This fixture adds the lifecycle environment to the capsule and syncs the content""" + module_capsule_configured.nailgun_capsule.content_add_lifecycle_environment( + data={'environment_id': module_lce_library.id} + ) + sync_status = module_capsule_configured.nailgun_capsule.content_sync(timeout=600) + assert sync_status['result'] == 'success', 'Capsule sync task failed.' + + +@pytest.fixture +def capsule_provisioning_hostgroup( + module_target_sat, + capsule_provisioning_sat, + module_sca_manifest_org, + module_location, + default_architecture, + capsule_provisioning_rhel_content, + module_lce_library, + default_partitiontable, + pxe_loader, + module_capsule_configured, +): + capsule = module_capsule_configured.nailgun_smart_proxy + provisioning_ip = capsule_provisioning_sat.broker_data.provisioning_addr_ipv4 + provisioning_ip = ipaddress.ip_interface(provisioning_ip).ip + return capsule_provisioning_sat.sat.api.HostGroup( + organization=[module_sca_manifest_org], + location=[module_location], + architecture=default_architecture, + domain=capsule_provisioning_sat.domain, + content_source=capsule.id, + content_view=capsule_provisioning_rhel_content.cv, + kickstart_repository=capsule_provisioning_rhel_content.ksrepo, + lifecycle_environment=module_lce_library, + root_pass=settings.provisioning.host_root_password, + operatingsystem=capsule_provisioning_rhel_content.os, + ptable=default_partitiontable, + subnet=capsule_provisioning_sat.subnet, + pxe_loader=pxe_loader.pxe_loader, + group_parameters_attributes=[ + { + 'name': 'remote_execution_ssh_keys', + 'parameter_type': 'string', + 'value': settings.provisioning.host_ssh_key_pub, + }, + # assign AK in order the hosts to be subscribed + { + 'name': 'kt_activation_keys', + 'parameter_type': 'string', + 'value': capsule_provisioning_rhel_content.ak.name, + }, + { + 'name': 'http_proxy', + 'parameter_type': 'string', + 'value': str(provisioning_ip), + }, + { + 'name': 'http_proxy_port', + 'parameter_type': 'string', + 'value': '80', + }, + ], + ).create() + + +@pytest.fixture(scope='module') +def capsule_provisioning_rhel_content( + request, + capsule_provisioning_sat, + module_sca_manifest_org, + module_lce_library, +): + """ + This fixture sets up kickstart repositories for a specific RHEL version + that is specified in `request.param`. + """ + sat = capsule_provisioning_sat.sat + rhel_ver = request.param + repo_names = [] + if int(rhel_ver) <= 7: + repo_names.append(f'rhel{rhel_ver}') + else: + repo_names.append(f'rhel{rhel_ver}_bos') + repo_names.append(f'rhel{rhel_ver}_aps') + rh_repos = [] + tasks = [] + rh_repo_id = "" + content_view = sat.api.ContentView(organization=module_sca_manifest_org).create() + + # Custom Content for Client repo + custom_product = sat.api.Product( + organization=module_sca_manifest_org, name=f'rhel{rhel_ver}_{gen_string("alpha")}' + ).create() + client_repo = sat.api.Repository( + organization=module_sca_manifest_org, + product=custom_product, + content_type='yum', + url=settings.repos.SATCLIENT_REPO[f'rhel{rhel_ver}'], + ).create() + task = client_repo.sync(synchronous=False) + tasks.append(task) + content_view.repository = [client_repo] + + for name in repo_names: + rh_kickstart_repo_id = sat.api_factory.enable_rhrepo_and_fetchid( + basearch=constants.DEFAULT_ARCHITECTURE, + org_id=module_sca_manifest_org.id, + product=constants.REPOS['kickstart'][name]['product'], + repo=constants.REPOS['kickstart'][name]['name'], + reposet=constants.REPOS['kickstart'][name]['reposet'], + releasever=constants.REPOS['kickstart'][name]['version'], + ) + # do not sync content repos for discovery based provisioning. + if not capsule_provisioning_sat.provisioning_type == 'discovery': + rh_repo_id = sat.api_factory.enable_rhrepo_and_fetchid( + basearch=constants.DEFAULT_ARCHITECTURE, + org_id=module_sca_manifest_org.id, + product=constants.REPOS[name]['product'], + repo=constants.REPOS[name]['name'], + reposet=constants.REPOS[name]['reposet'], + releasever=constants.REPOS[name]['releasever'], + ) + + # Sync step because repo is not synced by default + for repo_id in [rh_kickstart_repo_id, rh_repo_id]: + if repo_id: + rh_repo = sat.api.Repository(id=repo_id).read() + task = rh_repo.sync(synchronous=False) + tasks.append(task) + rh_repos.append(rh_repo) + content_view.repository.append(rh_repo) + content_view.update(['repository']) + for task in tasks: + sat.wait_for_tasks( + search_query=(f'id = {task["id"]}'), + poll_timeout=2500, + ) + task_status = sat.api.ForemanTask(id=task['id']).poll() + assert task_status['result'] == 'success' + rhel_xy = Version( + constants.REPOS['kickstart'][f'rhel{rhel_ver}']['version'] + if rhel_ver == 7 + else constants.REPOS['kickstart'][f'rhel{rhel_ver}_bos']['version'] + ) + o_systems = sat.api.OperatingSystem().search( + query={'search': f'family=Redhat and major={rhel_xy.major} and minor={rhel_xy.minor}'} + ) + assert o_systems, f'Operating system RHEL {rhel_xy} was not found' + os = o_systems[0].read() + # return only the first kickstart repo - RHEL X KS or RHEL X BaseOS KS + ksrepo = rh_repos[0] + publish = content_view.publish() + task_status = sat.wait_for_tasks( + search_query=(f'Actions::Katello::ContentView::Publish and id = {publish["id"]}'), + search_rate=15, + max_tries=10, + ) + assert task_status[0].result == 'success' + content_view = sat.api.ContentView( + organization=module_sca_manifest_org, name=content_view.name + ).search()[0] + ak = sat.api.ActivationKey( + organization=module_sca_manifest_org, + content_view=content_view, + environment=module_lce_library, + ).create() + + # Ensure client repo is enabled in the activation key + content = ak.product_content(data={'content_access_mode_all': '1'})['results'] + client_repo_label = [repo['label'] for repo in content if repo['name'] == client_repo.name][0] + ak.content_override( + data={'content_overrides': [{'content_label': client_repo_label, 'value': '1'}]} + ) + return Box(os=os, ak=ak, ksrepo=ksrepo, cv=content_view) diff --git a/pytest_plugins/fixture_markers.py b/pytest_plugins/fixture_markers.py index 888a720d13..41e12b85ba 100644 --- a/pytest_plugins/fixture_markers.py +++ b/pytest_plugins/fixture_markers.py @@ -7,6 +7,7 @@ 'rhel_contenthost', 'content_hosts', 'module_provisioning_rhel_content', + 'capsule_provisioning_rhel_content', 'rex_contenthost', ] diff --git a/tests/foreman/api/test_provisioning.py b/tests/foreman/api/test_provisioning.py index 081a5e0a04..5096ab6ddb 100644 --- a/tests/foreman/api/test_provisioning.py +++ b/tests/foreman/api/test_provisioning.py @@ -590,6 +590,131 @@ def test_rhel_pxe_provisioning_fips_enabled( assert provisioning_host.subscribed, 'Host is not subscribed' +@pytest.mark.e2e +@pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True) +@pytest.mark.rhel_ver_match('[^6]') +def test_capsule_pxe_provisioning( + request, + capsule_provisioning_sat, + module_capsule_configured, + capsule_provisioning_rhel_content, + module_sca_manifest_org, + module_location, + provisioning_host, + pxe_loader, + capsule_provisioning_hostgroup, + module_lce_library, + module_default_org_view, + capsule_provisioning_lce_sync_setup, +): + """Provision a host using external capsule + + :id: d76cd326-af4e-4bd5-b20c-128348e042d3 + + :steps: + 1. Configure satellite and capsule for provisioning + 2. Provision a host using capsule as the content source + 3. Check that resulting host is registered to Satellite + + :expectedresults: + 1. Provisioning using external capsule is successful. + 1. Host installs right version of RHEL + 2. Satellite is able to run REX job on the host + 3. Host is registered to Satellite and subscription status is 'Success' + + :parametrized: yes + """ + host_mac_addr = provisioning_host._broker_args['provisioning_nic_mac_addr'] + sat = capsule_provisioning_sat.sat + cap = module_capsule_configured + host = sat.api.Host( + hostgroup=capsule_provisioning_hostgroup, + organization=module_sca_manifest_org, + location=module_location, + content_facet_attributes={ + 'content_view_id': capsule_provisioning_rhel_content.cv.id, + 'lifecycle_environment_id': module_lce_library.id, + }, + name=gen_string('alpha').lower(), + mac=host_mac_addr, + operatingsystem=capsule_provisioning_rhel_content.os, + subnet=capsule_provisioning_sat.subnet, + host_parameters_attributes=[ + { + 'name': 'remote_execution_connect_by_ip', + 'value': 'true', + 'parameter_type': 'boolean', + }, + ], + build=True, # put the host in build mode + ).create(create_missing=False) + # Clean up the host to free IP leases on Satellite. + # broker should do that as a part of the teardown, putting here just to make sure. + request.addfinalizer(host.delete) + # Start the VM, do not ensure that we can connect to SSHD + provisioning_host.power_control(ensure=False) + # Host should do call back to the Satellite reporting + # the result of the installation. Wait until Satellite reports that the host is installed. + wait_for( + lambda: host.read().build_status_label != 'Pending installation', + timeout=1500, + delay=10, + ) + host = host.read() + assert host.build_status_label == 'Installed' + + # Change the hostname of the host as we know it already. + # In the current infra environment we do not support + # addressing hosts using FQDNs, falling back to IP. + provisioning_host.hostname = host.ip + # Host is not blank anymore + provisioning_host.blank = False + + # Wait for the host to be rebooted and SSH daemon to be started. + provisioning_host.wait_for_connection() + + # Perform version check and check if root password is properly updated + host_os = host.operatingsystem.read() + expected_rhel_version = f'{host_os.major}.{host_os.minor}' + + if int(host_os.major) >= 9: + assert ( + provisioning_host.execute( + 'echo -e "\nPermitRootLogin yes" >> /etc/ssh/sshd_config; systemctl restart sshd' + ).status + == 0 + ) + host_ssh_os = sat.execute( + f'sshpass -p {settings.provisioning.host_root_password} ' + 'ssh -o StrictHostKeyChecking=no -o PubkeyAuthentication=no -o PasswordAuthentication=yes ' + f'-o UserKnownHostsFile=/dev/null root@{provisioning_host.hostname} cat /etc/redhat-release' + ) + assert host_ssh_os.status == 0 + assert ( + expected_rhel_version in host_ssh_os.stdout + ), f'The installed OS version differs from the expected version {expected_rhel_version}' + + # Run a command on the host using REX to verify that Satellite's SSH key is present on the host + template_id = ( + sat.api.JobTemplate().search(query={'search': 'name="Run Command - Script Default"'})[0].id + ) + job = sat.api.JobInvocation().run( + data={ + 'job_template_id': template_id, + 'inputs': { + 'command': f'subscription-manager config | grep "hostname = {cap.hostname}"' + }, + 'search_query': f"name = {host.name}", + 'targeting_type': 'static_query', + }, + ) + assert job['result'] == 'success', 'Job invocation failed' + + # assert that the host is subscribed and consumes + # subsctiption provided by the activation key + assert provisioning_host.subscribed, 'Host is not subscribed' + + @pytest.mark.stubbed def test_rhel_provisioning_using_realm(): """Provision a host using realm From 61219a18502cbd082d5f9bf486707c68fa083967 Mon Sep 17 00:00:00 2001 From: Omkar Khatavkar Date: Wed, 27 Dec 2023 17:21:16 +0530 Subject: [PATCH 42/93] extra check not recording property incase of video recording is false (#13475) --- robottelo/hosts.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/robottelo/hosts.py b/robottelo/hosts.py index b4e4fdcc0c..143cb87588 100644 --- a/robottelo/hosts.py +++ b/robottelo/hosts.py @@ -1849,8 +1849,9 @@ def get_caller(): video_url = settings.ui.grid_url.replace( ':4444', f'/videos/{ui_session.ui_session_id}.mp4' ) - self.record_property('video_url', video_url) - self.record_property('session_id', ui_session.ui_session_id) + if self.record_property is not None and settings.ui.record_video: + self.record_property('video_url', video_url) + self.record_property('session_id', ui_session.ui_session_id) @property def satellite(self): From 1e07438697e9b98e1961bf6eb210d8afd8c552dc Mon Sep 17 00:00:00 2001 From: Gaurav Talreja Date: Thu, 28 Dec 2023 18:38:13 +0530 Subject: [PATCH 43/93] Add test for registration with rex pull-mode (#13565) Signed-off-by: Gaurav Talreja --- pytest_fixtures/core/sat_cap_factory.py | 14 +++ robottelo/hosts.py | 12 ++- .../foreman/destructive/test_registration.py | 96 +++++++++++++++++++ 3 files changed, 117 insertions(+), 5 deletions(-) create mode 100644 tests/foreman/destructive/test_registration.py diff --git a/pytest_fixtures/core/sat_cap_factory.py b/pytest_fixtures/core/sat_cap_factory.py index 436d8b6d44..d58ea9e8b4 100644 --- a/pytest_fixtures/core/sat_cap_factory.py +++ b/pytest_fixtures/core/sat_cap_factory.py @@ -126,6 +126,20 @@ def session_satellite_host(request, satellite_factory): yield sat +@pytest.fixture(scope='module') +def module_satellite_mqtt(module_target_sat): + """Configure satellite with MQTT broker enabled""" + module_target_sat.set_rex_script_mode_provider('pull-mqtt') + # lower the mqtt_resend_interval interval + module_target_sat.set_mqtt_resend_interval('30') + result = module_target_sat.execute('systemctl status mosquitto') + assert result.status == 0, 'MQTT broker is not running' + result = module_target_sat.execute('firewall-cmd --permanent --add-port="1883/tcp"') + assert result.status == 0, 'Failed to open mqtt port on capsule' + module_target_sat.execute('firewall-cmd --reload') + return module_target_sat + + @pytest.fixture def capsule_host(request, capsule_factory): """A fixture that provides a Capsule based on config settings""" diff --git a/robottelo/hosts.py b/robottelo/hosts.py index 143cb87588..ab6f3a9536 100644 --- a/robottelo/hosts.py +++ b/robottelo/hosts.py @@ -1648,11 +1648,13 @@ def update_download_policy(self, policy): def set_rex_script_mode_provider(self, mode='ssh'): """Set provider for remote execution script mode. One of: ssh(default), pull-mqtt, ssh-async""" - installer_opts = { - 'foreman-proxy-templates': 'true', - 'foreman-proxy-registration': 'true', - 'foreman-proxy-plugin-remote-execution-script-mode': mode, - } + + installer_opts = {'foreman-proxy-plugin-remote-execution-script-mode': mode} + + if self.__class__.__name__ == 'Capsule': + installer_opts['foreman-proxy-templates'] = 'true' + installer_opts['foreman-proxy-registration'] = 'true' + enable_mqtt_command = InstallerCommand( installer_opts=installer_opts, ) diff --git a/tests/foreman/destructive/test_registration.py b/tests/foreman/destructive/test_registration.py new file mode 100644 index 0000000000..0320f3b633 --- /dev/null +++ b/tests/foreman/destructive/test_registration.py @@ -0,0 +1,96 @@ +"""Tests for registration. + +:Requirement: Registration + +:CaseLevel: Acceptance + +:CaseComponent: Registration + +:CaseAutomation: Automated + +:CaseImportance: High + +:Team: Rocket + +:TestType: Functional + +:Upstream: No +""" +import pytest + +from robottelo.config import settings + + +@pytest.mark.tier3 +@pytest.mark.no_containers +@pytest.mark.rhel_ver_match('[^6]') +def test_host_registration_rex_pull_mode( + module_org, + module_satellite_mqtt, + module_location, + module_ak_with_cv, + module_capsule_configured_mqtt, + rhel_contenthost, +): + """Verify content host registration with Satellite/Capsule as MQTT broker + + :id: a082f599-fbf7-4779-aa18-5139e2bce779 + + :expectedresults: Host registered successfully with MQTT broker + + :parametrized: yes + """ + org = module_org + client_repo = settings.repos.SATCLIENT_REPO[f'rhel{rhel_contenthost.os_version.major}'] + # register host to satellite with pull provider rex + command = module_satellite_mqtt.api.RegistrationCommand( + organization=org, + location=module_location, + activation_keys=[module_ak_with_cv.name], + setup_remote_execution_pull=True, + insecure=True, + repo=client_repo, + ).create() + result = rhel_contenthost.execute(command) + assert result.status == 0, f'Failed to register host: {result.stderr}' + + # check mqtt client is running + result = rhel_contenthost.execute('systemctl status yggdrasild') + assert result.status == 0, f'Failed to start yggdrasil on client: {result.stderr}' + assert rhel_contenthost.execute('yggdrasil status').status == 0 + mqtt_url = f'mqtts://{module_satellite_mqtt.hostname}:1883' + assert rhel_contenthost.execute(f'cat /etc/yggdrasil/config.toml | grep {mqtt_url}').status == 0 + + # Update module_capsule_configured_mqtt to include module_org/module_location + nc = module_capsule_configured_mqtt.nailgun_smart_proxy + module_satellite_mqtt.api.SmartProxy(id=nc.id, organization=[org]).update(['organization']) + module_satellite_mqtt.api.SmartProxy(id=nc.id, location=[module_location]).update(['location']) + + # register host to capsule with pull provider rex + command = module_satellite_mqtt.api.RegistrationCommand( + smart_proxy=nc, + organization=org, + location=module_location, + activation_keys=[module_ak_with_cv.name], + setup_remote_execution_pull=True, + repo=client_repo, + insecure=True, + force=True, + ).create() + result = rhel_contenthost.execute(command) + assert result.status == 0, f'Failed to register host: {result.stderr}' + + # check mqtt client is running + result = rhel_contenthost.execute('systemctl status yggdrasild') + assert result.status == 0, f'Failed to start yggdrasil on client: {result.stderr}' + assert rhel_contenthost.execute('yggdrasil status').status == 0 + new_mqtt_url = f'mqtts://{module_capsule_configured_mqtt.hostname}:1883' + assert ( + rhel_contenthost.execute(f'cat /etc/yggdrasil/config.toml | grep {new_mqtt_url}').status + == 0 + ) + # After force register existing config.toml is saved as backup + assert ( + rhel_contenthost.execute(f'cat /etc/yggdrasil/config.toml.bak | grep {mqtt_url}').status + == 0 + ) From 97d47c75db86e49d5ceff5d6cdd102fd046627f7 Mon Sep 17 00:00:00 2001 From: Gaurav Talreja Date: Thu, 28 Dec 2023 18:38:23 +0530 Subject: [PATCH 44/93] Add test for show_unsupported_templates setting (#13560) Signed-off-by: Gaurav Talreja --- tests/foreman/ui/test_settings.py | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/foreman/ui/test_settings.py b/tests/foreman/ui/test_settings.py index 2b793394c6..e59693a980 100644 --- a/tests/foreman/ui/test_settings.py +++ b/tests/foreman/ui/test_settings.py @@ -576,3 +576,37 @@ def test_positive_setting_display_fqdn_for_hosts(session, target_sat): values = session.host_new.get_details(target_sat.hostname, widget_names='breadcrumb') assert values['breadcrumb'] == full_name + + +@pytest.mark.tier2 +def test_positive_show_unsupported_templates(request, target_sat, module_org, module_location): + """Verify setting show_unsupported_templates with new custom template + + :id: e0eaab69-4926-4c1e-b111-30c51ede273z + + :Steps: + 1. Goto Settings -> Provisioning tab -> Show unsupported provisioning templates + + :CaseImportance: Medium + + :expectedresults: Custom template aren't searchable when set to No, + and are searchable when set to Yes(default) + """ + pt = target_sat.api.ProvisioningTemplate( + name=gen_string('alpha'), + organization=[module_org], + location=[module_location], + template=gen_string('alpha'), + snippet=False, + ).create() + request.addfinalizer(pt.delete) + with target_sat.ui_session() as session: + session.organization.select(org_name=module_org.name) + session.location.select(loc_name=module_location.name) + default_value = target_sat.update_setting('show_unsupported_templates', 'No') + assert not session.provisioningtemplate.search(f'name={pt.name}') + + # Verify with show_unsupported_templates=Yes + target_sat.update_setting('show_unsupported_templates', default_value) + template = session.provisioningtemplate.search(f'name={pt.name}') + assert template[0]['Name'] == pt.name From cf8daac48a617e94e59fdb583b0288c0d33bbfe0 Mon Sep 17 00:00:00 2001 From: Gaurav Talreja Date: Thu, 28 Dec 2023 18:38:42 +0530 Subject: [PATCH 45/93] Fix parametrization in capsule provisioning fixture (#13566) Signed-off-by: Gaurav Talreja --- pytest_fixtures/component/provision_capsule_pxe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest_fixtures/component/provision_capsule_pxe.py b/pytest_fixtures/component/provision_capsule_pxe.py index 4e3a3a2cf5..d158e596a8 100644 --- a/pytest_fixtures/component/provision_capsule_pxe.py +++ b/pytest_fixtures/component/provision_capsule_pxe.py @@ -173,7 +173,7 @@ def capsule_provisioning_rhel_content( that is specified in `request.param`. """ sat = capsule_provisioning_sat.sat - rhel_ver = request.param + rhel_ver = request.param['rhel_version'] repo_names = [] if int(rhel_ver) <= 7: repo_names.append(f'rhel{rhel_ver}') From 55b6ce3add030e946c7af31c1476de605beafd41 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 31 Dec 2023 22:49:25 -0500 Subject: [PATCH 46/93] Bump pytest from 7.4.3 to 7.4.4 (#13578) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2cbd392b9b..a6b074d03c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,7 @@ navmazing==1.2.2 productmd==1.38 pyotp==2.9.0 python-box==7.1.1 -pytest==7.4.3 +pytest==7.4.4 pytest-order==1.2.0 pytest-services==2.2.1 pytest-mock==3.12.0 From fab24d956165283d95d858b7663df3adf68944fd Mon Sep 17 00:00:00 2001 From: vsedmik <46570670+vsedmik@users.noreply.github.com> Date: Tue, 2 Jan 2024 09:49:00 +0100 Subject: [PATCH 47/93] Add CLI tests for Capsule Content Counts (#13163) * Add CLI tests for capsule content counts * Address comments --- robottelo/cli/capsule.py | 10 ++ tests/foreman/cli/test_capsulecontent.py | 208 +++++++++++++++++++++++ 2 files changed, 218 insertions(+) create mode 100644 tests/foreman/cli/test_capsulecontent.py diff --git a/robottelo/cli/capsule.py b/robottelo/cli/capsule.py index 9f126e5a2a..2f27ba2f5c 100644 --- a/robottelo/cli/capsule.py +++ b/robottelo/cli/capsule.py @@ -105,6 +105,16 @@ def content_synchronize(cls, options, return_raw_response=None, timeout=3600000) return result + @classmethod + def content_update_counts(cls, options): + """Trigger content counts update.""" + + cls.command_sub = 'content update-counts' + + result = cls.execute(cls._construct_command(options), output_format='json') + + return result + @classmethod def import_classes(cls, options): """Import puppet classes from puppet Capsule.""" diff --git a/tests/foreman/cli/test_capsulecontent.py b/tests/foreman/cli/test_capsulecontent.py new file mode 100644 index 0000000000..58cbc12249 --- /dev/null +++ b/tests/foreman/cli/test_capsulecontent.py @@ -0,0 +1,208 @@ +"""Capsule-Content related tests being run through CLI. + +:Requirement: Capsule-Content + +:CaseAutomation: Automated + +:CaseLevel: System + +:CaseComponent: Capsule-Content + +:team: Phoenix-content + +:TestType: Functional + +:CaseImportance: High + +:Upstream: No +""" +import pytest + +from robottelo.config import settings +from robottelo.constants.repos import CUSTOM_FILE_REPO + + +@pytest.mark.parametrize( + 'repos_collection', + [ + { + 'distro': 'rhel8', + 'YumRepository': {'url': settings.repos.module_stream_1.url}, + 'FileRepository': {'url': CUSTOM_FILE_REPO}, + # TODO uncomment when BZ#2251019 is resolved + # 'DockerRepository': { + # 'url': CONTAINER_REGISTRY_HUB, + # 'upstream_name': CONTAINER_UPSTREAM_NAME, + # }, + # 'AnsibleRepository': { + # 'url': ANSIBLE_GALAXY, + # 'requirements': [ + # {'name': 'theforeman.foreman', 'version': '2.1.0'}, + # {'name': 'theforeman.operations', 'version': '0.1.0'}, + # ], + # }, + } + ], + indirect=True, +) +@pytest.mark.stream +def test_positive_content_counts_for_mixed_cv( + target_sat, + module_capsule_configured, + repos_collection, + function_org, + function_lce, + function_lce_library, +): + """Verify the content counts for a mixed-content CV + + :id: b9cfff16-6a2b-4d9f-8af9-e2adfd8bd1e4 + + :parametrized: yes + + :setup: + 1. A content view with repos of all content types (currently yum, file) + published into CVV and promoted to an LCE. + + :steps: + 1. Assign the Capsule with the LCE where the setup CVV is promoted to. + 2. Check the capsule lists correct LCE, CV and repo names and appropriate + warning message (no content counts) before sync. + 3. Sync the Capsule and get the content counts again. + 4. Get the content counts from Satellite side and compare them with Capsule. + 5. Remove the LCE from Capsule and ensure it's not listed. + + :expectedresults: + 1. Capsule returs proper warning instead content counts until it is synced. + 2. After sync the content counts from Capsule match those from Satellite. + 3. After LCE removal it's not listed anymore. + + # :BZ: 2251019 TODO uncomment when BZ#2251019 is resolved + + """ + expected_keys = { + 'yum': {'packages', 'package-groups', 'module-streams', 'errata'}, + 'file': {'files'}, + 'docker': {'container-tags', 'container-manifests', 'container-manifest-lists'}, + 'ansible_collection': {'ansible-collections'}, + } + + repos_collection.setup_content(function_org.id, function_lce.id, upload_manifest=False) + cv_id = repos_collection.setup_content_data['content_view']['id'] + cv = target_sat.cli.ContentView.info({'id': cv_id}) + cvv = target_sat.cli.ContentView.version_info({'id': cv['versions'][0]['id']}) + + # Assign the Capsule with function LCE + res = target_sat.cli.Capsule.content_add_lifecycle_environment( + { + 'id': module_capsule_configured.nailgun_capsule.id, + 'organization-id': function_org.id, + 'environment-id': function_lce.id, + } + ) + assert 'environment successfully added' in str(res) + + # Check the capsule lists correct LCE, CV and repo names and appropriate + # warning message (no content counts) before sync. + info = target_sat.cli.Capsule.content_info( + {'id': module_capsule_configured.nailgun_capsule.id, 'organization-id': function_org.id} + ) + assert len(info['lifecycle-environments']) == 1, 'Too many or few LCEs listed' + lce_info = info['lifecycle-environments']['1'] + assert lce_info['name'] == function_lce.name, 'Wrong LCE name listed' + assert lce_info['organization']['name'] == function_org.name, 'Wrong ORG name listed' + assert len(lce_info['content-views']) == 1, 'Too many or few CVs listed' + cv_info = lce_info['content-views']['1'] + assert cv_info['name']['name'] == cv['name'], 'Wrong CV name listed' + assert len(cv_info['repositories']) == len( + cvv['repositories'] + ), 'Too many or few repositories listed' + cv_info_reponames = set([repo['repository-name'] for repo in cv_info['repositories'].values()]) + cvv_reponames = set([repo['name'] for repo in cvv['repositories']]) + assert cv_info_reponames == cvv_reponames, 'Wrong repo names listed' + counts = [repo['content-counts'] for repo in cv_info['repositories'].values()] + assert all( + 'Content view must be synced to see content counts' in i['warning'] for i in counts + ), 'Expected warning for all repo content counts' + + # Sync, wait for counts to be updated and get them from the Capsule. + target_sat.cli.Capsule.content_synchronize( + {'id': module_capsule_configured.nailgun_capsule.id, 'organization-id': function_org.id} + ) + target_sat.wait_for_tasks( + search_query='label = Actions::Katello::CapsuleContent::UpdateContentCounts', + search_rate=5, + max_tries=5, + ) + + # Get the content counts from Satellite side and compare them with Capsule. + info = target_sat.cli.Capsule.content_info( + {'id': module_capsule_configured.nailgun_capsule.id, 'organization-id': function_org.id} + ) + + caps_counts = [ + repo + for repo in info['lifecycle-environments']['1']['content-views']['1'][ + 'repositories' + ].values() + ] + sat_repos = [ + target_sat.cli.Repository.info({'id': repo['repository-id']}) for repo in caps_counts + ] + + for s_repo in sat_repos: + c_repo = next(r for r in caps_counts if r['repository-id'] == s_repo['id']) + common_keys = set(s_repo['content-counts'].keys()) & set(c_repo['content-counts'].keys()) + assert len(common_keys), f'''No common keys found for type "{s_repo['content-type']}".''' + assert expected_keys[s_repo['content-type']].issubset(common_keys), ( + 'Some fields are missing: expected ' + f"{expected_keys[s_repo['content-type']]} but found {common_keys}" + ) + assert all( + [ + s_repo['content-counts'].get(key) == c_repo['content-counts'].get(key) + for key in common_keys + ] + ), 'Some of the content counts do not match' + + # Remove the LCE from Capsule and ensure it's not listed. + res = target_sat.cli.Capsule.content_remove_lifecycle_environment( + { + 'id': module_capsule_configured.nailgun_capsule.id, + 'organization-id': function_org.id, + 'environment-id': function_lce.id, + } + ) + assert 'environment successfully removed' in str(res) + + info = target_sat.cli.Capsule.content_info( + {'id': module_capsule_configured.nailgun_capsule.id, 'organization-id': function_org.id} + ) + assert len(info['lifecycle-environments']) == 0, 'The LCE is still listed' + + +@pytest.mark.stream +def test_positive_update_counts(target_sat, module_capsule_configured): + """Verify the update counts functionality + + :id: 5658dbb1-3d3d-4926-804b-1ff221cf5075 + + :setup: + 1. Satellite with registered Capsule. + + :steps: + 1. Run capsule content update-counts via hammer. + + :expectedresults: + 1. Update Content Counts task is created and succeeds. + + """ + task = target_sat.cli.Capsule.content_update_counts( + {'id': module_capsule_configured.nailgun_capsule.id, 'async': True} + ) + target_sat.wait_for_tasks( + search_query='label = Actions::Katello::CapsuleContent::UpdateContentCounts' + f' and id = {task["id"]}', + search_rate=5, + max_tries=5, + ) From 4958f65903d01afa454aad4ba2f31c24178ba429 Mon Sep 17 00:00:00 2001 From: Vladimir Sedmik Date: Thu, 21 Dec 2023 15:14:24 +0100 Subject: [PATCH 48/93] Add ISS Network Sync class and basic scenario --- robottelo/cli/org.py | 7 ++ tests/foreman/cli/test_satellitesync.py | 148 ++++++++++++++++++++++++ 2 files changed, 155 insertions(+) diff --git a/robottelo/cli/org.py b/robottelo/cli/org.py index 0ae1308013..38103aff3a 100644 --- a/robottelo/cli/org.py +++ b/robottelo/cli/org.py @@ -21,6 +21,7 @@ add-subnet Associate a resource add-user Associate a resource create Create an organization + configure-cdn Update the CDN configuration delete Delete an organization delete-parameter Delete parameter for an organization. info Show an organization @@ -166,3 +167,9 @@ def remove_user(cls, options=None): """Removes an user from an org""" cls.command_sub = 'remove-user' return cls.execute(cls._construct_command(options)) + + @classmethod + def configure_cdn(cls, options=None): + """Update the CDN configuration""" + cls.command_sub = 'configure-cdn' + return cls.execute(cls._construct_command(options)) diff --git a/tests/foreman/cli/test_satellitesync.py b/tests/foreman/cli/test_satellitesync.py index aa66074830..92847e5534 100644 --- a/tests/foreman/cli/test_satellitesync.py +++ b/tests/foreman/cli/test_satellitesync.py @@ -2059,3 +2059,151 @@ def test_positive_install_package_from_imported_repos(self): :CaseLevel: System """ + + +@pytest.fixture(scope='module') +def module_downstream_sat(module_satellite_host): + """Provides Downstream Satellite.""" + module_satellite_host.cli.Settings.set( + {'name': 'subscription_connection_enabled', 'value': 'No'} + ) + return module_satellite_host + + +@pytest.fixture +def function_downstream_org(module_downstream_sat, function_sca_manifest): + """Provides organization with manifest on Downstream Satellite.""" + org = module_downstream_sat.api.Organization().create() + module_downstream_sat.upload_manifest(org.id, function_sca_manifest.content) + return org + + +def _set_downstream_org( + dwn_sat, + up_sat, + dwn_org, + up_org='Default_Organization', + username=settings.server.admin_username, + password=settings.server.admin_password, + lce_label=None, + cv_label=None, +): + """Configures Downstream organization to sync from particular Upstream organization. + + :param dwn_sat: Downstream Satellite instance. + :param up_sat: Upstream Satellite instance. + :param dwn_org: Downstream organization to be configured. + :param up_org: Upstream organization to sync CDN content from, default: Default_Organization + :param username: Username for authentication, default: admin username from settings. + :param password: Password for authentication, default: admin password from settings. + :param lce_label: Upstream Lifecycle Environment, default: Library + :param cv_label: Upstream Content View Label, default: Default_Organization_View. + :return: True if succeeded. + """ + # Create Content Credentials with Upstream Satellite's katello-server-ca.crt. + crt_file = f'{up_sat.hostname}.crt' + dwn_sat.execute(f'curl -o {crt_file} http://{up_sat.hostname}/pub/katello-server-ca.crt') + cc = dwn_sat.cli.ContentCredential.create( + { + 'name': up_sat.hostname, + 'organization-id': dwn_org.id, + 'path': crt_file, + 'content-type': 'cert', + } + ) + # Set the CDN configuration to Network Sync. + res = dwn_sat.cli.Org.configure_cdn( + { + 'id': dwn_org.id, + 'type': 'network_sync', + 'url': f'https://{up_sat.hostname}/', + 'username': username, + 'password': password, + 'upstream-organization-label': up_org.label, + 'upstream-lifecycle-environment-label': lce_label, + 'upstream-content-view-label': cv_label, + 'ssl-ca-credential-id': cc['id'], + } + ) + return 'Updated CDN configuration' in res + + +class TestNetworkSync: + """Implements Network Sync scenarios.""" + + @pytest.mark.tier2 + @pytest.mark.parametrize( + 'function_synced_rhel_repo', + ['rhae2'], + indirect=True, + ) + def test_positive_network_sync_rh_repo( + self, + target_sat, + function_sca_manifest_org, + function_synced_rhel_repo, + module_downstream_sat, + function_downstream_org, + ): + """Sync a RH repo from Upstream to Downstream Satellite + + :id: fdb58c18-0a64-418b-990d-2233381fee8f + + :parametrized: yes + + :setup: + 1. Enabled and synced RH yum repository at Upstream Sat. + 2. Organization with manifest at Downstream Sat. + + :steps: + 1. Set the Downstream org to sync from Upstream org. + 2. Enable and sync the repository from Upstream to Downstream. + + :expectedresults: + 1. Repository can be enabled and synced. + + :CaseLevel: System + + :BZ: 2213128 + + :customerscenario: true + + """ + assert _set_downstream_org( + module_downstream_sat, + target_sat, + function_downstream_org, + function_sca_manifest_org, + ), 'Downstream org configuration failed' + + # Enable and sync the repository. + reposet = module_downstream_sat.cli.RepositorySet.list( + { + 'organization-id': function_downstream_org.id, + 'search': f'content_label={function_synced_rhel_repo["content-label"]}', + } + ) + assert ( + len(reposet) == 1 + ), f'Expected just one reposet for "{function_synced_rhel_repo["content-label"]}"' + res = module_downstream_sat.cli.RepositorySet.enable( + { + 'organization-id': function_downstream_org.id, + 'id': reposet[0]['id'], + 'basearch': DEFAULT_ARCHITECTURE, + } + ) + assert 'Repository enabled' in str(res), 'Repository enable failed' + + repos = module_downstream_sat.cli.Repository.list( + {'organization-id': function_downstream_org.id} + ) + assert len(repos) == 1, 'Expected 1 repo enabled' + repo = repos[0] + module_downstream_sat.cli.Repository.synchronize({'id': repo['id']}) + + repo = module_downstream_sat.cli.Repository.info({'id': repo['id']}) + assert 'Success' in repo['sync']['status'], 'Sync did not succeed' + assert ( + repo['content-counts'] == function_synced_rhel_repo['content-counts'] + ), 'Content counts do not match' From 6a42f67c927fcf822e7de4723247690b84358e47 Mon Sep 17 00:00:00 2001 From: Vladimir Sedmik Date: Tue, 2 Jan 2024 09:57:23 +0100 Subject: [PATCH 49/93] minor param renames --- tests/foreman/cli/test_satellitesync.py | 45 +++++++++++++------------ 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/tests/foreman/cli/test_satellitesync.py b/tests/foreman/cli/test_satellitesync.py index 92847e5534..e802ae9960 100644 --- a/tests/foreman/cli/test_satellitesync.py +++ b/tests/foreman/cli/test_satellitesync.py @@ -2079,10 +2079,10 @@ def function_downstream_org(module_downstream_sat, function_sca_manifest): def _set_downstream_org( - dwn_sat, - up_sat, - dwn_org, - up_org='Default_Organization', + downstream_sat, + upstream_sat, + downstream_org, + upstream_org='Default_Organization', username=settings.server.admin_username, password=settings.server.admin_password, lce_label=None, @@ -2090,10 +2090,11 @@ def _set_downstream_org( ): """Configures Downstream organization to sync from particular Upstream organization. - :param dwn_sat: Downstream Satellite instance. - :param up_sat: Upstream Satellite instance. - :param dwn_org: Downstream organization to be configured. - :param up_org: Upstream organization to sync CDN content from, default: Default_Organization + :param downstream_sat: Downstream Satellite instance. + :param upstream_sat: Upstream Satellite instance. + :param downstream_org: Downstream organization to be configured. + :param upstream_org: Upstream organization to sync CDN content from, + default: Default_Organization :param username: Username for authentication, default: admin username from settings. :param password: Password for authentication, default: admin password from settings. :param lce_label: Upstream Lifecycle Environment, default: Library @@ -2101,25 +2102,27 @@ def _set_downstream_org( :return: True if succeeded. """ # Create Content Credentials with Upstream Satellite's katello-server-ca.crt. - crt_file = f'{up_sat.hostname}.crt' - dwn_sat.execute(f'curl -o {crt_file} http://{up_sat.hostname}/pub/katello-server-ca.crt') - cc = dwn_sat.cli.ContentCredential.create( + crt_file = f'{upstream_sat.hostname}.crt' + downstream_sat.execute( + f'curl -o {crt_file} http://{upstream_sat.hostname}/pub/katello-server-ca.crt' + ) + cc = downstream_sat.cli.ContentCredential.create( { - 'name': up_sat.hostname, - 'organization-id': dwn_org.id, + 'name': upstream_sat.hostname, + 'organization-id': downstream_org.id, 'path': crt_file, 'content-type': 'cert', } ) # Set the CDN configuration to Network Sync. - res = dwn_sat.cli.Org.configure_cdn( + res = downstream_sat.cli.Org.configure_cdn( { - 'id': dwn_org.id, + 'id': downstream_org.id, 'type': 'network_sync', - 'url': f'https://{up_sat.hostname}/', + 'url': f'https://{upstream_sat.hostname}/', 'username': username, 'password': password, - 'upstream-organization-label': up_org.label, + 'upstream-organization-label': upstream_org.label, 'upstream-lifecycle-environment-label': lce_label, 'upstream-content-view-label': cv_label, 'ssl-ca-credential-id': cc['id'], @@ -2170,10 +2173,10 @@ def test_positive_network_sync_rh_repo( """ assert _set_downstream_org( - module_downstream_sat, - target_sat, - function_downstream_org, - function_sca_manifest_org, + downstream_sat=module_downstream_sat, + upstream_sat=target_sat, + downstream_org=function_downstream_org, + upstream_org=function_sca_manifest_org, ), 'Downstream org configuration failed' # Enable and sync the repository. From 8d9af7883fa241ac1a7a7083b0b468ca4668c3e3 Mon Sep 17 00:00:00 2001 From: Jitendra Yejare Date: Wed, 3 Jan 2024 17:03:02 +0530 Subject: [PATCH 50/93] Markers as test property in reports (#13043) --- pytest_plugins/metadata_markers.py | 12 +++++++++++- tests/foreman/virtwho/ui/test_nutanix_sca.py | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pytest_plugins/metadata_markers.py b/pytest_plugins/metadata_markers.py index 70aee47c6c..311628a896 100644 --- a/pytest_plugins/metadata_markers.py +++ b/pytest_plugins/metadata_markers.py @@ -116,8 +116,18 @@ def pytest_collection_modifyitems(items, config): # add markers as user_properties so they are recorded in XML properties of the report # pytest-ibutsu will include user_properties dict in testresult metadata + markers_prop_data = [] + exclude_markers = ['parametrize', 'skipif', 'usefixtures', 'skip_if_not_set'] for marker in item.iter_markers(): - item.user_properties.append((marker.name, next(iter(marker.args), None))) + prop = marker.name + if prop in exclude_markers: + continue + if marker_val := next(iter(marker.args), None): + prop = '='.join([prop, str(marker_val)]) + markers_prop_data.append(prop) + item.user_properties.append(("markers", ", ".join(markers_prop_data))) + + # Version specific user properties item.user_properties.append(("BaseOS", rhel_version)) item.user_properties.append(("SatelliteVersion", sat_version)) item.user_properties.append(("SnapVersion", snap_version)) diff --git a/tests/foreman/virtwho/ui/test_nutanix_sca.py b/tests/foreman/virtwho/ui/test_nutanix_sca.py index eb2d7d889a..89bae08771 100644 --- a/tests/foreman/virtwho/ui/test_nutanix_sca.py +++ b/tests/foreman/virtwho/ui/test_nutanix_sca.py @@ -8,7 +8,7 @@ :CaseComponent: Virt-whoConfigurePlugin -:Team: Phoenix +:Team: Phoenix-subscriptions :TestType: Functional From 963700ee9b59af5492e6f57679b8cea4e11e0913 Mon Sep 17 00:00:00 2001 From: Jameer Pathan <21165044+jameerpathan111@users.noreply.github.com> Date: Thu, 4 Jan 2024 07:32:36 +0100 Subject: [PATCH 51/93] Add test for fapolicyd installation (#13488) Update tests to cover fapolicyd installation --- pytest_fixtures/core/sat_cap_factory.py | 2 +- robottelo/hosts.py | 4 +- tests/foreman/installer/test_installer.py | 47 +++++++++++++++-------- 3 files changed, 35 insertions(+), 18 deletions(-) diff --git a/pytest_fixtures/core/sat_cap_factory.py b/pytest_fixtures/core/sat_cap_factory.py index d58ea9e8b4..c63a70e4d1 100644 --- a/pytest_fixtures/core/sat_cap_factory.py +++ b/pytest_fixtures/core/sat_cap_factory.py @@ -291,7 +291,7 @@ def module_sat_ready_rhels(request): @pytest.fixture def cap_ready_rhel(): - rhel_version = Version(settings.capsule.version.release) + rhel_version = Version(settings.capsule.version.rhel_version) deploy_args = { 'deploy_rhel_version': rhel_version.base_version, 'deploy_flavor': settings.flavors.default, diff --git a/robottelo/hosts.py b/robottelo/hosts.py index ab6f3a9536..439b5012a9 100644 --- a/robottelo/hosts.py +++ b/robottelo/hosts.py @@ -125,7 +125,7 @@ def setup_capsule(satellite, capsule, org, registration_args=None, installation_ capsule.unregister() # Add a manifest to the Satellite - with Manifester(manifest_category=settings.manifest.golden_ticket) as manifest: + with Manifester(manifest_category=settings.manifest.entitlement) as manifest: satellite.upload_manifest(org.id, manifest.content) # Enable RHEL 8 BaseOS and AppStream repos and sync @@ -151,7 +151,7 @@ def setup_capsule(satellite, capsule, org, registration_args=None, installation_ f'{file} root@{capsule.hostname}:{file}' ) capsule.install_katello_ca(satellite) - capsule.register_contenthost(**registration_args) + capsule.register_contenthost(org=org.label, **registration_args) return capsule.install(cmd_args) diff --git a/tests/foreman/installer/test_installer.py b/tests/foreman/installer/test_installer.py index c8268fd388..986080ffd2 100644 --- a/tests/foreman/installer/test_installer.py +++ b/tests/foreman/installer/test_installer.py @@ -21,7 +21,7 @@ from robottelo import ssh from robottelo.config import settings -from robottelo.constants import DEFAULT_ORG, FOREMAN_SETTINGS_YML, PRDS, REPOS, REPOSET +from robottelo.constants import FOREMAN_SETTINGS_YML, PRDS, REPOS, REPOSET from robottelo.hosts import setup_capsule from robottelo.utils.installer import InstallerCommand from robottelo.utils.issue_handlers import is_open @@ -1343,11 +1343,14 @@ def common_sat_install_assertions(satellite): result = satellite.execute(r'grep -iR "error" /var/log/candlepin/*') assert len(result.stdout) == 0 + httpd_log = satellite.execute('journalctl --unit=httpd') + assert "WARNING" not in httpd_log.stdout + result = satellite.cli.Health.check() assert 'FAIL' not in result.stdout -def install_satellite(satellite, installer_args): +def install_satellite(satellite, installer_args, enable_fapolicyd=False): # Register for RHEL8 repos, get Ohsnap repofile, and enable and download satellite satellite.register_to_cdn() satellite.download_repofile( @@ -1355,7 +1358,14 @@ def install_satellite(satellite, installer_args): release=settings.server.version.release, snap=settings.server.version.snap, ) + if enable_fapolicyd: + satellite.execute( + 'dnf -y install fapolicyd && systemctl enable --now fapolicyd' + ).status == 0 satellite.execute('dnf -y module enable satellite:el8 && dnf -y install satellite') + if enable_fapolicyd: + assert satellite.execute('rpm -q foreman-fapolicyd').status == 0 + assert satellite.execute('rpm -q foreman-proxy-fapolicyd').status == 0 # Configure Satellite firewall to open communication satellite.execute( 'firewall-cmd --permanent --add-service RH-Satellite-6 && firewall-cmd --reload' @@ -1381,14 +1391,14 @@ def sat_default_install(module_sat_ready_rhels): @pytest.fixture(scope='module') def sat_non_default_install(module_sat_ready_rhels): - """Install Satellite with various options""" + """Provides fapolicyd enabled Satellite with various options""" installer_args = [ 'scenario satellite', f'foreman-initial-admin-password {settings.server.admin_password}', 'foreman-rails-cache-store type:file', 'foreman-proxy-content-pulpcore-hide-guarded-distributions false', ] - install_satellite(module_sat_ready_rhels[1], installer_args) + install_satellite(module_sat_ready_rhels[1], installer_args, enable_fapolicyd=True) yield module_sat_ready_rhels[1] common_sat_install_assertions(module_sat_ready_rhels[1]) @@ -1396,16 +1406,17 @@ def sat_non_default_install(module_sat_ready_rhels): @pytest.mark.e2e @pytest.mark.tier1 @pytest.mark.pit_client -def test_capsule_installation(sat_default_install, cap_ready_rhel, default_org): - """Run a basic Capsule installation +def test_capsule_installation(sat_non_default_install, cap_ready_rhel): + """Run a basic Capsule installation with fapolicyd :id: 64fa85b6-96e6-4fea-bea4-a30539d59e65 :steps: - 1. Get a Satellite + 1. Get a fapolicyd enabled Satellite 2. Configure capsule repos - 3. Enable capsule module - 4. Install and setup capsule + 3. Install and enable fapolicyd + 4. Enable capsule module + 5. Install and setup capsule :expectedresults: 1. Capsule is installed and setup correctly @@ -1415,21 +1426,27 @@ def test_capsule_installation(sat_default_install, cap_ready_rhel, default_org): :CaseImportance: Critical """ # Get Capsule repofile, and enable and download satellite-capsule + org = sat_non_default_install.api.Organization().create() cap_ready_rhel.register_to_cdn() cap_ready_rhel.download_repofile( product='capsule', release=settings.server.version.release, snap=settings.server.version.snap, ) + # Enable fapolicyd + assert ( + cap_ready_rhel.execute( + 'dnf -y install fapolicyd && systemctl enable --now fapolicyd' + ).status + == 0 + ) cap_ready_rhel.execute( 'dnf -y module enable satellite-capsule:el8 && dnf -y install satellite-capsule' ) + assert cap_ready_rhel.execute('rpm -q foreman-proxy-fapolicyd').status == 0 # Setup Capsule - org = sat_default_install.api.Organization().search(query={'search': f'name="{DEFAULT_ORG}"'})[ - 0 - ] - setup_capsule(sat_default_install, cap_ready_rhel, org) - assert sat_default_install.api.Capsule().search( + setup_capsule(sat_non_default_install, cap_ready_rhel, org) + assert sat_non_default_install.api.Capsule().search( query={'search': f'name={cap_ready_rhel.hostname}'} )[0] @@ -1475,7 +1492,7 @@ def test_foreman_rails_cache_store(sat_non_default_install): :customerscenario: true - :BZ: 2063717, 2165092 + :BZ: 2063717, 2165092, 2244370 """ # Verify foreman-rails-cache-store option works assert sat_non_default_install.execute('rpm -q foreman-redis').status == 1 From ae99d0d0fe2ceda3d35c6586788e1587ab3c5ff6 Mon Sep 17 00:00:00 2001 From: Jitendra Yejare Date: Thu, 4 Jan 2024 21:58:44 +0530 Subject: [PATCH 52/93] Fixing the missing markers as independent properties (#13599) --- pytest_plugins/metadata_markers.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pytest_plugins/metadata_markers.py b/pytest_plugins/metadata_markers.py index 311628a896..57b12aa5c1 100644 --- a/pytest_plugins/metadata_markers.py +++ b/pytest_plugins/metadata_markers.py @@ -119,12 +119,15 @@ def pytest_collection_modifyitems(items, config): markers_prop_data = [] exclude_markers = ['parametrize', 'skipif', 'usefixtures', 'skip_if_not_set'] for marker in item.iter_markers(): - prop = marker.name - if prop in exclude_markers: + proprty = marker.name + if proprty in exclude_markers: continue if marker_val := next(iter(marker.args), None): - prop = '='.join([prop, str(marker_val)]) - markers_prop_data.append(prop) + proprty = '='.join([proprty, str(marker_val)]) + markers_prop_data.append(proprty) + # Adding independent marker as a property + item.user_properties.append((marker.name, marker_val)) + # Adding all markers as a single property item.user_properties.append(("markers", ", ".join(markers_prop_data))) # Version specific user properties From f378c330e8b7341679fa48e7ae0f236340b3af60 Mon Sep 17 00:00:00 2001 From: Griffin Sullivan <48397354+Griffin-Sullivan@users.noreply.github.com> Date: Thu, 4 Jan 2024 12:32:53 -0500 Subject: [PATCH 53/93] Add coverage for HTTP Proxy capsule install (#13507) --- tests/foreman/installer/test_installer.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/foreman/installer/test_installer.py b/tests/foreman/installer/test_installer.py index 986080ffd2..e170973bcf 100644 --- a/tests/foreman/installer/test_installer.py +++ b/tests/foreman/installer/test_installer.py @@ -1406,7 +1406,10 @@ def sat_non_default_install(module_sat_ready_rhels): @pytest.mark.e2e @pytest.mark.tier1 @pytest.mark.pit_client -def test_capsule_installation(sat_non_default_install, cap_ready_rhel): +@pytest.mark.parametrize( + 'setting_update', [f'http_proxy={settings.http_proxy.un_auth_proxy_url}'], indirect=True +) +def test_capsule_installation(sat_non_default_install, cap_ready_rhel, setting_update): """Run a basic Capsule installation with fapolicyd :id: 64fa85b6-96e6-4fea-bea4-a30539d59e65 @@ -1424,6 +1427,10 @@ def test_capsule_installation(sat_non_default_install, cap_ready_rhel): 3. health check runs successfully :CaseImportance: Critical + + :BZ: 1984400 + + :customerscenario: true """ # Get Capsule repofile, and enable and download satellite-capsule org = sat_non_default_install.api.Organization().create() From 3e5de78a0952cb7c43ff756d79b27b6f42250d7b Mon Sep 17 00:00:00 2001 From: Shweta Singh Date: Thu, 4 Jan 2024 23:05:58 +0530 Subject: [PATCH 54/93] Test capsule without registration module (#13583) --- tests/foreman/api/test_registration.py | 44 ++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tests/foreman/api/test_registration.py b/tests/foreman/api/test_registration.py index 77fd856db1..50f5e0c0b0 100644 --- a/tests/foreman/api/test_registration.py +++ b/tests/foreman/api/test_registration.py @@ -227,3 +227,47 @@ def test_negative_global_registration_without_ak(module_target_sat): with pytest.raises(HTTPError) as context: module_target_sat.api.RegistrationCommand().create() assert 'Missing activation key!' in context.value.response.text + + +def test_negative_capsule_without_registration_enabled( + module_target_sat, + module_capsule_configured, + module_ak_with_cv, + module_entitlement_manifest_org, + module_location, +): + """Verify registration with Capsule, when registration isn't configured in installer + + :id: a2f23e42-648d-4428-a961-6e0b933c6dff + + :steps: + 1. Get a configured capsule + 2. The registration is set to False on capsule by default + 3. Try to register host with that capsule + + :expectedresults: Registration fails with HTTP error code 422 and an error message. + """ + org = module_entitlement_manifest_org + + nc = module_capsule_configured.nailgun_smart_proxy + module_target_sat.api.SmartProxy(id=nc.id, organization=[org]).update(['organization']) + module_target_sat.api.SmartProxy(id=nc.id, location=[module_location]).update(['location']) + + res = module_capsule_configured.install( + cmd_args={}, + cmd_kwargs={'foreman-proxy-registration': 'false', 'foreman-proxy-templates': 'true'}, + ) + assert res.status == 0 + error_message = '422 Client Error' + with pytest.raises(HTTPError, match=f'{error_message}') as context: + module_target_sat.api.RegistrationCommand( + smart_proxy=nc, + organization=org, + location=module_location, + activation_keys=[module_ak_with_cv.name], + insecure=True, + ).create() + assert ( + "Proxy lacks one of the following features: 'Registration', 'Templates'" + in context.value.response.text + ) From b969de11f96f07bb1d50cb26c3d3dc4b7c10ec1d Mon Sep 17 00:00:00 2001 From: Samuel Bible Date: Fri, 5 Jan 2024 08:10:59 -0600 Subject: [PATCH 55/93] Change team to pheonix-subscriptions to match the Hosts-Content team (#13618) --- tests/foreman/ui/test_host.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/foreman/ui/test_host.py b/tests/foreman/ui/test_host.py index 9ea2cd736d..be174e1ea1 100644 --- a/tests/foreman/ui/test_host.py +++ b/tests/foreman/ui/test_host.py @@ -2459,7 +2459,7 @@ def test_all_hosts_delete(session, target_sat, function_org, function_location, :CaseComponent:Hosts-Content - :Team: Phoenix-content + :Team: Phoenix-subscriptions :CaseLevel: System """ @@ -2480,7 +2480,7 @@ def test_all_hosts_bulk_delete(session, target_sat, function_org, function_locat :CaseComponent:Hosts-Content - :Team: Phoenix-content + :Team: Phoenix-subscriptions :CaseLevel: System """ From f267421c45779c4246b0eb2171fd069d443634db Mon Sep 17 00:00:00 2001 From: Gaurav Talreja Date: Fri, 5 Jan 2024 21:44:02 +0530 Subject: [PATCH 56/93] Correct Casecomponent in upgrades/test_classparameter.py (#13621) --- tests/upgrades/test_classparameter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/upgrades/test_classparameter.py b/tests/upgrades/test_classparameter.py index f113f7ab23..689374d7db 100644 --- a/tests/upgrades/test_classparameter.py +++ b/tests/upgrades/test_classparameter.py @@ -6,7 +6,7 @@ :CaseLevel: Acceptance -:CaseComponent: Parameters +:CaseComponent: Puppet :Team: Rocket From 814ae23c1c0e28a1d1826bebfab819c9872f0592 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Jan 2024 03:36:08 +0000 Subject: [PATCH 57/93] Bump flake8 from 6.1.0 to 7.0.0 Bumps [flake8](https://github.com/pycqa/flake8) from 6.1.0 to 7.0.0. - [Commits](https://github.com/pycqa/flake8/compare/6.1.0...7.0.0) --- updated-dependencies: - dependency-name: flake8 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-optional.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-optional.txt b/requirements-optional.txt index 24b8b4c600..1dcaeaa560 100644 --- a/requirements-optional.txt +++ b/requirements-optional.txt @@ -1,5 +1,5 @@ # For running tests and checking code quality using these modules. -flake8==6.1.0 +flake8==7.0.0 pytest-cov==4.1.0 redis==5.0.1 pre-commit==3.6.0 From c9f64bc0877a3c9139858c7f9ef8cc6f202dfba0 Mon Sep 17 00:00:00 2001 From: Gaurav Talreja Date: Mon, 8 Jan 2024 13:22:08 +0530 Subject: [PATCH 58/93] Add a test for parameter precedence on the host (#13620) Signed-off-by: Gaurav Talreja --- tests/foreman/api/test_parameters.py | 76 ++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 tests/foreman/api/test_parameters.py diff --git a/tests/foreman/api/test_parameters.py b/tests/foreman/api/test_parameters.py new file mode 100644 index 0000000000..9aa297a594 --- /dev/null +++ b/tests/foreman/api/test_parameters.py @@ -0,0 +1,76 @@ +"""Tests for parameters + +:Requirement: Parameters + +:CaseAutomation: Automated + +:CaseLevel: Acceptance + +:CaseComponent: Parameters + +:Team: Rocket + +:TestType: Functional + +:CaseImportance: Critical + +:Upstream: No +""" +from fauxfactory import gen_string +import pytest + + +@pytest.mark.tier1 +@pytest.mark.e2e +@pytest.mark.upgrade +def test_positive_parameter_precedence_impact( + request, module_org, module_location, module_target_sat +): + """Check parameter precedences for Global, Hostgroup, and Host parameters + + :id: 8dd6c4e8-4ec9-4bee-8a04-f5788960979b + + :steps: + 1. Create Global Parameter + 2. Create host and verify global parameter is assigned + 3. Create Host Group with parameter + 4. Assign hostgroup to host created above and verify hostgroup parameter is assigned. + 5. Add parameter on the host directly, and verify that this should take precedence + over Host group and Global Parameter + + :expectedresults: Host parameter take precedence over hostgroup and global parameter, + and hostgroup take precedence over global parameter when there are no host parameters + """ + param_name = gen_string('alpha') + param_value = gen_string('alpha') + + cp = module_target_sat.api.CommonParameter(name=param_name, value=param_value).create() + host = module_target_sat.api.Host(organization=module_org, location=module_location).create() + result = [res for res in host.all_parameters if res['name'] == param_name] + assert result[0]['name'] == param_name + assert result[0]['associated_type'] == 'global' + + hg = module_target_sat.api.HostGroup( + organization=[module_org], + group_parameters_attributes=[{'name': param_name, 'value': param_value}], + ).create() + host.hostgroup = hg + host = host.update(['hostgroup']) + result = [res for res in host.all_parameters if res['name'] == param_name] + assert result[0]['name'] == param_name + assert result[0]['associated_type'] != 'global' + assert result[0]['associated_type'] == 'host group' + + @request.addfinalizer + def _finalize(): + host.delete() + hg.delete() + cp.delete() + + host.host_parameters_attributes = [{'name': param_name, 'value': param_value}] + host = host.update(['host_parameters_attributes']) + result = [res for res in host.all_parameters if res['name'] == param_name] + assert result[0]['name'] == param_name + assert result[0]['associated_type'] != 'global' + assert result[0]['associated_type'] != 'host group' + assert result[0]['associated_type'] == 'host' From 59efe3250f6275bfaa408e252f93e355e4c791c7 Mon Sep 17 00:00:00 2001 From: Vladimir Sedmik Date: Wed, 29 Nov 2023 18:06:05 +0100 Subject: [PATCH 59/93] ISS test for custom CDN with content credentials --- tests/foreman/cli/test_satellitesync.py | 129 ++++++++++++++++++++++++ 1 file changed, 129 insertions(+) diff --git a/tests/foreman/cli/test_satellitesync.py b/tests/foreman/cli/test_satellitesync.py index e802ae9960..c3df11569d 100644 --- a/tests/foreman/cli/test_satellitesync.py +++ b/tests/foreman/cli/test_satellitesync.py @@ -2034,6 +2034,135 @@ def test_positive_export_import_mismatch_label( ['success' in task['result'] for task in tasks] ), 'Not every import task succeeded' + @pytest.mark.tier3 + @pytest.mark.parametrize( + 'function_synced_rhel_repo', + ['rhae2'], + indirect=True, + ) + def test_positive_custom_cdn_with_credential( + self, + request, + target_sat, + export_import_cleanup_function, + config_export_import_settings, + function_sca_manifest_org, + function_synced_rhel_repo, # TODO rename this to `function_synced_rh_repo` + satellite_host, + function_sca_manifest, + ): + """Export and sync repository using custom cert for custom CDN. + + :id: de1f4b06-267a-4bad-9a90-665f2906ef5f + + :parametrized: yes + + :setup: + 1. Upstream Satellite with enabled and synced RH yum repository. + 2. Downstream Satellite to sync from Upstream Satellite. + + :steps: + On the Upstream Satellite: + 1. Export the repository in syncable format and move it + to /var/www/html/pub/repos to mimic custom CDN. + On the Downstream Satellite: + 2. Create new Organization, import manifest. + 3. Create Content Credentials with Upstream Satellite's katello-server-ca.crt. + 4. Set the CDN configuration to custom CDN and use the url and CC from above. + 5. Enable and sync the repository. + + :expectedresults: + 1. Repository can be enabled and synced from Upstream to Downstream Satellite. + + :CaseLevel: System + + :BZ: 2112098 + + :customerscenario: true + """ + meta_file = 'metadata.json' + crt_file = 'source.crt' + pub_dir = '/var/www/html/pub/repos' + + # Export the repository in syncable format and move it + # to /var/www/html/pub/repos to mimic custom CDN. + target_sat.cli.ContentExport.completeRepository( + {'id': function_synced_rhel_repo['id'], 'format': 'syncable'} + ) + assert '1.0' in target_sat.validate_pulp_filepath( + function_sca_manifest_org, PULP_EXPORT_DIR + ) + exp_dir = target_sat.execute( + f'find {PULP_EXPORT_DIR}{function_sca_manifest_org.name}/ -name {meta_file}' + ).stdout.splitlines() + assert len(exp_dir) == 1 + exp_dir = exp_dir[0].replace(meta_file, '') + + assert target_sat.execute(f'mv {exp_dir} {pub_dir}').status == 0 + request.addfinalizer(lambda: target_sat.execute(f'rm -rf {pub_dir}')) + target_sat.execute(f'semanage fcontext -a -t httpd_sys_content_t "{pub_dir}(/.*)?"') + target_sat.execute(f'restorecon -R {pub_dir}') + + # Create new Organization, import manifest. + import_org = satellite_host.api.Organization().create() + satellite_host.upload_manifest(import_org.id, function_sca_manifest.content) + + # Create Content Credentials with Upstream Satellite's katello-server-ca.crt. + satellite_host.execute( + f'curl -o {crt_file} http://{target_sat.hostname}/pub/katello-server-ca.crt' + ) + cc = satellite_host.cli.ContentCredential.create( + { + 'name': gen_string('alpha'), + 'organization-id': import_org.id, + 'path': crt_file, + 'content-type': 'cert', + } + ) + assert cc, 'No content credential created' + + # Set the CDN configuration to custom CDN and use the url and CC from above. + res = satellite_host.cli.Org.configure_cdn( + { + 'id': import_org.id, + 'type': 'custom_cdn', + 'ssl-ca-credential-id': cc['id'], + 'url': f'https://{target_sat.hostname}/pub/repos/', + } + ) + assert 'Updated CDN configuration' in res + + # Enable and sync the repository. + reposet = satellite_host.cli.RepositorySet.list( + { + 'organization-id': import_org.id, + 'search': f'content_label={function_synced_rhel_repo["content-label"]}', + } + ) + assert ( + len(reposet) == 1 + ), f'Expected just one reposet for "{function_synced_rhel_repo["content-label"]}"' + res = satellite_host.cli.RepositorySet.enable( + { + 'organization-id': import_org.id, + 'id': reposet[0]['id'], + 'basearch': DEFAULT_ARCHITECTURE, + } + ) + assert 'Repository enabled' in str(res) + + repos = satellite_host.cli.Repository.list({'organization-id': import_org.id}) + assert len(repos) == 1, 'Expected 1 repo enabled' + repo = repos[0] + satellite_host.cli.Repository.synchronize({'id': repo['id']}) + + repo = satellite_host.cli.Repository.info({'id': repo['id']}) + assert ( + f'{target_sat.hostname}/pub/repos/' in repo['url'] + ), 'Enabled repo does not point to the upstream Satellite' + assert 'Success' in repo['sync']['status'], 'Sync did not succeed' + assert int(repo['content-counts']['packages']) > 0, 'No synced packages downstream' + @pytest.mark.stubbed @pytest.mark.tier3 @pytest.mark.upgrade From 6ca5aae8451749e5a360c186a147dfeb408e953b Mon Sep 17 00:00:00 2001 From: Vladimir Sedmik Date: Tue, 19 Dec 2023 17:14:55 +0100 Subject: [PATCH 60/93] Rename fixture with better name --- tests/foreman/cli/test_satellitesync.py | 86 +++++++++++++------------ 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/tests/foreman/cli/test_satellitesync.py b/tests/foreman/cli/test_satellitesync.py index c3df11569d..bdb678e59b 100644 --- a/tests/foreman/cli/test_satellitesync.py +++ b/tests/foreman/cli/test_satellitesync.py @@ -130,8 +130,8 @@ def function_synced_custom_repo(target_sat, function_org, function_product): @pytest.fixture -def function_synced_rhel_repo(request, target_sat, function_sca_manifest_org): - """Enable and synchronize rhel content with immediate policy""" +def function_synced_rh_repo(request, target_sat, function_sca_manifest_org): + """Enable and synchronize RH repo with immediate policy""" repo_dict = ( REPOS['kickstart'][request.param.replace('kickstart', '')[1:]] if 'kickstart' in request.param @@ -325,7 +325,7 @@ def test_positive_export_library_custom_repo( @pytest.mark.tier3 @pytest.mark.upgrade @pytest.mark.parametrize( - 'function_synced_rhel_repo', + 'function_synced_rh_repo', ['rhae2'], indirect=True, ) @@ -334,7 +334,7 @@ def test_positive_export_complete_library_rh_repo( target_sat, export_import_cleanup_function, function_sca_manifest_org, - function_synced_rhel_repo, + function_synced_rh_repo, ): """Export RedHat repo via complete library @@ -363,7 +363,7 @@ def test_positive_export_complete_library_rh_repo( { 'id': cv['id'], 'organization-id': function_sca_manifest_org.id, - 'repository-id': function_synced_rhel_repo['id'], + 'repository-id': function_synced_rh_repo['id'], } ) target_sat.cli.ContentView.publish({'id': cv['id']}) @@ -621,7 +621,7 @@ def test_positive_export_import_cv_end_to_end( @pytest.mark.upgrade @pytest.mark.tier3 @pytest.mark.parametrize( - 'function_synced_rhel_repo', + 'function_synced_rh_repo', ['rhae2'], indirect=True, ) @@ -633,7 +633,7 @@ def test_positive_export_import_default_org_view( function_sca_manifest_org, function_import_org_with_manifest, function_synced_custom_repo, - function_synced_rhel_repo, + function_synced_rh_repo, ): """Export Default Organization View version contents in directory and Import them. @@ -676,7 +676,7 @@ def test_positive_export_import_default_org_view( { 'id': cv['id'], 'organization-id': function_sca_manifest_org.id, - 'repository-id': function_synced_rhel_repo['id'], + 'repository-id': function_synced_rh_repo['id'], } ) target_sat.cli.ContentView.publish({'id': cv['id']}) @@ -897,7 +897,7 @@ def test_positive_export_import_promoted_cv( @pytest.mark.upgrade @pytest.mark.e2e @pytest.mark.parametrize( - 'function_synced_rhel_repo', + 'function_synced_rh_repo', ['kickstart-rhel7', 'kickstart-rhel8_bos', 'rhscl7'], indirect=True, ) @@ -908,7 +908,7 @@ def test_positive_export_import_redhat_cv( config_export_import_settings, function_sca_manifest_org, function_import_org_with_manifest, - function_synced_rhel_repo, + function_synced_rh_repo, ): """Export CV version with RedHat contents in directory and import them. @@ -943,7 +943,7 @@ def test_positive_export_import_redhat_cv( { 'id': cv['id'], 'organization-id': function_sca_manifest_org.id, - 'repository-id': function_synced_rhel_repo['id'], + 'repository-id': function_synced_rh_repo['id'], } ) target_sat.cli.ContentView.publish({'id': cv['id']}) @@ -980,15 +980,15 @@ def test_positive_export_import_redhat_cv( assert len(exported_packages) == len(imported_packages) exported_repo = target_sat.cli.Repository.info( { - 'name': function_synced_rhel_repo['name'], - 'product': function_synced_rhel_repo['product']['name'], + 'name': function_synced_rh_repo['name'], + 'product': function_synced_rh_repo['product']['name'], 'organization-id': function_sca_manifest_org.id, } ) imported_repo = target_sat.cli.Repository.info( { - 'name': function_synced_rhel_repo['name'], - 'product': function_synced_rhel_repo['product']['name'], + 'name': function_synced_rh_repo['name'], + 'product': function_synced_rh_repo['product']['name'], 'organization-id': function_import_org_with_manifest.id, } ) @@ -1321,7 +1321,7 @@ def test_postive_export_import_cv_with_file_content( @pytest.mark.tier2 @pytest.mark.parametrize( - 'function_synced_rhel_repo', + 'function_synced_rh_repo', ['rhae2'], indirect=True, ) @@ -1330,7 +1330,7 @@ def test_positive_export_rerun_failed_import( target_sat, config_export_import_settings, export_import_cleanup_function, - function_synced_rhel_repo, + function_synced_rh_repo, function_sca_manifest_org, function_import_org_with_manifest, ): @@ -1367,7 +1367,7 @@ def test_positive_export_rerun_failed_import( { 'id': cv['id'], 'organization-id': function_sca_manifest_org.id, - 'repository-id': function_synced_rhel_repo['id'], + 'repository-id': function_synced_rh_repo['id'], } ) target_sat.cli.ContentView.publish({'id': cv['id']}) @@ -1548,7 +1548,7 @@ def test_postive_export_import_repo_with_GPG( @pytest.mark.tier3 @pytest.mark.parametrize( - 'function_synced_rhel_repo', + 'function_synced_rh_repo', ['rhae2'], indirect=True, ) @@ -1558,7 +1558,7 @@ def test_negative_import_redhat_cv_without_manifest( export_import_cleanup_function, config_export_import_settings, function_sca_manifest_org, - function_synced_rhel_repo, + function_synced_rh_repo, ): """Redhat content can't be imported into satellite/organization without manifest @@ -1588,7 +1588,7 @@ def test_negative_import_redhat_cv_without_manifest( { 'id': cv['id'], 'organization-id': function_sca_manifest_org.id, - 'repository-id': function_synced_rhel_repo['id'], + 'repository-id': function_synced_rh_repo['id'], } ) target_sat.cli.ContentView.publish({'id': cv['id']}) @@ -1697,7 +1697,7 @@ def test_positive_import_content_for_disconnected_sat_with_existing_content( @pytest.mark.tier3 @pytest.mark.parametrize( - 'function_synced_rhel_repo', + 'function_synced_rh_repo', ['rhae2'], indirect=True, ) @@ -1707,7 +1707,7 @@ def test_positive_export_incremental_syncable_check_content( export_import_cleanup_function, config_export_import_settings, function_sca_manifest_org, - function_synced_rhel_repo, + function_synced_rh_repo, ): """Export complete and incremental CV version in syncable format and assert that all files referenced in the repomd.xml (including productid) are present in the exports. @@ -1743,7 +1743,7 @@ def test_positive_export_incremental_syncable_check_content( { 'id': cv['id'], 'organization-id': function_sca_manifest_org.id, - 'repository-id': function_synced_rhel_repo['id'], + 'repository-id': function_synced_rh_repo['id'], } ) target_sat.cli.ContentView.publish({'id': cv['id']}) @@ -1945,7 +1945,7 @@ def test_positive_export_import_incremental_yum_repo( @pytest.mark.tier3 @pytest.mark.parametrize( - 'function_synced_rhel_repo', + 'function_synced_rh_repo', ['rhae2'], indirect=True, ) @@ -1956,7 +1956,7 @@ def test_positive_export_import_mismatch_label( config_export_import_settings, function_sca_manifest_org, function_import_org_with_manifest, - function_synced_rhel_repo, + function_synced_rh_repo, ): """Export and import repo with mismatched label @@ -1985,7 +1985,7 @@ def test_positive_export_import_mismatch_label( assert target_sat.validate_pulp_filepath(function_sca_manifest_org, PULP_EXPORT_DIR) == '' # Export the repository and check the export directory export = target_sat.cli.ContentExport.completeRepository( - {'id': function_synced_rhel_repo['id']} + {'id': function_synced_rh_repo['id']} ) assert '1.0' in target_sat.validate_pulp_filepath( function_sca_manifest_org, PULP_EXPORT_DIR @@ -1999,8 +1999,8 @@ def test_positive_export_import_mismatch_label( ) import_repo = target_sat.cli.Repository.info( { - 'name': function_synced_rhel_repo['name'], - 'product': function_synced_rhel_repo['product']['name'], + 'name': function_synced_rh_repo['name'], + 'product': function_synced_rh_repo['product']['name'], 'organization-id': function_sca_manifest_org.id, } ) @@ -2008,7 +2008,7 @@ def test_positive_export_import_mismatch_label( # Export again and check the export directory export = target_sat.cli.ContentExport.completeRepository( - {'id': function_synced_rhel_repo['id']} + {'id': function_synced_rh_repo['id']} ) assert '2.0' in target_sat.validate_pulp_filepath( function_sca_manifest_org, PULP_EXPORT_DIR @@ -2017,7 +2017,7 @@ def test_positive_export_import_mismatch_label( # Change the repo label in metadata.json and run the import again import_path = target_sat.move_pulp_archive(function_sca_manifest_org, export['message']) target_sat.execute( - f'''sed -i 's/"label":"{function_synced_rhel_repo['label']}"/''' + f'''sed -i 's/"label":"{function_synced_rh_repo['label']}"/''' f'''"label":"{gen_string("alpha")}"/g' {import_path}/metadata.json''' ) target_sat.cli.ContentImport.repository( @@ -2036,7 +2036,7 @@ def test_positive_export_import_mismatch_label( @pytest.mark.tier3 @pytest.mark.parametrize( - 'function_synced_rhel_repo', + 'function_synced_rh_repo', ['rhae2'], indirect=True, ) @@ -2047,7 +2047,7 @@ def test_positive_custom_cdn_with_credential( export_import_cleanup_function, config_export_import_settings, function_sca_manifest_org, - function_synced_rhel_repo, # TODO rename this to `function_synced_rh_repo` + function_synced_rh_repo, satellite_host, function_sca_manifest, ): @@ -2087,7 +2087,7 @@ def test_positive_custom_cdn_with_credential( # Export the repository in syncable format and move it # to /var/www/html/pub/repos to mimic custom CDN. target_sat.cli.ContentExport.completeRepository( - {'id': function_synced_rhel_repo['id'], 'format': 'syncable'} + {'id': function_synced_rh_repo['id'], 'format': 'syncable'} ) assert '1.0' in target_sat.validate_pulp_filepath( function_sca_manifest_org, PULP_EXPORT_DIR @@ -2136,12 +2136,12 @@ def test_positive_custom_cdn_with_credential( reposet = satellite_host.cli.RepositorySet.list( { 'organization-id': import_org.id, - 'search': f'content_label={function_synced_rhel_repo["content-label"]}', + 'search': f'content_label={function_synced_rh_repo["content-label"]}', } ) assert ( len(reposet) == 1 - ), f'Expected just one reposet for "{function_synced_rhel_repo["content-label"]}"' + ), f'Expected just one reposet for "{function_synced_rh_repo["content-label"]}"' res = satellite_host.cli.RepositorySet.enable( { 'organization-id': import_org.id, @@ -2161,7 +2161,9 @@ def test_positive_custom_cdn_with_credential( f'{target_sat.hostname}/pub/repos/' in repo['url'] ), 'Enabled repo does not point to the upstream Satellite' assert 'Success' in repo['sync']['status'], 'Sync did not succeed' - assert int(repo['content-counts']['packages']) > 0, 'No synced packages downstream' + assert ( + repo['content-counts'] == function_synced_rh_repo['content-counts'] + ), 'Content counts do not match' @pytest.mark.stubbed @pytest.mark.tier3 @@ -2265,7 +2267,7 @@ class TestNetworkSync: @pytest.mark.tier2 @pytest.mark.parametrize( - 'function_synced_rhel_repo', + 'function_synced_rh_repo', ['rhae2'], indirect=True, ) @@ -2273,7 +2275,7 @@ def test_positive_network_sync_rh_repo( self, target_sat, function_sca_manifest_org, - function_synced_rhel_repo, + function_synced_rh_repo, module_downstream_sat, function_downstream_org, ): @@ -2312,12 +2314,12 @@ def test_positive_network_sync_rh_repo( reposet = module_downstream_sat.cli.RepositorySet.list( { 'organization-id': function_downstream_org.id, - 'search': f'content_label={function_synced_rhel_repo["content-label"]}', + 'search': f'content_label={function_synced_rh_repo["content-label"]}', } ) assert ( len(reposet) == 1 - ), f'Expected just one reposet for "{function_synced_rhel_repo["content-label"]}"' + ), f'Expected just one reposet for "{function_synced_rh_repo["content-label"]}"' res = module_downstream_sat.cli.RepositorySet.enable( { 'organization-id': function_downstream_org.id, @@ -2337,5 +2339,5 @@ def test_positive_network_sync_rh_repo( repo = module_downstream_sat.cli.Repository.info({'id': repo['id']}) assert 'Success' in repo['sync']['status'], 'Sync did not succeed' assert ( - repo['content-counts'] == function_synced_rhel_repo['content-counts'] + repo['content-counts'] == function_synced_rh_repo['content-counts'] ), 'Content counts do not match' From ffadf54a55060a1b3f1a0da5964a78cbdc75b2fb Mon Sep 17 00:00:00 2001 From: vsedmik <46570670+vsedmik@users.noreply.github.com> Date: Mon, 8 Jan 2024 11:11:10 +0100 Subject: [PATCH 61/93] Fix test AK create with CV (#13642) --- tests/foreman/cli/test_activationkey.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/foreman/cli/test_activationkey.py b/tests/foreman/cli/test_activationkey.py index da61301e19..15aca83eaf 100644 --- a/tests/foreman/cli/test_activationkey.py +++ b/tests/foreman/cli/test_activationkey.py @@ -154,10 +154,11 @@ def test_positive_create_with_cv(name, module_org, get_default_env, module_targe new_cv = module_target_sat.cli_factory.make_content_view( {'name': name, 'organization-id': module_org.id} ) + module_target_sat.cli.ContentView.publish({'id': new_cv['id']}) new_ak_cv = module_target_sat.cli_factory.make_activation_key( { 'content-view': new_cv['name'], - 'environment': get_default_env['name'], + 'lifecycle-environment': get_default_env['name'], 'organization-id': module_org.id, } ) From 14cdcc2068a786f1637503d658f285dae33f9ff3 Mon Sep 17 00:00:00 2001 From: Omkar Khatavkar Date: Mon, 8 Jan 2024 20:42:30 +0530 Subject: [PATCH 62/93] remove the unused testimony tokens & none used for reporting (#13479) Bump flake8 from 6.1.0 to 7.0.0 Bumps [flake8](https://github.com/pycqa/flake8) from 6.1.0 to 7.0.0. - [Commits](https://github.com/pycqa/flake8/compare/6.1.0...7.0.0) --- updated-dependencies: - dependency-name: flake8 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- scripts/polarion-test-case-upload.sh | 5 + testimony.yaml | 23 --- tests/foreman/api/test_acs.py | 7 - tests/foreman/api/test_activationkey.py | 18 +- tests/foreman/api/test_ansible.py | 13 +- tests/foreman/api/test_architecture.py | 5 - tests/foreman/api/test_audit.py | 5 - tests/foreman/api/test_bookmarks.py | 31 ++-- tests/foreman/api/test_capsule.py | 10 -- tests/foreman/api/test_capsulecontent.py | 5 - tests/foreman/api/test_classparameters.py | 5 - tests/foreman/api/test_computeprofile.py | 15 -- .../api/test_computeresource_azurerm.py | 22 +-- tests/foreman/api/test_computeresource_gce.py | 17 +- .../api/test_computeresource_libvirt.py | 23 --- tests/foreman/api/test_contentcredentials.py | 5 - tests/foreman/api/test_contentview.py | 83 --------- tests/foreman/api/test_contentviewfilter.py | 55 ------ tests/foreman/api/test_contentviewversion.py | 61 +------ tests/foreman/api/test_convert2rhel.py | 9 +- tests/foreman/api/test_discoveredhost.py | 25 +-- tests/foreman/api/test_discoveryrule.py | 5 - tests/foreman/api/test_docker.py | 12 -- tests/foreman/api/test_environment.py | 9 - tests/foreman/api/test_errata.py | 45 +---- tests/foreman/api/test_filter.py | 5 - tests/foreman/api/test_foremantask.py | 5 - tests/foreman/api/test_host.py | 65 -------- tests/foreman/api/test_hostcollection.py | 9 - tests/foreman/api/test_hostgroup.py | 25 --- tests/foreman/api/test_http_proxy.py | 7 - tests/foreman/api/test_ldapauthsource.py | 5 - .../foreman/api/test_lifecycleenvironment.py | 15 +- tests/foreman/api/test_location.py | 11 -- tests/foreman/api/test_media.py | 7 - tests/foreman/api/test_multiple_paths.py | 5 - tests/foreman/api/test_notifications.py | 5 - tests/foreman/api/test_operatingsystem.py | 8 - tests/foreman/api/test_organization.py | 10 -- .../foreman/api/test_oscap_tailoringfiles.py | 5 - tests/foreman/api/test_oscappolicy.py | 7 - tests/foreman/api/test_parameters.py | 6 - tests/foreman/api/test_partitiontable.py | 5 - tests/foreman/api/test_permission.py | 5 - tests/foreman/api/test_ping.py | 5 - tests/foreman/api/test_product.py | 15 -- tests/foreman/api/test_provisioning.py | 5 - tests/foreman/api/test_provisioning_puppet.py | 5 - .../foreman/api/test_provisioningtemplate.py | 12 +- tests/foreman/api/test_registration.py | 9 - tests/foreman/api/test_remoteexecution.py | 5 - tests/foreman/api/test_reporttemplates.py | 5 - tests/foreman/api/test_repositories.py | 21 +-- tests/foreman/api/test_repository.py | 45 +---- tests/foreman/api/test_repository_set.py | 5 - tests/foreman/api/test_rhc.py | 7 +- tests/foreman/api/test_rhcloud_inventory.py | 13 +- tests/foreman/api/test_rhsm.py | 5 - tests/foreman/api/test_role.py | 36 ---- tests/foreman/api/test_settings.py | 13 +- tests/foreman/api/test_subnet.py | 21 --- tests/foreman/api/test_subscription.py | 5 - tests/foreman/api/test_syncplan.py | 41 ----- .../foreman/api/test_template_combination.py | 5 - tests/foreman/api/test_templatesync.py | 66 +++----- tests/foreman/api/test_user.py | 18 -- tests/foreman/api/test_usergroup.py | 7 - tests/foreman/api/test_webhook.py | 5 - tests/foreman/cli/test_abrt.py | 20 +-- tests/foreman/cli/test_acs.py | 9 - tests/foreman/cli/test_activationkey.py | 72 ++------ tests/foreman/cli/test_ansible.py | 9 +- tests/foreman/cli/test_architecture.py | 5 - tests/foreman/cli/test_auth.py | 26 +-- tests/foreman/cli/test_bootdisk.py | 5 - tests/foreman/cli/test_bootstrap_script.py | 7 +- tests/foreman/cli/test_capsule.py | 9 +- tests/foreman/cli/test_capsulecontent.py | 5 - tests/foreman/cli/test_classparameters.py | 5 - .../cli/test_computeresource_azurerm.py | 18 +- tests/foreman/cli/test_computeresource_ec2.py | 7 - .../cli/test_computeresource_libvirt.py | 31 ---- tests/foreman/cli/test_computeresource_osp.py | 5 - .../foreman/cli/test_computeresource_rhev.py | 8 - .../cli/test_computeresource_vmware.py | 5 - .../foreman/cli/test_container_management.py | 7 +- tests/foreman/cli/test_contentaccess.py | 7 - tests/foreman/cli/test_contentcredentials.py | 25 --- tests/foreman/cli/test_contentview.py | 123 ++------------ tests/foreman/cli/test_contentviewfilter.py | 11 -- tests/foreman/cli/test_discoveredhost.py | 11 +- tests/foreman/cli/test_discoveryrule.py | 18 -- tests/foreman/cli/test_docker.py | 11 -- tests/foreman/cli/test_domain.py | 7 - tests/foreman/cli/test_environment.py | 7 - tests/foreman/cli/test_errata.py | 14 -- tests/foreman/cli/test_fact.py | 5 - tests/foreman/cli/test_filter.py | 5 - tests/foreman/cli/test_foremantask.py | 6 - tests/foreman/cli/test_globalparam.py | 5 - tests/foreman/cli/test_hammer.py | 5 - tests/foreman/cli/test_host.py | 81 +-------- tests/foreman/cli/test_hostcollection.py | 13 -- tests/foreman/cli/test_hostgroup.py | 20 +-- tests/foreman/cli/test_http_proxy.py | 13 +- tests/foreman/cli/test_installer.py | 5 - tests/foreman/cli/test_jobtemplate.py | 6 - tests/foreman/cli/test_ldapauthsource.py | 5 - tests/foreman/cli/test_leapp_client.py | 7 +- .../foreman/cli/test_lifecycleenvironment.py | 5 - tests/foreman/cli/test_location.py | 6 - tests/foreman/cli/test_logging.py | 7 - tests/foreman/cli/test_medium.py | 6 - tests/foreman/cli/test_model.py | 5 - tests/foreman/cli/test_operatingsystem.py | 8 - tests/foreman/cli/test_organization.py | 30 ---- tests/foreman/cli/test_oscap.py | 5 - .../foreman/cli/test_oscap_tailoringfiles.py | 5 - tests/foreman/cli/test_ostreebranch.py | 7 - tests/foreman/cli/test_partitiontable.py | 7 - tests/foreman/cli/test_ping.py | 5 - tests/foreman/cli/test_product.py | 8 +- tests/foreman/cli/test_provisioning.py | 5 - .../foreman/cli/test_provisioningtemplate.py | 9 - tests/foreman/cli/test_puppetclass.py | 5 - tests/foreman/cli/test_realm.py | 5 - tests/foreman/cli/test_registration.py | 7 - tests/foreman/cli/test_remoteexecution.py | 27 +-- tests/foreman/cli/test_report.py | 5 - tests/foreman/cli/test_reporttemplates.py | 8 - tests/foreman/cli/test_repositories.py | 5 - tests/foreman/cli/test_repository.py | 94 +++-------- tests/foreman/cli/test_repository_set.py | 5 - tests/foreman/cli/test_rhcloud_inventory.py | 33 +--- tests/foreman/cli/test_role.py | 6 - tests/foreman/cli/test_satellitesync.py | 29 ---- tests/foreman/cli/test_settings.py | 11 -- tests/foreman/cli/test_sso.py | 5 - tests/foreman/cli/test_subnet.py | 5 - tests/foreman/cli/test_subscription.py | 7 - tests/foreman/cli/test_syncplan.py | 23 --- tests/foreman/cli/test_templatesync.py | 13 +- tests/foreman/cli/test_user.py | 20 +-- tests/foreman/cli/test_usergroup.py | 13 -- .../cli/test_vm_install_products_package.py | 5 - tests/foreman/cli/test_webhook.py | 5 - tests/foreman/destructive/conftest.py | 1 - tests/foreman/destructive/test_ansible.py | 9 +- tests/foreman/destructive/test_auth.py | 6 - tests/foreman/destructive/test_capsule.py | 7 - .../destructive/test_capsule_loadbalancer.py | 14 +- .../destructive/test_capsulecontent.py | 6 - tests/foreman/destructive/test_clone.py | 5 - tests/foreman/destructive/test_contenthost.py | 7 - tests/foreman/destructive/test_contentview.py | 5 - .../destructive/test_discoveredhost.py | 7 +- .../foreman/destructive/test_foreman_rake.py | 7 +- .../destructive/test_foreman_service.py | 7 +- tests/foreman/destructive/test_host.py | 7 - tests/foreman/destructive/test_infoblox.py | 7 +- tests/foreman/destructive/test_installer.py | 7 - .../destructive/test_katello_certs_check.py | 6 - .../destructive/test_ldap_authentication.py | 16 -- .../destructive/test_ldapauthsource.py | 5 - .../destructive/test_leapp_satellite.py | 5 - tests/foreman/destructive/test_packages.py | 5 - tests/foreman/destructive/test_ping.py | 5 - .../foreman/destructive/test_puppetplugin.py | 5 - tests/foreman/destructive/test_realm.py | 5 - .../foreman/destructive/test_registration.py | 6 - .../destructive/test_remoteexecution.py | 5 - tests/foreman/destructive/test_rename.py | 6 - tests/foreman/destructive/test_repository.py | 5 - tests/foreman/endtoend/test_api_endtoend.py | 5 - tests/foreman/endtoend/test_cli_endtoend.py | 5 - tests/foreman/installer/test_infoblox.py | 13 +- tests/foreman/installer/test_installer.py | 18 -- tests/foreman/longrun/test_inc_updates.py | 7 - tests/foreman/longrun/test_oscap.py | 27 +-- tests/foreman/maintain/test_advanced.py | 5 - tests/foreman/maintain/test_backup_restore.py | 6 +- tests/foreman/maintain/test_health.py | 5 - .../foreman/maintain/test_maintenance_mode.py | 5 - tests/foreman/maintain/test_offload_DB.py | 9 +- tests/foreman/maintain/test_packages.py | 5 - tests/foreman/maintain/test_service.py | 5 - tests/foreman/maintain/test_upgrade.py | 5 - tests/foreman/sanity/test_bvt.py | 7 - tests/foreman/sys/test_dynflow.py | 5 - tests/foreman/sys/test_fam.py | 7 - tests/foreman/sys/test_katello_certs_check.py | 6 - tests/foreman/sys/test_pulp3_filesystem.py | 5 - tests/foreman/ui/test_acs.py | 5 - tests/foreman/ui/test_activationkey.py | 77 +-------- tests/foreman/ui/test_ansible.py | 31 +--- tests/foreman/ui/test_architecture.py | 7 - tests/foreman/ui/test_audit.py | 15 -- tests/foreman/ui/test_bookmarks.py | 23 +-- tests/foreman/ui/test_branding.py | 9 +- tests/foreman/ui/test_capsulecontent.py | 5 - tests/foreman/ui/test_computeprofiles.py | 7 - tests/foreman/ui/test_computeresource.py | 19 --- .../ui/test_computeresource_azurerm.py | 11 -- tests/foreman/ui/test_computeresource_ec2.py | 11 +- tests/foreman/ui/test_computeresource_gce.py | 13 +- .../ui/test_computeresource_libvirt.py | 9 - .../foreman/ui/test_computeresource_vmware.py | 19 --- tests/foreman/ui/test_config_group.py | 7 - tests/foreman/ui/test_containerimagetag.py | 7 - tests/foreman/ui/test_contentcredentials.py | 33 ---- tests/foreman/ui/test_contenthost.py | 59 ------- tests/foreman/ui/test_contentview.py | 9 - tests/foreman/ui/test_contentview_old.py | 157 +----------------- tests/foreman/ui/test_dashboard.py | 26 +-- tests/foreman/ui/test_discoveredhost.py | 5 - tests/foreman/ui/test_discoveryrule.py | 11 +- tests/foreman/ui/test_domain.py | 15 -- tests/foreman/ui/test_errata.py | 57 ++----- tests/foreman/ui/test_hardwaremodel.py | 8 - tests/foreman/ui/test_host.py | 90 +--------- tests/foreman/ui/test_hostcollection.py | 39 +---- tests/foreman/ui/test_hostgroup.py | 11 +- tests/foreman/ui/test_http_proxy.py | 18 +- tests/foreman/ui/test_jobinvocation.py | 19 +-- tests/foreman/ui/test_jobtemplate.py | 7 - tests/foreman/ui/test_ldap_authentication.py | 25 +-- tests/foreman/ui/test_lifecycleenvironment.py | 19 +-- tests/foreman/ui/test_location.py | 13 -- tests/foreman/ui/test_media.py | 7 - tests/foreman/ui/test_modulestreams.py | 7 - tests/foreman/ui/test_operatingsystem.py | 9 - tests/foreman/ui/test_organization.py | 23 +-- tests/foreman/ui/test_oscapcontent.py | 13 +- tests/foreman/ui/test_oscappolicy.py | 11 +- tests/foreman/ui/test_oscaptailoringfile.py | 7 - tests/foreman/ui/test_package.py | 15 -- tests/foreman/ui/test_partitiontable.py | 19 --- tests/foreman/ui/test_product.py | 13 +- tests/foreman/ui/test_provisioningtemplate.py | 17 +- tests/foreman/ui/test_puppetclass.py | 7 - tests/foreman/ui/test_puppetenvironment.py | 9 - tests/foreman/ui/test_registration.py | 10 -- tests/foreman/ui/test_remoteexecution.py | 65 ++------ tests/foreman/ui/test_reporttemplates.py | 12 +- tests/foreman/ui/test_repositories.py | 5 - tests/foreman/ui/test_repository.py | 73 ++------ tests/foreman/ui/test_rhc.py | 9 +- tests/foreman/ui/test_rhcloud_insights.py | 15 +- tests/foreman/ui/test_rhcloud_inventory.py | 11 +- tests/foreman/ui/test_role.py | 7 - tests/foreman/ui/test_settings.py | 29 +--- tests/foreman/ui/test_smartclassparameter.py | 15 -- tests/foreman/ui/test_subnet.py | 7 - tests/foreman/ui/test_subscription.py | 15 -- tests/foreman/ui/test_sync.py | 15 +- tests/foreman/ui/test_syncplan.py | 13 -- tests/foreman/ui/test_templatesync.py | 11 +- tests/foreman/ui/test_user.py | 27 --- tests/foreman/ui/test_usergroup.py | 9 - tests/foreman/ui/test_webhook.py | 5 - tests/foreman/virtwho/api/test_esx.py | 23 --- tests/foreman/virtwho/api/test_esx_sca.py | 23 --- tests/foreman/virtwho/api/test_hyperv.py | 9 - tests/foreman/virtwho/api/test_hyperv_sca.py | 9 - tests/foreman/virtwho/api/test_kubevirt.py | 9 - .../foreman/virtwho/api/test_kubevirt_sca.py | 9 - tests/foreman/virtwho/api/test_libvirt.py | 9 - tests/foreman/virtwho/api/test_libvirt_sca.py | 9 - tests/foreman/virtwho/api/test_nutanix.py | 14 -- tests/foreman/virtwho/api/test_nutanix_sca.py | 13 -- tests/foreman/virtwho/cli/test_esx.py | 27 --- tests/foreman/virtwho/cli/test_esx_sca.py | 29 ---- tests/foreman/virtwho/cli/test_hyperv.py | 9 - tests/foreman/virtwho/cli/test_hyperv_sca.py | 9 - tests/foreman/virtwho/cli/test_kubevirt.py | 9 - .../foreman/virtwho/cli/test_kubevirt_sca.py | 9 - tests/foreman/virtwho/cli/test_libvirt.py | 9 - tests/foreman/virtwho/cli/test_libvirt_sca.py | 9 - tests/foreman/virtwho/cli/test_nutanix.py | 15 +- tests/foreman/virtwho/cli/test_nutanix_sca.py | 13 -- tests/foreman/virtwho/conftest.py | 2 - tests/foreman/virtwho/ui/test_esx.py | 31 +--- tests/foreman/virtwho/ui/test_esx_sca.py | 29 ---- tests/foreman/virtwho/ui/test_hyperv.py | 9 - tests/foreman/virtwho/ui/test_hyperv_sca.py | 9 - tests/foreman/virtwho/ui/test_kubevirt.py | 9 - tests/foreman/virtwho/ui/test_kubevirt_sca.py | 9 - tests/foreman/virtwho/ui/test_libvirt.py | 9 - tests/foreman/virtwho/ui/test_libvirt_sca.py | 9 - tests/foreman/virtwho/ui/test_nutanix.py | 14 -- tests/foreman/virtwho/ui/test_nutanix_sca.py | 15 -- tests/upgrades/test_activation_key.py | 5 - tests/upgrades/test_bookmarks.py | 13 +- tests/upgrades/test_capsule.py | 5 - tests/upgrades/test_classparameter.py | 5 - tests/upgrades/test_client.py | 5 - tests/upgrades/test_contentview.py | 5 - tests/upgrades/test_discovery.py | 5 - tests/upgrades/test_errata.py | 5 - tests/upgrades/test_host.py | 9 +- tests/upgrades/test_hostcontent.py | 5 - tests/upgrades/test_hostgroup.py | 5 - tests/upgrades/test_performance_tuning.py | 5 - tests/upgrades/test_provisioningtemplate.py | 5 - tests/upgrades/test_puppet.py | 5 - tests/upgrades/test_remoteexecution.py | 5 - tests/upgrades/test_repository.py | 5 - tests/upgrades/test_role.py | 5 - tests/upgrades/test_satellite_maintain.py | 5 - tests/upgrades/test_satellitesync.py | 5 - tests/upgrades/test_subnet.py | 5 - tests/upgrades/test_subscription.py | 5 - tests/upgrades/test_syncplan.py | 5 - tests/upgrades/test_user.py | 5 - tests/upgrades/test_usergroup.py | 5 - tests/upgrades/test_virtwho.py | 5 - 316 files changed, 360 insertions(+), 4133 deletions(-) diff --git a/scripts/polarion-test-case-upload.sh b/scripts/polarion-test-case-upload.sh index 888bacb04f..0c24ba35c8 100755 --- a/scripts/polarion-test-case-upload.sh +++ b/scripts/polarion-test-case-upload.sh @@ -69,6 +69,11 @@ DEFAULT_APPROVERS_VALUE = '${POLARION_USERNAME}:approved' DEFAULT_STATUS_VALUE = 'approved' DEFAULT_SUBTYPE2_VALUE = '-' TESTCASE_CUSTOM_FIELDS = default_config.TESTCASE_CUSTOM_FIELDS + ('customerscenario',) + ('team',) + ('markers',) +# converting TESTCASE_CUSTOM_FIELDS to list for removing tokens since the tokens are defined as defaults/mandatory in betelgeuse +TESTCASE_CUSTOM_FIELDS = list(TESTCASE_CUSTOM_FIELDS) +REMOVE_TOKEN_LIST = ['caselevel', 'upstream', 'testtype'] +TESTCASE_CUSTOM_FIELDS = tuple([token for token in TESTCASE_CUSTOM_FIELDS if token not in REMOVE_TOKEN_LIST]) + REQUIREMENT_CUSTOM_FIELDS = default_config.REQUIREMENT_CUSTOM_FIELDS + ('team',) TRANSFORM_CUSTOMERSCENARIO_VALUE = default_config._transform_to_lower DEFAULT_CUSTOMERSCENARIO_VALUE = 'false' diff --git a/testimony.yaml b/testimony.yaml index 237a80b8f2..7caf84e5cf 100644 --- a/testimony.yaml +++ b/testimony.yaml @@ -121,15 +121,6 @@ CaseImportance: - Low required: true type: choice -CaseLevel: - casesensitive: true - choices: - - Component - - Integration - - System - - Acceptance - required: true - type: choice CasePosNeg: casesensitive: false choices: @@ -157,20 +148,6 @@ SubComponent: type: choice Subtype1: {} Teardown: {} -TestType: - casesensitive: false - choices: - - Functional - - Structural - required: true - type: choice -Upstream: - casesensitive: false - choices: - - 'Yes' - - 'No' - required: true - type: choice Parametrized: casesensitive: false choices: diff --git a/tests/foreman/api/test_acs.py b/tests/foreman/api/test_acs.py index bb4cfaf125..8294f36366 100644 --- a/tests/foreman/api/test_acs.py +++ b/tests/foreman/api/test_acs.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: AlternateContentSources :Team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -50,7 +45,6 @@ def test_positive_CRUD_all_types( 3. ACS can be updated and read with new name. 4. ACS can be refreshed. 5. ACS can be deleted. - """ if 'rhui' in request.node.name and 'file' in request.node.name: pytest.skip('unsupported parametrize combination') @@ -127,7 +121,6 @@ def test_positive_run_bulk_actions(module_target_sat, module_yum_repo): :expectedresults: 1. All ACSes can be refreshed via bulk action. 2. Only the proper ACSes are deleted on bulk destroy. - """ acs_ids = [] for i in range(3): diff --git a/tests/foreman/api/test_activationkey.py b/tests/foreman/api/test_activationkey.py index d909c4b87a..56513c03d8 100644 --- a/tests/foreman/api/test_activationkey.py +++ b/tests/foreman/api/test_activationkey.py @@ -4,17 +4,13 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ActivationKeys :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No + """ import http @@ -278,8 +274,6 @@ def test_positive_get_releases_status_code(target_sat): :expectedresults: HTTP 200 is returned with an ``application/json`` content-type - - :CaseLevel: Integration """ act_key = target_sat.api.ActivationKey().create() path = act_key.path('releases') @@ -296,8 +290,6 @@ def test_positive_get_releases_content(target_sat): :id: 2fec3d71-33e9-40e5-b934-90b03afc26a1 :expectedresults: A list of results is returned. - - :CaseLevel: Integration """ act_key = target_sat.api.ActivationKey().create() response = client.get(act_key.path('releases'), auth=get_credentials(), verify=False).json() @@ -319,8 +311,6 @@ def test_positive_add_host_collections(module_org, module_target_sat): collections and reading that activation key, the correct host collections are listed. - :CaseLevel: Integration - :CaseImportance: Critical """ # An activation key has no host collections by default. @@ -358,8 +348,6 @@ def test_positive_remove_host_collection(module_org, module_target_sat): 3. Disassociating host collection from the activation key actually removes it from the list - :CaseLevel: Integration - :CaseImportance: Critical """ # An activation key has no host collections by default. @@ -451,8 +439,6 @@ def test_positive_fetch_product_content( :expectedresults: Both Red Hat and custom product subscriptions are assigned as Activation Key's product content - :CaseLevel: Integration - :CaseImportance: Critical """ module_target_sat.upload_manifest(module_org.id, session_entitlement_manifest.content) @@ -506,8 +492,6 @@ def test_positive_add_future_subscription(): :CaseAutomation: NotAutomated - :CaseLevel: Integration - :CaseImportance: Critical """ diff --git a/tests/foreman/api/test_ansible.py b/tests/foreman/api/test_ansible.py index a842ec5c3c..eca139145d 100644 --- a/tests/foreman/api/test_ansible.py +++ b/tests/foreman/api/test_ansible.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Ansible :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -33,7 +28,7 @@ def test_fetch_and_sync_ansible_playbooks(target_sat): :customerscenario: true - :Steps: + :steps: 1. Install ansible collection with playbooks. 2. Try to fetch the playbooks via api. @@ -79,7 +74,7 @@ def test_positive_ansible_job_on_host( :id: c8dcdc54-cb98-4b24-bff9-049a6cc36acb - :Steps: + :steps: 1. Register a content host with satellite 2. Import a role into satellite 3. Assign that role to a host @@ -220,7 +215,7 @@ def test_add_and_remove_ansible_role_hostgroup(target_sat): :id: 7672cf86-fa31-11ed-855a-0fd307d2d66b - :Steps: + :steps: 1. Create a hostgroup 2. Sync few ansible roles 3. Assign a few ansible roles with the host group @@ -260,7 +255,7 @@ def test_add_and_remove_ansible_role_hostgroup(target_sat): @pytest.fixture def filtered_user(target_sat, module_org, module_location): """ - :Steps: + :steps: 1. Create a role with a host view filtered 2. Create a user with that role 3. Setup a host diff --git a/tests/foreman/api/test_architecture.py b/tests/foreman/api/test_architecture.py index f0b7c428b0..362abbfae3 100644 --- a/tests/foreman/api/test_architecture.py +++ b/tests/foreman/api/test_architecture.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Hosts :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_choice import pytest diff --git a/tests/foreman/api/test_audit.py b/tests/foreman/api/test_audit.py index 85bcec9bd7..a90eda8388 100644 --- a/tests/foreman/api/test_audit.py +++ b/tests/foreman/api/test_audit.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: AuditLog :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/foreman/api/test_bookmarks.py b/tests/foreman/api/test_bookmarks.py index 694d0a6654..b51ac194cb 100644 --- a/tests/foreman/api/test_bookmarks.py +++ b/tests/foreman/api/test_bookmarks.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Search :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import random @@ -38,7 +33,7 @@ def test_positive_create_with_name(controller, target_sat): :parametrized: yes - :Steps: + :steps: 1. Create a bookmark with a random name and valid controller. 2. List the bookmarks. @@ -64,7 +59,7 @@ def test_positive_create_with_query(controller, target_sat): :parametrized: yes - :Steps: + :steps: 1. Create a bookmark with a random query and valid controller. 2. List the bookmarks. @@ -91,7 +86,7 @@ def test_positive_create_public(controller, public, target_sat): :parametrized: yes - :Steps: + :steps: 1. Create a bookmark with a valid controller and public attribute True or False. 2. List the bookmarks. @@ -116,7 +111,7 @@ def test_negative_create_with_invalid_name(controller, target_sat): :parametrized: yes - :Steps: + :steps: 1. Attempt to create a bookmark with an invalid name. 2. List the bookmarks. @@ -144,7 +139,7 @@ def test_negative_create_empty_query(controller, target_sat): :parametrized: yes - :Steps: + :steps: 1. Attempt to create a bookmark with a random name, valid controller, and empty query. 2. List the bookmarks. @@ -172,7 +167,7 @@ def test_negative_create_same_name(controller, target_sat): :parametrized: yes - :Steps: + :steps: 1. Create a bookmark with a random name and valid controller. 2. Attempt to create a second bookmark, using the same name as the previous bookmark. @@ -202,7 +197,7 @@ def test_negative_create_null_public(controller, target_sat): :parametrized: yes - :Steps: + :steps: 1. Attempt to create a bookmark with a random name and valid controller, with public attribute set to None. @@ -233,7 +228,7 @@ def test_positive_update_name(controller, target_sat): :parametrized: yes - :Steps: + :steps: 1. Create a bookmark with a valid controller. 2. Update the bookmark with a random name. @@ -260,7 +255,7 @@ def test_negative_update_same_name(controller, target_sat): :parametrized: yes - :Steps: + :steps: 1. Create a bookmark with a random name and valid controller. 2. Create a second bookmark for the same controller. @@ -291,7 +286,7 @@ def test_negative_update_invalid_name(controller, target_sat): :parametrized: yes - :Steps: + :steps: 1. Create a bookmark with valid controller. 2. Attempt to update the bookmark with an invalid name. @@ -320,7 +315,7 @@ def test_positive_update_query(controller, target_sat): :parametrized: yes - :Steps: + :steps: 1. Create a bookmark with a valid controller. 2. Update the bookmark's query with a random value. @@ -347,7 +342,7 @@ def test_negative_update_empty_query(controller, target_sat): :parametrized: yes - :Steps: + :steps: 1. Create a bookmark for a valid controller. 2. Attempt to update the query to an empty value. @@ -376,7 +371,7 @@ def test_positive_update_public(controller, public, target_sat): :parametrized: yes - :Steps: + :steps: 1. Create a bookmark for a valid controller. 2. Update the bookmark's public attribute. diff --git a/tests/foreman/api/test_capsule.py b/tests/foreman/api/test_capsule.py index b8304979e7..3d499ccf16 100644 --- a/tests/foreman/api/test_capsule.py +++ b/tests/foreman/api/test_capsule.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Capsule :Team: Platform -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ from fauxfactory import gen_string, gen_url import pytest @@ -43,7 +38,6 @@ def test_positive_update_capsule(target_sat, module_capsule_configured): :bz: 2077824 :customerscenario: true - """ new_name = f'{gen_string("alpha")}-{module_capsule_configured.name}' capsule = target_sat.api.SmartProxy().search( @@ -89,7 +83,6 @@ def test_negative_create_with_url(target_sat): :id: e48a6260-97e0-4234-a69c-77bbbcde85d6 :expectedresults: Proxy is not created - """ # Create a random proxy with pytest.raises(HTTPError) as context: @@ -125,7 +118,6 @@ def test_positive_update_url(request, target_sat): :id: 0305fd54-4e0c-4dd9-a537-d342c3dc867e :expectedresults: Capsule has the url updated - """ # Create fake capsule with name name = gen_string('alpha') @@ -159,8 +151,6 @@ def test_positive_import_puppet_classes( :CaseComponent: Puppet - :CaseLevel: Integration - :BZ: 1398695, 2142555 :customerscenario: true diff --git a/tests/foreman/api/test_capsulecontent.py b/tests/foreman/api/test_capsulecontent.py index 426dcdbe6e..8adb2fa831 100644 --- a/tests/foreman/api/test_capsulecontent.py +++ b/tests/foreman/api/test_capsulecontent.py @@ -5,17 +5,12 @@ :CaseAutomation: Automated -:CaseLevel: System - :CaseComponent: Capsule-Content :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from datetime import datetime import re diff --git a/tests/foreman/api/test_classparameters.py b/tests/foreman/api/test_classparameters.py index 446bdf1418..931a11edec 100644 --- a/tests/foreman/api/test_classparameters.py +++ b/tests/foreman/api/test_classparameters.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Puppet :CaseImportance: Medium :Team: Rocket -:TestType: Functional - -:Upstream: No """ import json from random import choice diff --git a/tests/foreman/api/test_computeprofile.py b/tests/foreman/api/test_computeprofile.py index dffe47620b..6d374bc8b3 100644 --- a/tests/foreman/api/test_computeprofile.py +++ b/tests/foreman/api/test_computeprofile.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: ComputeResources :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest from requests.exceptions import HTTPError @@ -37,8 +32,6 @@ def test_positive_create_with_name(name, target_sat): :CaseImportance: Critical - :CaseLevel: Component - :parametrized: yes """ profile = target_sat.api.ComputeProfile(name=name).create() @@ -56,8 +49,6 @@ def test_negative_create(name, target_sat): :CaseImportance: Critical - :CaseLevel: Component - :parametrized: yes """ with pytest.raises(HTTPError): @@ -75,8 +66,6 @@ def test_positive_update_name(new_name, target_sat): :CaseImportance: Critical - :CaseLevel: Component - :parametrized: yes """ profile = target_sat.api.ComputeProfile().create() @@ -96,8 +85,6 @@ def test_negative_update_name(new_name, target_sat): :CaseImportance: Critical - :CaseLevel: Component - :parametrized: yes """ profile = target_sat.api.ComputeProfile().create() @@ -118,8 +105,6 @@ def test_positive_delete(new_name, target_sat): :CaseImportance: Critical - :CaseLevel: Component - :parametrized: yes """ profile = target_sat.api.ComputeProfile(name=new_name).create() diff --git a/tests/foreman/api/test_computeresource_azurerm.py b/tests/foreman/api/test_computeresource_azurerm.py index 74d6a73309..66f25f74b2 100644 --- a/tests/foreman/api/test_computeresource_azurerm.py +++ b/tests/foreman/api/test_computeresource_azurerm.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ComputeResources-Azure :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -53,7 +48,6 @@ def test_positive_crud_azurerm_cr( :CaseImportance: Critical - :CaseLevel: Component """ # Create CR cr_name = gen_string('alpha') @@ -108,7 +102,6 @@ def test_positive_create_cloud_init_image( :expectedresults: Cloud init image should be added in AzureRM CR along with username - :CaseLevel: Integration """ assert module_azurerm_cloudimg.architecture.id == sat_azure_default_architecture.id @@ -128,7 +121,6 @@ def test_positive_check_available_networks(self, azurermclient, module_azurerm_c :expectedresults: All the networks from AzureRM CR should be available. - :CaseLevel: Integration """ cr_nws = module_azurerm_cr.available_networks() portal_nws = azurermclient.list_network() @@ -143,8 +135,6 @@ def test_gov_cloud_regions_from_azure_compute_resources(self): :CaseImportance: Medium - :CaseLevel: Acceptance - :CaseAutomation: ManualOnly :steps: @@ -267,9 +257,7 @@ def test_positive_azurerm_host_provisioned(self, class_host_ft, azureclient_host :id: ff27905f-fa3c-43ac-b969-9525b32f75f5 - :CaseLevel: Component - - ::CaseImportance: Critical + :CaseImportance: Critical :steps: 1. Create a AzureRM Compute Resource and provision host. @@ -300,8 +288,6 @@ def test_positive_azurerm_host_power_on_off(self, class_host_ft, azureclient_hos :id: 9ced29d7-d866-4d0c-ac27-78753b5b5a94 - :CaseLevel: System - :steps: 1. Create a AzureRM Compute Resource. 2. Provision a Host on Azure Cloud using above CR. @@ -421,9 +407,7 @@ def test_positive_azurerm_ud_host_provisioned(self, class_host_ud, azureclient_h :id: df496d7c-3443-4afe-b807-5bbfc90e866e - :CaseLevel: Component - - ::CaseImportance: Critical + :CaseImportance: Critical :steps: 1. Create a AzureRM Compute Resource and provision host. @@ -574,8 +558,6 @@ def test_positive_azurerm_custom_image_host_provisioned( :id: b5be5128-ad49-4dbd-a660-3e38ce012327 - :CaseLevel: System - :CaseImportance: Critical :steps: diff --git a/tests/foreman/api/test_computeresource_gce.py b/tests/foreman/api/test_computeresource_gce.py index 69bcdd7cbd..2d088f4f2a 100644 --- a/tests/foreman/api/test_computeresource_gce.py +++ b/tests/foreman/api/test_computeresource_gce.py @@ -7,17 +7,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: ComputeResources-GCE :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import random @@ -43,7 +38,6 @@ def test_positive_crud_gce_cr(self, sat_gce, sat_gce_org, sat_gce_loc, gce_cert) :CaseImportance: Critical - :CaseLevel: Component """ cr_name = gen_string('alpha') # Testing Create @@ -83,7 +77,6 @@ def test_positive_check_available_images(self, module_gce_compute, googleclient) :expectedresults: RHEL images from GCP are available to select in GCE CR - :CaseLevel: Integration """ satgce_images = module_gce_compute.available_images() googleclient_images = googleclient.list_templates( @@ -105,7 +98,6 @@ def test_positive_check_available_networks(self, module_gce_compute, googleclien :expectedresults: All the networks from Google CR should be available to select in GCE CR - :CaseLevel: Integration """ gceavailable_networks = module_gce_compute.available_networks() satgce_networks = [net['name'] for net in gceavailable_networks['results']] @@ -122,7 +114,6 @@ def test_positive_check_available_flavors(self, module_gce_compute): :expectedresults: All the flavors from Google CR should be available to select in GCE Host - :CaseLevel: Integration """ satgce_flavors = int(module_gce_compute.available_flavors()['total']) assert satgce_flavors > 1 @@ -143,7 +134,6 @@ def test_positive_create_finish_template_image( :expectedresults: Finish template image should be added in GCE CR along with username - :CaseLevel: Integration """ assert module_gce_finishimg.compute_resource.id == module_gce_compute.id assert module_gce_finishimg.uuid == gce_latest_rhel_uuid @@ -162,7 +152,6 @@ def test_positive_create_cloud_init_image( :expectedresults: Cloud init image should be added in GCE CR along with username - :CaseLevel: Integration """ assert module_gce_cloudimg.compute_resource.id == module_gce_compute.id assert module_gce_cloudimg.uuid == gce_custom_cloudinit_uuid @@ -243,9 +232,7 @@ def test_positive_gce_host_provisioned(self, class_host, google_host): :id: 889975f2-56ca-4584-95a7-21c513969630 - :CaseLevel: Component - - ::CaseImportance: Critical + :CaseImportance: Critical :steps: 1. Create a GCE Compute Resource @@ -269,8 +256,6 @@ def test_positive_gce_host_power_on_off(self, class_host, google_host): :id: b622c6fc-c45e-431d-8de3-9d0237873998 - :CaseLevel: System - :steps: 1. Create a GCE Compute Resource 2. Create a Hostgroup with all the Global and Foreman entities but diff --git a/tests/foreman/api/test_computeresource_libvirt.py b/tests/foreman/api/test_computeresource_libvirt.py index a02d741e89..5189af9d44 100644 --- a/tests/foreman/api/test_computeresource_libvirt.py +++ b/tests/foreman/api/test_computeresource_libvirt.py @@ -8,17 +8,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: ComputeResources-libvirt :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -46,8 +41,6 @@ def test_positive_crud_libvirt_cr(module_target_sat, module_org, module_location :expectedresults: Compute resources are created with expected names :CaseImportance: Critical - - :CaseLevel: Component """ name = gen_string('alphanumeric') description = gen_string('alphanumeric') @@ -111,8 +104,6 @@ def test_positive_create_with_name_description( :CaseImportance: Critical - :CaseLevel: Component - :parametrized: yes """ compresource = module_target_sat.api.LibvirtComputeResource( @@ -137,8 +128,6 @@ def test_positive_create_with_orgs_and_locs(request, module_target_sat): locations assigned :CaseImportance: High - - :CaseLevel: Integration """ orgs = [module_target_sat.api.Organization().create() for _ in range(2)] locs = [module_target_sat.api.Location(organization=[org]).create() for org in orgs] @@ -161,8 +150,6 @@ def test_negative_create_with_invalid_name(name, module_target_sat, module_org, :CaseImportance: High - :CaseLevel: Component - :parametrized: yes """ with pytest.raises(HTTPError): @@ -183,8 +170,6 @@ def test_negative_create_with_same_name(request, module_target_sat, module_org, :expectedresults: Compute resources is not created :CaseImportance: High - - :CaseLevel: Component """ name = gen_string('alphanumeric') cr = module_target_sat.api.LibvirtComputeResource( @@ -212,8 +197,6 @@ def test_negative_create_with_url(module_target_sat, module_org, module_location :CaseImportance: High - :CaseLevel: Component - :parametrized: yes """ with pytest.raises(HTTPError): @@ -235,8 +218,6 @@ def test_negative_update_invalid_name( :CaseImportance: High - :CaseLevel: Component - :parametrized: yes """ name = gen_string('alphanumeric') @@ -259,8 +240,6 @@ def test_negative_update_same_name(request, module_target_sat, module_org, modul :expectedresults: Compute resources is not updated :CaseImportance: High - - :CaseLevel: Component """ name = gen_string('alphanumeric') compresource = module_target_sat.api.LibvirtComputeResource( @@ -291,8 +270,6 @@ def test_negative_update_url(url, request, module_target_sat, module_org, module :CaseImportance: High - :CaseLevel: Component - :parametrized: yes """ compresource = module_target_sat.api.LibvirtComputeResource( diff --git a/tests/foreman/api/test_contentcredentials.py b/tests/foreman/api/test_contentcredentials.py index aaad032297..3f088ae625 100644 --- a/tests/foreman/api/test_contentcredentials.py +++ b/tests/foreman/api/test_contentcredentials.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ContentCredentials :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from copy import copy diff --git a/tests/foreman/api/test_contentview.py b/tests/foreman/api/test_contentview.py index 602f397846..438ecdf3ca 100644 --- a/tests/foreman/api/test_contentview.py +++ b/tests/foreman/api/test_contentview.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ContentViews :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import random @@ -118,8 +113,6 @@ def test_positive_subscribe_host( :expectedresults: It is possible to create a host and set its 'content_view_id' facet attribute - :CaseLevel: Integration - :CaseAutomation: Automated :CaseImportance: High @@ -153,8 +146,6 @@ def test_positive_clone_within_same_env(self, class_published_cloned_cv, module_ :expectedresults: Cloned content view can be published and promoted to the same environment as the original content view - :CaseLevel: Integration - :CaseImportance: High """ class_published_cloned_cv.read().version[0].promote(data={'environment_ids': module_lce.id}) @@ -173,8 +164,6 @@ def test_positive_clone_with_diff_env( :expectedresults: Cloned content view can be published and promoted to a different environment as the original content view - :CaseLevel: Integration - :CaseImportance: Medium """ le_clone = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() @@ -188,8 +177,6 @@ def test_positive_add_custom_content(self, module_product, module_org, module_ta :expectedresults: Custom content assigned and present in content view - :CaseLevel: Integration - :CaseImportance: Critical """ yum_repo = module_target_sat.api.Repository(product=module_product).create() @@ -214,8 +201,6 @@ def test_positive_add_custom_module_streams( :expectedresults: Custom content (module streams) assigned and present in content view - :CaseLevel: Integration - :CaseImportance: High """ yum_repo = module_target_sat.api.Repository( @@ -241,8 +226,6 @@ def test_negative_add_dupe_repos( :expectedresults: User cannot add repos multiple times to the view - :CaseLevel: Integration - :CaseImportance: Low """ yum_repo = module_target_sat.api.Repository(product=module_product).create() @@ -265,8 +248,6 @@ def test_positive_add_sha512_rpm(self, content_view, module_org, module_target_s :expectedresults: Custom sha512 assigned and present in content view - :CaseLevel: Integration - :CaseComponent: Pulp :team: Rocket @@ -428,8 +409,6 @@ def test_positive_publish_with_content_multiple(self, content_view, module_org): content view can be published several times, and each content view version has at least one package. - :CaseLevel: Integration - :CaseImportance: High """ content_view.repository = [self.yum_repo] @@ -456,8 +435,6 @@ def test_positive_publish_composite_multiple_content_once(self, module_org, modu :expectedresults: Composite content view is published and corresponding version is assigned to it. - :CaseLevel: Integration - :CaseImportance: Critical """ composite_cv = module_target_sat.api.ContentView( @@ -483,8 +460,6 @@ def test_positive_publish_composite_multiple_content_multiple( :expectedresults: Composite content view is published several times and corresponding versions are assigned to it. - :CaseLevel: Integration - :CaseImportance: High """ composite_cv = module_target_sat.api.ContentView( @@ -510,8 +485,6 @@ def test_positive_promote_with_yum_multiple(self, content_view, module_org, modu version is in ``REPEAT + 1`` lifecycle environments and it has at least one package. - :CaseLevel: Integration - :CaseImportance: High """ content_view.repository = [self.yum_repo] @@ -544,8 +517,6 @@ def test_positive_add_to_composite(self, content_view, module_org, module_target :expectedresults: Content view can be created and assigned to composite one through content view versions mechanism - :CaseLevel: Integration - :CaseImportance: Critical """ content_view.repository = [self.yum_repo] @@ -576,8 +547,6 @@ def test_negative_add_components_to_composite( :expectedresults: User cannot add components to the view - :CaseLevel: Integration - :CaseImportance: Low """ content_view.repository = [self.yum_repo] @@ -607,8 +576,6 @@ def test_positive_promote_composite_multiple_content_once( :expectedresults: Composite content view version points to ``Library + 1`` lifecycle environments after the promotions. - :CaseLevel: Integration - :CaseImportance: High """ composite_cv = module_target_sat.api.ContentView( @@ -638,8 +605,6 @@ def test_positive_promote_composite_multiple_content_multiple( :expectedresults: Composite content view version points to ``Library + random`` lifecycle environments after the promotions. - :CaseLevel: Integration - :CaseImportance: High """ composite_cv = module_target_sat.api.ContentView( @@ -669,8 +634,6 @@ def test_positive_promote_out_of_sequence(self, content_view, module_org): :expectedresults: Content view promoted out of sequence properly - :CaseLevel: Integration - :CaseImportance: Medium """ for _ in range(REPEAT): @@ -705,8 +668,6 @@ def test_positive_publish_multiple_repos(self, content_view, module_org, module_ :expectedresults: Content view publish should not raise an exception. - :CaseLevel: Integration - :CaseComponent: Pulp :team: Rocket @@ -801,8 +762,6 @@ def test_ccv_audit_scenarios(self, module_org, target_sat): :expectedresults: When appropriate, a ccv and it's cvs needs_publish flags get set or unset - :CaseLevel: Integration - :CaseImportance: High """ composite_cv = target_sat.api.ContentView(composite=True).create() @@ -862,8 +821,6 @@ def test_check_needs_publish_flag(self, target_sat): :expectedresults: The publish_only_if_needed flag is working as intended, and is defaulted to false - :CaseLevel: Integration - :CaseImportance: High """ cv = target_sat.api.ContentView().create() @@ -997,8 +954,6 @@ def test_positive_add_rh(self): :expectedresults: RH Content assigned and present in a view - :CaseLevel: Integration - :CaseImportance: High """ assert len(self.yumcv.repository) == 1 @@ -1013,8 +968,6 @@ def test_positive_add_rh_custom_spin(self, target_sat): :expectedresults: Filtered RH content is available and can be seen in a view - :CaseLevel: Integration - :CaseImportance: High """ # content_view ← cv_filter @@ -1041,8 +994,6 @@ def test_positive_update_rh_custom_spin(self, target_sat): :expectedresults: edited content view save is successful and info is updated - :CaseLevel: Integration - :CaseImportance: High """ cvf = target_sat.api.ErratumContentViewFilter( @@ -1067,8 +1018,6 @@ def test_positive_publish_rh(self, module_org, content_view): :expectedresults: Content view can be published - :CaseLevel: Integration - :CaseImportance: Critical """ content_view.repository = [self.repo] @@ -1085,8 +1034,6 @@ def test_positive_publish_rh_custom_spin(self, module_org, content_view, module_ :expectedresults: Content view can be published - :CaseLevel: Integration - :CaseImportance: High """ content_view.repository = [self.repo] @@ -1105,8 +1052,6 @@ def test_positive_promote_rh(self, module_org, content_view, module_lce): :expectedresults: Content view can be promoted - :CaseLevel: Integration - :CaseImportance: Critical """ content_view.repository = [self.repo] @@ -1130,8 +1075,6 @@ def test_positive_promote_rh_custom_spin(self, content_view, module_lce, module_ :expectedresults: Content view can be promoted - :CaseLevel: Integration - :CaseImportance: High """ content_view.repository = [self.repo] @@ -1166,8 +1109,6 @@ def test_cv_audit_scenarios(self, module_product, target_sat): :expectedresults: All of the above steps should results in the CV needing to be be published - :CaseLevel: Integration - :CaseImportance: High """ # needs_publish is set to true when created @@ -1251,8 +1192,6 @@ def test_positive_admin_user_actions( :expectedresults: The user can Read, Modify, Delete, Publish, Promote the content views - :CaseLevel: Integration - :CaseImportance: Critical """ user_login = gen_string('alpha') @@ -1311,8 +1250,6 @@ def test_positive_readonly_user_actions(target_sat, function_role, content_view, :expectedresults: User with read-only role for content view can view the repository in the content view - :CaseLevel: Integration - :CaseImportance: Critical """ user_login = gen_string('alpha') @@ -1377,8 +1314,6 @@ def test_negative_readonly_user_actions( :BZ: 1922134 - :CaseLevel: Integration - :CaseImportance: Critical """ user_login = gen_string('alpha') @@ -1454,8 +1389,6 @@ def test_negative_non_readonly_user_actions(target_sat, content_view, function_r :expectedresults: the user can perform different operations against content view, but not read it - :CaseLevel: Integration - :CaseImportance: Critical """ user_login = gen_string('alpha') @@ -1533,8 +1466,6 @@ def test_positive_add_custom_ostree_content(self, content_view): :expectedresults: Custom ostree content assigned and present in content view - :CaseLevel: Integration - :CaseImportance: High """ assert len(content_view.repository) == 0 @@ -1552,8 +1483,6 @@ def test_positive_publish_custom_ostree(self, content_view): :expectedresults: Content-view with Custom ostree published successfully - :CaseLevel: Integration - :CaseImportance: High """ content_view.repository = [self.ostree_repo] @@ -1570,8 +1499,6 @@ def test_positive_promote_custom_ostree(self, content_view, module_lce): :expectedresults: Content-view with custom ostree contents promoted successfully - :CaseLevel: Integration - :CaseImportance: High """ content_view.repository = [self.ostree_repo] @@ -1592,8 +1519,6 @@ def test_positive_publish_promote_with_custom_ostree_and_other(self, content_vie :expectedresults: Content-view with custom ostree and other contents promoted successfully - :CaseLevel: Integration - :CaseImportance: High """ content_view.repository = [self.ostree_repo, self.yum_repo, self.docker_repo] @@ -1636,8 +1561,6 @@ def test_positive_add_rh_ostree_content(self, content_view): :expectedresults: RH atomic ostree content assigned and present in content view - :CaseLevel: Integration - :CaseImportance: High """ assert len(content_view.repository) == 0 @@ -1655,8 +1578,6 @@ def test_positive_publish_RH_ostree(self, content_view): :expectedresults: Content-view with RH ostree contents published successfully - :CaseLevel: Integration - :CaseImportance: High """ content_view.repository = [self.repo] @@ -1673,8 +1594,6 @@ def test_positive_promote_RH_ostree(self, content_view, module_lce): :expectedresults: Content-view with RH ostree contents promoted successfully - :CaseLevel: Integration - :CaseImportance: High """ content_view.repository = [self.repo] @@ -1697,8 +1616,6 @@ def test_positive_publish_promote_with_RH_ostree_and_other( :expectedresults: Content-view with RH ostree and other contents promoted successfully - :CaseLevel: Integration - :CaseImportance: High """ repo_id = module_target_sat.api_factory.enable_rhrepo_and_fetchid( diff --git a/tests/foreman/api/test_contentviewfilter.py b/tests/foreman/api/test_contentviewfilter.py index 8e4ac95c75..6360bf5da1 100644 --- a/tests/foreman/api/test_contentviewfilter.py +++ b/tests/foreman/api/test_contentviewfilter.py @@ -8,17 +8,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ContentViews :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import http from random import randint @@ -79,8 +74,6 @@ def test_negative_get_with_no_args(self, target_sat): :expectedresults: An HTTP 200 response is received if a GET request is issued with no arguments specified. - :CaseLevel: Integration - :CaseImportance: Low """ response = client.get( @@ -99,8 +92,6 @@ def test_negative_get_with_bad_args(self, target_sat): :expectedresults: An HTTP 200 response is received if a GET request is issued with bad arguments specified. - :CaseLevel: Integration - :CaseImportance: Low """ response = client.get( @@ -123,7 +114,6 @@ def test_positive_create_erratum_with_name(self, name, content_view, target_sat) :expectedresults: Content view filter created successfully and has correct name and type - :CaseLevel: Integration """ cvf = target_sat.api.ErratumContentViewFilter(content_view=content_view, name=name).create() assert cvf.name == name @@ -141,8 +131,6 @@ def test_positive_create_pkg_group_with_name(self, name, content_view, target_sa :expectedresults: Content view filter created successfully and has correct name and type - :CaseLevel: Integration - :CaseImportance: Medium """ cvf = target_sat.api.PackageGroupContentViewFilter( @@ -164,8 +152,6 @@ def test_positive_create_rpm_with_name(self, name, content_view, target_sat): :expectedresults: Content view filter created successfully and has correct name and type - :CaseLevel: Integration - :CaseImportance: Medium """ cvf = target_sat.api.RPMContentViewFilter(content_view=content_view, name=name).create() @@ -184,7 +170,6 @@ def test_positive_create_with_inclusion(self, inclusion, content_view, target_sa :expectedresults: Content view filter created successfully and has correct inclusion value - :CaseLevel: Integration """ cvf = target_sat.api.RPMContentViewFilter( content_view=content_view, inclusion=inclusion @@ -203,8 +188,6 @@ def test_positive_create_with_description(self, description, content_view, targe :expectedresults: Content view filter created successfully and has correct description - :CaseLevel: Integration - :CaseImportance: Low """ cvf = target_sat.api.RPMContentViewFilter( @@ -222,7 +205,6 @@ def test_positive_create_with_repo(self, content_view, sync_repo, target_sat): :expectedresults: Content view filter created successfully and has repository assigned - :CaseLevel: Integration """ cvf = target_sat.api.RPMContentViewFilter( content_view=content_view, @@ -246,8 +228,6 @@ def test_positive_create_with_original_packages( :expectedresults: Content view filter created successfully and has 'original packages' value - :CaseLevel: Integration - :CaseImportance: Medium """ cvf = target_sat.api.RPMContentViewFilter( @@ -271,7 +251,6 @@ def test_positive_create_with_docker_repos( :expectedresults: Content view filter created successfully and has both repositories assigned (yum and docker) - :CaseLevel: Integration """ docker_repository = module_target_sat.api.Repository( content_type='docker', @@ -305,7 +284,6 @@ def test_positive_create_with_module_streams( :expectedresults: Content view filter created successfully for both Include and Exclude Type - :CaseLevel: Integration """ content_view.repository += [sync_repo_module_stream] content_view.update(['repository']) @@ -331,8 +309,6 @@ def test_negative_create_with_invalid_name(self, name, content_view, target_sat) :expectedresults: Content view filter was not created - :CaseLevel: Integration - :CaseImportance: Critical """ with pytest.raises(HTTPError): @@ -346,8 +322,6 @@ def test_negative_create_with_same_name(self, content_view, target_sat): :expectedresults: Second content view filter was not created - :CaseLevel: Integration - :CaseImportance: Low """ kwargs = {'content_view': content_view, 'name': gen_string('alpha')} @@ -364,8 +338,6 @@ def test_negative_create_without_cv(self, target_sat): :expectedresults: Content view filter is not created - :CaseLevel: Integration - :CaseImportance: Low """ with pytest.raises(HTTPError): @@ -380,8 +352,6 @@ def test_negative_create_with_invalid_repo_id(self, content_view, target_sat): :expectedresults: Content view filter is not created - :CaseLevel: Integration - :CaseImportance: Low """ with pytest.raises(HTTPError): @@ -398,8 +368,6 @@ def test_positive_delete_by_id(self, content_view, target_sat): :expectedresults: Content view filter was deleted - :CaseLevel: Integration - :CaseImportance: Critical """ cvf = target_sat.api.RPMContentViewFilter(content_view=content_view).create() @@ -419,7 +387,6 @@ def test_positive_update_name(self, name, content_view, target_sat): :expectedresults: Content view filter updated successfully and name was changed - :CaseLevel: Integration """ cvf = target_sat.api.RPMContentViewFilter(content_view=content_view).create() cvf.name = name @@ -437,8 +404,6 @@ def test_positive_update_description(self, description, content_view, target_sat :expectedresults: Content view filter updated successfully and description was changed - :CaseLevel: Integration - :CaseImportance: Low """ cvf = target_sat.api.RPMContentViewFilter(content_view=content_view).create() @@ -458,7 +423,6 @@ def test_positive_update_inclusion(self, inclusion, content_view, target_sat): :expectedresults: Content view filter updated successfully and inclusion value was changed - :CaseLevel: Integration """ cvf = target_sat.api.RPMContentViewFilter(content_view=content_view).create() cvf.inclusion = inclusion @@ -474,7 +438,6 @@ def test_positive_update_repo(self, module_product, sync_repo, content_view, tar :expectedresults: Content view filter updated successfully and has new repository assigned - :CaseLevel: Integration """ cvf = target_sat.api.RPMContentViewFilter( content_view=content_view, @@ -499,8 +462,6 @@ def test_positive_update_repos(self, module_product, sync_repo, content_view, ta :expectedresults: Content view filter updated successfully and has new repositories assigned - :CaseLevel: Integration - :CaseImportance: Low """ cvf = target_sat.api.RPMContentViewFilter( @@ -533,7 +494,6 @@ def test_positive_update_original_packages( :expectedresults: Content view filter updated successfully and 'original packages' value was changed - :CaseLevel: Integration """ cvf = target_sat.api.RPMContentViewFilter( content_view=content_view, @@ -556,7 +516,6 @@ def test_positive_update_repo_with_docker( :expectedresults: Content view filter was updated successfully and has both repositories assigned (yum and docker) - :CaseLevel: Integration """ cvf = target_sat.api.RPMContentViewFilter( content_view=content_view, @@ -588,8 +547,6 @@ def test_negative_update_name(self, name, content_view, target_sat): :expectedresults: Content view filter was not updated - :CaseLevel: Integration - :CaseImportance: Low """ cvf = target_sat.api.RPMContentViewFilter(content_view=content_view).create() @@ -605,8 +562,6 @@ def test_negative_update_same_name(self, content_view, target_sat): :expectedresults: Content view filter was not updated - :CaseLevel: Integration - :CaseImportance: Low """ name = gen_string('alpha', 8) @@ -625,7 +580,6 @@ def test_negative_update_cv_by_id(self, content_view, target_sat): :expectedresults: Content view filter was not updated - :CaseLevel: Integration """ cvf = target_sat.api.RPMContentViewFilter(content_view=content_view).create() cvf.content_view.id = gen_integer(10000, 99999) @@ -641,7 +595,6 @@ def test_negative_update_repo_by_id(self, sync_repo, content_view, target_sat): :expectedresults: Content view filter was not updated - :CaseLevel: Integration """ cvf = target_sat.api.RPMContentViewFilter( content_view=content_view, @@ -660,8 +613,6 @@ def test_negative_update_repo(self, module_product, sync_repo, content_view, tar :expectedresults: Content view filter was not updated - :CaseLevel: Integration - :CaseImportance: Low """ cvf = target_sat.api.RPMContentViewFilter( @@ -697,8 +648,6 @@ def test_positive_check_filter_applied_flag( :expectedresults: 1. Filters applied flag is set correctly per usage. - :CaseLevel: Integration - :CaseImportance: Medium """ @@ -784,7 +733,6 @@ def test_positive_promote_module_stream_filter( :expectedresults: Content View should get published and promoted successfully with correct Module Stream count. - :CaseLevel: Integration """ # Exclude module stream filter content_view = content_view_module_stream @@ -840,7 +788,6 @@ def test_positive_include_exclude_module_stream_filter( :expectedresults: Module Stream count changes automatically after including or excluding modular errata - :CaseLevel: Integration """ content_view = content_view_module_stream cv_filter = target_sat.api.ErratumContentViewFilter( @@ -890,7 +837,6 @@ def test_positive_multi_level_filters(self, content_view_module_stream, target_s :expectedresults: Verify module stream and errata count should correct - :CaseLevel: Integration """ content_view = content_view_module_stream # apply include errata filter @@ -940,7 +886,6 @@ def test_positive_dependency_solving_module_stream_filter( :expectedresults: Verify dependant/non dependant module streams are getting fetched. - :CaseLevel: Integration """ content_view = content_view_module_stream content_view.solve_dependencies = True diff --git a/tests/foreman/api/test_contentviewversion.py b/tests/foreman/api/test_contentviewversion.py index 5953edeed4..5f3414456e 100644 --- a/tests/foreman/api/test_contentviewversion.py +++ b/tests/foreman/api/test_contentviewversion.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ContentViews :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -52,8 +47,6 @@ def test_positive_create(module_cv): :expectedresults: Content View Version is created. - :CaseLevel: Integration - :CaseImportance: Critical """ # Fetch content view for latest information @@ -76,8 +69,6 @@ def test_negative_create(module_org, module_target_sat): :expectedresults: Content View Version is not created - :CaseLevel: Integration - :CaseImportance: Critical """ # The default content view cannot be published @@ -99,8 +90,6 @@ def test_positive_promote_valid_environment(module_lce_cv, module_org, module_ta :expectedresults: Promotion succeeds. - :CaseLevel: Integration - :CaseImportance: Critical """ # Create a new content view... @@ -131,8 +120,6 @@ def test_positive_promote_out_of_sequence_environment(module_org, module_lce_cv, :id: e88405de-843d-4279-9d81-cedaab7c23cf :expectedresults: The promotion succeeds. - - :CaseLevel: Integration """ # Create a new content view... cv = module_target_sat.api.ContentView(organization=module_org).create() @@ -159,8 +146,6 @@ def test_negative_promote_valid_environment(module_lce_cv): :expectedresults: The promotion fails. - :CaseLevel: Integration - :CaseImportance: Low """ lce1, _, default_cvv = module_lce_cv @@ -176,8 +161,6 @@ def test_negative_promote_out_of_sequence_environment(module_lce_cv, module_org, :id: 621d1bb6-92c6-4209-8369-6ea14a4c8a01 :expectedresults: The promotion fails. - - :CaseLevel: Integration """ # Create a new content view... cv = module_target_sat.api.ContentView(organization=module_org).create() @@ -209,8 +192,6 @@ def test_positive_delete(module_org, module_product, module_target_sat): :expectedresults: Content version deleted successfully - :CaseLevel: Integration - :CaseImportance: Critical """ key_content = DataFile.ZOO_CUSTOM_GPG_KEY.read_text() @@ -253,8 +234,6 @@ def test_positive_delete_non_default(module_org, module_target_sat): :expectedresults: Content view version deleted successfully - :CaseLevel: Integration - :CaseImportance: Critical """ content_view = module_target_sat.api.ContentView(organization=module_org).create() @@ -289,8 +268,6 @@ def test_positive_delete_composite_version(module_org, module_target_sat): :expectedresults: Content version deleted successfully - :CaseLevel: Integration - :BZ: 1276479 """ # Create product with repository and publish it @@ -330,8 +307,6 @@ def test_negative_delete(module_org, module_target_sat): :expectedresults: Content view version is not deleted - :CaseLevel: Integration - :CaseImportance: Critical """ content_view = module_target_sat.api.ContentView(organization=module_org).create() @@ -352,7 +327,7 @@ def test_positive_remove_renamed_cv_version_from_default_env(module_org, module_ :id: 7d5961d0-6a9a-4610-979e-cbc4ddbc50ca - :Steps: + :steps: 1. Create a content view 2. Add a yum repo to the content view @@ -362,8 +337,6 @@ def test_positive_remove_renamed_cv_version_from_default_env(module_org, module_ :expectedresults: content view version is removed from Library environment - - :CaseLevel: Integration """ new_name = gen_string('alpha') # create yum product and repo @@ -405,7 +378,7 @@ def test_positive_remove_qe_promoted_cv_version_from_default_env(module_org, mod :id: c7795762-93bd-419c-ac49-d10dc26b842b - :Steps: + :steps: 1. Create a content view 2. Add docker repo(s) to it @@ -416,8 +389,6 @@ def test_positive_remove_qe_promoted_cv_version_from_default_env(module_org, mod :expectedresults: Content view version exist only in DEV, QE and not in Library - - :CaseLevel: Integration """ lce_dev = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() lce_qe = module_target_sat.api.LifecycleEnvironment( @@ -465,7 +436,7 @@ def test_positive_remove_prod_promoted_cv_version_from_default_env(module_org, m :id: 24911876-7c2a-4a12-a3aa-98051dfda29d - :Steps: + :steps: 1. Create a content view 2. Add yum repositories and docker repositories to CV @@ -476,8 +447,6 @@ def test_positive_remove_prod_promoted_cv_version_from_default_env(module_org, m :expectedresults: Content view version exist only in DEV, QE, PROD and not in Library - - :CaseLevel: Integration """ lce_dev = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() lce_qe = module_target_sat.api.LifecycleEnvironment( @@ -534,7 +503,7 @@ def test_positive_remove_cv_version_from_env(module_org, module_target_sat): :id: 17cf18bf-09d5-4641-b0e0-c50e628fa6c8 - :Steps: + :steps: 1. Create a content view 2. Add a yum repo and a docker repo to the content view @@ -548,8 +517,6 @@ def test_positive_remove_cv_version_from_env(module_org, module_target_sat): :expectedresults: Content view version exist in Library, DEV, QE, STAGE, PROD - - :CaseLevel: Integration """ lce_dev = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() lce_qe = module_target_sat.api.LifecycleEnvironment( @@ -616,7 +583,7 @@ def test_positive_remove_cv_version_from_multi_env(module_org, module_target_sat :id: 18b86a68-8e6a-43ea-b95e-188fba125a26 - :Steps: + :steps: 1. Create a content view 2. Add a yum repo and a docker repo to the content view @@ -627,8 +594,6 @@ def test_positive_remove_cv_version_from_multi_env(module_org, module_target_sat :expectedresults: Content view version exists only in Library, DEV - :CaseLevel: Integration - :CaseImportance: Low """ lce_dev = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() @@ -693,7 +658,7 @@ def test_positive_delete_cv_promoted_to_multi_env(module_org, module_target_sat) :id: c164bd97-e710-4a5a-9c9f-657e6bed804b - :Steps: + :steps: 1. Create a content view 2. Add a yum repo and a docker repo to the content view @@ -705,8 +670,6 @@ def test_positive_delete_cv_promoted_to_multi_env(module_org, module_target_sat) :expectedresults: The content view doesn't exist - :CaseLevel: Integration - :CaseImportance: Critical """ lce_dev = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() @@ -770,7 +733,7 @@ def test_positive_remove_cv_version_from_env_with_host_registered(): :id: a5b9ba8b-80e6-4435-bc0a-041b3fda227c - :Steps: + :steps: 1. Create a content view cv1 2. Add a yum repo to the content view @@ -795,8 +758,6 @@ def test_positive_remove_cv_version_from_env_with_host_registered(): 5. At content-host some package from cv1 is installable :CaseAutomation: NotAutomated - - :CaseLevel: System """ @@ -810,7 +771,7 @@ def test_positive_delete_cv_multi_env_promoted_with_host_registered(): :id: 10699af9-617e-4930-9c80-2827a0ba52eb - :Steps: + :steps: 1. Create two content views, cv1 and cv2 2. Add a yum repo to both content views @@ -837,8 +798,6 @@ def test_positive_delete_cv_multi_env_promoted_with_host_registered(): 6. At content-host some package from cv2 is installable :CaseAutomation: NotAutomated - - :CaseLevel: System """ @@ -850,7 +809,7 @@ def test_positive_remove_cv_version_from_multi_env_capsule_scenario(): :id: 1e8a8e64-eec8-49e0-b121-919c53f416d2 - :Steps: + :steps: 1. Create a content view 2. module_lce_cv satellite to use a capsule and to sync all lifecycle @@ -874,6 +833,4 @@ def test_positive_remove_cv_version_from_multi_env_capsule_scenario(): Library and DEV and exists only in QE and PROD :CaseAutomation: NotAutomated - - :CaseLevel: System """ diff --git a/tests/foreman/api/test_convert2rhel.py b/tests/foreman/api/test_convert2rhel.py index 026acb467b..a89ce3f9da 100644 --- a/tests/foreman/api/test_convert2rhel.py +++ b/tests/foreman/api/test_convert2rhel.py @@ -4,15 +4,10 @@ :CaseAutomation: Automated -:CaseLevel: Integration - :CaseComponent: Registration :Team: Rocket -:TestType: Functional - -:Upstream: No """ import pytest import requests @@ -256,7 +251,7 @@ def test_convert2rhel_oracle(module_target_sat, oracle, activation_key_rhel, ver :id: 7fd393f0-551a-4de0-acdd-7f026b485f79 - :Steps: + :steps: 0. Have host registered to Satellite 1. Check for operating system 2. Convert host to RHEL @@ -308,7 +303,7 @@ def test_convert2rhel_centos(module_target_sat, centos, activation_key_rhel, ver :id: 6f698440-7d85-4deb-8dd9-363ea9003b92 - :Steps: + :steps: 0. Have host registered to Satellite 1. Check for operating system 2. Convert host to RHEL diff --git a/tests/foreman/api/test_discoveredhost.py b/tests/foreman/api/test_discoveredhost.py index 7d260b3d5e..5ecc02e1e5 100644 --- a/tests/foreman/api/test_discoveredhost.py +++ b/tests/foreman/api/test_discoveredhost.py @@ -8,11 +8,6 @@ :CaseAutomation: Automated -:CaseLevel: System - -:TestType: Functional - -:Upstream: No """ import re @@ -190,7 +185,7 @@ def test_positive_provision_pxe_host( :Setup: Provisioning and discovery should be configured - :Steps: + :steps: 1. Boot up the host to discover 2. Provision the host @@ -243,7 +238,7 @@ def test_positive_provision_pxe_less_host( :Setup: Provisioning should be configured and a host should be discovered - :Steps: PUT /api/v2/discovered_hosts/:id + :steps: PUT /api/v2/discovered_hosts/:id :expectedresults: Host should be provisioned successfully @@ -285,7 +280,7 @@ def test_positive_auto_provision_pxe_host( :Setup: Provisioning should be configured and a host should be discovered - :Steps: POST /api/v2/discovered_hosts/:id/auto_provision + :steps: POST /api/v2/discovered_hosts/:id/auto_provision :expectedresults: Selected Host should be auto-provisioned successfully @@ -314,7 +309,7 @@ def test_positive_auto_provision_all( :Setup: Provisioning should be configured and more than one host should be discovered - :Steps: POST /api/v2/discovered_hosts/auto_provision_all + :steps: POST /api/v2/discovered_hosts/auto_provision_all :expectedresults: All discovered hosts should be auto-provisioned successfully @@ -349,7 +344,7 @@ def test_positive_refresh_facts_pxe_host(self, module_target_sat): be discovered 2. Add a NIC on discovered host - :Steps: PUT /api/v2/discovered_hosts/:id/refresh_facts + :steps: PUT /api/v2/discovered_hosts/:id/refresh_facts :expectedresults: Added Fact should be displayed on refreshing the facts @@ -378,7 +373,7 @@ def test_positive_reboot_pxe_host( :Setup: Provisioning should be configured and a host should be discovered via PXE boot. - :Steps: PUT /api/v2/discovered_hosts/:id/reboot + :steps: PUT /api/v2/discovered_hosts/:id/reboot :expectedresults: Selected host should be rebooted successfully @@ -423,7 +418,7 @@ def test_positive_reboot_all_pxe_hosts( :Setup: Provisioning should be configured and hosts should be discovered via PXE boot. - :Steps: PUT /api/v2/discovered_hosts/reboot_all + :steps: PUT /api/v2/discovered_hosts/reboot_all :expectedresults: All discovered hosst should be rebooted successfully @@ -493,15 +488,13 @@ def test_positive_upload_facts(self, target_sat): :BZ: 1349364, 1392919 - :Steps: + :steps: 1. POST /api/v2/discovered_hosts/facts 2. Read the created discovered host :expectedresults: Host should be created successfully - :CaseLevel: Integration - :BZ: 1731112 """ name = gen_choice(list(valid_data_list().values())) @@ -519,7 +512,7 @@ def test_positive_delete_pxe_host(self, target_sat): :Setup: Provisioning should be configured and a host should be discovered - :Steps: DELETE /api/v2/discovered_hosts/:id + :steps: DELETE /api/v2/discovered_hosts/:id :expectedresults: Discovered Host should be deleted successfully """ diff --git a/tests/foreman/api/test_discoveryrule.py b/tests/foreman/api/test_discoveryrule.py index 6bdde9728b..3f6ff72e55 100644 --- a/tests/foreman/api/test_discoveryrule.py +++ b/tests/foreman/api/test_discoveryrule.py @@ -8,13 +8,8 @@ :Team: Rocket -:TestType: Functional - -:CaseLevel: Acceptance - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_choice, gen_integer, gen_string import pytest diff --git a/tests/foreman/api/test_docker.py b/tests/foreman/api/test_docker.py index 68a2fe6e37..b11cc4bc12 100644 --- a/tests/foreman/api/test_docker.py +++ b/tests/foreman/api/test_docker.py @@ -4,13 +4,8 @@ :CaseAutomation: Automated -:CaseLevel: Component - -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from random import choice, randint, shuffle @@ -173,7 +168,6 @@ def test_positive_create_repos_using_same_product(self, module_product, module_t :expectedresults: Multiple docker repositories are created with a Docker upstream repository and they all belong to the same product. - :CaseLevel: Integration """ for _ in range(randint(2, 5)): repo = _create_repository(module_target_sat, module_product) @@ -189,7 +183,6 @@ def test_positive_create_repos_using_multiple_products(self, module_org, module_ Docker upstream repository and they all belong to their respective products. - :CaseLevel: Integration """ for _ in range(randint(2, 5)): product = module_target_sat.api.Product(organization=module_org).create() @@ -326,8 +319,6 @@ class TestDockerContentView: :CaseComponent: ContentViews :team: Phoenix-content - - :CaseLevel: Integration """ @pytest.mark.tier2 @@ -983,8 +974,6 @@ class TestDockerActivationKey: :CaseComponent: ActivationKeys :team: Phoenix-subscriptions - - :CaseLevel: Integration """ @pytest.mark.tier2 @@ -1019,7 +1008,6 @@ def test_positive_remove_docker_repo_cv( :expectedresults: Docker-based content view can be added and then removed from the activation key. - :CaseLevel: Integration """ content_view = content_view_publish_promote ak = module_target_sat.api.ActivationKey( diff --git a/tests/foreman/api/test_environment.py b/tests/foreman/api/test_environment.py index cb96524421..02f7a3928e 100644 --- a/tests/foreman/api/test_environment.py +++ b/tests/foreman/api/test_environment.py @@ -8,17 +8,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Puppet :Team: Rocket -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -205,8 +200,6 @@ def test_positive_update_loc(module_puppet_environment): field. :BZ: 1262029 - - :CaseLevel: Integration """ names = {'location', 'location_ids', 'locations'} attributes = set(module_puppet_environment.update_json([]).keys()) @@ -223,8 +216,6 @@ def test_positive_update_org(module_puppet_environment): ``organization`` field. :BZ: 1262029 - - :CaseLevel: Integration """ names = {'organization', 'organization_ids', 'organizations'} attributes = set(module_puppet_environment.update_json([]).keys()) diff --git a/tests/foreman/api/test_errata.py b/tests/foreman/api/test_errata.py index bb545dda85..357472192b 100644 --- a/tests/foreman/api/test_errata.py +++ b/tests/foreman/api/test_errata.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: System - :CaseComponent: ErrataManagement :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ # For ease of use hc refers to host-collection throughout this document from time import sleep @@ -119,12 +114,10 @@ def test_positive_install_in_hc(module_org, activation_key, custom_repo, target_ :Setup: Errata synced on satellite server. - :Steps: PUT /api/v2/hosts/bulk/update_content + :steps: PUT /api/v2/hosts/bulk/update_content :expectedresults: errata is installed in the host-collection. - :CaseLevel: System - :BZ: 1983043 """ for client in content_hosts: @@ -177,8 +170,6 @@ def test_positive_install_multiple_in_host(target_sat, rhel_contenthost, module_ :CaseImportance: Medium :parametrized: yes - - :CaseLevel: System """ ak = target_sat.api.ActivationKey( organization=module_org, @@ -240,12 +231,10 @@ def test_positive_list(module_org, custom_repo, target_sat): :Setup: Errata synced on satellite server. - :Steps: Create two repositories each synced and containing errata + :steps: Create two repositories each synced and containing errata :expectedresults: Check that the errata belonging to one repo is not showing in the other. - - :CaseLevel: System """ repo1 = target_sat.api.Repository(id=custom_repo['repository-id']).read() repo2 = target_sat.api.Repository( @@ -274,11 +263,9 @@ def test_positive_list_updated(module_org, custom_repo, target_sat): :Setup: Errata synced on satellite server. - :Steps: GET /katello/api/errata + :steps: GET /katello/api/errata :expectedresults: Errata is filtered by Org and sorted by Updated date. - - :CaseLevel: System """ repo = target_sat.api.Repository(id=custom_repo['repository-id']).read() assert repo.sync()['result'] == 'success' @@ -297,11 +284,9 @@ def test_positive_sorted_issue_date_and_filter_by_cve(module_org, custom_repo, t :Setup: Errata synced on satellite server. - :Steps: GET /katello/api/errata + :steps: GET /katello/api/errata :expectedresults: Errata is sorted by issued date and filtered by CVE. - - :CaseLevel: System """ # Errata is sorted by issued date. erratum_list = target_sat.api.Errata(repository=custom_repo['repository-id']).search( @@ -392,12 +377,10 @@ def test_positive_get_count_for_host(setup_content_rhel6, rhel6_contenthost, tar 1. Errata synced on satellite server. 2. Some Content hosts present. - :Steps: GET /api/v2/hosts + :steps: GET /api/v2/hosts :expectedresults: The available errata count is retrieved. - :CaseLevel: System - :parametrized: yes :CaseImportance: Medium @@ -434,12 +417,10 @@ def test_positive_get_applicable_for_host(setup_content_rhel6, rhel6_contenthost 1. Errata synced on satellite server. 2. Some Content hosts present. - :Steps: GET /api/v2/hosts/:id/errata + :steps: GET /api/v2/hosts/:id/errata :expectedresults: The available errata is retrieved. - :CaseLevel: System - :parametrized: yes :CaseImportance: Medium @@ -482,12 +463,10 @@ def test_positive_get_diff_for_cv_envs(target_sat): 1. Errata synced on satellite server. 2. Multiple environments present. - :Steps: GET /katello/api/compare + :steps: GET /katello/api/compare :expectedresults: Difference in errata between a set of environments for a content view is retrieved. - - :CaseLevel: System """ org = target_sat.api.Organization().create() env = target_sat.api.LifecycleEnvironment(organization=org).create() @@ -540,7 +519,7 @@ def test_positive_incremental_update_required( :Setup: 1. Errata synced on satellite server - :Steps: + :steps: 1. Create VM as Content Host, registering to CV with custom errata 2. Install package in VM so it needs one erratum 3. Check if incremental_updates required: @@ -558,8 +537,6 @@ def test_positive_incremental_update_required( :parametrized: yes - :CaseLevel: System - :BZ: 2013093 """ rhel7_contenthost.install_katello_ca(target_sat) @@ -661,8 +638,6 @@ def test_errata_installation_with_swidtags( :parametrized: yes :CaseImportance: Critical - - :CaseLevel: System """ module_name = 'kangaroo' version = '20180704111719' @@ -817,8 +792,6 @@ def test_apply_modular_errata_using_default_content_view( :CaseAutomation: Automated :parametrized: yes - - :CaseLevel: System """ module_name = 'duck' stream = '0' @@ -867,8 +840,6 @@ def test_positive_sync_repos_with_large_errata(target_sat): :BZ: 1463811 - :CaseLevel: Integration - :expectedresults: both repositories were successfully synchronized """ org = target_sat.api.Organization().create() diff --git a/tests/foreman/api/test_filter.py b/tests/foreman/api/test_filter.py index c4f2e2d12c..ed61c98c76 100644 --- a/tests/foreman/api/test_filter.py +++ b/tests/foreman/api/test_filter.py @@ -8,17 +8,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: UsersRoles :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest from requests.exceptions import HTTPError diff --git a/tests/foreman/api/test_foremantask.py b/tests/foreman/api/test_foremantask.py index 6d8bee0b42..c736a0e716 100644 --- a/tests/foreman/api/test_foremantask.py +++ b/tests/foreman/api/test_foremantask.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: TasksPlugin :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest from requests.exceptions import HTTPError diff --git a/tests/foreman/api/test_host.py b/tests/foreman/api/test_host.py index 15411a4741..28dcda9517 100644 --- a/tests/foreman/api/test_host.py +++ b/tests/foreman/api/test_host.py @@ -8,17 +8,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Hosts :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import http @@ -93,8 +88,6 @@ def test_positive_search_by_org_id(target_sat): organization id was done :BZ: 1447958 - - :CaseLevel: Integration """ host = target_sat.api.Host().create() # adding org id as GET parameter for correspondence with BZ @@ -220,8 +213,6 @@ def test_positive_create_and_update_with_hostgroup( :id: 8f9601f9-afd8-4a88-8f28-a5cbc996e805 :expectedresults: A host is created and updated with expected hostgroup assigned - - :CaseLevel: Integration """ module_published_cv.version[0].promote(data={'environment_ids': module_lce.id, 'force': False}) hostgroup = module_target_sat.api.HostGroup( @@ -261,8 +252,6 @@ def test_positive_create_inherit_lce_cv( :expectedresults: Host's lifecycle environment and content view match the ones specified in hostgroup - :CaseLevel: Integration - :BZ: 1391656 """ hostgroup = module_target_sat.api.HostGroup( @@ -413,8 +402,6 @@ def test_positive_create_and_update_with_subnet( :id: 9aa97aff-8439-4027-89ee-01c643fbf7d1 :expectedresults: A host is created and updated with expected subnet assigned - - :CaseLevel: Integration """ host = module_target_sat.api.Host( location=module_location, organization=module_org, subnet=module_default_subnet @@ -438,8 +425,6 @@ def test_positive_create_and_update_with_compresource( :expectedresults: A host is created and updated with expected compute resource assigned - - :CaseLevel: Integration """ host = module_target_sat.api.Host( compute_resource=module_cr_libvirt, location=module_location, organization=module_org @@ -460,8 +445,6 @@ def test_positive_create_and_update_with_model(module_model, module_target_sat): :id: 7a912a19-71e4-4843-87fd-bab98c156f4a :expectedresults: A host is created and updated with expected model assigned - - :CaseLevel: Integration """ host = module_target_sat.api.Host(model=module_model).create() assert host.model.read().name == module_model.name @@ -480,8 +463,6 @@ def test_positive_create_and_update_with_user( :id: 72e20f8f-17dc-4e38-8ac1-d08df8758f56 :expectedresults: A host is created and updated with expected user assigned - - :CaseLevel: Integration """ host = module_target_sat.api.Host( owner=module_user, owner_type='User', organization=module_org, location=module_location @@ -504,8 +485,6 @@ def test_positive_create_and_update_with_usergroup( :id: 706e860c-8c05-4ddc-be20-0ecd9f0da813 :expectedresults: A host is created and updated with expected user group assigned - - :CaseLevel: Integration """ user = module_target_sat.api.User( location=[module_location], organization=[module_org], role=[function_role] @@ -619,8 +598,6 @@ def test_positive_create_and_update_with_compute_profile(module_compute_profile, :expectedresults: A host is created and updated with expected compute profile assigned - - :CaseLevel: Integration """ host = module_target_sat.api.Host(compute_profile=module_compute_profile).create() assert host.compute_profile.read().name == module_compute_profile.name @@ -639,8 +616,6 @@ def test_positive_create_and_update_with_content_view( :id: 10f69c7a-088e-474c-b869-1ad12deda2ad :expectedresults: A host is created and updated with expected content view - - :CaseLevel: Integration """ host = module_target_sat.api.Host( organization=module_org, @@ -710,8 +685,6 @@ def test_positive_end_to_end_with_image( :expectedresults: A host is created with expected image, image is removed and host is updated with expected image - - :CaseLevel: Integration """ host = module_target_sat.api.Host( organization=module_org, @@ -780,8 +753,6 @@ def test_positive_create_and_update_domain( :id: 8ca9f67c-4c11-40f9-b434-4f200bad000f :expectedresults: A host is created and updated with expected domain - - :CaseLevel: Integration """ host = module_target_sat.api.Host( organization=module_org, location=module_location, domain=module_domain @@ -805,8 +776,6 @@ def test_positive_create_and_update_env( :id: 87a08dbf-fd4c-4b6c-bf73-98ab70756fc6 :expectedresults: A host is created and updated with expected environment - - :CaseLevel: Integration """ host = session_puppet_enabled_sat.api.Host( organization=module_puppet_org, @@ -830,8 +799,6 @@ def test_positive_create_and_update_arch(module_architecture, module_target_sat) :id: 5f190b14-e6db-46e1-8cd1-e94e048e6a77 :expectedresults: A host is created and updated with expected architecture - - :CaseLevel: Integration """ host = module_target_sat.api.Host(architecture=module_architecture).create() assert host.architecture.read().name == module_architecture.name @@ -849,8 +816,6 @@ def test_positive_create_and_update_os(module_os, module_target_sat): :id: 46edced1-8909-4066-b196-b8e22512341f :expectedresults: A host is created updated with expected operating system - - :CaseLevel: Integration """ host = module_target_sat.api.Host(operatingsystem=module_os).create() assert host.operatingsystem.read().name == module_os.name @@ -873,8 +838,6 @@ def test_positive_create_and_update_medium(module_org, module_location, module_t :id: d81cb65c-48b3-4ce3-971e-51b9dd123697 :expectedresults: A host is created and updated with expected medium - - :CaseLevel: Integration """ medium = module_target_sat.api.Media( organization=[module_org], location=[module_location] @@ -938,8 +901,6 @@ def test_negative_update_arch(module_architecture, module_target_sat): :id: 07b9c0e7-f02b-4aff-99ae-5c203255aba1 :expectedresults: A host is not updated - - :CaseLevel: Integration """ host = module_target_sat.api.Host().create() host.architecture = module_architecture @@ -956,8 +917,6 @@ def test_negative_update_os(target_sat): :id: 40e79f73-6356-4d61-9806-7ade2f4f8829 :expectedresults: A host is not updated - - :CaseLevel: Integration """ host = target_sat.api.Host().create() new_os = target_sat.api.OperatingSystem( @@ -984,8 +943,6 @@ def test_positive_read_content_source_id( response :BZ: 1339613, 1488130 - - :CaseLevel: System """ proxy = target_sat.api.SmartProxy().search(query={'url': f'{target_sat.url}:9090'})[0].read() module_published_cv.version[0].promote(data={'environment_ids': module_lce.id, 'force': False}) @@ -1020,8 +977,6 @@ def test_positive_update_content_source_id( response :BZ: 1339613, 1488130 - - :CaseLevel: System """ proxy = target_sat.api.SmartProxy().search(query={'url': f'{target_sat.url}:9090'})[0] module_published_cv.version[0].promote(data={'environment_ids': module_lce.id, 'force': False}) @@ -1065,8 +1020,6 @@ def test_positive_read_enc_information( :expectedresults: host ENC information read successfully :BZ: 1362372 - - :CaseLevel: Integration """ lce = ( session_puppet_enabled_sat.api.LifecycleEnvironment() @@ -1127,8 +1080,6 @@ def test_positive_add_future_subscription(): 2. Add the subscription to the content host :expectedresults: The future-dated subscription was added to the host - - :CaseLevel: Integration """ @@ -1148,8 +1099,6 @@ def test_positive_add_future_subscription_with_ak(): 3. Register a new content host with the activation key :expectedresults: The host was registered and future subscription added - - :CaseLevel: Integration """ @@ -1168,8 +1117,6 @@ def test_negative_auto_attach_future_subscription(): 3. Run auto-attach on the content host :expectedresults: Only the current subscription was added to the host - - :CaseLevel: Integration """ @@ -1189,8 +1136,6 @@ def test_positive_create_baremetal_with_bios(): :expectedresults: Host is created :CaseAutomation: NotAutomated - - :CaseLevel: System """ @@ -1210,8 +1155,6 @@ def test_positive_create_baremetal_with_uefi(): :expectedresults: Host is created :CaseAutomation: NotAutomated - - :CaseLevel: System """ @@ -1242,8 +1185,6 @@ def test_positive_verify_files_with_pxegrub_uefi(): And record in /var/lib/dhcpd/dhcpd.leases points to the bootloader :CaseAutomation: NotAutomated - - :CaseLevel: System """ @@ -1278,8 +1219,6 @@ def test_positive_verify_files_with_pxegrub_uefi_secureboot(): :CaseComponent: TFTP :Team: Rocket - - :CaseLevel: Integration """ @@ -1314,8 +1253,6 @@ def test_positive_verify_files_with_pxegrub2_uefi(): :CaseComponent: TFTP :Team: Rocket - - :CaseLevel: Integration """ @@ -1347,8 +1284,6 @@ def test_positive_verify_files_with_pxegrub2_uefi_secureboot(): :CaseAutomation: NotAutomated - :CaseLevel: Integration - :CaseComponent: TFTP :Team: Rocket diff --git a/tests/foreman/api/test_hostcollection.py b/tests/foreman/api/test_hostcollection.py index 8935779101..aea239ac1a 100644 --- a/tests/foreman/api/test_hostcollection.py +++ b/tests/foreman/api/test_hostcollection.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: HostCollections :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from random import choice, randint @@ -205,8 +200,6 @@ def test_positive_add_host(module_org, fake_hosts, module_target_sat): :expectedresults: Host was added to the host collection. - :CaseLevel: Integration - :BZ:1325989 """ host_collection = module_target_sat.api.HostCollection(organization=module_org).create() @@ -224,8 +217,6 @@ def test_positive_add_hosts(module_org, fake_hosts, module_target_sat): :expectedresults: Hosts were added to the host collection. - :CaseLevel: Integration - :BZ: 1325989 """ host_collection = module_target_sat.api.HostCollection(organization=module_org).create() diff --git a/tests/foreman/api/test_hostgroup.py b/tests/foreman/api/test_hostgroup.py index 784b404e5d..e0e6fd9ed9 100644 --- a/tests/foreman/api/test_hostgroup.py +++ b/tests/foreman/api/test_hostgroup.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: HostGroup :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from random import randint @@ -62,7 +57,6 @@ def test_inherit_puppetclass(self, session_puppet_enabled_sat): :BZ: 1107708, 1222118, 1487586 - :CaseLevel: System """ # Creating entities like organization, content view and lifecycle_env # with not utf-8 names for easier interaction with puppet environment @@ -169,7 +163,6 @@ def test_rebuild_config(self, module_org, module_location, hostgroup, module_tar :CaseImportance: Medium - :CaseLevel: System """ lce = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() content_view = module_target_sat.api.ContentView(organization=module_org).create() @@ -248,8 +241,6 @@ def test_positive_create_with_properties( :expectedresults: A hostgroup is created with expected properties, updated and deleted - :CaseLevel: Integration - :CaseImportance: High """ env = session_puppet_enabled_sat.api.Environment( @@ -402,7 +393,6 @@ def test_positive_create_with_realm(self, module_org, module_location, target_sa :expectedresults: A hostgroup is created with expected realm assigned - :CaseLevel: Integration """ realm = target_sat.api.Realm( location=[module_location], @@ -427,7 +417,6 @@ def test_positive_create_with_locs(self, module_org, module_target_sat): :expectedresults: A hostgroup is created with expected multiple locations assigned - :CaseLevel: Integration """ locs = [ module_target_sat.api.Location(organization=[module_org]).create() @@ -449,7 +438,6 @@ def test_positive_create_with_orgs(self, target_sat): :expectedresults: A hostgroup is created with expected multiple organizations assigned - :CaseLevel: Integration """ orgs = [target_sat.api.Organization().create() for _ in range(randint(3, 5))] hostgroup = target_sat.api.HostGroup(organization=orgs).create() @@ -482,7 +470,6 @@ def test_positive_update_puppet_ca_proxy(self, puppet_hostgroup, session_puppet_ :CaseImportance: Medium - :CaseLevel: Integration """ new_proxy = session_puppet_enabled_sat.api.SmartProxy().search( query={'search': f'url = {session_puppet_enabled_sat.url}:9090'} @@ -502,7 +489,6 @@ def test_positive_update_realm(self, module_org, module_location, target_sat): :expectedresults: A hostgroup is updated with expected realm - :CaseLevel: Integration """ realm = target_sat.api.Realm( location=[module_location], @@ -535,7 +521,6 @@ def test_positive_update_puppet_proxy(self, puppet_hostgroup, session_puppet_ena :expectedresults: A hostgroup is updated with expected puppet proxy - :CaseLevel: Integration """ new_proxy = session_puppet_enabled_sat.api.SmartProxy().search( query={'search': f'url = {session_puppet_enabled_sat.url}:9090'} @@ -554,7 +539,6 @@ def test_positive_update_content_source(self, hostgroup, target_sat): :expectedresults: A hostgroup is updated with expected puppet proxy - :CaseLevel: Integration """ new_content_source = target_sat.api.SmartProxy().search( query={'search': f'url = {target_sat.url}:9090'} @@ -573,7 +557,6 @@ def test_positive_update_locs(self, module_org, hostgroup, module_target_sat): :expectedresults: A hostgroup is updated with expected locations - :CaseLevel: Integration """ new_locs = [ module_target_sat.api.Location(organization=[module_org]).create() @@ -593,7 +576,6 @@ def test_positive_update_orgs(self, hostgroup, target_sat): :expectedresults: A hostgroup is updated with expected organizations - :CaseLevel: Integration """ new_orgs = [target_sat.api.Organization().create() for _ in range(randint(3, 5))] hostgroup.organization = new_orgs @@ -649,8 +631,6 @@ def test_positive_create_with_group_parameters(self, module_org, module_target_s :customerscenario: true - :CaseLevel: Integration - :BZ: 1710853 """ group_params = {'name': gen_string('alpha'), 'value': gen_string('alpha')} @@ -681,7 +661,6 @@ def test_positive_get_content_source(self, hostgroup, module_target_sat): :expectedresults: The response contains both values for the ``content_source`` field. - :CaseLevel: Integration """ names = module_target_sat.api_factory.one_to_one_names('content_source') hostgroup_attrs = set(hostgroup.read_json().keys()) @@ -700,7 +679,6 @@ def test_positive_get_cv(self, hostgroup, module_target_sat): :expectedresults: The response contains both values for the ``content_view`` field. - :CaseLevel: Integration """ names = module_target_sat.api_factory.one_to_one_names('content_view') hostgroup_attrs = set(hostgroup.read_json().keys()) @@ -719,7 +697,6 @@ def test_positive_get_lce(self, hostgroup, module_target_sat): :expectedresults: The response contains both values for the ``lifecycle_environment`` field. - :CaseLevel: Integration """ names = module_target_sat.api_factory.one_to_one_names('lifecycle_environment') hostgroup_attrs = set(hostgroup.read_json().keys()) @@ -740,7 +717,6 @@ def test_positive_read_puppet_proxy_name(self, session_puppet_enabled_sat): :BZ: 1371900 - :CaseLevel: Integration """ proxy = session_puppet_enabled_sat.api.SmartProxy().search( query={'search': f'url = {session_puppet_enabled_sat.url}:9090'} @@ -762,7 +738,6 @@ def test_positive_read_puppet_ca_proxy_name(self, session_puppet_enabled_sat): :BZ: 1371900 - :CaseLevel: Integration """ proxy = session_puppet_enabled_sat.api.SmartProxy().search( query={'search': f'url = {session_puppet_enabled_sat.url}:9090'} diff --git a/tests/foreman/api/test_http_proxy.py b/tests/foreman/api/test_http_proxy.py index 1e6da4dfcf..0f8f1cab5c 100644 --- a/tests/foreman/api/test_http_proxy.py +++ b/tests/foreman/api/test_http_proxy.py @@ -2,19 +2,14 @@ :Requirement: HttpProxy -:CaseLevel: Acceptance - :CaseComponent: Repositories :team: Phoenix-content -:TestType: Functional - :CaseImportance: High :CaseAutomation: Automated -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -157,8 +152,6 @@ def test_positive_auto_attach_with_http_proxy( :BZ: 2046337 :parametrized: yes - - :CaseLevel: System """ org = function_entitlement_manifest_org lce = module_target_sat.api.LifecycleEnvironment(organization=org).create() diff --git a/tests/foreman/api/test_ldapauthsource.py b/tests/foreman/api/test_ldapauthsource.py index 2139e7c947..fbcc703919 100644 --- a/tests/foreman/api/test_ldapauthsource.py +++ b/tests/foreman/api/test_ldapauthsource.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: LDAP :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest from requests.exceptions import HTTPError diff --git a/tests/foreman/api/test_lifecycleenvironment.py b/tests/foreman/api/test_lifecycleenvironment.py index dfc3ed1ba2..b68017efb8 100644 --- a/tests/foreman/api/test_lifecycleenvironment.py +++ b/tests/foreman/api/test_lifecycleenvironment.py @@ -8,17 +8,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: LifecycleEnvironments :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -138,8 +133,6 @@ def test_positive_update_description(module_lce, new_desc, module_target_sat): :expectedresults: Lifecycle environment is created and updated properly - :CaseLevel: Integration - :CaseImportance: Low :parametrized: yes @@ -197,7 +190,7 @@ def test_positive_search_in_org(name, target_sat): :id: 110e4777-c374-4365-b676-b1db4552fe51 - :Steps: + :steps: 1. Create an organization. 2. Create a lifecycle environment belonging to the organization. @@ -206,8 +199,6 @@ def test_positive_search_in_org(name, target_sat): :expectedresults: Only "Library" and the lifecycle environment just created are in the search results. - :CaseLevel: Integration - :parametrized: yes """ new_org = target_sat.api.Organization().create() @@ -232,11 +223,9 @@ def test_positive_create_environment_after_host_register(): 2. Create a new content host. 3. Register the content host to the Library environment. - :Steps: Create a new environment. + :steps: Create a new environment. :expectedresults: The environment is created without any errors. - :CaseLevel: Integration - :CaseAutomation: NotAutomated """ diff --git a/tests/foreman/api/test_location.py b/tests/foreman/api/test_location.py index ad226389c5..2e54a4862f 100644 --- a/tests/foreman/api/test_location.py +++ b/tests/foreman/api/test_location.py @@ -7,17 +7,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: OrganizationsandLocations :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from random import randint @@ -40,7 +35,6 @@ def valid_loc_data_list(): Note: The maximum allowed length of location name is 246 only. This is an intended behavior (Also note that 255 is the standard across other entities.) - """ return dict( alpha=gen_string('alpha', randint(1, 246)), @@ -127,7 +121,6 @@ def test_positive_create_and_update_with_org(self, make_orgs, target_sat): :expectedresults: Location created successfully and has correct organization assigned to it with expected title - :CaseLevel: Integration """ location = target_sat.api.Location(organization=[make_orgs['org']]).create() assert location.organization[0].id == make_orgs['org'].id @@ -208,7 +201,6 @@ def test_positive_update_entities(self, make_entities, target_sat): :expectedresults: Location updated successfully and has correct domain assigned - :CaseLevel: Integration """ location = target_sat.api.Location().create() @@ -247,8 +239,6 @@ def test_positive_create_update_and_remove_capsule(self, make_proxies, target_sa :BZ: 1398695 - :CaseLevel: Integration - :CaseImportance: High """ proxy_id_1 = make_proxies['proxy1']['id'] @@ -276,7 +266,6 @@ def test_negative_update_domain(self, target_sat): :expectedresults: Location is not updated - :CaseLevel: Integration """ location = target_sat.api.Location(domain=[target_sat.api.Domain().create()]).create() domain = target_sat.api.Domain().create() diff --git a/tests/foreman/api/test_media.py b/tests/foreman/api/test_media.py index 8fb0ec5af6..b29339448c 100644 --- a/tests/foreman/api/test_media.py +++ b/tests/foreman/api/test_media.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Hosts :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import random @@ -88,7 +83,6 @@ def test_positive_create_with_location(self, module_org, module_location, module :expectedresults: Media entity is created and has proper location - :CaseLevel: Integration """ media = module_target_sat.api.Media( organization=[module_org], location=[module_location] @@ -103,7 +97,6 @@ def test_positive_create_with_os(self, module_org, module_target_sat): :expectedresults: Media entity is created and assigned to expected OS - :CaseLevel: Integration """ os = module_target_sat.api.OperatingSystem().create() media = module_target_sat.api.Media( diff --git a/tests/foreman/api/test_multiple_paths.py b/tests/foreman/api/test_multiple_paths.py index 4cacae5051..30531f7702 100644 --- a/tests/foreman/api/test_multiple_paths.py +++ b/tests/foreman/api/test_multiple_paths.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: API :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import http diff --git a/tests/foreman/api/test_notifications.py b/tests/foreman/api/test_notifications.py index 9bdbaa01f5..c2f1582f7d 100644 --- a/tests/foreman/api/test_notifications.py +++ b/tests/foreman/api/test_notifications.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Notifications :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from mailbox import mbox from re import findall diff --git a/tests/foreman/api/test_operatingsystem.py b/tests/foreman/api/test_operatingsystem.py index 4cdb27a04a..9e25a92e16 100644 --- a/tests/foreman/api/test_operatingsystem.py +++ b/tests/foreman/api/test_operatingsystem.py @@ -4,17 +4,12 @@ :CaseAutomation: NotAutomated -:CaseLevel: System - :CaseComponent: Provisioning :Team: Rocket -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ from http.client import NOT_FOUND import random @@ -213,7 +208,6 @@ def test_positive_create_with_archs(self, target_sat): :expectedresults: The operating system is created and points at the expected architectures. - :CaseLevel: Integration """ amount = range(random.randint(3, 5)) archs = [target_sat.api.Architecture().create() for _ in amount] @@ -231,7 +225,6 @@ def test_positive_create_with_ptables(self, target_sat): :expectedresults: The operating system is created and points at the expected partition tables. - :CaseLevel: Integration """ amount = range(random.randint(3, 5)) ptables = [target_sat.api.PartitionTable().create() for _ in amount] @@ -365,7 +358,6 @@ def test_positive_update_medias(self, module_org, module_target_sat): :expectedresults: The operating system is updated and points at the expected medias. - :CaseLevel: Integration """ initial_media = module_target_sat.api.Media(organization=[module_org]).create() os = module_target_sat.api.OperatingSystem(medium=[initial_media]).create() diff --git a/tests/foreman/api/test_organization.py b/tests/foreman/api/test_organization.py index 868ec7368b..4ec6a3e850 100644 --- a/tests/foreman/api/test_organization.py +++ b/tests/foreman/api/test_organization.py @@ -7,17 +7,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: OrganizationsandLocations :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import http import json @@ -259,7 +254,6 @@ def test_positive_update_user(self, module_org, target_sat): :expectedresults: User is associated with organization. - :CaseLevel: Integration """ user = target_sat.api.User().create() module_org.user = [user] @@ -275,7 +269,6 @@ def test_positive_update_subnet(self, module_org, target_sat): :expectedresults: Subnet is associated with organization. - :CaseLevel: Integration """ subnet = target_sat.api.Subnet().create() module_org.subnet = [subnet] @@ -293,8 +286,6 @@ def test_positive_add_and_remove_hostgroup(self, target_sat): :expectedresults: Hostgroup is added to organization and then removed - :CaseLevel: Integration - :CaseImportance: Medium """ org = target_sat.api.Organization().create() @@ -317,7 +308,6 @@ def test_positive_add_and_remove_smart_proxy(self, target_sat): :BZ: 1395229 - :CaseLevel: Integration """ # Every Satellite has a built-in smart proxy, so let's find it smart_proxy = target_sat.api.SmartProxy().search( diff --git a/tests/foreman/api/test_oscap_tailoringfiles.py b/tests/foreman/api/test_oscap_tailoringfiles.py index fb6b78750f..af6b5f47a6 100644 --- a/tests/foreman/api/test_oscap_tailoringfiles.py +++ b/tests/foreman/api/test_oscap_tailoringfiles.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: SCAPPlugin :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/foreman/api/test_oscappolicy.py b/tests/foreman/api/test_oscappolicy.py index c9500c465d..ba318c801c 100644 --- a/tests/foreman/api/test_oscappolicy.py +++ b/tests/foreman/api/test_oscappolicy.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: SCAPPlugin :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -34,8 +29,6 @@ def test_positive_crud_scap_policy( :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: Critical """ name = gen_string('alpha') diff --git a/tests/foreman/api/test_parameters.py b/tests/foreman/api/test_parameters.py index 9aa297a594..1e415d15dc 100644 --- a/tests/foreman/api/test_parameters.py +++ b/tests/foreman/api/test_parameters.py @@ -4,17 +4,11 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Parameters :Team: Rocket -:TestType: Functional - :CaseImportance: Critical - -:Upstream: No """ from fauxfactory import gen_string import pytest diff --git a/tests/foreman/api/test_partitiontable.py b/tests/foreman/api/test_partitiontable.py index 6d78ba1135..2a9012e1a6 100644 --- a/tests/foreman/api/test_partitiontable.py +++ b/tests/foreman/api/test_partitiontable.py @@ -8,17 +8,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Hosts :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import random diff --git a/tests/foreman/api/test_permission.py b/tests/foreman/api/test_permission.py index 62fae40802..95929e79e3 100644 --- a/tests/foreman/api/test_permission.py +++ b/tests/foreman/api/test_permission.py @@ -8,17 +8,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: UsersRoles :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from itertools import chain import json diff --git a/tests/foreman/api/test_ping.py b/tests/foreman/api/test_ping.py index 14e4401efa..e5e72933b3 100644 --- a/tests/foreman/api/test_ping.py +++ b/tests/foreman/api/test_ping.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: API :Team: Endeavour -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ import pytest diff --git a/tests/foreman/api/test_product.py b/tests/foreman/api/test_product.py index dfa9f59f70..7915ddd2de 100644 --- a/tests/foreman/api/test_product.py +++ b/tests/foreman/api/test_product.py @@ -7,17 +7,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Repositories :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -96,8 +91,6 @@ def test_positive_create_with_gpg(module_org, module_target_sat): :id: 57331c1f-15dd-4c9f-b8fc-3010847b2975 :expectedresults: A product is created with the specified GPG key. - - :CaseLevel: Integration """ gpg_key = module_target_sat.api.GPGKey( content=DataFile.VALID_GPG_KEY_FILE.read_text(), @@ -225,8 +218,6 @@ def test_positive_update_gpg(module_org, module_target_sat): :id: 3b08f155-a0d6-4987-b281-dc02e8d5a03e :expectedresults: The updated product points to a new GPG key. - - :CaseLevel: Integration """ # Create a product and make it point to a GPG key. gpg_key_1 = module_target_sat.api.GPGKey( @@ -254,8 +245,6 @@ def test_positive_update_organization(module_org, module_target_sat): :expectedresults: The updated product points to a new organization - :CaseLevel: Integration - :BZ: 1310422 """ product = module_target_sat.api.Product(organization=module_org).create() @@ -350,8 +339,6 @@ def test_positive_sync_several_repos(module_org, module_target_sat): :expectedresults: All repositories within a product are successfully synced. - :CaseLevel: Integration - :BZ: 1389543 """ product = module_target_sat.api.Product(organization=module_org).create() @@ -380,8 +367,6 @@ def test_positive_filter_product_list(module_entitlement_manifest_org, module_ta :expectedresults: Able to list the products based on defined filter. - :CaseLevel: Integration - :BZ: 1667129 """ org = module_entitlement_manifest_org diff --git a/tests/foreman/api/test_provisioning.py b/tests/foreman/api/test_provisioning.py index 5096ab6ddb..481dd84f1f 100644 --- a/tests/foreman/api/test_provisioning.py +++ b/tests/foreman/api/test_provisioning.py @@ -4,17 +4,12 @@ :CaseAutomation: NotAutomated -:CaseLevel: System - :CaseComponent: Provisioning :Team: Rocket -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ import re diff --git a/tests/foreman/api/test_provisioning_puppet.py b/tests/foreman/api/test_provisioning_puppet.py index a32d542abb..447a462f05 100644 --- a/tests/foreman/api/test_provisioning_puppet.py +++ b/tests/foreman/api/test_provisioning_puppet.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Puppet :Team: Rocket -:TestType: Functional - :CaseImportance: Medium -:Upstream: No """ from fauxfactory import gen_string from packaging.version import Version diff --git a/tests/foreman/api/test_provisioningtemplate.py b/tests/foreman/api/test_provisioningtemplate.py index b154eaa4e8..33f794cb98 100644 --- a/tests/foreman/api/test_provisioningtemplate.py +++ b/tests/foreman/api/test_provisioningtemplate.py @@ -11,13 +11,8 @@ :Team: Rocket -:TestType: Functional - -:CaseLevel: Integration - :CaseImportance: High -:Upstream: No """ from random import choice @@ -129,10 +124,7 @@ def tftpboot(module_org, module_target_sat): class TestProvisioningTemplate: - """Tests for provisioning templates - - :CaseLevel: Acceptance - """ + """Tests for provisioning templates""" @pytest.mark.tier1 @pytest.mark.e2e @@ -225,8 +217,6 @@ def test_positive_build_pxe_default(self, tftpboot, module_target_sat): :expectedresults: The response is a JSON payload, all templates are deployed to TFTP/HTTP and are rendered correctly - :CaseLevel: Integration - :CaseImportance: Critical :BZ: 1202564 diff --git a/tests/foreman/api/test_registration.py b/tests/foreman/api/test_registration.py index 50f5e0c0b0..9a3b98e355 100644 --- a/tests/foreman/api/test_registration.py +++ b/tests/foreman/api/test_registration.py @@ -2,8 +2,6 @@ :Requirement: Registration -:CaseLevel: Acceptance - :CaseComponent: Registration :CaseAutomation: Automated @@ -12,9 +10,6 @@ :Team: Rocket -:TestType: Functional - -:Upstream: No """ import uuid @@ -110,8 +105,6 @@ def test_positive_allow_reregistration_when_dmi_uuid_changed( :customerscenario: true :BZ: 1747177,2229112 - - :CaseLevel: Integration """ uuid_1 = str(uuid.uuid1()) uuid_2 = str(uuid.uuid4()) @@ -148,8 +141,6 @@ def test_positive_update_packages_registration( :id: 3d0a3252-ab81-4acf-bca6-253b746f26bb :expectedresults: Package update is successful on host post registration. - - :CaseLevel: Component """ org = module_sca_manifest_org command = module_target_sat.api.RegistrationCommand( diff --git a/tests/foreman/api/test_remoteexecution.py b/tests/foreman/api/test_remoteexecution.py index 4cf5174238..e8333ced36 100644 --- a/tests/foreman/api/test_remoteexecution.py +++ b/tests/foreman/api/test_remoteexecution.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: RemoteExecution :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/foreman/api/test_reporttemplates.py b/tests/foreman/api/test_reporttemplates.py index b011a06c4b..85e906ffd7 100644 --- a/tests/foreman/api/test_reporttemplates.py +++ b/tests/foreman/api/test_reporttemplates.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Reporting :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import re diff --git a/tests/foreman/api/test_repositories.py b/tests/foreman/api/test_repositories.py index 191c19c064..45b12ab0bf 100644 --- a/tests/foreman/api/test_repositories.py +++ b/tests/foreman/api/test_repositories.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Repositories :team: Phoenix-content -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ from manifester import Manifester from nailgun.entity_mixins import call_entity_method_with_timeout @@ -35,7 +30,7 @@ def test_negative_disable_repository_with_cv(module_entitlement_manifest_org, ta :id: e521a7a4-2502-4fe2-b297-a13fc99e679b - :Steps: + :steps: 1. Enable and sync a RH Repo 2. Create a Content View with Repository attached 3. Publish Content View @@ -77,7 +72,7 @@ def test_positive_update_repository_metadata(module_org, target_sat): :id: 6fe7bb3f-1640-4904-a223-b4764534afe8 - :Steps: + :steps: 1. Create a Product and Yum Repository 2. Sync the Repository and returns its content_counts for rpm 3. Update the url to a different Repo and re-sync the Repository @@ -127,7 +122,7 @@ def test_positive_epel_repositories_with_mirroring_policy( :id: 5c4e0ba4-4486-4eaf-b6ad-62831b7353a4 - :Steps: + :steps: 1. Create a Epel repository with mirroring_policy set 2. Sync the Repository and return its content_counts for rpm 3. Assert content was synced and mirroring policy type is correct @@ -151,8 +146,6 @@ def test_positive_sync_kickstart_repo(module_entitlement_manifest_org, target_sa :expectedresults: No encoding gzip errors present in /var/log/messages. - :CaseLevel: Integration - :customerscenario: true :steps: @@ -199,7 +192,7 @@ def test_negative_upload_expired_manifest(module_org, target_sat): :id: d6e652d8-5f46-4d15-9191-d842466d45d0 - :Steps: + :steps: 1. Upload a manifest 2. Delete the Subscription Allocation on RHSM 3. Attempt to refresh the manifest @@ -224,7 +217,7 @@ def test_positive_multiple_orgs_with_same_repo(target_sat): :id: 39cff8ea-969d-4b8f-9fb4-33b1ba768ff2 - :Steps: + :steps: 1. Create multiple organizations 2. Sync the same repository to each organization 3. Assert that each repository from each organization contain the same content counts @@ -249,7 +242,7 @@ def test_positive_sync_mulitple_large_repos(module_target_sat, module_entitlemen :id: b51c4a3d-d532-4342-be61-e868f7c3a723 - :Steps: + :steps: 1. Enabled multiple large Repositories Red Hat Enterprise Linux 8 for x86_64 - AppStream RPMs 8 Red Hat Enterprise Linux 8 for x86_64 - BaseOS RPMs 8 @@ -297,7 +290,7 @@ def test_positive_available_repositories_endpoint(module_sca_manifest_org, targe :id: f4c9d4a0-9a82-4f06-b772-b1f7e3f45e7d - :Steps: + :steps: 1. Enable a Red Hat Repository 2. Attempt to hit the enpoint: GET /katello/api/repository_sets/:id/available_repositories diff --git a/tests/foreman/api/test_repository.py b/tests/foreman/api/test_repository.py index 29cfbba2d1..dd7ce7bb3a 100644 --- a/tests/foreman/api/test_repository.py +++ b/tests/foreman/api/test_repository.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Repositories :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import re from string import punctuation @@ -317,7 +312,6 @@ def test_positive_create_with_gpg(self, module_org, module_product, module_targe :expectedresults: A repository is created with the given GPG key ID. - :CaseLevel: Integration """ gpg_key = module_target_sat.api.GPGKey( organization=module_org, @@ -336,7 +330,6 @@ def test_positive_create_same_name_different_orgs(self, repo, target_sat): :expectedresults: The two repositories are successfully created and have given name. - :CaseLevel: Integration """ org_2 = target_sat.api.Organization().create() product_2 = target_sat.api.Product(organization=org_2).create() @@ -678,7 +671,6 @@ def test_positive_update_gpg(self, module_org, module_product, module_target_sat :expectedresults: The updated repository points to a new GPG key. - :CaseLevel: Integration """ # Create a repo and make it point to a GPG key. gpg_key_1 = module_target_sat.api.GPGKey( @@ -705,7 +697,6 @@ def test_positive_update_contents(self, repo): :expectedresults: The repository's contents include one RPM. - :CaseLevel: Integration """ # Upload RPM content. repo.upload_content(files={'content': DataFile.RPM_TO_UPLOAD.read_bytes()}) @@ -867,7 +858,6 @@ def test_positive_synchronize(self, repo): :expectedresults: The repo has at least one RPM. - :CaseLevel: Integration """ repo.sync() assert repo.read().content_counts['rpm'] >= 1 @@ -901,7 +891,6 @@ def test_positive_synchronize_auth_yum_repo(self, repo): :expectedresults: Repository is created and synced - :CaseLevel: Integration """ # Verify that repo is not yet synced assert repo.content_counts['rpm'] == 0 @@ -940,7 +929,6 @@ def test_negative_synchronize_auth_yum_repo(self, repo): :expectedresults: Repository is created but synchronization fails - :CaseLevel: Integration """ with pytest.raises(TaskFailedError): repo.sync() @@ -967,7 +955,6 @@ def test_positive_resynchronize_rpm_repo(self, repo, target_sat): :BZ: 1459845, 1318004 - :CaseLevel: Integration """ # Synchronize it repo.sync() @@ -1023,7 +1010,6 @@ def test_positive_delete_rpm(self, repo): :expectedresults: The repository deleted successfully. - :CaseLevel: Integration """ repo.sync() # Check that there is at least one package @@ -1058,8 +1044,6 @@ def test_positive_access_protected_repository(self, module_org, repo, target_sat :BZ: 1242310 - :CaseLevel: Integration - :CaseImportance: High """ repo.sync() @@ -1100,8 +1084,6 @@ def test_positive_access_unprotected_repository(self, module_org, repo, target_s :expectedresults: The repository data file is successfully accessed. - :CaseLevel: Integration - :CaseImportance: Medium """ repo.sync() @@ -1208,7 +1190,6 @@ def test_positive_mirroring_policy(self, target_sat): :expectedresults: 1. The resync restores the original content properly. - :CaseLevel: System """ repo_url = settings.repos.yum_0.url packages_count = constants.FAKE_0_YUM_REPO_PACKAGES_COUNT @@ -1314,8 +1295,6 @@ def test_positive_sync_repos_with_lots_files(self, target_sat): :BZ: 1404345 - :CaseLevel: Integration - :expectedresults: repository was successfully synchronized """ org = target_sat.api.Organization().create() @@ -1333,7 +1312,6 @@ def test_positive_sync_rh(self, module_entitlement_manifest_org, target_sat): :expectedresults: Synced repo should fetch the data successfully. - :CaseLevel: Integration """ repo_id = target_sat.api_factory.enable_rhrepo_and_fetchid( basearch='x86_64', @@ -1365,8 +1343,6 @@ def test_positive_sync_yum_with_string_based_version(self, repo): :expectedresults: Synced repo should fetch the data successfully and parse versions as string. - :CaseLevel: Integration - :customerscenario: true :BZ: 1741011 @@ -1387,7 +1363,6 @@ def test_positive_sync_rh_app_stream(self): :expectedresults: Synced repo should fetch the data successfully and it should contain the module streams. - :CaseLevel: Integration """ pass @@ -1790,7 +1765,6 @@ def test_positive_synchronize_private_registry(self, repo): :BZ: 1475121 - :CaseLevel: Integration """ repo.sync() assert repo.read().content_counts['docker_manifest'] >= 1 @@ -1828,7 +1802,6 @@ def test_negative_synchronize_private_registry_wrong_password(self, repo_options :BZ: 1475121, 1580510 - :CaseLevel: Integration """ msg = "401, message=\'Unauthorized\'" with pytest.raises(TaskFailedError, match=msg): @@ -1867,7 +1840,6 @@ def test_negative_synchronize_private_registry_wrong_repo(self, repo_options, re :BZ: 1475121, 1580510 - :CaseLevel: Integration """ msg = "404, message=\'Not Found\'" with pytest.raises(TaskFailedError, match=msg): @@ -1907,7 +1879,6 @@ def test_negative_synchronize_private_registry_no_passwd( :BZ: 1475121, 1580510 - :CaseLevel: Integration """ with pytest.raises( HTTPError, @@ -2175,8 +2146,6 @@ def test_negative_synchronize_docker_repo_with_invalid_tags(self, repo_options, # # :expectedresults: Synced repo should fetch the data successfully. # -# :CaseLevel: Integration -# # :customerscenario: true # # :BZ: 1625783 @@ -2278,8 +2247,6 @@ class TestSRPMRepositoryIgnoreContent: In particular sync of duplicate SRPMs would fail when using the flag ``ignorable_content``. - :CaseLevel: Integration - :CaseComponent: Pulp :customerscenario: true @@ -2389,7 +2356,7 @@ def test_positive_upload_file_to_file_repo(self, repo, target_sat): :id: fdb46481-f0f4-45aa-b075-2a8f6725e51b - :Steps: + :steps: 1. Create a File Repository 2. Upload an arbitrary file to it @@ -2418,7 +2385,7 @@ def test_positive_file_permissions(self): 1. Create a File Repository 2. Upload an arbitrary file to it - :Steps: Retrieve file permissions from File Repository + :steps: Retrieve file permissions from File Repository :expectedresults: uploaded file permissions are kept after upload @@ -2444,7 +2411,7 @@ def test_positive_remove_file(self, repo, target_sat): 1. Create a File Repository 2. Upload an arbitrary file to it - :Steps: Remove a file from File Repository + :steps: Remove a file from File Repository :expectedresults: file is not listed under File Repository after removal @@ -2474,7 +2441,7 @@ def test_positive_remote_directory_sync(self): 1. Create a directory to be synced with a pulp manifest on its root 2. Make the directory available through http - :Steps: + :steps: 1. Create a File Repository with url pointing to http url created on setup 2. Initialize synchronization @@ -2497,7 +2464,7 @@ def test_positive_local_directory_sync(self): 1. Create a directory to be synced with a pulp manifest on its root locally (on the Satellite/Foreman host) - :Steps: + :steps: 1. Create a File Repository with url pointing to local url created on setup 2. Initialize synchronization @@ -2523,7 +2490,7 @@ def test_positive_symlinks_sync(self): locally (on the Satellite/Foreman host) 2. Make sure it contains synlinks - :Steps: + :steps: 1. Create a File Repository with url pointing to local url created on setup 2. Initialize synchronization diff --git a/tests/foreman/api/test_repository_set.py b/tests/foreman/api/test_repository_set.py index e476658582..8f8c56ea04 100644 --- a/tests/foreman/api/test_repository_set.py +++ b/tests/foreman/api/test_repository_set.py @@ -7,17 +7,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Repositories :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/foreman/api/test_rhc.py b/tests/foreman/api/test_rhc.py index 992d1017c7..521b1cb15d 100644 --- a/tests/foreman/api/test_rhc.py +++ b/tests/foreman/api/test_rhc.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: RHCloud-CloudConnector :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -44,7 +39,7 @@ def test_positive_configure_cloud_connector(target_sat, default_org, fixture_ena :id: 1338dc6a-12e0-4378-9a51-a33f4679ba30 - :Steps: + :steps: 1. Enable RH Cloud Connector 2. Check if the task is completed successfully diff --git a/tests/foreman/api/test_rhcloud_inventory.py b/tests/foreman/api/test_rhcloud_inventory.py index a50d8fd9e3..9cbd70dc2d 100644 --- a/tests/foreman/api/test_rhcloud_inventory.py +++ b/tests/foreman/api/test_rhcloud_inventory.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: System - :CaseComponent: RHCloud-Inventory :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_alphanumeric, gen_string import pytest @@ -133,7 +128,7 @@ def test_rhcloud_inventory_api_hosts_synchronization( :id: 7be22e1c-906b-4ae5-93dd-5f79f395601c - :Steps: + :steps: 1. Prepare machine and upload its data to Insights. 2. Sync inventory status using RH Cloud plugin api. @@ -171,7 +166,7 @@ def test_rhcloud_inventory_auto_upload_setting(): :customerscenario: true - :Steps: + :steps: 1. Register a content host with satellite. 2. Enable "Automatic inventory upload" setting. 3. Verify that satellite automatically generate and upload @@ -201,7 +196,7 @@ def test_inventory_upload_with_http_proxy(): :customerscenario: true - :Steps: + :steps: 1. Create a http proxy which is using port 80. 2. Update general and content proxy in Satellite settings. 3. Register a content host with satellite. @@ -233,7 +228,7 @@ def test_include_parameter_tags_setting( :id: 3136a1e3-f844-416b-8334-75b27fd9e3a1 - :Steps: + :steps: 1. Enable include_parameter_tags setting. 2. Register a content host with satellite. 3. Create a host parameter with long text value. diff --git a/tests/foreman/api/test_rhsm.py b/tests/foreman/api/test_rhsm.py index 2194ecdb14..096163a871 100644 --- a/tests/foreman/api/test_rhsm.py +++ b/tests/foreman/api/test_rhsm.py @@ -8,17 +8,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: SubscriptionManagement :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import http diff --git a/tests/foreman/api/test_role.py b/tests/foreman/api/test_role.py index da880c71f5..2499d48559 100644 --- a/tests/foreman/api/test_role.py +++ b/tests/foreman/api/test_role.py @@ -8,17 +8,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: UsersRoles :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from nailgun.config import ServerConfig import pytest @@ -576,7 +571,6 @@ def test_negative_access_entities_from_org_admin( :expectedresults: User should not be able to access any resources and permissions in taxonomies selected in Org Admin role - :CaseLevel: System """ user = self.create_org_admin_user( target_sat, role_taxos=role_taxonomies, user_taxos=filter_taxonomies @@ -609,7 +603,6 @@ def test_negative_access_entities_from_user( :expectedresults: User should not be able to access any resources and permissions in its own taxonomies - :CaseLevel: System """ user = self.create_org_admin_user( target_sat, role_taxos=role_taxonomies, user_taxos=filter_taxonomies @@ -636,7 +629,6 @@ def test_positive_override_cloned_role_filter(self, role_taxonomies, target_sat) :expectedresults: Filter in cloned role should be overridden - :CaseLevel: Integration """ role_name = gen_string('alpha') role = target_sat.api.Role(name=role_name).create() @@ -679,7 +671,6 @@ def test_positive_emptiness_of_filter_taxonomies_on_role_clone( None in cloned role 2. Override flag is set to True in cloned role filter - :CaseLevel: Integration """ role = target_sat.api.Role( name=gen_string('alpha'), @@ -722,7 +713,6 @@ def test_positive_clone_role_having_overridden_filter_with_taxonomies( :expectedresults: Unlimited and Override flags should be set to True on filter for filter that is overridden in parent role - :CaseLevel: Integration """ role = target_sat.api.Role( name=gen_string('alpha'), @@ -770,7 +760,6 @@ def test_positive_clone_role_having_non_overridden_filter_with_taxonomies( :expectedresults: Both unlimited and override flag should be set to False on filter for filter that is not overridden in parent role - :CaseLevel: Integration """ role = target_sat.api.Role( name=gen_string('alpha'), @@ -811,7 +800,6 @@ def test_positive_clone_role_having_unlimited_filter_with_taxonomies( :expectedresults: Both unlimited and override flags should be set to False on filter for filter that is unlimited in parent role - :CaseLevel: Integration """ role = target_sat.api.Role( name=gen_string('alpha'), @@ -852,7 +840,6 @@ def test_positive_clone_role_having_overridden_filter_without_taxonomies( :expectedresults: Both unlimited and Override flags should be set to True on filter for filter that is overridden in parent role - :CaseLevel: Integration """ role = target_sat.api.Role( name=gen_string('alpha'), @@ -895,8 +882,6 @@ def test_positive_clone_role_without_taxonomies_non_overided_filter( 1. Unlimited flag should be set to True 2. Override flag should be set to False - :CaseLevel: Integration - :BZ: 1488908 """ role = target_sat.api.Role( @@ -935,8 +920,6 @@ def test_positive_clone_role_without_taxonomies_unlimited_filter( 1. Unlimited flag should be set to True 2. Override flag should be set to False - :CaseLevel: Integration - :BZ: 1488908 """ role = target_sat.api.Role( @@ -974,7 +957,6 @@ def test_positive_user_group_users_access_as_org_admin(self, role_taxonomies, ta :expectedresults: Both the user should have access to the resources of organization A and Location A - :CaseLevel: System """ org_admin = self.create_org_admin_role( target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] @@ -1059,7 +1041,6 @@ def test_positive_user_group_users_access_contradict_as_org_admins(self): 2. User assigned to Organization A and Location A should have access to the resources of organization A and Location A - :CaseLevel: System """ @pytest.mark.tier2 @@ -1082,7 +1063,6 @@ def test_negative_assign_org_admin_to_user_group( :expectedresults: Both the user shouldn't have access to the resources of organization A,B and Location A,B - :CaseLevel: System """ org_admin = self.create_org_admin_role( target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] @@ -1124,7 +1104,6 @@ def test_negative_assign_taxonomies_by_org_admin( :expectedresults: Org Admin should not be able to assign the organizations to any of its resources - :CaseLevel: Integration """ org_admin = self.create_org_admin_role( target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] @@ -1206,7 +1185,6 @@ def test_positive_taxonomies_control_to_superadmin_with_org_admin( :expectedresults: Super admin should be able to access the target_sat.api in taxonomies assigned to Org Admin - :CaseLevel: Integration """ user = self.create_org_admin_user( target_sat, role_taxos=role_taxonomies, user_taxos=role_taxonomies @@ -1251,7 +1229,6 @@ def test_positive_taxonomies_control_to_superadmin_without_org_admin( :expectedresults: Super admin should be able to access the target_sat.api in taxonomies assigned to Org Admin after deleting Org Admin - :CaseLevel: Integration """ user = self.create_org_admin_user( target_sat, role_taxos=role_taxonomies, user_taxos=role_taxonomies @@ -1367,7 +1344,6 @@ def test_negative_admin_permissions_to_org_admin(self, role_taxonomies, target_s :expectedresults: Org Admin should not have access of Admin user - :CaseLevel: Integration """ org_admin = self.create_org_admin_role( target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] @@ -1414,7 +1390,6 @@ def test_positive_create_user_by_org_admin(self, role_taxonomies, target_sat): :customerscenario: true - :CaseLevel: Integration """ org_admin = self.create_org_admin_role( target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id] @@ -1468,7 +1443,6 @@ def test_positive_access_users_inside_org_admin_taxonomies(self, role_taxonomies :expectedresults: Org Admin should be able to access users inside its taxonomies - :CaseLevel: Integration """ user = self.create_org_admin_user( target_sat, role_taxos=role_taxonomies, user_taxos=role_taxonomies @@ -1499,7 +1473,6 @@ def test_positive_create_nested_location(self, role_taxonomies, target_sat): :expectedresults: after adding the needed permissions, user should be able to create nested locations - :CaseLevel: Integration """ user_login = gen_string('alpha') user_pass = gen_string('alphanumeric') @@ -1544,7 +1517,6 @@ def test_negative_access_users_outside_org_admin_taxonomies( :expectedresults: Org Admin should not be able to access users outside its taxonomies - :CaseLevel: Integration """ user = self.create_org_admin_user( target_sat, role_taxos=role_taxonomies, user_taxos=role_taxonomies @@ -1669,8 +1641,6 @@ def test_negative_access_entities_from_ldap_org_admin( :expectedresults: LDAP User should not be able to access resources and permissions in taxonomies selected in Org Admin role - :CaseLevel: System - :CaseAutomation: Automated """ org_admin = self.create_org_admin_role( @@ -1716,8 +1686,6 @@ def test_negative_access_entities_from_ldap_user( :expectedresults: LDAP User should not be able to access any resources and permissions in its own taxonomies - :CaseLevel: System - :CaseAutomation: Automated """ org_admin = self.create_org_admin_role( @@ -1762,8 +1730,6 @@ def test_positive_assign_org_admin_to_ldap_user_group( resources in taxonomies if the taxonomies of Org Admin role are same - :CaseLevel: System - :CaseAutomation: Automated """ group_name = gen_string("alpha") @@ -1825,8 +1791,6 @@ def test_negative_assign_org_admin_to_ldap_user_group( resources in taxonomies if the taxonomies of Org Admin role is not same - :CaseLevel: System - :CaseAutomation: Automated """ group_name = gen_string("alpha") diff --git a/tests/foreman/api/test_settings.py b/tests/foreman/api/test_settings.py index b4fe49c23c..4cbb5609bd 100644 --- a/tests/foreman/api/test_settings.py +++ b/tests/foreman/api/test_settings.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Settings :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import random @@ -50,7 +45,6 @@ def test_positive_update_login_page_footer_text(setting_update): :parametrized: yes :expectedresults: Parameter is updated successfully - """ login_text_value = random.choice(list(valid_data_list().values())) setting_update.value = login_text_value @@ -69,7 +63,6 @@ def test_positive_update_login_page_footer_text_without_value(setting_update): :parametrized: yes :expectedresults: login_text has empty value after update - """ setting_update.value = "" setting_update = setting_update.update({'value'}) @@ -88,7 +81,6 @@ def test_positive_update_login_page_footer_text_with_long_string(setting_update) :parametrized: yes :expectedresults: Parameter is updated - """ login_text_value = random.choice(list(generate_strings_list(1000))) setting_update.value = login_text_value @@ -126,7 +118,6 @@ def test_positive_update_hostname_prefix_without_value(setting_update): :BZ: 1911228 :expectedresults: Error should be raised on setting empty value for discovery_prefix setting - """ setting_update.value = "" with pytest.raises(HTTPError): @@ -192,7 +183,7 @@ def test_positive_custom_repo_download_policy(setting_update, download_policy, t :id: d5150cce-ba85-4ea0-a8d1-6a54d0d29571 - :Steps: + :steps: 1. Create a product, Organization 2. Update the Default Custom Repository download policy in the setting. 3. Create a custom repo under the created organization. @@ -205,8 +196,6 @@ def test_positive_custom_repo_download_policy(setting_update, download_policy, t repository. :CaseImportance: Medium - - :CaseLevel: Acceptance """ org = target_sat.api.Organization().create() prod = target_sat.api.Product(organization=org).create() diff --git a/tests/foreman/api/test_subnet.py b/tests/foreman/api/test_subnet.py index 9ac9fca097..b4882116f8 100644 --- a/tests/foreman/api/test_subnet.py +++ b/tests/foreman/api/test_subnet.py @@ -9,17 +9,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Networking :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import re @@ -206,8 +201,6 @@ def test_positive_inherit_subnet_parmeters_in_host(): 2. The parameters from subnet should be displayed in host enc output - :CaseLevel: System - :CaseImportance: Medium :BZ: 1470014 @@ -234,8 +227,6 @@ def test_positive_subnet_parameters_override_from_host(): 2. The new value should be assigned to parameter 3. The parameter and value should be accessible as host parameters - :CaseLevel: Integration - :CaseImportance: Medium :BZ: 1470014 @@ -258,8 +249,6 @@ def test_positive_subnet_parameters_override_impact_on_subnet(target_sat): :expectedresults: The override value of subnet parameter from host should not change actual value in subnet parameter - :CaseLevel: System - :CaseImportance: Medium """ @@ -368,8 +357,6 @@ def test_positive_update_subnet_parameter_host_impact(): 2. The inherited subnet parameter in host enc should have updated name and value - :CaseLevel: Integration - :BZ: 1470014 """ @@ -415,8 +402,6 @@ def test_positive_delete_subnet_parameter_host_impact(): 1. The parameter should be deleted from host 2. The parameter should be deleted from host enc - :CaseLevel: Integration - :BZ: 1470014 """ @@ -444,8 +429,6 @@ def test_positive_delete_subnet_overridden_parameter_host_impact(): host parameter now 2. The parameter should not be deleted from host enc as well - :CaseLevel: Integration - :BZ: 1470014 """ @@ -512,8 +495,6 @@ def test_positive_subnet_parameter_priority(): 2. Host enc should display the parameter with value inherited from higher priority component(HostGroup in this case) - :CaseLevel: System - :CaseImportance: Low :BZ: 1470014 @@ -543,8 +524,6 @@ def test_negative_component_overrides_subnet_parameter(): 2. Host enc should not display the parameter with value inherited from lower priority component(domain in this case) - :CaseLevel: System - :CaseImportance: Low :BZ: 1470014 diff --git a/tests/foreman/api/test_subscription.py b/tests/foreman/api/test_subscription.py index 5d5a2aedd3..3f98847191 100644 --- a/tests/foreman/api/test_subscription.py +++ b/tests/foreman/api/test_subscription.py @@ -8,17 +8,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: SubscriptionManagement :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string from nailgun.config import ServerConfig diff --git a/tests/foreman/api/test_syncplan.py b/tests/foreman/api/test_syncplan.py index dec71b6b9c..3ecbfac871 100644 --- a/tests/foreman/api/test_syncplan.py +++ b/tests/foreman/api/test_syncplan.py @@ -8,17 +8,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: SyncPlans :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from datetime import datetime, timedelta from time import sleep @@ -485,8 +480,6 @@ def test_positive_add_product(module_org, target_sat): :expectedresults: A sync plan can be created and one product can be added to it. - :CaseLevel: Integration - :CaseImportance: Critical """ sync_plan = target_sat.api.SyncPlan(enabled=False, organization=module_org).create() @@ -506,8 +499,6 @@ def test_positive_add_products(module_org, target_sat): :expectedresults: A sync plan can be created and two products can be added to it. - - :CaseLevel: Integration """ sync_plan = target_sat.api.SyncPlan(enabled=False, organization=module_org).create() products = [target_sat.api.Product(organization=module_org).create() for _ in range(2)] @@ -528,8 +519,6 @@ def test_positive_remove_product(module_org, target_sat): :expectedresults: A sync plan can be created and one product can be removed from it. - :CaseLevel: Integration - :BZ: 1199150 """ sync_plan = target_sat.api.SyncPlan(enabled=False, organization=module_org).create() @@ -553,8 +542,6 @@ def test_positive_remove_products(module_org, target_sat): :expectedresults: A sync plan can be created and both products can be removed from it. - - :CaseLevel: Integration """ sync_plan = target_sat.api.SyncPlan(enabled=False, organization=module_org).create() products = [target_sat.api.Product(organization=module_org).create() for _ in range(2)] @@ -574,8 +561,6 @@ def test_positive_repeatedly_add_remove(module_org, request, target_sat): :expectedresults: A task is returned which can be used to monitor the additions and removals. - :CaseLevel: Integration - :BZ: 1199150 """ sync_plan = target_sat.api.SyncPlan(organization=module_org).create() @@ -598,8 +583,6 @@ def test_positive_add_remove_products_custom_cron(module_org, request, target_sa :expectedresults: A sync plan can be created and both products can be removed from it. - - :CaseLevel: Integration """ cron_expression = gen_choice(valid_cron_expressions()) @@ -625,8 +608,6 @@ def test_negative_synchronize_custom_product_past_sync_date(module_org, request, :expectedresults: Product was not synchronized :BZ: 1279539 - - :CaseLevel: System """ product = target_sat.api.Product(organization=module_org).create() repo = target_sat.api.Repository(product=product).create() @@ -657,8 +638,6 @@ def test_positive_synchronize_custom_product_past_sync_date(module_org, request, :expectedresults: Product is synchronized successfully. :BZ: 1279539 - - :CaseLevel: System """ interval = 60 * 60 # 'hourly' sync interval in seconds delay = 2 * 60 @@ -703,8 +682,6 @@ def test_positive_synchronize_custom_product_future_sync_date(module_org, reques :expectedresults: Product is synchronized successfully. - :CaseLevel: System - :BZ: 1655595, 1695733 """ delay = 2 * 60 # delay for sync date in seconds @@ -754,8 +731,6 @@ def test_positive_synchronize_custom_products_future_sync_date(module_org, reque :expectedresults: Products are synchronized successfully. - :CaseLevel: System - :BZ: 1695733 """ # Test with multiple products and multiple repos needs more delay. @@ -821,8 +796,6 @@ def test_positive_synchronize_rh_product_past_sync_date( :customerscenario: true :BZ: 1279539, 1879537 - - :CaseLevel: System """ interval = 60 * 60 # 'hourly' sync interval in seconds delay = 2 * 60 @@ -886,8 +859,6 @@ def test_positive_synchronize_rh_product_future_sync_date( :id: 6697a00f-2181-4c2b-88eb-2333268d780b :expectedresults: Product is synchronized successfully. - - :CaseLevel: System """ delay = 2 * 60 # delay for sync date in seconds org = function_entitlement_manifest_org @@ -944,8 +915,6 @@ def test_positive_synchronize_custom_product_daily_recurrence(module_org, reques :id: d60e33a0-f75c-498e-9e6f-0a2025295a9d :expectedresults: Product is synchronized successfully. - - :CaseLevel: System """ delay = 2 * 60 product = target_sat.api.Product(organization=module_org).create() @@ -989,8 +958,6 @@ def test_positive_synchronize_custom_product_weekly_recurrence(module_org, reque :expectedresults: Product is synchronized successfully. :BZ: 1396647 - - :CaseLevel: System """ delay = 2 * 60 product = target_sat.api.Product(organization=module_org).create() @@ -1031,8 +998,6 @@ def test_positive_delete_one_product(module_org, target_sat): :expectedresults: A sync plan is created with one product and sync plan can be deleted. - - :CaseLevel: Integration """ sync_plan = target_sat.api.SyncPlan(organization=module_org).create() product = target_sat.api.Product(organization=module_org).create() @@ -1051,8 +1016,6 @@ def test_positive_delete_products(module_org, target_sat): :expectedresults: A sync plan is created with one product and sync plan can be deleted. - - :CaseLevel: Integration """ sync_plan = target_sat.api.SyncPlan(organization=module_org).create() products = [target_sat.api.Product(organization=module_org).create() for _ in range(2)] @@ -1072,8 +1035,6 @@ def test_positive_delete_synced_product(module_org, module_target_sat): :expectedresults: A sync plan is created with one synced product and sync plan can be deleted. - - :CaseLevel: Integration """ sync_plan = module_target_sat.api.SyncPlan(organization=module_org).create() product = module_target_sat.api.Product(organization=module_org).create() @@ -1095,8 +1056,6 @@ def test_positive_delete_synced_product_custom_cron(module_org, module_target_sa :expectedresults: A sync plan is created with one synced product and sync plan can be deleted. - - :CaseLevel: Integration """ sync_plan = module_target_sat.api.SyncPlan( organization=module_org, diff --git a/tests/foreman/api/test_template_combination.py b/tests/foreman/api/test_template_combination.py index 3eb5d59c12..a10125e0a5 100644 --- a/tests/foreman/api/test_template_combination.py +++ b/tests/foreman/api/test_template_combination.py @@ -4,15 +4,10 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ProvisioningTemplates :Team: Rocket -:TestType: Functional - -:Upstream: No """ import pytest from requests.exceptions import HTTPError diff --git a/tests/foreman/api/test_templatesync.py b/tests/foreman/api/test_templatesync.py index 8e38540d39..d91c8ad378 100644 --- a/tests/foreman/api/test_templatesync.py +++ b/tests/foreman/api/test_templatesync.py @@ -4,15 +4,10 @@ :CaseAutomation: Automated -:CaseLevel: Integration - :CaseComponent: TemplatesPlugin :Team: Endeavour -:TestType: Functional - -:Upstream: No """ import base64 import json @@ -35,10 +30,7 @@ class TestTemplateSyncTestCase: - """Implements TemplateSync tests from API - - :CaseLevel: Acceptance - """ + """Implements TemplateSync tests from API""" @pytest.fixture(scope='module', autouse=True) def setUpClass(self, module_target_sat): @@ -74,7 +66,7 @@ def test_positive_import_filtered_templates_from_git( :id: 628a95d6-7a4e-4e56-ad7b-d9fecd34f765 - :Steps: + :steps: 1. Using nailgun or direct API call import only the templates matching with regex e.g: `^atomic.*` refer to: `/apidoc/v2/template/import.html` @@ -150,7 +142,7 @@ def test_import_filtered_templates_from_git_with_negate(self, module_org, module :id: a6857454-249b-4a2e-9b53-b5d7b4eb34e3 - :Steps: + :steps: 1. Using nailgun or direct API call import the templates NOT matching with regex e.g: `^freebsd.*` refer to: `/apidoc/v2/template/import.html` using the @@ -194,7 +186,7 @@ def test_import_filtered_templates_from_git_with_negate(self, module_org, module def test_import_template_with_puppet(self, parametrized_puppet_sat): """Importing puppet templates with enabled/disabled puppet module - :Steps: + :steps: 1. Have enabled(disabled) puppet module 2. Import template containing puppet 3. Check if template was imported @@ -243,7 +235,7 @@ def test_positive_import_and_associate( :id: 04a14a56-bd71-412b-b2da-4b8c3991c401 - :Steps: + :steps: 1. Create new taxonomies, lets say org X and loc Y. 2. From X and Y taxonomies scope, Import template1 as associate 'never', where the template contains the metadata anything other than X and Y taxonomies. @@ -373,7 +365,7 @@ def test_positive_import_from_subdirectory(self, module_org, module_target_sat): :id: 8ea11a1a-165e-4834-9387-7accb4c94e77 - :Steps: + :steps: 1. Using nailgun or direct API call import templates specifying a git subdirectory e.g: `-d {'dirname': 'test_sub_dir'}` in POST body @@ -411,7 +403,7 @@ def test_positive_export_filtered_templates_to_localdir( :id: b7c98b75-4dd1-4b6a-b424-35b0f48c25db - :Steps: + :steps: 1. Using nailgun or direct API call export only the templates matching with regex e.g: `robottelo` refer to: `/apidoc/v2/template/export.html` @@ -447,7 +439,7 @@ def test_positive_export_filtered_templates_negate( :id: 2f8ad8f3-f02b-4b2d-85af-423a228976f3 - :Steps: + :steps: 1. Using nailgun or direct API call export templates matching that does not matches regex e.g: `robottelo` using `negate` option. @@ -482,7 +474,7 @@ def test_positive_export_and_import_with_metadata( :id: ba8a34ce-c2c6-4889-8729-59714c0a4b19 - :Steps: + :steps: 1. Create a template in local directory and specify Org/Loc. 2. Use import to pull this specific template (using filter). 3. Using nailgun or direct API call @@ -560,7 +552,7 @@ def test_positive_import_json_output_verbose(self, module_org, verbose, module_t :id: 74b0a701-341f-4062-9769-e5cb1a1c4792 - :Steps: + :steps: 1. Using nailgun or direct API call Impot a template with verbose `True` and `False` option @@ -612,7 +604,7 @@ def test_positive_import_json_output_changed_key_true( :id: 4b866144-822c-4786-9188-53bc7e2dd44a - :Steps: + :steps: 1. Using nailgun or direct API call Create a template and import it from a source 2. Update the template data in source location @@ -648,7 +640,7 @@ def test_positive_import_json_output_changed_key_false( :id: 64456c0c-c2c6-4a1c-a16e-54ca4a8b66d3 - :Steps: + :steps: 1. Using nailgun or direct API call Create a template and import it from a source 2. Dont update the template data in source location @@ -681,7 +673,7 @@ def test_positive_import_json_output_name_key( :id: a5639368-3d23-4a37-974a-889e2ec0916e - :Steps: + :steps: 1. Using nailgun or direct API call Create a template with some name and import it from a source @@ -713,7 +705,7 @@ def test_positive_import_json_output_imported_key( :id: 5bc11163-e8f3-4744-8a76-5c16e6e46e86 - :Steps: + :steps: 1. Using nailgun or direct API call Create a template and import it from a source @@ -740,7 +732,7 @@ def test_positive_import_json_output_file_key( :id: da0b094c-6dc8-4526-b115-8e08bfb05fbb - :Steps: + :steps: 1. Using nailgun or direct API call Create a template with some name and import it from a source @@ -767,7 +759,7 @@ def test_positive_import_json_output_corrupted_metadata( :id: 6bd5bc6b-a7a2-4529-9df6-47a670cd86d8 - :Steps: + :steps: 1. Create a template with wrong syntax in metadata 2. Using nailgun or direct API call Import above template @@ -801,7 +793,7 @@ def test_positive_import_json_output_filtered_skip_message( :id: db68b5de-7647-4568-b79c-2aec3292328a - :Steps: + :steps: 1. Using nailgun or direct API call Create template with name not matching filter @@ -837,7 +829,7 @@ def test_positive_import_json_output_no_name_error( :id: 259a8a3a-8749-442d-a2bc-51e9af89ce8c - :Steps: + :steps: 1. Create a template without name in metadata 2. Using nailgun or direct API call Import above template @@ -871,7 +863,7 @@ def test_positive_import_json_output_no_model_error( :id: d3f1ffe4-58d7-45a8-b278-74e081dc5062 - :Steps: + :steps: 1. Create a template without model keyword in metadata 2. Using nailgun or direct API call Import above template @@ -905,7 +897,7 @@ def test_positive_import_json_output_blank_model_error( :id: 5007b12d-1cf6-49e6-8e54-a189d1a209de - :Steps: + :steps: 1. Create a template with blank model name in metadata 2. Using nailgun or direct API call Import above template @@ -938,7 +930,7 @@ def test_positive_export_json_output( :id: 141b893d-72a3-47c2-bb03-004c757bcfc9 - :Steps: + :steps: 1. Using nailgun or direct API call Export all the templates @@ -990,7 +982,7 @@ def test_positive_import_log_to_production(self, module_org, target_sat): :id: 19ed0e6a-ee77-4e28-86c9-49db1adec479 - :Steps: + :steps: 1. Using nailgun or direct API call Import template from a source @@ -999,8 +991,6 @@ def test_positive_import_log_to_production(self, module_org, target_sat): :Requirement: Take Templates out of tech preview - :CaseLevel: System - :CaseImportance: Low """ target_sat.api.Template().imports( @@ -1028,7 +1018,7 @@ def test_positive_export_log_to_production( :id: 8ae370b1-84e8-436e-a7d7-99cd0b8f45b1 - :Steps: + :steps: 1. Using nailgun or direct API call Export template to destination @@ -1037,8 +1027,6 @@ def test_positive_export_log_to_production( :Requirement: Take Templates out of tech preview - :CaseLevel: System - :CaseImportance: Low """ target_sat.api.Template().imports( @@ -1085,7 +1073,7 @@ def test_positive_export_all_templates_to_repo( :id: 0bf6fe77-01a3-4843-86d6-22db5b8adf3b - :Steps: + :steps: 1. Using nailgun export all templates to repository (ensure filters are empty) :expectedresults: @@ -1126,7 +1114,7 @@ def test_positive_import_all_templates_from_repo(self, module_org, module_target :id: 95ac9543-d989-44f4-b4d9-18f20a0b58b9 - :Steps: + :steps: 1. Using nailgun import all templates from repository (ensure filters are empty) :expectedresults: @@ -1158,7 +1146,7 @@ def test_negative_import_locked_template(self, module_org, module_target_sat): :id: 88e21cad-448e-45e0-add2-94493a1319c5 - :Steps: + :steps: 1. Using nailgun try to import a locked template :expectedresults: @@ -1207,7 +1195,7 @@ def test_positive_import_locked_template(self, module_org, module_target_sat): :id: 936c91cc-1947-45b0-8bf0-79ba4be87b97 - :Steps: + :steps: 1. Using nailgun try to import a locked template with force parameter :expectedresults: diff --git a/tests/foreman/api/test_user.py b/tests/foreman/api/test_user.py index de78386805..75dd19e6f5 100644 --- a/tests/foreman/api/test_user.py +++ b/tests/foreman/api/test_user.py @@ -8,17 +8,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: UsersRoles :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import json import re @@ -640,7 +635,6 @@ def test_positive_ssh_key_in_host_enc(self, class_target_sat): :expectedresults: SSH key should be added to host ENC output - :CaseLevel: Integration """ org = class_target_sat.api.Organization().create() loc = class_target_sat.api.Location(organization=[org]).create() @@ -709,7 +703,6 @@ def test_positive_create_in_ldap_mode(self, username, create_ldap, target_sat): :expectedresults: User is created without specifying the password - :CaseLevel: Integration """ user = target_sat.api.User( login=username, auth_source=create_ldap['authsource'], password='' @@ -728,7 +721,6 @@ def test_positive_ad_basic_no_roles(self, create_ldap, target_sat): :expectedresults: Log in to foreman successfully but cannot access target_sat.api. - :CaseLevel: System """ sc = ServerConfig( auth=(create_ldap['ldap_user_name'], create_ldap['ldap_user_passwd']), @@ -756,7 +748,6 @@ def test_positive_access_entities_from_ldap_org_admin(self, create_ldap, module_ :expectedresults: LDAP User should be able to access all the resources and permissions in taxonomies selected in Org Admin role - :CaseLevel: System """ # Workaround issue where, in an upgrade template, there is already # some auth source present with this user. That auth source instance @@ -861,7 +852,6 @@ def test_positive_ipa_basic_no_roles(self, create_ldap, target_sat): :expectedresults: Log in to foreman successfully but cannot access target_sat.api. - :CaseLevel: System """ sc = ServerConfig( auth=(create_ldap['username'], create_ldap['ldap_user_passwd']), @@ -889,7 +879,6 @@ def test_positive_access_entities_from_ipa_org_admin(self, create_ldap, target_s :expectedresults: FreeIPA User should be able to access all the resources and permissions in taxonomies selected in Org Admin role - :CaseLevel: System """ role_name = gen_string('alpha') default_org_admin = target_sat.api.Role().search( @@ -949,8 +938,6 @@ def test_personal_access_token_admin(self): 1. Should show output of the api endpoint 2. When revoked, authentication error - :CaseLevel: System - :CaseImportance: High """ @@ -973,10 +960,7 @@ def test_positive_personal_access_token_user_with_role(self): 2. When an incorrect role and end point is used, missing permission should be displayed. - :CaseLevel: System - :CaseImportance: High - """ @pytest.mark.tier2 @@ -993,8 +977,6 @@ def test_expired_personal_access_token(self): :expectedresults: Authentication error - :CaseLevel: System - :CaseImportance: Medium """ diff --git a/tests/foreman/api/test_usergroup.py b/tests/foreman/api/test_usergroup.py index a01ee213a3..95d1547934 100644 --- a/tests/foreman/api/test_usergroup.py +++ b/tests/foreman/api/test_usergroup.py @@ -7,17 +7,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: UsersRoles :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from random import randint @@ -155,7 +150,6 @@ def test_positive_create_with_usergroups(self, target_sat): :expectedresults: User group is created successfully and contains all expected user groups - :CaseLevel: Integration """ sub_user_groups = [target_sat.api.UserGroup().create() for _ in range(randint(3, 5))] user_group = target_sat.api.UserGroup(usergroup=sub_user_groups).create() @@ -234,7 +228,6 @@ def test_positive_update_with_existing_user(self, target_sat): :expectedresults: User group is updated successfully. - :CaseLevel: Integration """ users = [target_sat.api.User().create() for _ in range(2)] user_group = target_sat.api.UserGroup(user=[users[0]]).create() diff --git a/tests/foreman/api/test_webhook.py b/tests/foreman/api/test_webhook.py index e06f93dc0a..dbe0e57523 100644 --- a/tests/foreman/api/test_webhook.py +++ b/tests/foreman/api/test_webhook.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: HooksandWebhooks :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import re diff --git a/tests/foreman/cli/test_abrt.py b/tests/foreman/cli/test_abrt.py index ecba0b067b..0543679b73 100644 --- a/tests/foreman/cli/test_abrt.py +++ b/tests/foreman/cli/test_abrt.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Infrastructure :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -30,7 +25,7 @@ def test_positive_create_report(self): :Setup: abrt - :Steps: start a sleep process in background, kill it send the report + :steps: start a sleep process in background, kill it send the report using smart-proxy-abrt-send :expectedresults: A abrt report with ccpp.* extension created under @@ -39,7 +34,6 @@ def test_positive_create_report(self): :CaseAutomation: NotAutomated :CaseImportance: Critical - """ @@ -51,7 +45,7 @@ def test_positive_create_reports(self): :Setup: abrt - :Steps: + :steps: 1. Create multiple reports of abrt 2. Keep track of counts @@ -59,7 +53,6 @@ def test_positive_create_reports(self): :expectedresults: Count is updated in proper manner :CaseAutomation: NotAutomated - """ @@ -71,12 +64,11 @@ def test_positive_update_timer(self): :Setup: abrt - :Steps: edit the timer for /etc/cron.d/rubygem-smart_proxy_abrt + :steps: edit the timer for /etc/cron.d/rubygem-smart_proxy_abrt :expectedresults: the timer file is edited :CaseAutomation: NotAutomated - """ @@ -88,12 +80,11 @@ def test_positive_identify_hostname(self): :Setup: abrt - :Steps: UI => Settings => Abrt tab => edit hostnames + :steps: UI => Settings => Abrt tab => edit hostnames :expectedresults: Assertion of hostnames is possible :CaseAutomation: NotAutomated - """ @@ -105,10 +96,9 @@ def test_positive_search_report(self): :Setup: abrt - :Steps: access /var/tmp/abrt/ccpp-* files + :steps: access /var/tmp/abrt/ccpp-* files :expectedresults: Assertion of parameters :CaseAutomation: NotAutomated - """ diff --git a/tests/foreman/cli/test_acs.py b/tests/foreman/cli/test_acs.py index 37750aed9b..f7ad33cf20 100644 --- a/tests/foreman/cli/test_acs.py +++ b/tests/foreman/cli/test_acs.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: AlternateContentSources :Team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_alphanumeric import pytest @@ -58,7 +53,6 @@ def test_positive_CRUD_all_types( 3. ACS can be updated and read with new name. 4. ACS can be refreshed. 5. ACS can be deleted. - """ if 'rhui' in request.node.name and 'file' in request.node.name: pytest.skip('unsupported parametrize combination') @@ -141,7 +135,6 @@ def test_negative_check_name_validation(module_target_sat, acs_type): :expectedresults: 1. Should fail with validation error and proper message. - """ with pytest.raises(CLIReturnCodeError) as context: module_target_sat.cli.ACS.create({'alternate-content-source-type': acs_type}) @@ -167,7 +160,6 @@ def test_negative_check_custom_rhui_validations(module_target_sat, acs_type, mod :expectedresults: 1. Should fail as base-url and verify-ssl are required. 2. Should fail as product-ids is forbidden. - """ # Create with required missing with pytest.raises(CLIReturnCodeError) as context: @@ -217,7 +209,6 @@ def test_negative_check_simplified_validations( :expectedresults: 1. Should fail and list all the forbidden parameters must be blank. - """ # Create with forbidden present params = { diff --git a/tests/foreman/cli/test_activationkey.py b/tests/foreman/cli/test_activationkey.py index 15aca83eaf..7a0d5f57dd 100644 --- a/tests/foreman/cli/test_activationkey.py +++ b/tests/foreman/cli/test_activationkey.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ActivationKeys :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from random import choice import re @@ -147,8 +142,6 @@ def test_positive_create_with_cv(name, module_org, get_default_env, module_targe :expectedresults: Activation key is created and has proper content view assigned - :CaseLevel: Integration - :parametrized: yes """ new_cv = module_target_sat.cli_factory.make_content_view( @@ -206,8 +199,6 @@ def test_positive_create_content_and_check_enabled(module_org, module_target_sat successfully :BZ: 1361993 - - :CaseLevel: Integration """ result = module_target_sat.cli_factory.setup_org_for_a_custom_repo( {'url': settings.repos.yum_0.url, 'organization-id': module_org.id} @@ -367,8 +358,6 @@ def test_positive_delete_with_cv(module_org, module_target_sat): :id: bba323fa-0362-4a9b-97af-560d446cbb6c :expectedresults: Activation key is deleted - - :CaseLevel: Integration """ new_cv = module_target_sat.cli_factory.make_content_view({'organization-id': module_org.id}) new_ak = module_target_sat.cli_factory.make_activation_key( @@ -387,8 +376,6 @@ def test_positive_delete_with_lce(module_org, get_default_env, module_target_sat :id: e1830e52-5b1a-4ac4-8d0a-df6efb218a8b :expectedresults: Activation key is deleted - - :CaseLevel: Integration """ new_ak = module_target_sat.cli_factory.make_activation_key( {'organization-id': module_org.id, 'lifecycle-environment': get_default_env['name']} @@ -477,8 +464,6 @@ def test_positive_update_lce(module_org, get_default_env, module_target_sat): :id: 55aaee60-b8c8-49f0-995a-6c526b9b653b :expectedresults: Activation key is updated - - :CaseLevel: Integration """ ak_env = module_target_sat.cli_factory.make_activation_key( {'organization-id': module_org.id, 'lifecycle-environment-id': get_default_env['id']} @@ -511,8 +496,6 @@ def test_positive_update_cv(module_org, module_target_sat): :id: aa94997d-fc9b-4532-aeeb-9f27b9834914 :expectedresults: Activation key is updated - - :CaseLevel: Integration """ cv = module_target_sat.cli_factory.make_content_view({'organization-id': module_org.id}) ak_cv = module_target_sat.cli_factory.make_activation_key( @@ -616,7 +599,7 @@ def test_positive_usage_limit(module_org, target_sat): :id: 00ded856-e939-4140-ac84-91b6a8643623 - :Steps: + :steps: 1. Create Activation key 2. Update Usage Limit to a finite number @@ -628,8 +611,6 @@ def test_positive_usage_limit(module_org, target_sat): shown :CaseImportance: Critical - - :CaseLevel: System """ env = target_sat.cli_factory.make_lifecycle_environment({'organization-id': module_org.id}) new_cv = target_sat.cli_factory.make_content_view({'organization-id': module_org.id}) @@ -671,8 +652,6 @@ def test_positive_update_host_collection(module_org, host_col_name, module_targe :expectedresults: Host collections are successfully associated to Activation key - :CaseLevel: Integration - :parametrized: yes """ activation_key = module_target_sat.cli_factory.make_activation_key( @@ -731,8 +710,6 @@ def test_positive_add_redhat_product(function_entitlement_manifest_org, target_s :expectedresults: RH products are successfully associated to Activation key - - :CaseLevel: System """ org = function_entitlement_manifest_org @@ -763,8 +740,6 @@ def test_positive_add_custom_product(module_org, module_target_sat): :expectedresults: Custom products are successfully associated to Activation key - :CaseLevel: System - :BZ: 1426386 """ result = module_target_sat.cli_factory.setup_org_for_a_custom_repo( @@ -788,7 +763,7 @@ def test_positive_add_redhat_and_custom_products( :id: 74c77426-18f5-4abb-bca9-a2135f7fcc1f - :Steps: + :steps: 1. Create Activation key 2. Associate RH product(s) to Activation Key @@ -797,8 +772,6 @@ def test_positive_add_redhat_and_custom_products( :expectedresults: RH/Custom product is successfully associated to Activation key - :CaseLevel: System - :BZ: 1426386 """ org = function_entitlement_manifest_org @@ -836,7 +809,7 @@ def test_positive_delete_manifest(function_entitlement_manifest_org, target_sat) :id: 8256ac6d-3f60-4668-897d-2e88d29532d3 - :Steps: + :steps: 1. Upload manifest 2. Create activation key - attach some subscriptions 3. Delete manifest @@ -877,8 +850,6 @@ def test_positive_delete_subscription(function_entitlement_manifest_org, module_ :expectedresults: Deleting subscription removes it from the Activation key - - :CaseLevel: Integration """ org = function_entitlement_manifest_org new_ak = module_target_sat.cli_factory.make_activation_key({'organization-id': org.id}) @@ -916,8 +887,6 @@ def test_positive_update_aks_to_chost(module_org, rhel7_contenthost, target_sat) host :parametrized: yes - - :CaseLevel: System """ env = target_sat.cli_factory.make_lifecycle_environment({'organization-id': module_org.id}) new_cv = target_sat.cli_factory.make_content_view({'organization-id': module_org.id}) @@ -965,8 +934,6 @@ def test_positive_update_aks_to_chost_in_one_command(module_org): :expectedresults: Multiple Activation keys are attached to a Content host - - :CaseLevel: System """ @@ -1048,7 +1015,7 @@ def test_positive_remove_host_collection_by_id(module_org, module_target_sat): :id: 20f8ecca-1756-4900-b966-f0144b6bd0aa - :Steps: + :steps: 1. Create Activation key 2. Create host collection @@ -1061,8 +1028,6 @@ def test_positive_remove_host_collection_by_id(module_org, module_target_sat): :CaseImportance: Medium - :CaseLevel: Integration - :BZ: 1336716 """ activation_key = module_target_sat.cli_factory.make_activation_key( @@ -1099,7 +1064,7 @@ def test_positive_remove_host_collection_by_name(module_org, host_col, module_ta :id: 1a559a82-db5f-48b0-beeb-2fa02aed7ef9 - :Steps: + :steps: 1. Create Activation key 2. Create host collection @@ -1110,8 +1075,6 @@ def test_positive_remove_host_collection_by_name(module_org, host_col, module_ta :expectedresults: Host collection successfully removed from activation key - :CaseLevel: Integration - :BZ: 1336716 :parametrized: yes @@ -1151,7 +1114,7 @@ def test_create_ak_with_syspurpose_set(module_entitlement_manifest_org, module_t :id: ac8931e5-7089-494a-adac-cee2a8ab57ee - :Steps: + :steps: 1. Create Activation key with system purpose values set 2. Read Activation key values and assert system purpose values are set 3. Clear AK system purpose values @@ -1202,7 +1165,7 @@ def test_update_ak_with_syspurpose_values(module_entitlement_manifest_org, modul :id: db943c05-70f1-4385-9537-fe23368a9dfd - :Steps: + :steps: 1. Create Activation key with no system purpose values set 2. Assert system purpose values are not set @@ -1270,7 +1233,7 @@ def test_positive_add_subscription_by_id(module_entitlement_manifest_org, module :id: b884be1c-b35d-440a-9a9d-c854c83e10a7 - :Steps: + :steps: 1. Create Activation key 2. Upload manifest and add subscription @@ -1280,8 +1243,6 @@ def test_positive_add_subscription_by_id(module_entitlement_manifest_org, module :BZ: 1463685 - :CaseLevel: Integration - :BZ: 1463685 """ org_id = module_entitlement_manifest_org.id @@ -1346,7 +1307,6 @@ def test_negative_copy_with_same_name(module_org, module_target_sat): :id: f867c468-4155-495c-a1e5-c04d9868a2e0 :expectedresults: Activation key is not successfully copied - """ parent_ak = module_target_sat.cli_factory.make_activation_key( {'organization-id': module_org.id} @@ -1372,15 +1332,13 @@ def test_positive_copy_subscription(module_entitlement_manifest_org, module_targ :id: f4ee8096-4120-4d06-8c9a-57ac1eaa8f68 - :Steps: + :steps: 1. Create parent key and add content 2. Copy Activation key by passing id of parent 3. Verify content was successfully copied :expectedresults: Activation key is successfully copied - - :CaseLevel: Integration """ # Begin test setup org = module_entitlement_manifest_org @@ -1410,7 +1368,7 @@ def test_positive_update_autoattach_toggle(module_org, module_target_sat): :id: de3b5fb7-7963-420a-b4c9-c66e78a111dc - :Steps: + :steps: 1. Get the key's current auto attach value. 2. Update the key with the value's inverse. @@ -1455,7 +1413,7 @@ def test_negative_update_autoattach(module_org, module_target_sat): :id: 54b6f808-ff54-4e69-a54d-e1f99a4652f9 - :Steps: + :steps: 1. Attempt to update a key with incorrect auto-attach value 2. Verify that an appropriate error message was returned @@ -1484,7 +1442,7 @@ def test_positive_content_override(module_org, module_target_sat): :id: a4912cc0-3bf7-4e90-bb51-ec88b2fad227 - :Steps: + :steps: 1. Create activation key and add content 2. Get the first product's label @@ -1492,8 +1450,6 @@ def test_positive_content_override(module_org, module_target_sat): 4. Verify that the command succeeded :expectedresults: Activation key content override was successful - - :CaseLevel: System """ result = module_target_sat.cli_factory.setup_org_for_a_custom_repo( {'url': settings.repos.yum_0.url, 'organization-id': module_org.id} @@ -1574,8 +1530,6 @@ def test_positive_view_subscriptions_by_non_admin_user( subscription :BZ: 1406076 - - :CaseLevel: System """ org = module_entitlement_manifest_org user_name = gen_alphanumeric() @@ -1715,7 +1669,7 @@ def test_positive_ak_with_custom_product_on_rhel6(module_org, rhel6_contenthost, :customerscenario: true - :Steps: + :steps: 1. Create a custom repo 2. Create ak and add custom repo to ak 3. Add subscriptions to the ak diff --git a/tests/foreman/cli/test_ansible.py b/tests/foreman/cli/test_ansible.py index a684cdbd44..b628c9d8fa 100644 --- a/tests/foreman/cli/test_ansible.py +++ b/tests/foreman/cli/test_ansible.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Ansible :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -31,7 +26,7 @@ def test_positive_ansible_e2e(target_sat, module_org, rhel_contenthost): :id: 0c52bc63-a41a-4f48-a980-fe49b4ecdbdc - :Steps: + :steps: 1. Register a content host with satellite 2. Import a role into satellite 3. Assign that role to a host @@ -132,7 +127,7 @@ def test_add_and_remove_ansible_role_hostgroup(target_sat): :customerscenario: true - :Steps: + :steps: 1. Create a hostgroup 2. Sync few ansible roles 3. Assign a few ansible roles with the host group diff --git a/tests/foreman/cli/test_architecture.py b/tests/foreman/cli/test_architecture.py index 4f0fe73061..7578fe577b 100644 --- a/tests/foreman/cli/test_architecture.py +++ b/tests/foreman/cli/test_architecture.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Hosts :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_choice import pytest diff --git a/tests/foreman/cli/test_auth.py b/tests/foreman/cli/test_auth.py index c57ca0ab27..59aafee0be 100644 --- a/tests/foreman/cli/test_auth.py +++ b/tests/foreman/cli/test_auth.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Authentication :Team: Endeavour -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ from time import sleep @@ -70,7 +65,7 @@ def test_positive_create_session(admin_user, target_sat): :id: fcee7f5f-1040-41a9-bf17-6d0c24a93e22 - :Steps: + :steps: 1. Set use_sessions, set short expiration time 2. Authenticate, assert credentials are not demanded @@ -109,7 +104,7 @@ def test_positive_disable_session(admin_user, target_sat): :id: 38ee0d85-c2fe-4cac-a992-c5dbcec11031 - :Steps: + :steps: 1. Set use_sessions 2. Authenticate, assert credentials are not demanded @@ -117,7 +112,6 @@ def test_positive_disable_session(admin_user, target_sat): 3. Disable use_sessions :expectedresults: The session is terminated - """ result = configure_sessions(target_sat) assert result == 0, 'Failed to configure hammer sessions' @@ -141,7 +135,7 @@ def test_positive_log_out_from_session(admin_user, target_sat): :id: 0ba05f2d-7b83-4b0c-a04c-80e62b7c4cf2 - :Steps: + :steps: 1. Set use_sessions 2. Authenticate, assert credentials are not demanded @@ -149,7 +143,6 @@ def test_positive_log_out_from_session(admin_user, target_sat): 3. Run `hammer auth logout` :expectedresults: The session is terminated - """ result = configure_sessions(target_sat) assert result == 0, 'Failed to configure hammer sessions' @@ -171,7 +164,7 @@ def test_positive_change_session(admin_user, non_admin_user, target_sat): :id: b6ea6f3c-fcbd-4e7b-97bd-f3e0e6b9da8f - :Steps: + :steps: 1. Set use_sessions 2. Authenticate, assert credentials are not demanded @@ -181,7 +174,6 @@ def test_positive_change_session(admin_user, non_admin_user, target_sat): :CaseImportance: High :expectedresults: The session is altered - """ result = configure_sessions(target_sat) assert result == 0, 'Failed to configure hammer sessions' @@ -202,7 +194,7 @@ def test_positive_session_survives_unauthenticated_call(admin_user, target_sat): :id: 8bc304a0-70ea-489c-9c3f-ea8343c5284c - :Steps: + :steps: 1. Set use_sessions 2. Authenticate, assert credentials are not demanded @@ -212,7 +204,6 @@ def test_positive_session_survives_unauthenticated_call(admin_user, target_sat): :CaseImportance: Medium :expectedresults: The session is unchanged - """ result = configure_sessions(target_sat) assert result == 0, 'Failed to configure hammer sessions' @@ -236,7 +227,7 @@ def test_positive_session_survives_failed_login(admin_user, non_admin_user, targ :BZ: 1465552 - :Steps: + :steps: 1. Set use_sessions 2. Authenticate, assert credentials are not demanded @@ -244,7 +235,6 @@ def test_positive_session_survives_failed_login(admin_user, non_admin_user, targ 3. Run login with invalid credentials :expectedresults: The session is unchanged - """ result = configure_sessions(target_sat) assert result == 0, 'Failed to configure hammer sessions' @@ -275,7 +265,7 @@ def test_positive_session_preceeds_saved_credentials(admin_user, target_sat): :CaseImportance: High - :Steps: + :steps: 1. Set use_sessions, set username and password, set short expiration time @@ -285,7 +275,6 @@ def test_positive_session_preceeds_saved_credentials(admin_user, target_sat): :expectedresults: Session expires after specified time and saved credentials are not applied - """ try: idle_timeout = target_sat.cli.Settings.list({'search': 'name=idle_timeout'})[0]['value'] @@ -331,7 +320,6 @@ def test_negative_no_permissions(admin_user, non_admin_user, target_sat): :expectedresults: Command is not executed :CaseImportance: High - """ result = configure_sessions(target_sat) assert result == 0, 'Failed to configure hammer sessions' diff --git a/tests/foreman/cli/test_bootdisk.py b/tests/foreman/cli/test_bootdisk.py index 7e8ad4fca9..e6515e1af9 100644 --- a/tests/foreman/cli/test_bootdisk.py +++ b/tests/foreman/cli/test_bootdisk.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: System - :CaseComponent: BootdiskPlugin :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_mac, gen_string import pytest diff --git a/tests/foreman/cli/test_bootstrap_script.py b/tests/foreman/cli/test_bootstrap_script.py index e3b910a0a8..f4b71c24bd 100644 --- a/tests/foreman/cli/test_bootstrap_script.py +++ b/tests/foreman/cli/test_bootstrap_script.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Bootstrap :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -35,7 +30,7 @@ def test_positive_register( :id: e34561fd-e0d6-4587-84eb-f86bd131aab1 - :Steps: + :steps: 1. Ensure system is not registered 2. Register a system diff --git a/tests/foreman/cli/test_capsule.py b/tests/foreman/cli/test_capsule.py index 94d8fdb8f0..e41759fbc2 100644 --- a/tests/foreman/cli/test_capsule.py +++ b/tests/foreman/cli/test_capsule.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Capsule :Team: Platform -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ import pytest @@ -29,8 +24,6 @@ def test_positive_import_puppet_classes(session_puppet_enabled_sat): :id: 42e3a9c0-62e1-4049-9667-f3c0cdfe0b04 :expectedresults: Puppet classes are imported from proxy - - :CaseLevel: Component """ with session_puppet_enabled_sat as puppet_sat: port = puppet_sat.available_capsule_port @@ -50,7 +43,7 @@ def test_positive_capsule_content(): :Setup: Capsule with some content synced - :Steps: + :steps: 1. Register a host to the capsule 2. Sync content from capsule to the host diff --git a/tests/foreman/cli/test_capsulecontent.py b/tests/foreman/cli/test_capsulecontent.py index 58cbc12249..b55b845719 100644 --- a/tests/foreman/cli/test_capsulecontent.py +++ b/tests/foreman/cli/test_capsulecontent.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: System - :CaseComponent: Capsule-Content :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/foreman/cli/test_classparameters.py b/tests/foreman/cli/test_classparameters.py index aa0d6e3fb2..433552737d 100644 --- a/tests/foreman/cli/test_classparameters.py +++ b/tests/foreman/cli/test_classparameters.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Puppet :CaseImportance: Medium :Team: Rocket -:TestType: Functional - -:Upstream: No """ import pytest diff --git a/tests/foreman/cli/test_computeresource_azurerm.py b/tests/foreman/cli/test_computeresource_azurerm.py index e281411037..1621b48d12 100644 --- a/tests/foreman/cli/test_computeresource_azurerm.py +++ b/tests/foreman/cli/test_computeresource_azurerm.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ComputeResources-Azure :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -73,7 +68,6 @@ def test_positive_crud_azurerm_cr( :CaseImportance: Critical - :CaseLevel: Component """ # Create CR cr_name = gen_string('alpha') @@ -156,7 +150,6 @@ def test_positive_image_crud( :CaseImportance: Critical - :CaseLevel: Integration """ # Create @@ -230,8 +223,6 @@ def test_positive_check_available_networks(self, sat_azure, azurermclient, modul :expectedresults: All the networks from AzureRM CR should be available. - :CaseLevel: Integration - :BZ: 1850934 """ @@ -255,7 +246,6 @@ def test_positive_create_compute_profile_values( :expectedresults: Compute-profile values should be create with AzureRm CR - :CaseLevel: Integration """ username = gen_string('alpha') password = gen_string('alpha') @@ -398,9 +388,7 @@ def test_positive_azurerm_host_provisioned( :id: 9e8242e5-3ef3-4884-a200-7ba79b8ef49f - :CaseLevel: Component - - ::CaseImportance: Critical + :CaseImportance: Critical :steps: 1. Create a AzureRM Compute Resource and provision host. @@ -528,9 +516,7 @@ def test_positive_azurerm_host_provisioned( :id: c99d2679-1742-4ef3-9288-2961d18a30e7 - :CaseLevel: Component - - ::CaseImportance: Critical + :CaseImportance: Critical :steps: 1. Create a AzureRM Compute Resource and provision host. diff --git a/tests/foreman/cli/test_computeresource_ec2.py b/tests/foreman/cli/test_computeresource_ec2.py index 61efdd4283..e4e1e669e6 100644 --- a/tests/foreman/cli/test_computeresource_ec2.py +++ b/tests/foreman/cli/test_computeresource_ec2.py @@ -1,17 +1,12 @@ """ :Requirement: Computeresource EC2 -:CaseLevel: Acceptance - :CaseComponent: ComputeResources-EC2 :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -53,8 +48,6 @@ def test_positive_create_ec2_with_custom_region(aws, module_target_sat): :CaseAutomation: Automated :CaseImportance: Critical - - :CaseLevel: Component """ cr_name = gen_string(str_type='alpha') cr_description = gen_string(str_type='alpha') diff --git a/tests/foreman/cli/test_computeresource_libvirt.py b/tests/foreman/cli/test_computeresource_libvirt.py index 91baee553d..e2109872f9 100644 --- a/tests/foreman/cli/test_computeresource_libvirt.py +++ b/tests/foreman/cli/test_computeresource_libvirt.py @@ -21,17 +21,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: ComputeResources-libvirt :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import random @@ -120,8 +115,6 @@ def test_positive_create_with_name(libvirt_url, module_target_sat): :expectedresults: Compute resource is created :CaseImportance: Critical - - :CaseLevel: Component """ module_target_sat.cli.ComputeResource.create( { @@ -141,8 +134,6 @@ def test_positive_info(libvirt_url, module_target_sat): :expectedresults: Compute resource Info is displayed :CaseImportance: Critical - - :CaseLevel: Component """ name = gen_string('utf8') compute_resource = module_target_sat.cli_factory.compute_resource( @@ -165,8 +156,6 @@ def test_positive_list(libvirt_url, module_target_sat): :expectedresults: Compute resource List is displayed :CaseImportance: Critical - - :CaseLevel: Component """ comp_res = module_target_sat.cli_factory.compute_resource( {'provider': FOREMAN_PROVIDERS['libvirt'], 'url': libvirt_url} @@ -190,8 +179,6 @@ def test_positive_delete_by_name(libvirt_url, module_target_sat): :expectedresults: Compute resource deleted :CaseImportance: Critical - - :CaseLevel: Component """ comp_res = module_target_sat.cli_factory.compute_resource( {'provider': FOREMAN_PROVIDERS['libvirt'], 'url': libvirt_url} @@ -215,8 +202,6 @@ def test_positive_create_with_libvirt(libvirt_url, options, target_sat): :CaseImportance: Critical - :CaseLevel: Component - :parametrized: yes """ target_sat.cli.ComputeResource.create( @@ -238,8 +223,6 @@ def test_positive_create_with_loc(libvirt_url, module_target_sat): :expectedresults: Compute resource is created and has location assigned :CaseImportance: High - - :CaseLevel: Integration """ location = module_target_sat.cli_factory.make_location() comp_resource = module_target_sat.cli_factory.compute_resource( @@ -263,8 +246,6 @@ def test_positive_create_with_locs(libvirt_url, module_target_sat): locations assigned :CaseImportance: High - - :CaseLevel: Integration """ locations_amount = random.randint(3, 5) locations = [module_target_sat.cli_factory.make_location() for _ in range(locations_amount)] @@ -294,8 +275,6 @@ def test_negative_create_with_name_url(libvirt_url, options, target_sat): :CaseImportance: High - :CaseLevel: Component - :parametrized: yes """ with pytest.raises(CLIReturnCodeError): @@ -317,8 +296,6 @@ def test_negative_create_with_same_name(libvirt_url, module_target_sat): :expectedresults: Compute resource not created :CaseImportance: High - - :CaseLevel: Component """ comp_res = module_target_sat.cli_factory.compute_resource( {'provider': FOREMAN_PROVIDERS['libvirt'], 'url': libvirt_url} @@ -347,8 +324,6 @@ def test_positive_update_name(libvirt_url, options, module_target_sat): :CaseImportance: Critical - :CaseLevel: Component - :parametrized: yes """ comp_res = module_target_sat.cli_factory.compute_resource( @@ -379,8 +354,6 @@ def test_negative_update(libvirt_url, options, module_target_sat): :CaseImportance: High - :CaseLevel: Component - :parametrized: yes """ comp_res = module_target_sat.cli_factory.compute_resource( @@ -411,8 +384,6 @@ def test_positive_create_with_console_password_and_name( :CaseImportance: High - :CaseLevel: Component - :parametrized: yes """ module_target_sat.cli.ComputeResource.create( @@ -438,8 +409,6 @@ def test_positive_update_console_password(libvirt_url, set_console_password, mod :CaseImportance: High - :CaseLevel: Component - :parametrized: yes """ cr_name = gen_string('utf8') diff --git a/tests/foreman/cli/test_computeresource_osp.py b/tests/foreman/cli/test_computeresource_osp.py index 1d76fe561d..d88daaf1ad 100644 --- a/tests/foreman/cli/test_computeresource_osp.py +++ b/tests/foreman/cli/test_computeresource_osp.py @@ -3,17 +3,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: ComputeResources-OpenStack :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from box import Box from fauxfactory import gen_string diff --git a/tests/foreman/cli/test_computeresource_rhev.py b/tests/foreman/cli/test_computeresource_rhev.py index 5036bd2fd7..808f1bbfd6 100644 --- a/tests/foreman/cli/test_computeresource_rhev.py +++ b/tests/foreman/cli/test_computeresource_rhev.py @@ -3,17 +3,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ComputeResources-RHEV :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -344,7 +339,6 @@ def test_negative_add_image_rhev_with_invalid_name(rhev, module_os, module_targe name parameter, compute-resource image create. :expectedresults: The image should not be added to the CR - """ if rhev.image_uuid is None: pytest.skip('Missing configuration for rhev.image_uuid') @@ -538,8 +532,6 @@ def test_positive_provision_rhev_without_host_group(rhev): :expectedresults: The host should be provisioned successfully :CaseAutomation: NotAutomated - - :CaseLevel: Integration """ diff --git a/tests/foreman/cli/test_computeresource_vmware.py b/tests/foreman/cli/test_computeresource_vmware.py index 3606b0a077..e106fa9f49 100644 --- a/tests/foreman/cli/test_computeresource_vmware.py +++ b/tests/foreman/cli/test_computeresource_vmware.py @@ -1,19 +1,14 @@ """ :Requirement: Computeresource Vmware -:CaseLevel: Acceptance - :CaseComponent: ComputeResources-VMWare :Team: Rocket -:TestType: Functional - :CaseImportance: High :CaseAutomation: Automated -:Upstream: No """ from fauxfactory import gen_string import pytest diff --git a/tests/foreman/cli/test_container_management.py b/tests/foreman/cli/test_container_management.py index 9229260475..17d0b0b4bd 100644 --- a/tests/foreman/cli/test_container_management.py +++ b/tests/foreman/cli/test_container_management.py @@ -4,13 +4,10 @@ :CaseAutomation: Automated -:TestType: Functional - :Team: Phoenix-content :CaseComponent: ContainerManagement-Content -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -52,8 +49,6 @@ class TestDockerClient: """Tests specific to using ``Docker`` as a client to pull Docker images from a Satellite 6 instance. - :CaseLevel: System - :CaseImportance: Medium """ @@ -64,7 +59,7 @@ def test_positive_pull_image(self, module_org, container_contenthost, target_sat :id: 023f0538-2aad-4f87-b8a8-6ccced648366 - :Steps: + :steps: 1. Publish and promote content view with Docker content 2. Register Docker-enabled client against Satellite 6. diff --git a/tests/foreman/cli/test_contentaccess.py b/tests/foreman/cli/test_contentaccess.py index 526ff086d3..0c59e5c70e 100644 --- a/tests/foreman/cli/test_contentaccess.py +++ b/tests/foreman/cli/test_contentaccess.py @@ -2,17 +2,12 @@ :Requirement: Content Access -:CaseLevel: Acceptance - :CaseComponent: Hosts-Content :CaseAutomation: Automated :team: Phoenix-subscriptions -:TestType: Functional - -:Upstream: No """ import time @@ -237,8 +232,6 @@ def test_negative_unregister_and_pull_content(vm): :expectedresults: Host can no longer retrieve content from satellite - :CaseLevel: System - :parametrized: yes :CaseImportance: Critical diff --git a/tests/foreman/cli/test_contentcredentials.py b/tests/foreman/cli/test_contentcredentials.py index 8541ce0f71..208812cb85 100644 --- a/tests/foreman/cli/test_contentcredentials.py +++ b/tests/foreman/cli/test_contentcredentials.py @@ -6,17 +6,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ContentCredentials :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from tempfile import mkstemp @@ -381,8 +376,6 @@ def test_positive_add_empty_product(target_sat, module_org): :id: 61c700db-43ab-4b8c-8527-f4cfc085afaa :expectedresults: gpg key is associated with product - - :CaseLevel: Integration """ gpg_key = target_sat.cli_factory.make_content_credential({'organization-id': module_org.id}) product = target_sat.cli_factory.make_product( @@ -400,8 +393,6 @@ def test_positive_add_product_with_repo(target_sat, module_org): :expectedresults: gpg key is associated with product as well as with the repository - - :CaseLevel: Integration """ product = target_sat.cli_factory.make_product({'organization-id': module_org.id}) repo = target_sat.cli_factory.make_repository( @@ -427,8 +418,6 @@ def test_positive_add_product_with_repos(target_sat, module_org): :expectedresults: gpg key is associated with product as well as with the repositories - - :CaseLevel: Integration """ product = target_sat.cli_factory.make_product({'organization-id': module_org.id}) repos = [ @@ -456,8 +445,6 @@ def test_positive_add_repo_from_product_with_repo(target_sat, module_org): :expectedresults: gpg key is associated with the repository but not with the product - - :CaseLevel: Integration """ product = target_sat.cli_factory.make_product({'organization-id': module_org.id}) repo = target_sat.cli_factory.make_repository( @@ -484,8 +471,6 @@ def test_positive_add_repo_from_product_with_repos(target_sat, module_org): :id: e3019a61-ec32-4044-9087-e420b8db4e09 :expectedresults: gpg key is associated with the repository - - :CaseLevel: Integration """ product = target_sat.cli_factory.make_product({'organization-id': module_org.id}) repos = [ @@ -517,8 +502,6 @@ def test_positive_update_key_for_empty_product(target_sat, module_org): :expectedresults: gpg key is associated with product before/after update - - :CaseLevel: Integration """ # Create a product and a gpg key product = target_sat.cli_factory.make_product({'organization-id': module_org.id}) @@ -555,8 +538,6 @@ def test_positive_update_key_for_product_with_repo(target_sat, module_org): :expectedresults: gpg key is associated with product before/after update as well as with the repository - - :CaseLevel: Integration """ # Create a product and a gpg key product = target_sat.cli_factory.make_product({'organization-id': module_org.id}) @@ -602,8 +583,6 @@ def test_positive_update_key_for_product_with_repos(target_sat, module_org): :expectedresults: gpg key is associated with product before/after update as well as with the repositories - - :CaseLevel: Integration """ # Create a product and a gpg key product = target_sat.cli_factory.make_product({'organization-id': module_org.id}) @@ -652,8 +631,6 @@ def test_positive_update_key_for_repo_from_product_with_repo(target_sat, module_ :expectedresults: gpg key is associated with the repository before/after update, but not with the product - - :CaseLevel: Integration """ # Create a product and a gpg key product = target_sat.cli_factory.make_product({'organization-id': module_org.id}) @@ -693,8 +670,6 @@ def test_positive_update_key_for_repo_from_product_with_repos(target_sat, module :expectedresults: gpg key is associated with a single repository before/after update and not associated with product or other repositories - - :CaseLevel: Integration """ # Create a product and a gpg key product = target_sat.cli_factory.make_product({'organization-id': module_org.id}) diff --git a/tests/foreman/cli/test_contentview.py b/tests/foreman/cli/test_contentview.py index 703787189e..6aeea931ff 100644 --- a/tests/foreman/cli/test_contentview.py +++ b/tests/foreman/cli/test_contentview.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ContentViews :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import random @@ -205,8 +200,6 @@ def test_positive_update_filter(self, repo_setup, module_target_sat): :expectedresults: Edited content view save is successful and info is updated - :CaseLevel: Integration - :CaseImportance: High """ # Create CV @@ -289,7 +282,6 @@ def test_positive_delete_version_by_name(self, module_org, module_target_sat): :CaseImportance: High - :CaseLevel: Integration """ content_view = module_target_sat.cli_factory.make_content_view( {'organization-id': module_org.id} @@ -372,7 +364,6 @@ def test_negative_delete_version_by_id(self, module_org, module_target_sat): :CaseImportance: Critical - :CaseLevel: Integration """ content_view = module_target_sat.cli_factory.make_content_view( {'organization-id': module_org.id} @@ -417,7 +408,6 @@ def test_positive_remove_lce_by_id_and_reassign_ak(self, module_org, module_targ :CaseImportance: Medium - :CaseLevel: Integration """ env = [ module_target_sat.cli_factory.make_lifecycle_environment( @@ -484,7 +474,6 @@ def test_positive_remove_lce_by_id_and_reassign_chost(self, module_org, module_t :CaseImportance: Low - :CaseLevel: Integration """ env = [ module_target_sat.cli_factory.make_lifecycle_environment( @@ -668,8 +657,6 @@ def test_positive_create_composite(self, module_org, module_target_sat): :expectedresults: Composite content views are created - :CaseLevel: Integration - :CaseImportance: High """ # Create REPO @@ -714,8 +701,6 @@ def test_positive_create_composite_by_name(self, module_org, module_target_sat): :BZ: 1416857 - :CaseLevel: Integration - :CaseImportance: High """ new_product = module_target_sat.cli_factory.make_product({'organization-id': module_org.id}) @@ -765,8 +750,6 @@ def test_positive_remove_version_by_id_from_composite( :expectedresults: Composite content view info output does not contain any values - :CaseLevel: Integration - :CaseImportance: High """ # Create new repository @@ -820,8 +803,6 @@ def test_positive_remove_component_by_name(self, module_org, module_product, mod :BZ: 1416857 - :CaseLevel: Integration - :CaseImportance: High """ # Create new repository @@ -874,8 +855,6 @@ def test_positive_create_composite_with_component_ids(self, module_org, module_t :BZ: 1487265 - :CaseLevel: Integration - :CaseImportance: High """ # Create first CV @@ -911,8 +890,6 @@ def test_negative_create_composite_with_component_ids(self, module_org, module_t :BZ: 1487265 - :CaseLevel: Integration - :CaseImportance: Low """ # Create CV @@ -943,8 +920,6 @@ def test_positive_update_composite_with_component_ids(module_org, module_target_ :expectedresults: Composite content view component ids are similar to the nested content view versions ids - :CaseLevel: Integration - :CaseImportance: Low """ # Create a CV to add to the composite one @@ -980,8 +955,6 @@ def test_positive_add_rh_repo_by_id( :expectedresults: RH Content can be seen in the content view - :CaseLevel: Integration - :CaseImportance: Critical """ # Create CV @@ -1019,8 +992,6 @@ def test_positive_add_rh_repo_by_id_and_create_filter( :CaseImportance: Low - :CaseLevel: Integration - :BZ: 1359665 """ # Create CV @@ -1064,7 +1035,6 @@ def test_positive_add_module_stream_filter_rule(self, module_org, target_sat): :CaseImportance: Low - :CaseLevel: Integration """ filter_name = gen_string('alpha') repo_name = gen_string('alpha') @@ -1112,7 +1082,6 @@ def test_positive_add_custom_repo_by_id(self, module_org, module_product, module :CaseImportance: High - :CaseLevel: Integration """ new_repo = module_target_sat.cli_factory.make_repository( {'content-type': 'yum', 'product-id': module_product.id} @@ -1172,7 +1141,6 @@ def test_negative_add_component_in_non_composite_cv( :CaseImportance: Low - :CaseLevel: Integration """ # Create REPO new_repo = module_target_sat.cli_factory.make_repository( @@ -1209,7 +1177,6 @@ def test_negative_add_same_yum_repo_twice(self, module_org, module_product, modu :CaseImportance: Low - :CaseLevel: Integration """ new_repo = module_target_sat.cli_factory.make_repository( {'content-type': 'yum', 'product-id': module_product.id} @@ -1247,7 +1214,6 @@ def test_positive_promote_rh_content( :CaseImportance: Critical - :CaseLevel: Integration """ # Create CV new_cv = module_target_sat.cli_factory.make_content_view( @@ -1287,7 +1253,6 @@ def test_positive_promote_rh_and_custom_content( :CaseImportance: Low - :CaseLevel: Integration """ # Create custom repo new_repo = module_target_sat.cli_factory.make_repository( @@ -1348,7 +1313,6 @@ def test_positive_promote_custom_content(self, module_org, module_product, modul :CaseImportance: High - :CaseLevel: Integration """ # Create REPO new_repo = module_target_sat.cli_factory.make_repository( @@ -1395,7 +1359,6 @@ def test_positive_promote_ccv(self, module_org, module_product, module_target_sa :CaseImportance: High - :CaseLevel: Integration """ # Create REPO new_repo = module_target_sat.cli_factory.make_repository( @@ -1452,7 +1415,6 @@ def test_negative_promote_default_cv(self, module_org, module_target_sat): :CaseImportance: Low - :CaseLevel: Integration """ environment = module_target_sat.cli_factory.make_lifecycle_environment( {'organization-id': module_org.id} @@ -1482,7 +1444,6 @@ def test_negative_promote_with_invalid_lce(self, module_org, module_product, mod :CaseImportance: Low - :CaseLevel: Integration """ # Create REPO new_repo = module_target_sat.cli_factory.make_repository( @@ -1527,7 +1488,6 @@ def test_positive_publish_rh_content( :CaseImportance: Critical - :CaseLevel: Integration """ # Create CV new_cv = module_target_sat.cli_factory.make_content_view( @@ -1561,7 +1521,6 @@ def test_positive_publish_rh_and_custom_content( :CaseImportance: High - :CaseLevel: Integration """ # Create custom repo new_repo = module_target_sat.cli_factory.make_repository( @@ -1615,7 +1574,6 @@ def test_positive_publish_custom_content(self, module_org, module_product, modul :CaseImportance: Critical - :CaseLevel: Integration """ new_repo = module_target_sat.cli_factory.make_repository( {'content-type': 'yum', 'product-id': module_product.id} @@ -1651,7 +1609,6 @@ def test_positive_publish_custom_major_minor_cv_version(self, module_target_sat) 1. CV version with custom major and minor versions is created - :CaseLevel: System """ org = module_target_sat.cli_factory.make_org() major = random.randint(1, 1000) @@ -1687,7 +1644,6 @@ def test_positive_publish_custom_content_module_stream( :CaseImportance: Medium - :CaseLevel: Integration """ software_repo = module_target_sat.cli_factory.make_repository( { @@ -1756,7 +1712,6 @@ def test_positive_republish_after_content_removed( :customerscenario: true - :CaseLevel: Integration """ # Create new Yum repository yum_repo = module_target_sat.cli_factory.make_repository( @@ -1824,8 +1779,6 @@ def test_positive_republish_after_rh_content_removed( :BZ: 1323751 - :CaseLevel: Integration - :customerscenario: true :CaseImportance: Medium @@ -1871,7 +1824,6 @@ def test_positive_publish_ccv(self, module_org, module_product, module_target_sa :CaseImportance: Critical - :CaseLevel: Integration """ repository = module_target_sat.cli_factory.make_repository( {'content-type': 'yum', 'product-id': module_product.id} @@ -1932,8 +1884,6 @@ def test_positive_update_version_once(self, module_org, module_product, module_t environment. - :CaseLevel: Integration - :CaseImportance: Critical """ # Create REPO @@ -2011,7 +1961,6 @@ def test_positive_update_version_multiple(self, module_org, module_product, modu :CaseImportance: Low - :CaseLevel: Integration """ # Create REPO new_repo = module_target_sat.cli_factory.make_repository( @@ -2098,8 +2047,6 @@ def test_positive_auto_update_composite_to_latest_cv_version( :BZ: 1177766 - :CaseLevel: Integration - :CaseImportance: High """ content_view = module_target_sat.cli_factory.make_content_view( @@ -2155,7 +2102,6 @@ def test_positive_subscribe_chost_by_id(self, module_org, module_target_sat): :CaseImportance: High - :CaseLevel: System """ env = module_target_sat.cli_factory.make_lifecycle_environment( {'organization-id': module_org.id} @@ -2195,8 +2141,6 @@ def test_positive_subscribe_chost_by_id_using_rh_content( :expectedresults: Content Host can be subscribed to content view with Red Hat repository - :CaseLevel: System - :CaseImportance: Medium """ env = module_target_sat.cli_factory.make_lifecycle_environment( @@ -2247,8 +2191,6 @@ def test_positive_subscribe_chost_by_id_using_rh_content_and_filters( :expectedresults: Content Host can be subscribed to filtered content view with Red Hat repository - :CaseLevel: System - :BZ: 1359665 :CaseImportance: Low @@ -2320,8 +2262,6 @@ def test_positive_subscribe_chost_by_id_using_custom_content( :expectedresults: Content Host can be subscribed to content view with custom repository - :CaseLevel: System - :CaseImportance: High """ new_product = module_target_sat.cli_factory.make_product({'organization-id': module_org.id}) @@ -2375,7 +2315,6 @@ def test_positive_subscribe_chost_by_id_using_ccv(self, module_org, module_targe :CaseImportance: High - :CaseLevel: System """ env = module_target_sat.cli_factory.make_lifecycle_environment( {'organization-id': module_org.id} @@ -2448,7 +2387,6 @@ def test_positive_sub_host_with_restricted_user_perm_at_custom_loc( :parametrized: yes - :CaseLevel: System """ # Note: this test has been stubbed waitin for bug 1511481 resolution # prepare the user and the required permissions data @@ -2605,7 +2543,6 @@ def test_positive_sub_host_with_restricted_user_perm_at_default_loc( :parametrized: yes - :CaseLevel: System """ # prepare the user and the required permissions data user_name = gen_alphanumeric() @@ -2777,8 +2714,6 @@ def test_positive_clone_within_same_env(self, module_org, module_target_sat): :expectedresults: Cloned content view can be published and promoted to the same environment as the original content view - :CaseLevel: Integration - :CaseImportance: High """ cloned_cv_name = gen_string('alpha') @@ -2818,7 +2753,6 @@ def test_positive_clone_with_diff_env(self, module_org, module_target_sat): :CaseImportance: Low - :CaseLevel: Integration """ cloned_cv_name = gen_string('alpha') lc_env = module_target_sat.cli_factory.make_lifecycle_environment( @@ -2893,7 +2827,7 @@ def test_positive_remove_renamed_cv_version_from_default_env( :id: aa9bbfda-72e8-45ec-b26d-fdf2691980cf - :Steps: + :steps: 1. Create a content view 2. Add a yum repo to the content view @@ -2904,8 +2838,6 @@ def test_positive_remove_renamed_cv_version_from_default_env( :expectedresults: content view version is removed from Library environment - :CaseLevel: Integration - :CaseImportance: Low """ new_name = gen_string('alpha') @@ -2969,7 +2901,7 @@ def test_positive_remove_promoted_cv_version_from_default_env( :id: 6643837a-560a-47de-aa4d-90778914dcfa - :Steps: + :steps: 1. Create a content view 2. Add a yum repo to the content view @@ -2982,8 +2914,6 @@ def test_positive_remove_promoted_cv_version_from_default_env( 1. Content view version exist only in DEV and not in Library 2. The yum repo exists in content view version - :CaseLevel: Integration - :CaseImportance: High """ lce_dev = module_target_sat.cli_factory.make_lifecycle_environment( @@ -3061,7 +2991,7 @@ def test_positive_remove_qe_promoted_cv_version_from_default_env( :id: e286697f-4113-40a3-b8e8-9ca50647e6d5 - :Steps: + :steps: 1. Create a content view 2. Add docker repo(s) to it @@ -3073,8 +3003,6 @@ def test_positive_remove_qe_promoted_cv_version_from_default_env( :expectedresults: Content view version exist only in DEV, QE and not in Library - :CaseLevel: Integration - :CaseImportance: High """ lce_dev = module_target_sat.cli_factory.make_lifecycle_environment( @@ -3150,7 +3078,7 @@ def test_positive_remove_prod_promoted_cv_version_from_default_env( :id: ffe3d64e-c3d2-4889-9454-ccc6b10f4db7 - :Steps: + :steps: 1. Create a content view 2. Add yum repositories and docker repositories to CV @@ -3164,7 +3092,6 @@ def test_positive_remove_prod_promoted_cv_version_from_default_env( :CaseImportance: High - :CaseLevel: Integration """ lce_dev = module_target_sat.cli_factory.make_lifecycle_environment( {'organization-id': module_org.id} @@ -3257,7 +3184,7 @@ def test_positive_remove_cv_version_from_env(self, module_org, module_target_sat :id: 577757ac-b184-4ece-9310-182dd5ceb718 - :Steps: + :steps: 1. Create a content view 2. Add a yum repo and a docker repo to the content view @@ -3272,8 +3199,6 @@ def test_positive_remove_cv_version_from_env(self, module_org, module_target_sat :expectedresults: Content view version exist in Library, DEV, QE, STAGE, PROD - :CaseLevel: Integration - :CaseImportance: High """ lce_dev = module_target_sat.cli_factory.make_lifecycle_environment( @@ -3385,7 +3310,7 @@ def test_positive_remove_cv_version_from_multi_env(self, module_org, module_targ :id: 997cfd7d-9029-47e2-a41e-84f4370b5ce5 - :Steps: + :steps: 1. Create a content view 2. Add a yum repo and a docker to the content view @@ -3396,8 +3321,6 @@ def test_positive_remove_cv_version_from_multi_env(self, module_org, module_targ :expectedresults: Content view version exists only in Library, DEV - :CaseLevel: Integration - :CaseImportance: High """ lce_dev = module_target_sat.cli_factory.make_lifecycle_environment( @@ -3491,7 +3414,7 @@ def test_positive_delete_cv_promoted_to_multi_env(self, module_org, module_targe :id: 93dd7518-5901-4a71-a4c3-0f1215238b26 - :Steps: + :steps: 1. Create a content view 2. Add a yum repo and a docker to the content view @@ -3503,8 +3426,6 @@ def test_positive_delete_cv_promoted_to_multi_env(self, module_org, module_targe :expectedresults: The content view doesn't exists - :CaseLevel: Integration - :CaseImportance: High """ lce_dev = module_target_sat.cli_factory.make_lifecycle_environment( @@ -3603,7 +3524,7 @@ def test_positive_remove_cv_version_from_env_with_host_registered(self): :id: 001a2b76-a87b-4c11-8837-f5fe3c04a075 - :Steps: + :steps: 1. Create a content view cv1 2. Add a yum repo to the content view @@ -3630,7 +3551,6 @@ def test_positive_remove_cv_version_from_env_with_host_registered(self): :CaseAutomation: NotAutomated - :CaseLevel: System """ @pytest.mark.stubbed @@ -3642,7 +3562,7 @@ def test_positive_delete_cv_multi_env_promoted_with_host_registered(self): :id: 82442d23-45b5-4d39-b867-c5d46bbcbbf9 - :Steps: + :steps: 1. Create two content view cv1 and cv2 2. Add a yum repo to both content views @@ -3670,7 +3590,6 @@ def test_positive_delete_cv_multi_env_promoted_with_host_registered(self): :CaseAutomation: NotAutomated - :CaseLevel: System """ @pytest.mark.run_in_one_thread @@ -3687,7 +3606,7 @@ def test_positive_remove_cv_version_from_multi_env_capsule_scenario( :id: 3725fef6-73a4-4dcb-a306-70e6ba826a3d - :Steps: + :steps: 1. Create a content view 2. Setup satellite to use a capsule and to sync all lifecycle @@ -3712,8 +3631,6 @@ def test_positive_remove_cv_version_from_multi_env_capsule_scenario( :CaseAutomation: Automated - :CaseLevel: System - :CaseImportance: High """ # Note: This test case requires complete external capsule @@ -3911,8 +3828,6 @@ def test_negative_user_with_read_only_cv_permission(self, module_org, module_tar :BZ: 1922134 - :CaseLevel: Integration - :CaseImportance: Critical """ cv = module_target_sat.cli_factory.make_content_view({'organization-id': module_org.id}) @@ -3988,8 +3903,6 @@ def test_positive_user_with_all_cv_permissions(self, module_org, module_target_s :BZ: 1464414 - :CaseLevel: Integration - :CaseImportance: Critical """ cv = module_target_sat.cli_factory.make_content_view({'organization-id': module_org.id}) @@ -4062,7 +3975,6 @@ def test_positive_inc_update_no_lce(self, module_org, module_product, module_tar :CaseImportance: Medium - :CaseLevel: Integration """ repo = module_target_sat.cli_factory.make_repository( { @@ -4156,15 +4068,13 @@ def test_positive_arbitrary_file_repo_addition( 2. Upload an arbitrary file to it 3. Create a Content View (CV) - :Steps: + :steps: 1. Add the FR to the CV :expectedresults: Check FR is added to CV :CaseAutomation: Automated - :CaseLevel: Integration - :CaseImportance: High :BZ: 1610309, 1908465 @@ -4201,15 +4111,13 @@ def test_positive_arbitrary_file_repo_removal( 3. Create a Content View (CV) 4. Add the FR to the CV - :Steps: + :steps: 1. Remove the FR from the CV :expectedresults: Check FR is removed from CV :CaseAutomation: Automated - :CaseLevel: Integration - :BZ: 1908465 """ cv = module_target_sat.cli_factory.make_content_view({'organization-id': module_org.id}) @@ -4241,14 +4149,13 @@ def test_positive_arbitrary_file_sync_over_capsule(self): 5. Create a Capsule 6. Connect the Capsule with Satellite/Foreman host - :Steps: + :steps: 1. Start synchronization :expectedresults: Check CV with FR is synced over Capsule :CaseAutomation: NotAutomated - :CaseLevel: System """ @pytest.mark.tier3 @@ -4267,7 +4174,7 @@ def test_positive_arbitrary_file_repo_promotion( 4. Add the FR to the CV 5. Create an Environment - :Steps: + :steps: 1. Promote the CV to the Environment :expectedresults: Check arbitrary files from FR is available on @@ -4275,8 +4182,6 @@ def test_positive_arbitrary_file_repo_promotion( :CaseAutomation: Automated - :CaseLevel: Integration - :CaseImportance: High """ diff --git a/tests/foreman/cli/test_contentviewfilter.py b/tests/foreman/cli/test_contentviewfilter.py index dac2b0d0a6..65ffeb940a 100644 --- a/tests/foreman/cli/test_contentviewfilter.py +++ b/tests/foreman/cli/test_contentviewfilter.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ContentViews :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import random @@ -592,8 +587,6 @@ def test_positive_update_name(self, new_name, module_org, content_view, module_t :expectedresults: Content view filter updated successfully and has proper and expected name - :CaseLevel: Integration - :CaseImportance: Critical """ cvf_name = gen_string('utf8') @@ -630,8 +623,6 @@ def test_positive_update_repo_with_same_type( :expectedresults: Content view filter updated successfully and has new repository affected - :CaseLevel: Integration - :CaseImportance: Critical """ cvf_name = gen_string('utf8') @@ -686,7 +677,6 @@ def test_positive_update_repo_with_different_type( :expectedresults: Content view filter updated successfully and has new repository affected - :CaseLevel: Integration """ cvf_name = gen_string('utf8') module_target_sat.cli.ContentView.filter.create( @@ -739,7 +729,6 @@ def test_positive_update_inclusion(self, module_org, content_view, module_target :expectedresults: Content view filter updated successfully and has correct and expected value for inclusion parameter - :CaseLevel: Integration """ cvf_name = gen_string('utf8') module_target_sat.cli.ContentView.filter.create( diff --git a/tests/foreman/cli/test_discoveredhost.py b/tests/foreman/cli/test_discoveredhost.py index 4ee7015ec0..6da0330db1 100644 --- a/tests/foreman/cli/test_discoveredhost.py +++ b/tests/foreman/cli/test_discoveredhost.py @@ -8,11 +8,6 @@ :Team: Rocket -:TestType: Functional - -:CaseLevel: System - -:Upstream: No """ import pytest from wait_for import wait_for @@ -40,7 +35,7 @@ def test_rhel_pxe_discovery_provisioning( :Setup: Satellite with Provisioning and Discovery features configured - :Steps: + :steps: 1. Boot up the host to discover 2. Provision the host @@ -166,7 +161,7 @@ def test_positive_provision_pxeless_bios_syslinux(): :Setup: 1. Craft the FDI with remaster the image to have ssh enabled - :Steps: + :steps: 1. Create a BIOS VM and set it to boot from the FDI 2. Run assertion steps #1-2 3. Provision the discovered host using PXELinux loader @@ -417,7 +412,7 @@ def test_positive_list_facts(): :Setup: 1. Provisioning is configured and Host is already discovered - :Steps: Validate specified builtin and custom facts + :steps: Validate specified builtin and custom facts :expectedresults: All checked facts should be displayed correctly diff --git a/tests/foreman/cli/test_discoveryrule.py b/tests/foreman/cli/test_discoveryrule.py index 4daea9571e..2d9059f196 100644 --- a/tests/foreman/cli/test_discoveryrule.py +++ b/tests/foreman/cli/test_discoveryrule.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: DiscoveryPlugin :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from functools import partial import random @@ -140,7 +135,6 @@ def test_positive_create_with_hostname(self, discoveryrule_factory): :expectedresults: Rule should be successfully created and has expected hostname value - :CaseLevel: Component """ host_name = 'myhost' rule = discoveryrule_factory(options={'hostname': host_name}) @@ -239,7 +233,6 @@ def test_positive_create_with_hosts_limit(self, discoveryrule_factory): :expectedresults: Rule should be successfully created and has expected hosts limit value - :CaseLevel: Component """ hosts_limit = '5' rule = discoveryrule_factory(options={'hosts-limit': hosts_limit}) @@ -276,7 +269,6 @@ def test_positive_create_disabled_rule(self, discoveryrule_factory): :expectedresults: Disabled rule should be successfully created - :CaseLevel: Component """ rule = discoveryrule_factory(options={'enabled': 'false'}) assert rule.enabled == 'false' @@ -292,8 +284,6 @@ def test_negative_create_with_invalid_name(self, name, discoveryrule_factory): :CaseImportance: Medium - :CaseLevel: Component - :parametrized: yes """ with pytest.raises(CLIFactoryError): @@ -310,8 +300,6 @@ def test_negative_create_with_invalid_hostname(self, name, discoveryrule_factory :CaseImportance: Medium - :CaseLevel: Component - :BZ: 1378427 :parametrized: yes @@ -356,8 +344,6 @@ def test_positive_update_discovery_params(self, discoveryrule_factory, class_org :expectedresults: Rule params are updated - :CaseLevel: Component - :CaseImportance: Medium """ rule = discoveryrule_factory(options={'hosts-limit': '5'}) @@ -410,8 +396,6 @@ def test_negative_update_discovery_params(self, name, discoveryrule_factory, tar :expectedresults: Rule params are not updated - :CaseLevel: Component - :CaseImportance: Medium :parametrized: yes @@ -507,7 +491,6 @@ def test_positive_crud_with_non_admin_user( :expectedresults: Rule should be created and deleted successfully. - :CaseLevel: Integration """ rule_name = gen_string('alpha') new_name = gen_string('alpha') @@ -564,7 +547,6 @@ def test_negative_delete_rule_with_non_admin_user( :expectedresults: User should validation error and rule should not be deleted successfully. - :CaseLevel: Integration """ rule = target_sat.cli_factory.make_discoveryrule( { diff --git a/tests/foreman/cli/test_docker.py b/tests/foreman/cli/test_docker.py index e745f44af8..a4dd51c17c 100644 --- a/tests/foreman/cli/test_docker.py +++ b/tests/foreman/cli/test_docker.py @@ -4,13 +4,8 @@ :CaseAutomation: Automated -:CaseLevel: Component - -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from random import choice, randint @@ -169,7 +164,6 @@ def test_positive_create_repos_using_same_product( :expectedresults: Multiple docker repositories are created with a Docker upstream repository and they all belong to the same product. - :CaseLevel: Integration """ repo_names = set() for _ in range(randint(2, 5)): @@ -191,7 +185,6 @@ def test_positive_create_repos_using_multiple_products(self, module_org, module_ Docker upstream repository and they all belong to their respective products. - :CaseLevel: Integration """ for _ in range(randint(2, 5)): product = module_target_sat.cli_factory.make_product_wait( @@ -404,8 +397,6 @@ class TestDockerContentView: :CaseComponent: ContentViews :team: Phoenix-content - - :CaseLevel: Integration """ @pytest.mark.tier2 @@ -1145,8 +1136,6 @@ class TestDockerActivationKey: :CaseComponent: ActivationKeys :team: Phoenix-subscriptions - - :CaseLevel: Integration """ @pytest.mark.tier2 diff --git a/tests/foreman/cli/test_domain.py b/tests/foreman/cli/test_domain.py index ad48827e8f..8b1c157c65 100644 --- a/tests/foreman/cli/test_domain.py +++ b/tests/foreman/cli/test_domain.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Hosts :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -196,8 +191,6 @@ def test_negative_create_with_invalid_dns_id(module_target_sat): :BZ: 1398392 - :CaseLevel: Integration - :CaseImportance: Medium """ with pytest.raises(CLIFactoryError) as context: diff --git a/tests/foreman/cli/test_environment.py b/tests/foreman/cli/test_environment.py index 10481c743c..90e5b79e72 100644 --- a/tests/foreman/cli/test_environment.py +++ b/tests/foreman/cli/test_environment.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Puppet :Team: Rocket -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ from random import choice @@ -49,8 +44,6 @@ def test_negative_list_with_parameters( :expectedresults: Server returns empty result as there is no environment associated with location - :CaseLevel: Integration - :BZ: 1337947 """ session_puppet_enabled_sat.cli.Environment.create( diff --git a/tests/foreman/cli/test_errata.py b/tests/foreman/cli/test_errata.py index d7a90b34c5..d1975547de 100644 --- a/tests/foreman/cli/test_errata.py +++ b/tests/foreman/cli/test_errata.py @@ -4,17 +4,11 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ErrataManagement :team: Phoenix-content -:TestType: Functional - :CaseImportance: High - -:Upstream: No """ from datetime import date, datetime, timedelta from operator import itemgetter @@ -264,7 +258,6 @@ def start_and_wait_errata_recalculate(sat, host): :param sat: Satellite instance to check for task(s) :param host: ContentHost instance to schedule errata recalculate - """ # Find any in-progress task for this host search = "label = Actions::Katello::Applicability::Hosts::BulkGenerate and result = pending" @@ -454,8 +447,6 @@ def test_positive_install_by_host_collection_and_org( :expectedresults: Erratum is installed. - :CaseLevel: System - :BZ: 1457977, 1983043 """ errata_id = REPO_WITH_ERRATA['errata'][0]['id'] @@ -505,8 +496,6 @@ def test_negative_install_erratum_on_host_collection( :expectedresults: Error message thrown. Not supported. Use the remote execution equivalent :CaseImportance: Low - - :CaseLevel: System """ module_target_sat.cli_factory.make_host_collection( {'organization-id': module_entitlement_manifest_org.id} @@ -1032,8 +1021,6 @@ def test_negative_list_filter_by_product_name(products_with_repos, module_target :expectedresults: Error must be returned. :CaseImportance: Low - - :CaseLevel: System """ with pytest.raises(CLIReturnCodeError): module_target_sat.cli.Erratum.list( @@ -1088,7 +1075,6 @@ def test_positive_list_filter_by_cve(module_sca_manifest_org, rh_repo, target_sa :Steps: erratum list --cve :expectedresults: Errata is filtered by CVE. - """ target_sat.cli.RepositorySet.enable( { diff --git a/tests/foreman/cli/test_fact.py b/tests/foreman/cli/test_fact.py index 1b1dd65825..ddaaa47794 100644 --- a/tests/foreman/cli/test_fact.py +++ b/tests/foreman/cli/test_fact.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Fact :Team: Rocket -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ from fauxfactory import gen_string import pytest diff --git a/tests/foreman/cli/test_filter.py b/tests/foreman/cli/test_filter.py index 434b91e398..9c12b23908 100644 --- a/tests/foreman/cli/test_filter.py +++ b/tests/foreman/cli/test_filter.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: UsersRoles :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/foreman/cli/test_foremantask.py b/tests/foreman/cli/test_foremantask.py index 7dcd90ac66..bdce6e63a9 100644 --- a/tests/foreman/cli/test_foremantask.py +++ b/tests/foreman/cli/test_foremantask.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: TasksPlugin :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -48,5 +43,4 @@ def test_positive_tasks_backup(): :CaseImportance: High :CaseAutomation: NotAutomated - """ diff --git a/tests/foreman/cli/test_globalparam.py b/tests/foreman/cli/test_globalparam.py index 2a5d49cf96..41bb8ca769 100644 --- a/tests/foreman/cli/test_globalparam.py +++ b/tests/foreman/cli/test_globalparam.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Parameters :Team: Rocket -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ from functools import partial diff --git a/tests/foreman/cli/test_hammer.py b/tests/foreman/cli/test_hammer.py index 8a424bb62e..c795352c5e 100644 --- a/tests/foreman/cli/test_hammer.py +++ b/tests/foreman/cli/test_hammer.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Hammer :Team: Endeavour -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ import io import json diff --git a/tests/foreman/cli/test_host.py b/tests/foreman/cli/test_host.py index 60c013804a..a3a59102d6 100644 --- a/tests/foreman/cli/test_host.py +++ b/tests/foreman/cli/test_host.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Hosts :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from random import choice import re @@ -576,8 +571,6 @@ def test_positive_katello_and_openscap_loaded(target_sat): and foreman_openscap are available in help message (note: help is generated dynamically based on apipie cache) - :CaseLevel: System - :customerscenario: true :CaseImportance: Medium @@ -604,8 +597,6 @@ def test_positive_list_and_unregister( Unlike content host, host has not disappeared from list of hosts after unregistering. :parametrized: yes - - :CaseLevel: System """ rhel7_contenthost.register(module_org, None, module_ak_with_cv.name, target_sat) assert rhel7_contenthost.subscribed @@ -633,8 +624,6 @@ def test_positive_list_by_last_checkin( :BZ: 1285992 :parametrized: yes - - :CaseLevel: System """ rhel7_contenthost.install_katello_ca(target_sat) rhel7_contenthost.register_contenthost( @@ -661,8 +650,6 @@ def test_positive_list_infrastructure_hosts( :expectedresults: Infrastructure hosts are listed :parametrized: yes - - :CaseLevel: System """ rhel7_contenthost.install_katello_ca(target_sat) rhel7_contenthost.register_contenthost( @@ -698,8 +685,6 @@ def test_positive_create_inherit_lce_cv( :expectedresults: Host's lifecycle environment and content view match the ones specified in hostgroup - :CaseLevel: Integration - :BZ: 1391656 """ hostgroup = target_sat.api.HostGroup( @@ -727,8 +712,6 @@ def test_positive_create_inherit_nested_hostgroup(target_sat): :expectedresults: Host created successfully using host group title - :CaseLevel: System - :customerscenario: true :BZ: 1436162 @@ -789,8 +772,6 @@ def test_positive_list_with_nested_hostgroup(target_sat): nested host groups names in its hostgroup parameter :BZ: 1427554, 1955421 - - :CaseLevel: System """ options = target_sat.api.Host() options.create_missing() @@ -866,9 +847,7 @@ def test_negative_create_with_incompatible_pxe_loader(): 2. Files not deployed on TFTP 3. Host not created - :CaseAutomation: NotAutomated - - :CaseLevel: System + :CaseAutomation: NotAutomated """ @@ -983,8 +962,6 @@ def test_negative_update_arch(function_host, module_architecture, target_sat): :id: a86524da-8caf-472b-9a3d-17a4385c3a18 :expectedresults: A host is not updated - - :CaseLevel: Integration """ with pytest.raises(CLIReturnCodeError): target_sat.cli.Host.update( @@ -1003,8 +980,6 @@ def test_negative_update_os(target_sat, function_host, module_architecture): :id: ff13d2af-e54a-4daf-a24d-7ec930b4fbbe :expectedresults: A host is not updated - - :CaseLevel: Integration """ p_table = function_host['operating-system']['partition-table'] p_table = target_sat.api.PartitionTable().search(query={'search': f'name="{p_table}"'})[0] @@ -1034,7 +1009,7 @@ def test_hammer_host_info_output(target_sat, module_user): :id: 03468516-0ebb-11eb-8ad8-0c7a158cbff4 - :Steps: + :steps: 1. Update the host with any owner 2. Get host info by running `hammer host info` 3. Create new user and update his location and organization based on the hosts @@ -1282,8 +1257,6 @@ def test_positive_set_multi_line_and_with_spaces_parameter_value(function_host, from yaml format :BZ: 1315282 - - :CaseLevel: Integration """ param_name = gen_string('alpha').lower() # long string that should be escaped and affected by line break with @@ -1351,9 +1324,7 @@ def test_positive_provision_baremetal_with_bios_syslinux(): 6. GRUB config changes the boot order (boot local first) 7. Hosts boots straight to RHEL after reboot (step #4) - :CaseAutomation: NotAutomated - - :CaseLevel: System + :CaseAutomation: NotAutomated """ @@ -1389,9 +1360,7 @@ def test_positive_provision_baremetal_with_uefi_syslinux(): 6. GRUB config changes the boot order (boot local first) 7. Hosts boots straight to RHEL after reboot (step #4) - :CaseAutomation: NotAutomated - - :CaseLevel: System + :CaseAutomation: NotAutomated """ @@ -1430,9 +1399,7 @@ def test_positive_provision_baremetal_with_uefi_grub(): 7. Hosts boots straight to RHEL after reboot (step #4) - :CaseAutomation: NotAutomated - - :CaseLevel: System + :CaseAutomation: NotAutomated """ @@ -1473,9 +1440,7 @@ def test_positive_provision_baremetal_with_uefi_grub2(): 7. Hosts boots straight to RHEL after reboot (step #4) - :CaseAutomation: NotAutomated - - :CaseLevel: System + :CaseAutomation: NotAutomated """ @@ -1508,9 +1473,7 @@ def test_positive_provision_baremetal_with_uefi_secureboot(): :expectedresults: Host is provisioned - :CaseAutomation: NotAutomated - - :CaseLevel: System + :CaseAutomation: NotAutomated """ @@ -1614,8 +1577,6 @@ def test_positive_report_package_installed_removed( :BZ: 1463809 :parametrized: yes - - :CaseLevel: System """ client = katello_host_tools_host host_info = target_sat.cli.Host.info({'name': client.hostname}) @@ -1660,8 +1621,6 @@ def test_positive_package_applicability(katello_host_tools_host, setup_custom_re :BZ: 1463809 :parametrized: yes - - :CaseLevel: System """ client = katello_host_tools_host host_info = target_sat.cli.Host.info({'name': client.hostname}) @@ -1724,8 +1683,6 @@ def test_positive_erratum_applicability( :BZ: 1463809,1740790 :parametrized: yes - - :CaseLevel: System """ client = katello_host_tools_host host_info = target_sat.cli.Host.info({'name': client.hostname}) @@ -1779,8 +1736,6 @@ def test_positive_apply_security_erratum(katello_host_tools_host, setup_custom_r :expectedresults: erratum is recognized by the `yum update --security` command on client - :CaseLevel: System - :customerscenario: true :BZ: 1420671 @@ -1819,8 +1774,6 @@ def test_positive_install_package_via_rex( :expectedresults: Package was installed - :CaseLevel: System - :parametrized: yes """ client = katello_host_tools_host @@ -1883,8 +1836,6 @@ def test_positive_register( :expectedresults: host successfully registered :parametrized: yes - - :CaseLevel: System """ hosts = target_sat.cli.Host.list( { @@ -1947,8 +1898,6 @@ def test_positive_attach( enabled, and repository package installed :parametrized: yes - - :CaseLevel: System """ # create an activation key without subscriptions # register the client host @@ -2004,8 +1953,6 @@ def test_positive_attach_with_lce( repository enabled, and repository package installed :parametrized: yes - - :CaseLevel: System """ host_subscription_client.register_contenthost( module_org.name, @@ -2043,8 +1990,6 @@ def test_negative_without_attach( :expectedresults: repository list is empty :parametrized: yes - - :CaseLevel: System """ target_sat.cli.Host.subscription_register( { @@ -2082,8 +2027,6 @@ def test_negative_without_attach_with_lce( :expectedresults: repository not enabled on host :parametrized: yes - - :CaseLevel: System """ content_view = target_sat.api.ContentView(organization=function_org).create() ak = target_sat.api.ActivationKey( @@ -2146,8 +2089,6 @@ def test_positive_remove( :expectedresults: subscription successfully removed from host :parametrized: yes - - :CaseLevel: System """ target_sat.cli.Host.subscription_register( { @@ -2221,8 +2162,6 @@ def test_positive_auto_attach( repository enabled, and repository package installed :parametrized: yes - - :CaseLevel: System """ target_sat.cli.Host.subscription_register( { @@ -2257,8 +2196,6 @@ def test_positive_unregister_host_subscription( :expectedresults: host subscription is unregistered :parametrized: yes - - :CaseLevel: System """ # register the host client host_subscription_client.register_contenthost( @@ -2315,8 +2252,6 @@ def test_syspurpose_end_to_end( :CaseImportance: Critical :parametrized: yes - - :CaseLevel: System """ # Create an activation key with test values purpose_addons = "test-addon1, test-addon2" @@ -2576,8 +2511,6 @@ def test_positive_list_scparams( :expectedresults: Overridden sc-param from puppet class are listed - - :CaseLevel: Integration """ update_smart_proxy(session_puppet_enabled_sat, module_puppet_loc, session_puppet_enabled_proxy) # Create hostgroup with associated puppet class diff --git a/tests/foreman/cli/test_hostcollection.py b/tests/foreman/cli/test_hostcollection.py index 91bf5c4f56..ce3426030b 100644 --- a/tests/foreman/cli/test_hostcollection.py +++ b/tests/foreman/cli/test_hostcollection.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: HostCollections :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from broker import Broker from fauxfactory import gen_string @@ -224,8 +219,6 @@ def test_positive_list_by_org_id(module_org, module_target_sat): :id: afbe077a-0de1-432c-a0c4-082129aab92e :expectedresults: Only host-collection within specific org is listed - - :CaseLevel: Integration """ # Create two host collections within different organizations module_target_sat.cli_factory.make_host_collection({'organization-id': module_org.id}) @@ -253,8 +246,6 @@ def test_positive_host_collection_host_pagination(module_org, module_target_sat) :expectedresults: Number of host per page follows per_page configuration restriction - - :CaseLevel: Integration """ host_collection = module_target_sat.cli_factory.make_host_collection( {'organization-id': module_org.id} @@ -287,8 +278,6 @@ def test_positive_copy_by_id(module_org, module_target_sat): :expectedresults: Host collection is cloned successfully :BZ: 1328925 - - :CaseLevel: Integration """ host_collection = module_target_sat.cli_factory.make_host_collection( {'name': gen_string('alpha', 15), 'organization-id': module_org.id} @@ -311,8 +300,6 @@ def test_positive_register_host_ak_with_host_collection(module_org, module_ak_wi :expectedresults: Host successfully registered and listed in host collection :BZ: 1385814 - - :CaseLevel: System """ host_info = _make_fake_host_helper(module_org, target_sat) diff --git a/tests/foreman/cli/test_hostgroup.py b/tests/foreman/cli/test_hostgroup.py index 3f5ebbf0ed..febe94038f 100644 --- a/tests/foreman/cli/test_hostgroup.py +++ b/tests/foreman/cli/test_hostgroup.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: HostGroup :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_integer from nailgun import entities @@ -116,8 +111,6 @@ def test_positive_create_with_multiple_entities_and_delete( :BZ: 1395254, 1313056 - :CaseLevel: Integration - :CaseImportance: Critical """ with session_puppet_enabled_sat: @@ -215,8 +208,6 @@ def test_negative_create_with_content_source(module_org, module_target_sat): :BZ: 1260697 :expectedresults: Hostgroup was not created - - :CaseLevel: Integration """ with pytest.raises(CLIFactoryError): module_target_sat.cli_factory.hostgroup( @@ -248,8 +239,6 @@ def test_positive_update_hostgroup_with_puppet( :expectedresults: Hostgroup was successfully updated with new content source, name and puppet classes - - :CaseLevel: Integration """ with session_puppet_enabled_sat as puppet_sat: hostgroup = puppet_sat.cli_factory.hostgroup( @@ -303,8 +292,6 @@ def test_positive_update_hostgroup( :expectedresults: Hostgroup was successfully updated with new content source and name - - :CaseLevel: Integration """ hostgroup = module_target_sat.cli_factory.hostgroup( { @@ -338,8 +325,6 @@ def test_negative_update_content_source(hostgroup, content_source, module_target :expectedresults: Host group was not updated. Content source remains the same as it was before update - - :CaseLevel: Integration """ with pytest.raises(CLIReturnCodeError): module_target_sat.cli.HostGroup.update( @@ -371,8 +356,6 @@ def test_negative_delete_by_id(module_target_sat): :id: 047c9f1a-4dd6-4fdc-b7ed-37cc725c68d3 :expectedresults: HostGroup is not deleted - - :CaseLevel: Integration """ entity_id = invalid_id_list()[0] with pytest.raises(CLIReturnCodeError): @@ -391,7 +374,6 @@ def test_positive_created_nested_hostgroup(module_org, module_target_sat): :customerscenario: true :CaseImportance: Low - """ parent_hg = module_target_sat.cli_factory.hostgroup({'organization-ids': module_org.id}) nested = module_target_sat.cli_factory.hostgroup( @@ -413,7 +395,7 @@ def test_positive_nested_hostgroup_info(): :customerscenario: true - :Steps: + :steps: 1. Create parent hostgroup and nested hostgroup, with puppet environment, classes, and parameters on each. diff --git a/tests/foreman/cli/test_http_proxy.py b/tests/foreman/cli/test_http_proxy.py index 8fb4d6af0a..c6bea60857 100644 --- a/tests/foreman/cli/test_http_proxy.py +++ b/tests/foreman/cli/test_http_proxy.py @@ -2,19 +2,14 @@ :Requirement: HttpProxy -:CaseLevel: Acceptance - :CaseComponent: Repositories :team: Phoenix-content -:TestType: Functional - :CaseImportance: High :CaseAutomation: Automated -:Upstream: No """ from fauxfactory import gen_integer, gen_string, gen_url import pytest @@ -99,7 +94,7 @@ def test_insights_client_registration_with_http_proxy(): :customerscenario: true - :Steps: + :steps: 1. Create HTTP Proxy. 2. Set created proxy as "Default HTTP Proxy" in settings. 3. Edit /etc/resolv.conf and comment out all entries so that @@ -130,7 +125,7 @@ def test_positive_set_content_default_http_proxy(block_fake_repo_access, target_ :id: c12868eb-98f1-4763-a168-281ac44d9ff5 - :Steps: + :steps: 1. Create a product with repo. 2. Create an un-authenticated proxy. 3. Set the proxy to be the global default proxy. @@ -139,7 +134,6 @@ def test_positive_set_content_default_http_proxy(block_fake_repo_access, target_ :expectedresults: Repo is synced :CaseImportance: High - """ org = target_sat.api.Organization().create() proxy_name = gen_string('alpha', 15) @@ -184,7 +178,7 @@ def test_positive_environment_variable_unset_set(): :customerscenario: true - :Steps: + :steps: 1. Export any environment variable from [http_proxy, https_proxy, ssl_cert_file, HTTP_PROXY, HTTPS_PROXY, SSL_CERT_FILE] 2. satellite-installer @@ -195,7 +189,6 @@ def test_positive_environment_variable_unset_set(): :CaseImportance: High :CaseAutomation: NotAutomated - """ diff --git a/tests/foreman/cli/test_installer.py b/tests/foreman/cli/test_installer.py index 7980f40a38..4a42eaa131 100644 --- a/tests/foreman/cli/test_installer.py +++ b/tests/foreman/cli/test_installer.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Installer :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/foreman/cli/test_jobtemplate.py b/tests/foreman/cli/test_jobtemplate.py index 7d52d3486b..66553d2c54 100644 --- a/tests/foreman/cli/test_jobtemplate.py +++ b/tests/foreman/cli/test_jobtemplate.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: RemoteExecution :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -158,7 +153,6 @@ def test_positive_view_dump(module_org, module_target_sat): :id: 25fcfcaa-fc4c-425e-919e-330e36195c4a :expectedresults: Verify no errors are thrown - """ template_name = gen_string('alpha', 7) module_target_sat.cli_factory.job_template( diff --git a/tests/foreman/cli/test_ldapauthsource.py b/tests/foreman/cli/test_ldapauthsource.py index 8f363f5606..528a47420a 100644 --- a/tests/foreman/cli/test_ldapauthsource.py +++ b/tests/foreman/cli/test_ldapauthsource.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: LDAP :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string from nailgun import entities diff --git a/tests/foreman/cli/test_leapp_client.py b/tests/foreman/cli/test_leapp_client.py index 550a1b662a..6ab248b0f9 100644 --- a/tests/foreman/cli/test_leapp_client.py +++ b/tests/foreman/cli/test_leapp_client.py @@ -2,19 +2,14 @@ :Requirement: leapp -:CaseLevel: Integration - :CaseComponent: Leappintegration :Team: Rocket -:TestType: Functional - :CaseImportance: High :CaseAutomation: Automated -:Upstream: No """ from broker import Broker import pytest @@ -228,7 +223,7 @@ def test_leapp_upgrade_rhel( :id: 8eccc689-3bea-4182-84f3-c121e95d54c3 - :Steps: + :steps: 1. Import a subscription manifest and enable, sync source & target repositories 2. Create LCE, Create CV, add repositories to it, publish and promote CV, Create AK, etc. 3. Register content host with AK diff --git a/tests/foreman/cli/test_lifecycleenvironment.py b/tests/foreman/cli/test_lifecycleenvironment.py index 93001a70fe..75bf12c681 100644 --- a/tests/foreman/cli/test_lifecycleenvironment.py +++ b/tests/foreman/cli/test_lifecycleenvironment.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: LifecycleEnvironments :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from math import ceil diff --git a/tests/foreman/cli/test_location.py b/tests/foreman/cli/test_location.py index 4779bf9373..9f835c1c58 100644 --- a/tests/foreman/cli/test_location.py +++ b/tests/foreman/cli/test_location.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: OrganizationsandLocations :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -282,7 +277,6 @@ def test_positive_add_and_remove_capsule(self, request, target_sat): :BZ: 1398695 - :CaseLevel: Integration """ location = _location(request, target_sat) proxy = _proxy(request, target_sat) diff --git a/tests/foreman/cli/test_logging.py b/tests/foreman/cli/test_logging.py index 61ead1bee0..8d315b3e59 100644 --- a/tests/foreman/cli/test_logging.py +++ b/tests/foreman/cli/test_logging.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Logging :Team: Rocket -:TestType: Functional - :CaseImportance: Medium -:Upstream: No """ import re @@ -223,8 +218,6 @@ def test_positive_logging_from_pulp3(module_org, target_sat): :id: 8d5718e6-3442-47d6-b541-0aa78d007e8b - :CaseLevel: Component - :CaseImportance: High """ source_log = '/var/log/foreman/production.log' diff --git a/tests/foreman/cli/test_medium.py b/tests/foreman/cli/test_medium.py index 5ded3225e8..26017b415a 100644 --- a/tests/foreman/cli/test_medium.py +++ b/tests/foreman/cli/test_medium.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Hosts :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_alphanumeric import pytest @@ -93,7 +88,6 @@ def test_positive_remove_os(self, module_target_sat): :expectedresults: Operating system removed - :CaseLevel: Integration """ medium = module_target_sat.cli_factory.make_medium() os = module_target_sat.cli_factory.make_os() diff --git a/tests/foreman/cli/test_model.py b/tests/foreman/cli/test_model.py index 0dfc2cb3ba..d06e392b6b 100644 --- a/tests/foreman/cli/test_model.py +++ b/tests/foreman/cli/test_model.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Hosts :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest diff --git a/tests/foreman/cli/test_operatingsystem.py b/tests/foreman/cli/test_operatingsystem.py index 7b5e0bd60a..48ed8af809 100644 --- a/tests/foreman/cli/test_operatingsystem.py +++ b/tests/foreman/cli/test_operatingsystem.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Provisioning :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_alphanumeric, gen_string import pytest @@ -223,7 +218,6 @@ def test_positive_add_arch(self, target_sat): :expectedresults: Architecture is added to Operating System - :CaseLevel: Integration """ architecture = target_sat.cli_factory.make_architecture() os = target_sat.cli_factory.make_os() @@ -243,7 +237,6 @@ def test_positive_add_template(self, target_sat): :expectedresults: Provisioning template is added to Operating System - :CaseLevel: Integration """ template = target_sat.cli_factory.make_template() os = target_sat.cli_factory.make_os() @@ -265,7 +258,6 @@ def test_positive_add_ptable(self, target_sat): :expectedresults: Partition table is added to Operating System - :CaseLevel: Integration """ # Create a partition table. ptable_name = target_sat.cli_factory.make_partition_table()['name'] diff --git a/tests/foreman/cli/test_organization.py b/tests/foreman/cli/test_organization.py index 9b2b3893c8..c7d8446639 100644 --- a/tests/foreman/cli/test_organization.py +++ b/tests/foreman/cli/test_organization.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: OrganizationsandLocations :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -172,8 +167,6 @@ def test_positive_add_and_remove_subnets(module_org, module_target_sat): :expectedresults: Subnets are handled as expected :BZ: 1395229 - - :CaseLevel: Integration """ subnets = [module_target_sat.cli_factory.make_subnet() for _ in range(0, 2)] module_target_sat.cli.Org.add_subnet({'name': module_org.name, 'subnet': subnets[0]['name']}) @@ -203,8 +196,6 @@ def test_positive_add_and_remove_users(module_org, module_target_sat): 4. create and delete admin user by id :BZ: 1395229 - - :CaseLevel: Integration """ user = module_target_sat.cli_factory.user() admin_user = module_target_sat.cli_factory.user({'admin': '1'}) @@ -250,8 +241,6 @@ def test_positive_add_and_remove_hostgroups(module_org, module_target_sat): :steps: 1. add and remove hostgroup by name 2. add and remove hostgroup by id - - :CaseLevel: Integration """ hostgroups = [module_target_sat.cli_factory.hostgroup() for _ in range(0, 2)] @@ -291,8 +280,6 @@ def test_positive_add_and_remove_compute_resources(module_org, module_target_sat :steps: 1. Add and remove compute resource by id 2. Add and remove compute resource by name - - :CaseLevel: Integration """ compute_resources = [ module_target_sat.cli_factory.compute_resource( @@ -339,8 +326,6 @@ def test_positive_add_and_remove_media(module_org, module_target_sat): :steps: 1. add and remove medium by id 2. add and remove medium by name - - :CaseLevel: Integration """ media = [module_target_sat.cli_factory.make_medium() for _ in range(0, 2)] module_target_sat.cli.Org.add_medium({'id': module_org.id, 'medium-id': media[0]['id']}) @@ -370,8 +355,6 @@ def test_positive_add_and_remove_templates(module_org, module_target_sat): :steps: 1. Add and remove template by id 2. Add and remove template by name - - :CaseLevel: Integration """ # create and remove templates by name name = list(valid_data_list().values())[0] @@ -428,8 +411,6 @@ def test_positive_add_and_remove_domains(module_org, module_target_sat): :steps: 1. Add and remove domain by name 2. Add and remove domain by id - - :CaseLevel: Integration """ domains = [module_target_sat.cli_factory.make_domain() for _ in range(0, 2)] module_target_sat.cli.Org.add_domain({'domain-id': domains[0]['id'], 'name': module_org.name}) @@ -456,8 +437,6 @@ def test_positive_add_and_remove_lce(module_org, module_target_sat): :steps: 1. create and add lce to org 2. remove lce from org - - :CaseLevel: Integration """ # Create a lifecycle environment. lc_env_name = module_target_sat.cli_factory.make_lifecycle_environment( @@ -488,8 +467,6 @@ def test_positive_add_and_remove_capsules(proxy, module_org, module_target_sat): :steps: 1. add and remove capsule by ip 2. add and remove capsule by name - - :CaseLevel: Integration """ module_target_sat.cli.Org.add_smart_proxy({'id': module_org.id, 'smart-proxy-id': proxy['id']}) org_info = module_target_sat.cli.Org.info({'name': module_org.name}) @@ -525,8 +502,6 @@ def test_positive_add_and_remove_locations(module_org, module_target_sat): :steps: 1. add and remove locations by name 2. add and remove locations by id - - :CaseLevel: Integration """ locations = [module_target_sat.cli_factory.make_location() for _ in range(0, 2)] module_target_sat.cli.Org.add_location( @@ -600,7 +575,6 @@ def test_negative_create_with_invalid_name(name, module_target_sat): :parametrized: yes :expectedresults: organization is not created - """ with pytest.raises(CLIFactoryError): module_target_sat.cli_factory.make_org( @@ -667,7 +641,6 @@ def test_negative_update_name(new_name, module_org, module_target_sat): :parametrized: yes :expectedresults: organization name is not updated - """ with pytest.raises(CLIReturnCodeError): module_target_sat.cli.Org.update({'id': module_org.id, 'new-name': new_name}) @@ -683,8 +656,6 @@ def test_positive_create_user_with_timezone(module_org, module_target_sat): :BZ: 1733269 - :CaseLevel: Integration - :CaseImportance: Medium :steps: @@ -693,7 +664,6 @@ def test_positive_create_user_with_timezone(module_org, module_target_sat): 3. Remove user from organization and validate :expectedresults: User created and removed successfully with valid timezone - """ users_timezones = [ 'Pacific Time (US & Canada)', diff --git a/tests/foreman/cli/test_oscap.py b/tests/foreman/cli/test_oscap.py index f2430235a5..ecbc50f06d 100644 --- a/tests/foreman/cli/test_oscap.py +++ b/tests/foreman/cli/test_oscap.py @@ -2,19 +2,14 @@ :Requirement: Oscap -:CaseLevel: Acceptance - :CaseComponent: SCAPPlugin :Team: Endeavour -:TestType: Functional - :CaseImportance: High :CaseAutomation: Automated -:Upstream: No """ from fauxfactory import gen_string from nailgun import entities diff --git a/tests/foreman/cli/test_oscap_tailoringfiles.py b/tests/foreman/cli/test_oscap_tailoringfiles.py index 3f36bff328..e95cfb2891 100644 --- a/tests/foreman/cli/test_oscap_tailoringfiles.py +++ b/tests/foreman/cli/test_oscap_tailoringfiles.py @@ -2,19 +2,14 @@ :Requirement: tailoringfiles -:CaseLevel: Acceptance - :CaseComponent: SCAPPlugin :Team: Endeavour -:TestType: Functional - :CaseImportance: High :CaseAutomation: Automated -:Upstream: No """ from fauxfactory import gen_string import pytest diff --git a/tests/foreman/cli/test_ostreebranch.py b/tests/foreman/cli/test_ostreebranch.py index ccb35ea0ba..d768b3f2d7 100644 --- a/tests/foreman/cli/test_ostreebranch.py +++ b/tests/foreman/cli/test_ostreebranch.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Repositories :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import random @@ -94,7 +89,6 @@ def test_positive_list_by_repo_id( :id: 8cf1a973-031c-4c02-af14-0faba22ab60b :expectedresults: Ostree Branch List is displayed - """ branch = module_target_sat.cli.OstreeBranch.with_user(*ostree_user_credentials) @@ -139,7 +133,6 @@ def test_positive_list_by_cv_id(ostree_repo_with_user, ostree_user_credentials, :id: 3654f107-44ee-4af2-a9e4-f9fd8c68491e :expectedresults: Ostree Branch List is displayed - """ result = module_target_sat.cli.OstreeBranch.with_user(*ostree_user_credentials).list( {'content-view-id': ostree_repo_with_user['cv']['id']} diff --git a/tests/foreman/cli/test_partitiontable.py b/tests/foreman/cli/test_partitiontable.py index fe863cfd42..352602eef8 100644 --- a/tests/foreman/cli/test_partitiontable.py +++ b/tests/foreman/cli/test_partitiontable.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Hosts :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from random import randint @@ -134,7 +129,6 @@ def test_positive_add_remove_os_by_id(self, module_target_sat): :expectedresults: Operating system is added to partition table - :CaseLevel: Integration """ ptable = module_target_sat.cli_factory.make_partition_table() os = module_target_sat.cli_factory.make_os() @@ -159,7 +153,6 @@ def test_positive_add_remove_os_by_name(self, module_target_sat): :expectedresults: Operating system is added to partition table - :CaseLevel: Integration """ ptable = module_target_sat.cli_factory.make_partition_table() os = module_target_sat.cli_factory.make_os() diff --git a/tests/foreman/cli/test_ping.py b/tests/foreman/cli/test_ping.py index 3a59698fb8..69727dd3d0 100644 --- a/tests/foreman/cli/test_ping.py +++ b/tests/foreman/cli/test_ping.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Hammer :Team: Endeavour -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ import pytest diff --git a/tests/foreman/cli/test_product.py b/tests/foreman/cli/test_product.py index 5a61c2dfb3..3d413209db 100644 --- a/tests/foreman/cli/test_product.py +++ b/tests/foreman/cli/test_product.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Repositories :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_alphanumeric, gen_integer, gen_string, gen_url import pytest @@ -172,7 +167,6 @@ def test_product_list_with_default_settings(module_org, target_sat): :customerscenario: true :expectedresults: product/reporsitory list should work as expected. - """ org_id = str(module_org.id) default_product_name = gen_string('alpha') @@ -227,7 +221,7 @@ def test_positive_product_sync_state(module_org, module_target_sat): :customerscenario: true - :Steps: + :steps: 1. Sync a custom repository that fails. 2. Run `hammer product info --product-id `. 3. Successfully sync another repository under the same product. diff --git a/tests/foreman/cli/test_provisioning.py b/tests/foreman/cli/test_provisioning.py index 8e67bdcbb4..1c7799edc5 100644 --- a/tests/foreman/cli/test_provisioning.py +++ b/tests/foreman/cli/test_provisioning.py @@ -4,17 +4,12 @@ :CaseAutomation: NotAutomated -:CaseLevel: System - :CaseComponent: Provisioning :Team: Rocket -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ import pytest diff --git a/tests/foreman/cli/test_provisioningtemplate.py b/tests/foreman/cli/test_provisioningtemplate.py index 663aa64a1e..59aabc2d2c 100644 --- a/tests/foreman/cli/test_provisioningtemplate.py +++ b/tests/foreman/cli/test_provisioningtemplate.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: ProvisioningTemplates :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import random from random import randint @@ -167,8 +162,6 @@ def test_positive_add_remove_os_by_id(module_target_sat, module_os_with_minor): :id: d9f481b3-9757-4208-b451-baf4792d4d70 :expectedresults: Operating system is added/removed from the template - - :CaseLevel: Integration """ os = module_os_with_minor os_string = f'{os.name} {os.major}.{os.minor}' @@ -212,8 +205,6 @@ def test_positive_clone(module_target_sat): :id: 27d69c1e-0d83-4b99-8a3c-4f1bdec3d261 :expectedresults: The template is cloned successfully - - :CaseLevel: Integration """ cloned_template_name = gen_string('alpha') template = module_target_sat.cli_factory.make_template() diff --git a/tests/foreman/cli/test_puppetclass.py b/tests/foreman/cli/test_puppetclass.py index 9d849ff0ff..3a8b50856b 100644 --- a/tests/foreman/cli/test_puppetclass.py +++ b/tests/foreman/cli/test_puppetclass.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Puppet :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/foreman/cli/test_realm.py b/tests/foreman/cli/test_realm.py index e488e150cc..c05dc1291f 100644 --- a/tests/foreman/cli/test_realm.py +++ b/tests/foreman/cli/test_realm.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Authentication :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import random diff --git a/tests/foreman/cli/test_registration.py b/tests/foreman/cli/test_registration.py index 633fbf3be9..f4260cb118 100644 --- a/tests/foreman/cli/test_registration.py +++ b/tests/foreman/cli/test_registration.py @@ -2,8 +2,6 @@ :Requirement: Registration -:CaseLevel: Acceptance - :CaseComponent: Registration :CaseAutomation: Automated @@ -12,9 +10,6 @@ :Team: Rocket -:TestType: Functional - -:Upstream: No """ import pytest @@ -161,8 +156,6 @@ def test_negative_register_twice(module_ak_with_cv, module_org, rhel_contenthost :expectedresults: host cannot be registered twice :parametrized: yes - - :CaseLevel: System """ rhel_contenthost.register(module_org, None, module_ak_with_cv.name, target_sat) assert rhel_contenthost.subscribed diff --git a/tests/foreman/cli/test_remoteexecution.py b/tests/foreman/cli/test_remoteexecution.py index e5c0df5678..5d6d86bb84 100644 --- a/tests/foreman/cli/test_remoteexecution.py +++ b/tests/foreman/cli/test_remoteexecution.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: RemoteExecution :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from calendar import monthrange from datetime import datetime, timedelta @@ -596,7 +591,7 @@ def test_positive_run_effective_user_job(self, rex_contenthost, target_sat): :id: a5fa20d8-c2bd-4bbf-a6dc-bf307b59dd8c - :Steps: + :steps: 0. Create a VM and register to SAT and prepare for REX (ssh key) @@ -610,8 +605,6 @@ def test_positive_run_effective_user_job(self, rex_contenthost, target_sat): :CaseAutomation: Automated - :CaseLevel: System - :parametrized: yes """ client = rex_contenthost @@ -651,7 +644,7 @@ def test_positive_run_reccuring_job(self, rex_contenthost, target_sat): :id: 49b0d31d-58f9-47f1-aa5d-561a1dcb0d66 - :Steps: + :steps: 0. Create a VM and register to SAT and prepare for REX (ssh key) @@ -667,8 +660,6 @@ def test_positive_run_reccuring_job(self, rex_contenthost, target_sat): :bz: 2129432 - :CaseLevel: System - :parametrized: yes """ client = rex_contenthost @@ -703,7 +694,7 @@ def test_positive_run_concurrent_jobs(self, registered_hosts, target_sat): :id: ad0f108c-03f2-49c7-8732-b1056570567b - :Steps: + :steps: 0. Create 2 hosts, disable foreman_tasks_proxy_batch_trigger @@ -715,8 +706,6 @@ def test_positive_run_concurrent_jobs(self, registered_hosts, target_sat): :customerscenario: true - :CaseLevel: System - :BZ: 1817320 :parametrized: yes @@ -759,7 +748,7 @@ def test_positive_run_serial(self, registered_hosts, target_sat): :Setup: 0. Create 2 hosts - :Steps: + :steps: 0. Run a bash command job with concurrency level 1 @@ -767,8 +756,6 @@ def test_positive_run_serial(self, registered_hosts, target_sat): :CaseAutomation: Automated - :CaseLevel: System - :parametrized: yes """ hosts = registered_hosts @@ -837,7 +824,7 @@ def test_positive_run_packages_and_services_job( :id: 47ed82fb-77ca-43d6-a52e-f62bae5d3a42 - :Steps: + :steps: 0. Create a VM and register to SAT and prepare for REX (ssh key) @@ -853,8 +840,6 @@ def test_positive_run_packages_and_services_job( :CaseAutomation: Automated - :CaseLevel: System - :bz: 1872688, 1811166 :CaseImportance: Critical @@ -918,7 +903,7 @@ def test_positive_install_ansible_collection( ): """Test whether Ansible collection can be installed via REX - :Steps: + :steps: 1. Upload a manifest. 2. Enable and sync Ansible repository. 3. Register content host to Satellite. diff --git a/tests/foreman/cli/test_report.py b/tests/foreman/cli/test_report.py index 94946b88e6..7ef9e7fc9e 100644 --- a/tests/foreman/cli/test_report.py +++ b/tests/foreman/cli/test_report.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Puppet :Team: Rocket -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ import random diff --git a/tests/foreman/cli/test_reporttemplates.py b/tests/foreman/cli/test_reporttemplates.py index d00c83765d..cd45f6fc5a 100644 --- a/tests/foreman/cli/test_reporttemplates.py +++ b/tests/foreman/cli/test_reporttemplates.py @@ -3,17 +3,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Reporting :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from broker import Broker from fauxfactory import gen_alpha @@ -120,7 +115,6 @@ def test_positive_report_help(module_target_sat): :expectedresults: report-templates command is included in help, report-templates command details are displayed, report-templates create command details are displayed - """ command_output = module_target_sat.cli.Base().execute('--help') assert 'report-template' in command_output @@ -298,7 +292,6 @@ def test_positive_report_add_userinput(module_target_sat): 1. hammer template-input create ... :expectedresults: User input is assigned to the report template - """ name = gen_alpha() report_template = module_target_sat.cli_factory.report_template({'name': name}) @@ -441,7 +434,6 @@ def test_positive_applied_errata(): :expectedresults: 1. A report is generated with all applied errata listed 2,3. A report is generated asynchronously - """ diff --git a/tests/foreman/cli/test_repositories.py b/tests/foreman/cli/test_repositories.py index 222f693886..cf6e10db5c 100644 --- a/tests/foreman/cli/test_repositories.py +++ b/tests/foreman/cli/test_repositories.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Repositories :team: Phoenix-content -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ import pytest from requests.exceptions import HTTPError diff --git a/tests/foreman/cli/test_repository.py b/tests/foreman/cli/test_repository.py index 1ca398b9ff..184536c02c 100644 --- a/tests/foreman/cli/test_repository.py +++ b/tests/foreman/cli/test_repository.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Repositories :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from random import choice from string import punctuation @@ -730,8 +725,6 @@ def test_positive_synchronize_yum_repo(self, repo_options, repo, target_sat): :expectedresults: Repository is created and synced - :CaseLevel: Integration - :CaseImportance: Critical """ # Repo is not yet synced @@ -757,8 +750,6 @@ def test_positive_synchronize_file_repo(self, repo_options, repo, target_sat): :expectedresults: Repository is created and synced - :CaseLevel: Integration - :CaseImportance: Critical """ # Assertion that repo is not yet synced @@ -799,7 +790,6 @@ def test_positive_synchronize_auth_yum_repo(self, repo, target_sat): :BZ: 1328092 - :CaseLevel: Integration """ # Assertion that repo is not yet synced assert repo['sync']['status'] == 'Not Synced' @@ -840,7 +830,6 @@ def test_negative_synchronize_auth_yum_repo(self, repo, target_sat): :BZ: 1405503, 1453118 - :CaseLevel: Integration """ # Try to synchronize it repo_sync = target_sat.cli.Repository.synchronize({'id': repo['id'], 'async': True}) @@ -1122,7 +1111,6 @@ def test_positive_resynchronize_rpm_repo(self, repo, target_sat): :BZ: 1459845, 1459874, 1318004 - :CaseLevel: Integration """ target_sat.cli.Repository.synchronize({'id': repo['id']}) repo = target_sat.cli.Repository.info({'id': repo['id']}) @@ -1179,7 +1167,7 @@ def test_mirror_on_sync_removes_rpm(self, module_org, repo, repo_options_2, modu 3. Delete one package from repo 1. 4. Sync the second repo (repo 2) from the first repo (repo 1). - :Steps: + :steps: 1. Check that the package deleted from repo 1 was removed from repo 2. :expectedresults: A package removed from repo 1 is removed from repo 2 when synced. @@ -1251,8 +1239,6 @@ def test_positive_synchronize_rpm_repo_ignore_SRPM( :BZ: 1591358 - :CaseLevel: Integration - """ target_sat.cli.Repository.synchronize({'id': repo['id']}) repo = target_sat.cli.Repository.info({'id': repo['id']}) @@ -1681,7 +1667,7 @@ def test_negative_restricted_user_cv_add_repository(self, module_org, repo, modu :BZ: 1436209,1410916 - :Steps: + :steps: 1. Setup a restricted user with permissions that filter the products with names like Test_* or "rhel7*" 2. Create a content view @@ -1697,7 +1683,6 @@ def test_negative_restricted_user_cv_add_repository(self, module_org, repo, modu view, assert that the restricted user still cannot view the product repository. - :CaseLevel: Integration """ required_permissions = { 'Katello::Product': ( @@ -1980,7 +1965,7 @@ def test_positive_create_get_update_delete_module_streams( :Setup: 1. valid yum repo with Module Streams. - :Steps: + :steps: 1. Create Yum Repository with url contain module-streams 2. Initialize synchronization 3. Another Repository with same Url @@ -2049,7 +2034,7 @@ def test_module_stream_list_validation( :Setup: 1. valid yum repo with Module Streams. - :Steps: + :steps: 1. Create Yum Repositories with url contain module-streams and Products 2. Initialize synchronization 3. Verify the module-stream list with various inputs options @@ -2087,7 +2072,7 @@ def test_module_stream_info_validation(self, repo, module_target_sat): :Setup: 1. valid yum repo with Module Streams. - :Steps: + :steps: 1. Create Yum Repositories with url contain module-streams 2. Initialize synchronization 3. Verify the module-stream info with various inputs options @@ -2121,7 +2106,7 @@ def test_negative_update_red_hat_repo(self, module_manifest_org, module_target_s :BZ: 1756951, 2002653 - :Steps: + :steps: 1. Import manifest and enable a Red Hat repository. 2. Attempt to update the Red Hat repository: # hammer repository update --id --url http://example.com/repo @@ -2359,9 +2344,8 @@ def test_positive_sync_third_party_repo(self, repo_options, module_target_sat): # :parametrized: yes # # :expectedresults: Ostree repository is created and synced -# -# :CaseLevel: Integration -# + + # :BZ: 1625783 # """ # # Synchronize it @@ -2546,8 +2530,6 @@ def test_positive_sync_ansible_collection(self, repo, module_target_sat): :expectedresults: All content synced successfully - :CaseLevel: Integration - :CaseImportance: High :parametrized: yes @@ -2580,8 +2562,6 @@ def test_positive_export_ansible_collection(self, repo, module_org, target_sat): :expectedresults: All content exported and imported successfully - :CaseLevel: Integration - :CaseImportance: High """ @@ -2640,8 +2620,6 @@ def test_positive_sync_ansible_collection_from_satellite(self, repo, target_sat) :expectedresults: All content synced successfully - :CaseLevel: Integration - :CaseImportance: High """ @@ -2813,11 +2791,9 @@ def test_positive_git_local_create(self): :id: 89211cd5-82b8-4391-b729-a7502e57f824 - :CaseLevel: Integration - :Setup: Assure local GIT puppet has been created and found by pulp - :Steps: Create link to local puppet mirror via cli + :steps: Create link to local puppet mirror via cli :expectedresults: Content source containing local GIT puppet mirror content is created @@ -2832,11 +2808,9 @@ def test_positive_git_local_update(self): :id: 341f40f2-3501-4754-9acf-7cda1a61f7db - :CaseLevel: Integration - :Setup: Assure local GIT puppet has been created and found by pulp - :Steps: Modify details for existing puppet repo (name, etc.) via cli + :steps: Modify details for existing puppet repo (name, etc.) via cli :expectedresults: Content source containing local GIT puppet mirror content is modified @@ -2852,11 +2826,9 @@ def test_positive_git_local_delete(self): :id: a243f5bb-5186-41b3-8e8a-07d5cc784ccd - :CaseLevel: Integration - :Setup: Assure local GIT puppet has been created and found by pulp - :Steps: Delete link to local puppet mirror via cli + :steps: Delete link to local puppet mirror via cli :expectedresults: Content source containing local GIT puppet mirror content no longer exists/is available. @@ -2871,11 +2843,9 @@ def test_positive_git_remote_create(self): :id: 8582529f-3112-4b49-8d8f-f2bbf7dceca7 - :CaseLevel: Integration - :Setup: Assure remote GIT puppet has been created and found by pulp - :Steps: Create link to local puppet mirror via cli + :steps: Create link to local puppet mirror via cli :expectedresults: Content source containing remote GIT puppet mirror content is created @@ -2890,11 +2860,9 @@ def test_positive_git_remote_update(self): :id: 582c50b3-3b90-4244-b694-97642b1b13a9 - :CaseLevel: Integration - :Setup: Assure remote GIT puppet has been created and found by pulp - :Steps: modify details for existing puppet repo (name, etc.) via cli + :steps: modify details for existing puppet repo (name, etc.) via cli :expectedresults: Content source containing remote GIT puppet mirror content is modified @@ -2910,11 +2878,9 @@ def test_positive_git_remote_delete(self): :id: 0a23f969-b202-4c6c-b12e-f651a0b7d049 - :CaseLevel: Integration - :Setup: Assure remote GIT puppet has been created and found by pulp - :Steps: Delete link to remote puppet mirror via cli + :steps: Delete link to remote puppet mirror via cli :expectedresults: Content source containing remote GIT puppet mirror content no longer exists/is available. @@ -2929,11 +2895,9 @@ def test_positive_git_sync(self): :id: a46c16bd-0986-48db-8e62-aeb3907ba4d2 - :CaseLevel: Integration - :Setup: git mirror (local or remote) exists as a content source - :Steps: Attempt to sync content from mirror via cli + :steps: Attempt to sync content from mirror via cli :expectedresults: Content is pulled down without error @@ -2950,11 +2914,9 @@ def test_positive_git_sync_schedule(self): :id: 0d58d180-9836-4524-b608-66b67f9cab12 - :CaseLevel: Integration - :Setup: git mirror (local or remote) exists as a content source - :Steps: Attempt to create a scheduled sync content from mirror, via cli + :steps: Attempt to create a scheduled sync content from mirror, via cli :expectedresults: Content is pulled down without error on expected schedule @@ -2969,11 +2931,9 @@ def test_positive_git_view_content(self): :id: 02f06092-dd6c-49fa-be9f-831e52476e41 - :CaseLevel: Integration - :Setup: git mirror (local or remote) exists as a content source - :Steps: Attempt to list contents of repo via cli + :steps: Attempt to list contents of repo via cli :expectedresults: Spot-checked items (filenames, dates, perhaps checksums?) are correct. @@ -2998,7 +2958,7 @@ def test_positive_upload_file_to_file_repo(self, repo_options, repo, target_sat) :parametrized: yes - :Steps: + :steps: 1. Create a File Repository 2. Upload an arbitrary file to it @@ -3039,7 +2999,7 @@ def test_positive_file_permissions(self): 1. Create a File Repository 2. Upload an arbitrary file to it - :Steps: Retrieve file permissions from File Repository + :steps: Retrieve file permissions from File Repository :expectedresults: uploaded file permissions are kept after upload @@ -3066,7 +3026,7 @@ def test_positive_remove_file(self, repo, target_sat): 1. Create a File Repository 2. Upload an arbitrary file to it - :Steps: Remove a file from File Repository + :steps: Remove a file from File Repository :expectedresults: file is not listed under File Repository after removal @@ -3122,7 +3082,7 @@ def test_positive_remote_directory_sync(self, repo, module_target_sat): 1. Create a directory to be synced with a pulp manifest on its root 2. Make the directory available through http - :Steps: + :steps: 1. Create a File Repository with url pointing to http url created on setup 2. Initialize synchronization @@ -3152,7 +3112,7 @@ def test_positive_file_repo_local_directory_sync(self, repo, target_sat): 1. Create a directory to be synced with a pulp manifest on its root locally (on the Satellite/Foreman host) - :Steps: + :steps: 1. Create a File Repository with url pointing to local url created on setup 2. Initialize synchronization @@ -3190,7 +3150,7 @@ def test_positive_symlinks_sync(self, repo, target_sat): locally (on the Satellite/Foreman host) 2. Make sure it contains symlinks - :Steps: + :steps: 1. Create a File Repository with url pointing to local url created on setup 2. Initialize synchronization @@ -3232,7 +3192,7 @@ def test_file_repo_contains_only_newer_file(self, repo_options, repo, target_sat 4. Add some text keyword to the file locally. 5. Upload new version of file. - :Steps: + :steps: 1. Check that the repo contains only the new version of the file :expectedresults: The file is not duplicated and only the latest version of the file @@ -3295,7 +3255,7 @@ def test_copy_package_group_between_repos(): 2. Create another product and create a yum repo (repo 2) 3. Select the package group from repo 1 and sync it to repo 2 - :Steps: + :steps: Assert the list of package in repo 2 matches the group list from repo 1 :CaseAutomation: NotAutomated @@ -3320,7 +3280,7 @@ def test_include_and_exclude_content_units(): 4. Select a package and exclude its dependencies 5. Copy packages from repo 1 to repo 2 - :Steps: + :steps: Assert the list of packages in repo 2 matches the packages selected in repo 1, including only those dependencies expected. @@ -3347,7 +3307,7 @@ def test_copy_erratum_and_RPMs_within_a_date_range(): 5. Copy filtered list of items from repo 1 to repo 2 6. Repeat using errata in place of RPMs - :Steps: + :steps: Assert the list of packages or errata in repo 2 matches those selected and filtered in repo 1, including those dependencies expected. diff --git a/tests/foreman/cli/test_repository_set.py b/tests/foreman/cli/test_repository_set.py index 317f19e33d..092034c6dc 100644 --- a/tests/foreman/cli/test_repository_set.py +++ b/tests/foreman/cli/test_repository_set.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Repositories :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/foreman/cli/test_rhcloud_inventory.py b/tests/foreman/cli/test_rhcloud_inventory.py index cdbf63c2d2..e127f6e738 100644 --- a/tests/foreman/cli/test_rhcloud_inventory.py +++ b/tests/foreman/cli/test_rhcloud_inventory.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: System - :CaseComponent: RHCloud-Inventory :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from datetime import datetime import time @@ -41,7 +36,7 @@ def test_positive_inventory_generate_upload_cli( :customerscenario: true - :Steps: + :steps: 0. Create a VM and register to insights within org having manifest. 1. Generate and upload report for all organizations @@ -64,8 +59,6 @@ def test_positive_inventory_generate_upload_cli( :BZ: 1957129, 1895953, 1956190 :CaseAutomation: Automated - - :CaseLevel: System """ org = rhcloud_manifest_org cmd = f'organization_id={org.id} foreman-rake rh_cloud_inventory:report:generate_upload' @@ -112,7 +105,7 @@ def test_positive_inventory_recommendation_sync( :id: 361af91d-1246-4308-9cc8-66beada7d651 - :Steps: + :steps: 0. Create a VM and register to insights within org having manifest. 1. Sync insights recommendation using following foreman-rake command. @@ -123,8 +116,6 @@ def test_positive_inventory_recommendation_sync( :BZ: 1957186 :CaseAutomation: Automated - - :CaseLevel: System """ org = rhcloud_manifest_org cmd = f'organization_id={org.id} foreman-rake rh_cloud_insights:sync' @@ -156,7 +147,7 @@ def test_positive_sync_inventory_status( :id: 915ffbfd-c2e6-4296-9d69-f3f9a0e79b32 - :Steps: + :steps: 0. Create a VM and register to insights within org having manifest. 1. Sync inventory status for specific organization. @@ -168,8 +159,6 @@ def test_positive_sync_inventory_status( :BZ: 1957186 :CaseAutomation: Automated - - :CaseLevel: System """ org = rhcloud_manifest_org cmd = f'organization_id={org.id} foreman-rake rh_cloud_inventory:sync' @@ -203,7 +192,7 @@ def test_max_org_size_variable(): :id: 7dd964c3-fde8-4335-ab13-02329119d7f6 - :Steps: + :steps: 1. Register few content hosts with satellite. 2. Change value of max_org_size for testing purpose(See BZ#1962694#c2). @@ -218,8 +207,6 @@ def test_max_org_size_variable(): :BZ: 1962694 :CaseAutomation: ManualOnly - - :CaseLevel: System """ @@ -229,7 +216,7 @@ def test_satellite_inventory_slice_variable(): :id: ffbef1c7-08f3-444b-9255-2251d5594fcb - :Steps: + :steps: 1. Register few content hosts with satellite. 2. Set SATELLITE_INVENTORY_SLICE_SIZE=1 dynflow environment variable. @@ -244,8 +231,6 @@ def test_satellite_inventory_slice_variable(): :BZ: 1945661 :CaseAutomation: ManualOnly - - :CaseLevel: System """ @@ -255,7 +240,7 @@ def test_rhcloud_external_links(): :id: bc7f6354-ed3e-4ac5-939d-90bfe4177043 - :Steps: + :steps: 1. Go to Configure > Inventory upload 2. Go to Configure > Insights @@ -267,8 +252,6 @@ def test_rhcloud_external_links(): :BZ: 1975093 :CaseAutomation: ManualOnly - - :CaseLevel: System """ @@ -278,7 +261,7 @@ def test_positive_generate_all_reports_job(target_sat): :id: a9e4bfdb-6d7c-4f8c-ae57-a81442926dd8 - :Steps: + :steps: 1. Disable the Automatic Inventory upload setting. 2. Execute Foreman GenerateAllReportsJob via foreman-rake. @@ -289,8 +272,6 @@ def test_positive_generate_all_reports_job(target_sat): :customerscenario: true :CaseAutomation: Automated - - :CaseLevel: System """ try: target_sat.update_setting('allow_auto_inventory_upload', False) diff --git a/tests/foreman/cli/test_role.py b/tests/foreman/cli/test_role.py index 11474b42f1..90f12c6ce4 100644 --- a/tests/foreman/cli/test_role.py +++ b/tests/foreman/cli/test_role.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: UsersRoles :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from math import ceil from random import choice @@ -281,7 +276,6 @@ def test_system_admin_role_end_to_end(self, target_sat): 4. System Admin role should be able to create Organization admins 5. User with sys admin role should be able to edit filters on roles - :CaseLevel: System """ org = target_sat.cli_factory.make_org() location = target_sat.cli_factory.make_location() diff --git a/tests/foreman/cli/test_satellitesync.py b/tests/foreman/cli/test_satellitesync.py index bdb678e59b..dcbc284875 100644 --- a/tests/foreman/cli/test_satellitesync.py +++ b/tests/foreman/cli/test_satellitesync.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: InterSatelliteSync :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import os from time import sleep @@ -239,8 +234,6 @@ def test_positive_export_version_custom_repo( 1. Complete export succeeds, exported files are present on satellite machine. 2. Incremental export succeeds, exported files are present on satellite machine. - :CaseLevel: System - :BZ: 1944733 :customerscenario: true @@ -298,7 +291,6 @@ def test_positive_export_library_custom_repo( 1. Complete export succeeds, exported files are present on satellite machine. 2. Incremental export succeeds, exported files are present on satellite machine. - :CaseLevel: System """ # Create cv and publish cv_name = gen_string('alpha') @@ -352,7 +344,6 @@ def test_positive_export_complete_library_rh_repo( :expectedresults: 1. Repository was successfully exported, exported files are present on satellite machine - :CaseLevel: System """ # Create cv and publish cv_name = gen_string('alpha') @@ -562,8 +553,6 @@ def test_positive_export_import_cv_end_to_end( 1. CV version custom contents has been exported to directory. 2. All The exported custom contents has been imported in org/satellite. - :CaseLevel: System - :BZ: 1832858 :customerscenario: true @@ -654,8 +643,6 @@ def test_positive_export_import_default_org_view( 1. Default Organization View version custom contents has been exported. 2. All the exported custom contents has been imported in org/satellite. - :CaseLevel: System - :BZ: 1671319 :customerscenario: true @@ -753,7 +740,6 @@ def test_positive_export_import_filtered_cvv( 1. Filtered CV version custom contents has been exported to directory 2. Filtered exported custom contents has been imported in org/satellite - :CaseLevel: System """ exporting_cv_name = importing_cvv = gen_string('alpha') exporting_cv, exporting_cvv = _create_cv( @@ -846,7 +832,6 @@ def test_positive_export_import_promoted_cv( 2. Promoted CV version contents has been imported successfully. 3. The imported CV should only be published and not promoted. - :CaseLevel: System """ import_cv_name = class_export_entities['exporting_cv_name'] export_cv_id = class_export_entities['exporting_cv']['id'] @@ -932,7 +917,6 @@ def test_positive_export_import_redhat_cv( :customerscenario: true - :CaseLevel: System """ # Create cv and publish cv_name = gen_string('alpha') @@ -1728,8 +1712,6 @@ def test_positive_export_incremental_syncable_check_content( 1. Complete and incremental export succeed. 2. All files referenced in the repomd.xml files are present in the exports. - :CaseLevel: System - :BZ: 2212523 :customerscenario: true @@ -1814,7 +1796,6 @@ def test_positive_export_import_cv_incremental(self): :CaseAutomation: NotAutomated - :CaseLevel: System """ @pytest.mark.stubbed @@ -1836,7 +1817,6 @@ def test_positive_reimport_repo(self): :CaseAutomation: NotAutomated - :CaseLevel: System """ @pytest.mark.stubbed @@ -1854,7 +1834,6 @@ def test_negative_export_repo_from_future_datetime(self): :CaseAutomation: NotAutomated - :CaseLevel: System """ @pytest.mark.tier3 @@ -1886,7 +1865,6 @@ def test_positive_export_import_incremental_yum_repo( in the importing organization and content counts match. 2. Incremental export and import succeeds, content counts match the updated counts. - :CaseLevel: System """ export_cc = target_sat.cli.Repository.info({'id': function_synced_custom_repo.id})[ 'content-counts' @@ -1973,8 +1951,6 @@ def test_positive_export_import_mismatch_label( :expectedresults: 1. All exports and imports succeed. - :CaseLevel: System - :CaseImportance: Medium :BZ: 2092039 @@ -2074,8 +2050,6 @@ def test_positive_custom_cdn_with_credential( :expectedresults: 1. Repository can be enabled and synced from Upstream to Downstream Satellite. - :CaseLevel: System - :BZ: 2112098 :customerscenario: true @@ -2188,7 +2162,6 @@ def test_positive_install_package_from_imported_repos(self): :CaseAutomation: NotAutomated - :CaseLevel: System """ @@ -2296,8 +2269,6 @@ def test_positive_network_sync_rh_repo( :expectedresults: 1. Repository can be enabled and synced. - :CaseLevel: System - :BZ: 2213128 :customerscenario: true diff --git a/tests/foreman/cli/test_settings.py b/tests/foreman/cli/test_settings.py index 4923e8ec5f..fdd005e02e 100644 --- a/tests/foreman/cli/test_settings.py +++ b/tests/foreman/cli/test_settings.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Settings :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import random from time import sleep @@ -60,7 +55,6 @@ def test_positive_update_hostname_prefix_without_value(setting_update, module_ta :BZ: 1470083 :expectedresults: Error should be raised on setting empty value for discovery_prefix setting - """ with pytest.raises(CLIReturnCodeError): module_target_sat.cli.Settings.set({'name': "discovery_prefix", 'value': ""}) @@ -76,7 +70,6 @@ def test_positive_update_hostname_default_prefix(setting_update, module_target_s :parametrized: yes :expectedresults: Default set prefix should be updated with new value - """ hostname_prefix_value = gen_string('alpha') module_target_sat.cli.Settings.set({'name': "discovery_prefix", 'value': hostname_prefix_value}) @@ -128,7 +121,6 @@ def test_positive_update_login_page_footer_text(setting_update, module_target_sa :parametrized: yes :expectedresults: Parameter is updated successfully - """ login_text_value = random.choice(list(valid_data_list().values())) module_target_sat.cli.Settings.set({'name': "login_text", 'value': login_text_value}) @@ -151,7 +143,6 @@ def test_positive_update_login_page_footer_text_without_value(setting_update, mo :parametrized: yes :expectedresults: Message on login screen should be removed - """ module_target_sat.cli.Settings.set({'name': "login_text", 'value': ""}) login_text = module_target_sat.cli.Settings.list({'search': 'name=login_text'})[0] @@ -465,8 +456,6 @@ def test_positive_failed_login_attempts_limit(setting_update, target_sat): :CaseImportance: Critical - :CaseLevel: System - :parametrized: yes :expectedresults: failed_login_attempts_limit works as expected diff --git a/tests/foreman/cli/test_sso.py b/tests/foreman/cli/test_sso.py index d70a56a139..d8b772a936 100644 --- a/tests/foreman/cli/test_sso.py +++ b/tests/foreman/cli/test_sso.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: LDAP :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/foreman/cli/test_subnet.py b/tests/foreman/cli/test_subnet.py index a08fe818df..12272ed57c 100644 --- a/tests/foreman/cli/test_subnet.py +++ b/tests/foreman/cli/test_subnet.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Networking :Team: Rocket -:TestType: Functional - :CaseImportance: Medium -:Upstream: No """ import random import re diff --git a/tests/foreman/cli/test_subscription.py b/tests/foreman/cli/test_subscription.py index f2491479e4..c6d053a465 100644 --- a/tests/foreman/cli/test_subscription.py +++ b/tests/foreman/cli/test_subscription.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: SubscriptionManagement :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string from nailgun import entities @@ -92,8 +87,6 @@ def test_positive_enable_manifest_reposet(function_entitlement_manifest_org, mod :expectedresults: you are able to enable and synchronize repository contained in a manifest - :CaseLevel: Integration - :CaseImportance: Critical """ module_target_sat.cli.Subscription.list( diff --git a/tests/foreman/cli/test_syncplan.py b/tests/foreman/cli/test_syncplan.py index b6dc18e9bc..1fdd8bf0c1 100644 --- a/tests/foreman/cli/test_syncplan.py +++ b/tests/foreman/cli/test_syncplan.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: SyncPlans :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from datetime import datetime, timedelta from time import sleep @@ -349,8 +344,6 @@ def test_positive_info_with_assigned_product(module_org, module_target_sat): :BZ: 1390545 :CaseImportance: Critical - - :CaseLevel: Integration """ prod1 = gen_string('alpha') prod2 = gen_string('alpha') @@ -384,8 +377,6 @@ def test_negative_synchronize_custom_product_past_sync_date(module_org, request, :expectedresults: Repository was not synchronized :BZ: 1279539 - - :CaseLevel: System """ new_sync_plan = target_sat.cli_factory.sync_plan( { @@ -415,8 +406,6 @@ def test_positive_synchronize_custom_product_past_sync_date(module_org, request, :expectedresults: Product is synchronized successfully. :BZ: 1279539 - - :CaseLevel: System """ interval = 60 * 60 # 'hourly' sync interval in seconds delay = 2 * 60 @@ -467,8 +456,6 @@ def test_positive_synchronize_custom_product_future_sync_date(module_org, reques :expectedresults: Product is synchronized successfully. - :CaseLevel: System - :BZ: 1655595 """ cron_multiple = 5 # sync event is on every multiple of this value, starting from 00 mins @@ -526,8 +513,6 @@ def test_positive_synchronize_custom_products_future_sync_date(module_org, reque :expectedresults: Products are synchronized successfully. - :CaseLevel: System - :BZ: 1655595 """ cron_multiple = 5 # sync event is on every multiple of this value, starting from 00 mins @@ -606,8 +591,6 @@ def test_positive_synchronize_rh_product_past_sync_date( :expectedresults: Product is synchronized successfully. :BZ: 1279539 - - :CaseLevel: System """ interval = 60 * 60 # 'hourly' sync interval in seconds delay = 2 * 60 @@ -673,8 +656,6 @@ def test_positive_synchronize_rh_product_future_sync_date( :expectedresults: Product is synchronized successfully. - :CaseLevel: System - :BZ: 1655595 """ cron_multiple = 5 # sync event is on every multiple of this value, starting from 00 mins @@ -746,8 +727,6 @@ def test_positive_synchronize_custom_product_daily_recurrence(module_org, reques :id: 8d882e8b-b5c1-4449-81c6-0efd31ad75a7 :expectedresults: Product is synchronized successfully. - - :CaseLevel: System """ delay = 2 * 60 product = target_sat.cli_factory.make_product({'organization-id': module_org.id}) @@ -797,8 +776,6 @@ def test_positive_synchronize_custom_product_weekly_recurrence(module_org, reque :expectedresults: Product is synchronized successfully. :BZ: 1396647 - - :CaseLevel: System """ delay = 2 * 60 product = target_sat.cli_factory.make_product({'organization-id': module_org.id}) diff --git a/tests/foreman/cli/test_templatesync.py b/tests/foreman/cli/test_templatesync.py index 2facc9139d..3f8472d829 100644 --- a/tests/foreman/cli/test_templatesync.py +++ b/tests/foreman/cli/test_templatesync.py @@ -4,15 +4,10 @@ :CaseAutomation: Automated -:CaseLevel: Integration - :CaseComponent: TemplatesPlugin :Team: Endeavour -:TestType: Functional - -:Upstream: No """ import base64 @@ -66,7 +61,7 @@ def test_positive_import_force_locked_template( :id: b80fbfc4-bcab-4a5d-b6c1-0e22906cd8ab - :Steps: + :steps: 1. Import some of the locked template specifying the `force` parameter `false`. 2. After ensuring the template is not updated, Import same locked template @@ -134,7 +129,7 @@ def test_positive_update_templates_in_git( :id: 5b0be026-2983-4570-bc63-d9aba36fca65 - :Steps: + :steps: 1. Repository contains file with same name as exported template. 2. Export "Atomic Kickstart default" templates to git repo. @@ -201,7 +196,7 @@ def test_positive_export_filtered_templates_to_git( :id: fd583f85-f170-4b93-b9b1-36d72f31c31f - :Steps: + :steps: 1. Export only the templates matching with regex e.g: `^atomic.*` to git repo. :expectedresults: @@ -242,7 +237,7 @@ def test_positive_export_filtered_templates_to_temp_dir(self, module_org, target :bz: 1778177 - :Steps: Export the templates matching with regex e.g: `ansible` to /tmp directory. + :steps: Export the templates matching with regex e.g: `ansible` to /tmp directory. :expectedresults: The templates are exported /tmp directory diff --git a/tests/foreman/cli/test_user.py b/tests/foreman/cli/test_user.py index b30f3d91b0..c549b9e667 100644 --- a/tests/foreman/cli/test_user.py +++ b/tests/foreman/cli/test_user.py @@ -10,17 +10,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: UsersRoles :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import datetime import random @@ -205,7 +200,6 @@ def test_positive_create_with_orgs_and_update(self, module_target_sat): :expectedresults: User is created with orgs, orgs are updated - :CaseLevel: Integration """ orgs_amount = 2 orgs = [module_target_sat.cli_factory.make_org() for _ in range(orgs_amount)] @@ -247,7 +241,6 @@ def test_positive_last_login_for_new_user(self, module_target_sat): :BZ: 1763816 - :CaseLevel: Integration """ login = gen_string('alpha') password = gen_string('alpha') @@ -280,7 +273,7 @@ def test_positive_update_all_locales(self, module_target_sat): :id: f0993495-5117-461d-a116-44867b820139 - :Steps: Update current User with all different Language options + :steps: Update current User with all different Language options :expectedresults: Current User is updated @@ -309,7 +302,6 @@ def test_positive_add_and_delete_roles(self, module_roles, module_target_sat): :expectedresults: Roles are added to user and deleted successfully - :CaseLevel: Integration """ user = module_target_sat.cli_factory.user() original_role_names = set(user['roles']) @@ -415,8 +407,6 @@ def test_personal_access_token_admin_user(self, target_sat): 1. Should show output of the api endpoint 2. When revoked, authentication error - :CaseLevel: System - :CaseImportance: High """ user = target_sat.cli_factory.user({'admin': '1'}) @@ -453,8 +443,6 @@ def test_positive_personal_access_token_user_with_role(self, target_sat): 2. When an incorrect end point is used, missing permission should be displayed. - :CaseLevel: System - :CaseImportance: High """ user = target_sat.cli_factory.user() @@ -487,8 +475,6 @@ def test_expired_personal_access_token(self, target_sat): :expectedresults: Authentication error - :CaseLevel: System - :CaseImportance: Medium """ user = target_sat.cli_factory.user() @@ -527,8 +513,6 @@ def test_custom_personal_access_token_role(self, target_sat): :expectedresults: Non admin user is able to view only the assigned entity - :CaseLevel: System - :CaseImportance: High :BZ: 1974685, 1996048 @@ -575,8 +559,6 @@ def test_negative_personal_access_token_invalid_date(self, target_sat): :expectedresults: token is not created with invalid or past expire time - :CaseLevel: System - :CaseImportance: Medium :BZ: 2231814 diff --git a/tests/foreman/cli/test_usergroup.py b/tests/foreman/cli/test_usergroup.py index 81e412de41..6ad115d96f 100644 --- a/tests/foreman/cli/test_usergroup.py +++ b/tests/foreman/cli/test_usergroup.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: UsersRoles :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import random @@ -118,8 +113,6 @@ def test_positive_add_and_remove_elements(module_target_sat): :expectedresults: Elements are added to user group and then removed successfully. - - :CaseLevel: Integration """ role = module_target_sat.cli_factory.make_role() user_group = module_target_sat.cli_factory.usergroup() @@ -165,8 +158,6 @@ def test_positive_remove_user_assigned_to_usergroup(module_target_sat): :customerscenario: true - :CaseLevel: Integration - :BZ: 1667704 """ user = module_target_sat.cli_factory.user() @@ -190,8 +181,6 @@ def test_positive_automate_bz1426957(ldap_auth_source, function_user_group, targ :customerscenario: true - :CaseLevel: Integration - :BZ: 1426957, 1667704 """ ext_user_group = target_sat.cli_factory.usergroup_external( @@ -230,8 +219,6 @@ def test_negative_automate_bz1437578(ldap_auth_source, function_user_group, modu :expectedresults: Error message as Domain Users is a special group in AD. - :CaseLevel: Integration - :BZ: 1437578 """ with pytest.raises(CLIReturnCodeError): diff --git a/tests/foreman/cli/test_vm_install_products_package.py b/tests/foreman/cli/test_vm_install_products_package.py index e71a9e8c4e..eb5a38a09f 100644 --- a/tests/foreman/cli/test_vm_install_products_package.py +++ b/tests/foreman/cli/test_vm_install_products_package.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Repositories :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from broker import Broker import pytest diff --git a/tests/foreman/cli/test_webhook.py b/tests/foreman/cli/test_webhook.py index 516df792b6..2849b6aa57 100644 --- a/tests/foreman/cli/test_webhook.py +++ b/tests/foreman/cli/test_webhook.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: HooksandWebhooks :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from functools import partial from random import choice diff --git a/tests/foreman/destructive/conftest.py b/tests/foreman/destructive/conftest.py index 190bc2cabe..c80a2b6d28 100644 --- a/tests/foreman/destructive/conftest.py +++ b/tests/foreman/destructive/conftest.py @@ -20,7 +20,6 @@ def test_foo(session): with session: # your ui test steps here session.architecture.create({'name': 'bar'}) - """ with module_target_sat.ui_session(test_name, ui_user.login, ui_user.password) as session: yield session diff --git a/tests/foreman/destructive/test_ansible.py b/tests/foreman/destructive/test_ansible.py index 34e7985ec8..0ff8fc67a1 100644 --- a/tests/foreman/destructive/test_ansible.py +++ b/tests/foreman/destructive/test_ansible.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Ansible :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -30,7 +25,7 @@ def test_positive_persistent_ansible_cfg_change(target_sat): :customerscenario: true - :Steps: + :steps: 1. Update value in ansible.cfg. 2. Verify value is updated in the file. 3. Run "satellite-installer". @@ -53,7 +48,7 @@ def test_positive_import_all_roles(target_sat): :id: 53fe3857-a08f-493d-93c7-3fed331ed391 - :Steps: + :steps: 1. Navigate to the Configure > Roles page. 2. Click the `Import from [hostname]` button. diff --git a/tests/foreman/destructive/test_auth.py b/tests/foreman/destructive/test_auth.py index 7ab8f29e2a..d97c592d05 100644 --- a/tests/foreman/destructive/test_auth.py +++ b/tests/foreman/destructive/test_auth.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Authentication :Team: Endeavour -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -38,7 +33,6 @@ def test_positive_password_reset(target_sat): :expectedresults: verify the 'foreman-rake permissions:reset' command for the admin user :CaseImportance: High - """ result = target_sat.execute('foreman-rake permissions:reset') assert result.status == 0 diff --git a/tests/foreman/destructive/test_capsule.py b/tests/foreman/destructive/test_capsule.py index 0051e062be..40935c114b 100644 --- a/tests/foreman/destructive/test_capsule.py +++ b/tests/foreman/destructive/test_capsule.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Capsule :Team: Platform -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -33,8 +28,6 @@ def test_positive_capsule_certs_generate_with_special_char(target_sat): :expectedresults: capsule-certs-generate works - :CaseLevel: Component - :BZ: 1908841 :customerscenario: true diff --git a/tests/foreman/destructive/test_capsule_loadbalancer.py b/tests/foreman/destructive/test_capsule_loadbalancer.py index 77adccd1fc..a392e0907d 100644 --- a/tests/foreman/destructive/test_capsule_loadbalancer.py +++ b/tests/foreman/destructive/test_capsule_loadbalancer.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Integration - :CaseComponent: Capsule :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest from wrapanapi import VmState @@ -183,7 +178,7 @@ def test_loadbalancer_install_package( :id: bd3c2e50-18e2-4be7-8a7f-c32472e17c61 - :Steps: + :steps: 1. run `subscription-manager register --org=Your_Organization \ --activationkey=Your_Activation_Key \` 2. Try package installation @@ -195,8 +190,7 @@ def test_loadbalancer_install_package( :expectedresults: The client should be get the package irrespective of the capsule registration. - :CaseLevel: Integration - """ + """ # Register content host result = rhel7_contenthost.register( org=module_org, @@ -255,7 +249,7 @@ def test_client_register_through_lb( :id: c7e47d61-167b-4fc2-8d1a-d9a64350fdc4 - :Steps: + :steps: 1. Setup capsules, host and loadbalancer. 2. Generate curl command for host registration. 3. Register host through loadbalancer using global registration @@ -263,8 +257,6 @@ def test_client_register_through_lb( :expectedresults: Global Registration should have option to register through loadbalancer and host should get registered successfully. - :CaseLevel: Integration - :BZ: 1963266 :customerscenario: true diff --git a/tests/foreman/destructive/test_capsulecontent.py b/tests/foreman/destructive/test_capsulecontent.py index f7a6618ad3..e746b2cc8d 100644 --- a/tests/foreman/destructive/test_capsulecontent.py +++ b/tests/foreman/destructive/test_capsulecontent.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: System - :CaseComponent: Capsule-Content :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from box import Box from fauxfactory import gen_alpha @@ -52,7 +47,6 @@ def test_positive_sync_without_deadlock( :customerscenario: true :BZ: 2062526 - """ # Note: As of now BZ#2122872 prevents us to use the originally intended RHEL7 repo because # of a memory leak causing Satellite OOM crash in this scenario. Therefore, for now we use diff --git a/tests/foreman/destructive/test_clone.py b/tests/foreman/destructive/test_clone.py index f29fd0d22c..fade8abcf6 100644 --- a/tests/foreman/destructive/test_clone.py +++ b/tests/foreman/destructive/test_clone.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: SatelliteClone :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/foreman/destructive/test_contenthost.py b/tests/foreman/destructive/test_contenthost.py index a420502ba1..bf3b0264d2 100644 --- a/tests/foreman/destructive/test_contenthost.py +++ b/tests/foreman/destructive/test_contenthost.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Hosts-Content :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -33,8 +28,6 @@ def test_content_access_after_stopped_foreman(target_sat, rhel7_contenthost): :expectedresults: Package should get installed even after foreman service is stopped - :CaseLevel: System - :CaseImportance: Medium :CaseComponent: Infrastructure diff --git a/tests/foreman/destructive/test_contentview.py b/tests/foreman/destructive/test_contentview.py index 76f91ac0f4..03af433a93 100644 --- a/tests/foreman/destructive/test_contentview.py +++ b/tests/foreman/destructive/test_contentview.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ContentViews :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from nailgun.entity_mixins import TaskFailedError import pytest diff --git a/tests/foreman/destructive/test_discoveredhost.py b/tests/foreman/destructive/test_discoveredhost.py index 4466747f2e..79645a1eb7 100644 --- a/tests/foreman/destructive/test_discoveredhost.py +++ b/tests/foreman/destructive/test_discoveredhost.py @@ -8,11 +8,6 @@ :CaseAutomation: Automated -:CaseLevel: System - -:TestType: Functional - -:Upstream: No """ from copy import copy import re @@ -210,7 +205,7 @@ def test_positive_provision_pxe_host_dhcp_change(): :Setup: Provisioning should be configured and a host should be discovered - :Steps: + :steps: 1. Set some dhcp range in dhcpd.conf in satellite. 2. Create subnet entity in satellite with a range different from whats defined in `dhcpd.conf`. diff --git a/tests/foreman/destructive/test_foreman_rake.py b/tests/foreman/destructive/test_foreman_rake.py index f655fc3787..5162fa94be 100644 --- a/tests/foreman/destructive/test_foreman_rake.py +++ b/tests/foreman/destructive/test_foreman_rake.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: System - -:TestType: Functional - :CaseImportance: Medium :CaseComponent: TasksPlugin :Team: Endeavour -:Upstream: No """ import pytest @@ -28,7 +23,7 @@ def test_positive_katello_reimport(target_sat): :id: b4119265-1bf0-4b0b-8b96-43f68af39708 - :Steps: Have satellite up and run 'foreman-rake katello:reimport' + :steps: Have satellite up and run 'foreman-rake katello:reimport' :expectedresults: Successfully reimport without errors diff --git a/tests/foreman/destructive/test_foreman_service.py b/tests/foreman/destructive/test_foreman_service.py index 7f481df311..6d0d24de11 100644 --- a/tests/foreman/destructive/test_foreman_service.py +++ b/tests/foreman/destructive/test_foreman_service.py @@ -4,13 +4,8 @@ :CaseAutomation: Automated -:CaseLevel: System - -:TestType: Functional - :CaseImportance: Medium -:Upstream: No """ import pytest @@ -29,7 +24,7 @@ def test_positive_foreman_service_auto_restart(foreman_service_teardown): :id: 766560b8-30bb-11eb-8dae-d46d6dd3b5b2 - :Steps: + :steps: 1. Stop the Foreman Service 2. Make any API call to Satellite diff --git a/tests/foreman/destructive/test_host.py b/tests/foreman/destructive/test_host.py index 65d7ebe184..bab00e5aca 100644 --- a/tests/foreman/destructive/test_host.py +++ b/tests/foreman/destructive/test_host.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Hosts :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from airgun.exceptions import NoSuchElementException import pytest @@ -41,8 +36,6 @@ def test_positive_cockpit(self, cockpit_host, class_cockpit_sat, class_org): :BZ: 1876220 - :CaseLevel: System - :steps: 1. kill the cockpit service. 2. go to web console and verify if getting 503 error. diff --git a/tests/foreman/destructive/test_infoblox.py b/tests/foreman/destructive/test_infoblox.py index 8aa92f22a8..52e26830b1 100644 --- a/tests/foreman/destructive/test_infoblox.py +++ b/tests/foreman/destructive/test_infoblox.py @@ -2,17 +2,12 @@ :Requirement: Infoblox, Installer -:CaseLevel: System - :CaseComponent: DHCPDNS :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_mac, gen_string import pytest @@ -100,7 +95,7 @@ def test_plugin_installation(target_sat, command_args, command_opts, rpm_command :id: c75aa5f3-870a-4f4a-9d7a-0a871b47fd6f - :Steps: Run installer with mininum options required to install plugins + :steps: Run installer with mininum options required to install plugins :expectedresults: Plugins install successfully diff --git a/tests/foreman/destructive/test_installer.py b/tests/foreman/destructive/test_installer.py index b06df33d96..da213102b8 100644 --- a/tests/foreman/destructive/test_installer.py +++ b/tests/foreman/destructive/test_installer.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Installer :Team: Platform -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ from fauxfactory import gen_domain, gen_string import pytest @@ -55,8 +50,6 @@ def test_installer_sat_pub_directory_accessibility(target_sat): :CaseImportance: High - :CaseLevel: System - :BZ: 1960801 :customerscenario: true diff --git a/tests/foreman/destructive/test_katello_certs_check.py b/tests/foreman/destructive/test_katello_certs_check.py index 0d0f9fd5a9..4b297f0f97 100644 --- a/tests/foreman/destructive/test_katello_certs_check.py +++ b/tests/foreman/destructive/test_katello_certs_check.py @@ -4,18 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: System - :CaseComponent: Certificates :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No - """ import re diff --git a/tests/foreman/destructive/test_ldap_authentication.py b/tests/foreman/destructive/test_ldap_authentication.py index bc35a10bd8..89f312fb99 100644 --- a/tests/foreman/destructive/test_ldap_authentication.py +++ b/tests/foreman/destructive/test_ldap_authentication.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Integration - :CaseComponent: LDAP :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import os from time import sleep @@ -224,7 +219,6 @@ def test_single_sign_on_ldap_ipa_server( :expectedresults: After single sign on user should redirected from /extlogin to /hosts page :BZ: 1941997 - """ result = target_sat.execute(f'echo {settings.ipa.password} | kinit {settings.ipa.user}') assert result.status == 0 @@ -249,7 +243,6 @@ def test_single_sign_on_ldap_ad_server( using curl. It should navigate to hosts page. (verify using url only) :BZ: 1941997 - """ # create the kerberos ticket for authentication result = target_sat.execute(f'echo {settings.ldap.password} | kinit {settings.ldap.username}') @@ -460,7 +453,6 @@ def test_user_permissions_rhsso_user_after_group_delete( :expectedresults: external rhsso user's permissions should get revoked after external rhsso group deletion. - """ default_sso_host.get_rhsso_client_id() username = settings.rhsso.rhsso_user @@ -618,7 +610,6 @@ def test_permissions_external_ldap_mapped_rhsso_group( :expectedresults: The external ldap mapped rhsso user should contain the permissions based on the user group level - """ ad_data = ad_data() login_details = { @@ -663,7 +654,6 @@ def test_negative_negotiate_login_without_ticket( :expectedresults: 1. Proper messages are returned in all cases. 2. Login and hosts listing fails without Kerberos ticket. - """ result = parametrized_enrolled_sat.cli.Auth.status() assert NO_KERB_MSG in str(result) @@ -702,7 +692,6 @@ def test_positive_negotiate_login_with_ticket( 2. Negotiate login works with the ticket. 3. External user is created and permissions enforcing works. 4. Proper messages are returned in all cases. - """ auth_type = request.node.callspec.params['parametrized_enrolled_sat'] user = ( @@ -766,7 +755,6 @@ def test_positive_negotiate_CRUD( 3. Listing and CRUD operations via hammer succeed. :BZ: 2122617 - """ auth_type = request.node.callspec.params['parametrized_enrolled_sat'] user = ( @@ -843,7 +831,6 @@ def test_positive_negotiate_logout( 1. Session is closed on log out properly on logout. 2. Hammer command fails after log out. 3. Proper messages are returned in all cases. - """ auth_type = request.node.callspec.params['parametrized_enrolled_sat'] user = ( @@ -906,7 +893,6 @@ def test_positive_autonegotiate( :expectedresults: 1. Kerberos ticket can be acquired. 2. Automatic login occurs on first hammer command, user is created - """ auth_type = request.node.callspec.params['parametrized_enrolled_sat'] user = ( @@ -966,7 +952,6 @@ def test_positive_negotiate_manual_with_autonegotiation_disabled( 1. Kerberos ticket can be acquired. 2. Manual login successful, user is created. 3. Session is kept for following Hammer commands. - """ with parametrized_enrolled_sat.omit_credentials(): auth_type = request.node.callspec.params['parametrized_enrolled_sat'] @@ -1047,7 +1032,6 @@ def test_negative_autonegotiate_with_autonegotiation_disabled( 1. Kerberos ticket can be acquired. 2. Autonegotiation doesn't occur 3. Action is denied and user not created because the user isn't authenticated. - """ with parametrized_enrolled_sat.omit_credentials(): auth_type = request.node.callspec.params['parametrized_enrolled_sat'] diff --git a/tests/foreman/destructive/test_ldapauthsource.py b/tests/foreman/destructive/test_ldapauthsource.py index 03e09384db..020aad9f71 100644 --- a/tests/foreman/destructive/test_ldapauthsource.py +++ b/tests/foreman/destructive/test_ldapauthsource.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: LDAP :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from time import sleep diff --git a/tests/foreman/destructive/test_leapp_satellite.py b/tests/foreman/destructive/test_leapp_satellite.py index f32d8bdfd1..9022b4fec8 100644 --- a/tests/foreman/destructive/test_leapp_satellite.py +++ b/tests/foreman/destructive/test_leapp_satellite.py @@ -2,17 +2,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Upgrades :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from broker import Broker import pytest diff --git a/tests/foreman/destructive/test_packages.py b/tests/foreman/destructive/test_packages.py index 4e7fb07c9a..e81eb22826 100644 --- a/tests/foreman/destructive/test_packages.py +++ b/tests/foreman/destructive/test_packages.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ForemanMaintain :Team: Platform -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ import re diff --git a/tests/foreman/destructive/test_ping.py b/tests/foreman/destructive/test_ping.py index e683a84a2b..96ae171c8f 100644 --- a/tests/foreman/destructive/test_ping.py +++ b/tests/foreman/destructive/test_ping.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Hammer :Team: Endeavour -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ import pytest diff --git a/tests/foreman/destructive/test_puppetplugin.py b/tests/foreman/destructive/test_puppetplugin.py index 3e79850a26..9bd118ac4e 100644 --- a/tests/foreman/destructive/test_puppetplugin.py +++ b/tests/foreman/destructive/test_puppetplugin.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Puppet :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/foreman/destructive/test_realm.py b/tests/foreman/destructive/test_realm.py index 6d429e483c..a4baa15e7b 100644 --- a/tests/foreman/destructive/test_realm.py +++ b/tests/foreman/destructive/test_realm.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Authentication :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import random diff --git a/tests/foreman/destructive/test_registration.py b/tests/foreman/destructive/test_registration.py index 0320f3b633..357e779c5d 100644 --- a/tests/foreman/destructive/test_registration.py +++ b/tests/foreman/destructive/test_registration.py @@ -2,8 +2,6 @@ :Requirement: Registration -:CaseLevel: Acceptance - :CaseComponent: Registration :CaseAutomation: Automated @@ -11,10 +9,6 @@ :CaseImportance: High :Team: Rocket - -:TestType: Functional - -:Upstream: No """ import pytest diff --git a/tests/foreman/destructive/test_remoteexecution.py b/tests/foreman/destructive/test_remoteexecution.py index 23cee12cff..ce19cc6bb6 100644 --- a/tests/foreman/destructive/test_remoteexecution.py +++ b/tests/foreman/destructive/test_remoteexecution.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: RemoteExecution :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string from nailgun import client diff --git a/tests/foreman/destructive/test_rename.py b/tests/foreman/destructive/test_rename.py index 493f3042c2..d5af1d6cfe 100644 --- a/tests/foreman/destructive/test_rename.py +++ b/tests/foreman/destructive/test_rename.py @@ -4,18 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: System - :CaseComponent: satellite-change-hostname :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No - """ from fauxfactory import gen_string import pytest diff --git a/tests/foreman/destructive/test_repository.py b/tests/foreman/destructive/test_repository.py index 2ff48fb13b..026134f201 100644 --- a/tests/foreman/destructive/test_repository.py +++ b/tests/foreman/destructive/test_repository.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Repositories :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from nailgun.entity_mixins import TaskFailedError import pytest diff --git a/tests/foreman/endtoend/test_api_endtoend.py b/tests/foreman/endtoend/test_api_endtoend.py index 47c28ffbef..86cebd69c6 100644 --- a/tests/foreman/endtoend/test_api_endtoend.py +++ b/tests/foreman/endtoend/test_api_endtoend.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: API :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from collections import defaultdict import http diff --git a/tests/foreman/endtoend/test_cli_endtoend.py b/tests/foreman/endtoend/test_cli_endtoend.py index 2a63dd5392..30de18bd96 100644 --- a/tests/foreman/endtoend/test_cli_endtoend.py +++ b/tests/foreman/endtoend/test_cli_endtoend.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Hammer :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_alphanumeric, gen_ipaddr import pytest diff --git a/tests/foreman/installer/test_infoblox.py b/tests/foreman/installer/test_infoblox.py index e8b77fcc67..5f839d4e85 100644 --- a/tests/foreman/installer/test_infoblox.py +++ b/tests/foreman/installer/test_infoblox.py @@ -2,19 +2,14 @@ :Requirement: Infoblox, Installer -:CaseLevel: System - :CaseAutomation: Automated :CaseComponent: DHCPDNS :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -27,13 +22,11 @@ def test_dhcp_ip_range(): :id: ba957e82-79bb-11e6-94c5-68f72889dc7f - :Steps: Provision a host with infoblox as dhcp provider + :steps: Provision a host with infoblox as dhcp provider :expectedresults: Check host ip is on infoblox range configured by option --foreman-proxy-plugin-dhcp-infoblox-use-ranges=true - :CaseLevel: System - :CaseAutomation: NotAutomated """ @@ -46,14 +39,12 @@ def test_dns_records(): :id: 007ad06e-79bc-11e6-885f-68f72889dc7f - :Steps: + :steps: 1. Provision a host with infoblox as dns provider 2. Update a DNS record on infoblox :expectedresults: Check host dns is updated accordingly to infoblox - :CaseLevel: System - :CaseAutomation: NotAutomated """ diff --git a/tests/foreman/installer/test_installer.py b/tests/foreman/installer/test_installer.py index e170973bcf..f1e0033193 100644 --- a/tests/foreman/installer/test_installer.py +++ b/tests/foreman/installer/test_installer.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Installer :Team: Platform -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ import pytest import requests @@ -1577,8 +1572,6 @@ def test_positive_selinux_foreman_module(target_sat): 1. Check "foreman-selinux" package availability on satellite. 2. Check SELinux foreman module on satellite. - :CaseLevel: System - :expectedresults: Foreman RPM and SELinux module are both present on the satellite """ rpm_result = target_sat.execute('rpm -q foreman-selinux') @@ -1623,8 +1616,6 @@ def test_positive_check_installer_hammer_ping(target_sat): :customerscenario: true :expectedresults: All services are active (running) - - :CaseLevel: System """ # check status reported by hammer ping command result = target_sat.execute('hammer ping') @@ -1692,8 +1683,6 @@ def test_satellite_installation_on_ipv6(): 4: Satellite service restart should work. 5: After system reboot all the services comes to up state. - :CaseLevel: System - :CaseAutomation: NotAutomated """ @@ -1715,8 +1704,6 @@ def test_capsule_installation_on_ipv6(): 3. Satellite service restart should work. 4. After system reboot all the services come to up state. - :CaseLevel: System - :CaseAutomation: NotAutomated """ @@ -1739,8 +1726,6 @@ def test_installer_check_on_ipv6(): 1. Tuning parameter set successfully for medium size. 2. custom-hiera.yaml related changes should be successfully applied. - :CaseLevel: System - :CaseAutomation: NotAutomated """ @@ -1766,8 +1751,6 @@ def test_installer_cap_pub_directory_accessibility(capsule_configured): :CaseImportance: High - :CaseLevel: System - :BZ: 1860519 :customerscenario: true @@ -1823,7 +1806,6 @@ def test_satellite_installation(installer_satellite): 5. redis is set as default foreman cache :CaseImportance: Critical - """ common_sat_install_assertions(installer_satellite) diff --git a/tests/foreman/longrun/test_inc_updates.py b/tests/foreman/longrun/test_inc_updates.py index 7621393632..7f916b0385 100644 --- a/tests/foreman/longrun/test_inc_updates.py +++ b/tests/foreman/longrun/test_inc_updates.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Hosts-Content :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from datetime import datetime, timedelta @@ -192,8 +187,6 @@ def test_positive_noapply_api( Content view has a newer version :parametrized: yes - - :CaseLevel: System """ # Promote CV to new LCE versions = sorted(module_cv.read().version, key=lambda ver: ver.id) diff --git a/tests/foreman/longrun/test_oscap.py b/tests/foreman/longrun/test_oscap.py index b4ef157197..be5d38f389 100644 --- a/tests/foreman/longrun/test_oscap.py +++ b/tests/foreman/longrun/test_oscap.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: SCAPPlugin :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from broker import Broker from fauxfactory import gen_string @@ -344,7 +339,7 @@ def test_positive_has_arf_report_summary_page(): :id: 25be7898-50c5-4825-adc7-978c7b4e3488 - :Steps: + :steps: 1. Make sure the oscap report with it's corresponding hostname is visible in the UI. 2. Click on the host name to access the oscap report. @@ -352,8 +347,6 @@ def test_positive_has_arf_report_summary_page(): :expectedresults: Oscap ARF reports should have summary page. :CaseAutomation: NotAutomated - - :CaseLevel: System """ @@ -364,7 +357,7 @@ def test_positive_view_full_report_button(): :id: 5a41916d-66db-4d2f-8261-b83f833189b9 - :Steps: + :steps: 1. Make sure the oscap report with it's corresponding hostname is visible in the UI. 2. Click on the host name to access the oscap report. @@ -373,8 +366,6 @@ def test_positive_view_full_report_button(): actual HTML report. :CaseAutomation: NotAutomated - - :CaseLevel: System """ @@ -386,7 +377,7 @@ def test_positive_download_xml_button(): :id: 07a5f495-a702-4ca4-b5a4-579a133f9181 - :Steps: + :steps: 1. Make sure the oscap report with it's corresponding hostname is visible in the UI. 2. Click on the host name to access the oscap report. @@ -395,8 +386,6 @@ def test_positive_download_xml_button(): the xml report. :CaseAutomation: NotAutomated - - :CaseLevel: System """ @@ -408,15 +397,13 @@ def test_positive_select_oscap_proxy(): :id: d56576c8-6fab-4af6-91c1-6a56d9cca94b - :Steps: Choose the Oscap Proxy/capsule appropriately for the host or + :steps: Choose the Oscap Proxy/capsule appropriately for the host or host-groups. :expectedresults: Should have an Oscap-Proxy select box while filling hosts and host-groups form. :CaseAutomation: NotAutomated - - :CaseLevel: System """ @@ -427,7 +414,7 @@ def test_positive_delete_multiple_arf_reports(): :id: c1a8ce02-f42f-4c48-893d-8f31432b5520 - :Steps: + :steps: 1. Run Oscap scans are run for multiple Hosts. 2. Make sure the oscap reports with it's corresponding hostnames are visible in the UI. @@ -437,8 +424,6 @@ def test_positive_delete_multiple_arf_reports(): :expectedresults: Multiple Oscap ARF reports can be deleted. :CaseAutomation: NotAutomated - - :CaseLevel: System """ @@ -452,8 +437,6 @@ def test_positive_reporting_emails_of_oscap_reports(): :expectedresults: Whether email reporting of oscap reports is possible. :CaseAutomation: NotAutomated - - :CaseLevel: System """ diff --git a/tests/foreman/maintain/test_advanced.py b/tests/foreman/maintain/test_advanced.py index 279ce48c4e..b264cb339c 100644 --- a/tests/foreman/maintain/test_advanced.py +++ b/tests/foreman/maintain/test_advanced.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ForemanMaintain :Team: Platform -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ import pytest import yaml diff --git a/tests/foreman/maintain/test_backup_restore.py b/tests/foreman/maintain/test_backup_restore.py index 6f6817730b..a845e71a16 100644 --- a/tests/foreman/maintain/test_backup_restore.py +++ b/tests/foreman/maintain/test_backup_restore.py @@ -4,17 +4,13 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ForemanMaintain :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No + """ import re diff --git a/tests/foreman/maintain/test_health.py b/tests/foreman/maintain/test_health.py index 313c2d89fe..4313c37205 100644 --- a/tests/foreman/maintain/test_health.py +++ b/tests/foreman/maintain/test_health.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ForemanMaintain :Team: Platform -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ import time diff --git a/tests/foreman/maintain/test_maintenance_mode.py b/tests/foreman/maintain/test_maintenance_mode.py index f72ac4468d..3cc340f774 100644 --- a/tests/foreman/maintain/test_maintenance_mode.py +++ b/tests/foreman/maintain/test_maintenance_mode.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ForemanMaintain :Team: Platform -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ import pytest import yaml diff --git a/tests/foreman/maintain/test_offload_DB.py b/tests/foreman/maintain/test_offload_DB.py index e9913918f9..ca0f64f87d 100644 --- a/tests/foreman/maintain/test_offload_DB.py +++ b/tests/foreman/maintain/test_offload_DB.py @@ -4,17 +4,12 @@ :CaseAutomation: ManualOnly -:CaseLevel: Integration - :CaseComponent: ForemanMaintain :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -28,12 +23,10 @@ def test_offload_internal_db_to_external_db_host(): :id: d07235c8-4584-469a-a87d-ace4dadb0a1f - :Steps: Run satellite-installer with foreman, candlepin and pulpcore options + :steps: Run satellite-installer with foreman, candlepin and pulpcore options referring to external DB host :expectedresults: Installed successful, all services running - :CaseLevel: Integration - :CaseComponent: Installer """ diff --git a/tests/foreman/maintain/test_packages.py b/tests/foreman/maintain/test_packages.py index ba288549ab..9931d14435 100644 --- a/tests/foreman/maintain/test_packages.py +++ b/tests/foreman/maintain/test_packages.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ForemanMaintain :Team: Platform -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ import pytest diff --git a/tests/foreman/maintain/test_service.py b/tests/foreman/maintain/test_service.py index b1cd9d8342..802ca684bb 100644 --- a/tests/foreman/maintain/test_service.py +++ b/tests/foreman/maintain/test_service.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ForemanMaintain :Team: Platform -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ from fauxfactory import gen_string import pytest diff --git a/tests/foreman/maintain/test_upgrade.py b/tests/foreman/maintain/test_upgrade.py index 0da2676f59..13ea31a5de 100644 --- a/tests/foreman/maintain/test_upgrade.py +++ b/tests/foreman/maintain/test_upgrade.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ForemanMaintain :Team: Platform -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ import pytest diff --git a/tests/foreman/sanity/test_bvt.py b/tests/foreman/sanity/test_bvt.py index 7fe5dc77f0..7da1ccc3d8 100644 --- a/tests/foreman/sanity/test_bvt.py +++ b/tests/foreman/sanity/test_bvt.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: BVT :Team: JPL -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ import re @@ -76,8 +71,6 @@ def test_all_interfaces_are_accessible(target_sat): :id: 0a212120-8e49-4489-a1a4-4272004e16dc :expectedresults: All three satellite interfaces are accessible - - """ errors = {} # API Interface diff --git a/tests/foreman/sys/test_dynflow.py b/tests/foreman/sys/test_dynflow.py index 5a0acaf0e5..f08f07d4f8 100644 --- a/tests/foreman/sys/test_dynflow.py +++ b/tests/foreman/sys/test_dynflow.py @@ -2,19 +2,14 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Dynflow :Team: Endeavour :Requirement: Dynflow -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/foreman/sys/test_fam.py b/tests/foreman/sys/test_fam.py index aeab1f2cc4..ebc9d15576 100644 --- a/tests/foreman/sys/test_fam.py +++ b/tests/foreman/sys/test_fam.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: System - -:TestType: Functional - :CaseImportance: High :CaseComponent: AnsibleCollection :Team: Platform -:Upstream: No """ import pytest @@ -46,7 +41,6 @@ def test_positive_ansible_modules_installation(target_sat): :expectedresults: ansible-collection-redhat-satellite package is available and supported modules are contained - """ # list installed modules result = target_sat.execute(f'ls {FAM_MODULE_PATH} | grep .py$ | sed "s/.[^.]*$//"') @@ -72,7 +66,6 @@ def test_positive_import_run_roles(sync_roles, target_sat): :id: d3379fd3-b847-43ce-a51f-c02170e7b267 :expectedresults: fam roles import and run successfully - """ roles = sync_roles.get('roles') target_sat.cli.Host.ansible_roles_assign({'ansible-roles': roles, 'name': target_sat.hostname}) diff --git a/tests/foreman/sys/test_katello_certs_check.py b/tests/foreman/sys/test_katello_certs_check.py index 3ce28168e4..5bfeed3eee 100644 --- a/tests/foreman/sys/test_katello_certs_check.py +++ b/tests/foreman/sys/test_katello_certs_check.py @@ -4,18 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: System - :CaseComponent: Certificates :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No - """ import re diff --git a/tests/foreman/sys/test_pulp3_filesystem.py b/tests/foreman/sys/test_pulp3_filesystem.py index 1e868cd691..af19af65f9 100644 --- a/tests/foreman/sys/test_pulp3_filesystem.py +++ b/tests/foreman/sys/test_pulp3_filesystem.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: System - :CaseComponent: Pulp :team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from datetime import datetime import json diff --git a/tests/foreman/ui/test_acs.py b/tests/foreman/ui/test_acs.py index b6daa63f50..726a60c9cc 100644 --- a/tests/foreman/ui/test_acs.py +++ b/tests/foreman/ui/test_acs.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: AlternateContentSources :Team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/foreman/ui/test_activationkey.py b/tests/foreman/ui/test_activationkey.py index b0d1e52de2..dd2d77f579 100644 --- a/tests/foreman/ui/test_activationkey.py +++ b/tests/foreman/ui/test_activationkey.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: ActivationKeys :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import random @@ -40,8 +35,6 @@ def test_positive_end_to_end_crud(session, module_org): :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ name = gen_string('alpha') @@ -91,8 +84,6 @@ def test_positive_end_to_end_register( :expectedresults: Content host was registered successfully using activation key, association is reflected on webUI - :CaseLevel: System - :parametrized: yes :CaseImportance: High @@ -126,8 +117,6 @@ def test_positive_create_with_cv(session, module_org, cv_name, target_sat): :parametrized: yes :expectedresults: Activation key is created - - :CaseLevel: Integration """ name = gen_string('alpha') env_name = gen_string('alpha') @@ -155,8 +144,6 @@ def test_positive_search_scoped(session, module_org, target_sat): :BZ: 1259374 - :CaseLevel: Integration - :CaseImportance: High """ name = gen_string('alpha') @@ -190,8 +177,6 @@ def test_positive_create_with_host_collection(session, module_org): :id: 0e4ad2b4-47a7-4087-828f-2b0535a97b69 :expectedresults: Activation key is created - - :CaseLevel: Integration """ name = gen_string('alpha') hc = entities.HostCollection(organization=module_org).create() @@ -211,8 +196,6 @@ def test_positive_create_with_envs(session, module_org, target_sat): :id: f75e994a-6da1-40a3-9685-f8387388b3f0 :expectedresults: Activation key is created - - :CaseLevel: Integration """ name = gen_string('alpha') cv_name = gen_string('alpha') @@ -241,8 +224,6 @@ def test_positive_add_host_collection_non_admin(module_org, test_name, target_sa listed :BZ: 1473212 - - :CaseLevel: Integration """ ak_name = gen_string('alpha') hc = entities.HostCollection(organization=module_org).create() @@ -277,8 +258,6 @@ def test_positive_remove_host_collection_non_admin(module_org, test_name, target :expectedresults: Activation key is created, removed host collection is not listed - - :CaseLevel: Integration """ ak_name = gen_string('alpha') hc = entities.HostCollection(organization=module_org).create() @@ -314,8 +293,6 @@ def test_positive_delete_with_env(session, module_org, target_sat): :id: b6019881-3d6e-4b75-89f5-1b62aff3b1ca :expectedresults: Activation key is deleted - - :CaseLevel: Integration """ name = gen_string('alpha') cv_name = gen_string('alpha') @@ -338,8 +315,6 @@ def test_positive_delete_with_cv(session, module_org, target_sat): :id: 7e40e1ed-8314-406b-9451-05f64806a6e6 :expectedresults: Activation key is deleted - - :CaseLevel: Integration """ name = gen_string('alpha') cv_name = gen_string('alpha') @@ -364,8 +339,6 @@ def test_positive_update_env(session, module_org, target_sat): :id: 895cda6a-bb1e-4b94-a858-95f0be78a17b :expectedresults: Activation key is updated - - :CaseLevel: Integration """ name = gen_string('alpha') cv_name = gen_string('alpha') @@ -395,14 +368,12 @@ def test_positive_update_cv(session, module_org, cv2_name, target_sat): :parametrized: yes - :Steps: + :steps: 1. Create Activation key 2. Update the Content view with another Content view which has custom products :expectedresults: Activation key is updated - - :CaseLevel: Integration """ name = gen_string('alpha') env1_name = gen_string('alpha') @@ -434,15 +405,13 @@ def test_positive_update_rh_product(function_entitlement_manifest_org, session, :id: 9b0ac209-45de-4cc4-97e8-e191f3f37239 - :Steps: + :steps: 1. Create an activation key 2. Update the content view with another content view which has RH products :expectedresults: Activation key is updated - - :CaseLevel: Integration """ name = gen_string('alpha') env1_name = gen_string('alpha') @@ -491,8 +460,6 @@ def test_positive_add_rh_product(function_entitlement_manifest_org, session, tar :id: d805341b-6d2f-4e16-8cb4-902de00b9a6c :expectedresults: RH products are successfully associated to Activation key - - :CaseLevel: Integration """ name = gen_string('alpha') cv_name = gen_string('alpha') @@ -528,8 +495,6 @@ def test_positive_add_custom_product(session, module_org, target_sat): :expectedresults: Custom products are successfully associated to Activation key - - :CaseLevel: Integration """ name = gen_string('alpha') cv_name = gen_string('alpha') @@ -561,15 +526,13 @@ def test_positive_add_rh_and_custom_products( :id: 3d8876fa-1412-47ca-a7a4-bce2e8baf3bc - :Steps: + :steps: 1. Create Activation key 2. Associate RH product(s) to Activation Key 3. Associate custom product(s) to Activation Key :expectedresults: RH/Custom product is successfully associated to Activation key - - :CaseLevel: Integration """ name = gen_string('alpha') rh_repo = { @@ -626,8 +589,6 @@ def test_positive_fetch_product_content(target_sat, function_entitlement_manifes assigned as Activation Key's product content :BZ: 1426386, 1432285 - - :CaseLevel: Integration """ org = function_entitlement_manifest_org rh_repo_id = target_sat.api_factory.enable_rhrepo_and_fetchid( @@ -675,8 +636,6 @@ def test_positive_access_non_admin_user(session, test_name): admin user :BZ: 1463813 - - :CaseLevel: Integration """ ak_name = gen_string('alpha') non_searchable_ak_name = gen_string('alpha') @@ -787,8 +746,6 @@ def test_positive_add_docker_repo_cv(session, module_org): :expectedresults: Content view with docker repo can be added to activation key - - :CaseLevel: Integration """ lce = entities.LifecycleEnvironment(organization=module_org).create() repo = entities.Repository( @@ -823,8 +780,6 @@ def test_positive_add_docker_repo_ccv(session, module_org): :expectedresults: Docker-based content view can be added to activation key - - :CaseLevel: Integration """ lce = entities.LifecycleEnvironment(organization=module_org).create() repo = entities.Repository( @@ -861,7 +816,7 @@ def test_positive_add_host(session, module_org, rhel6_contenthost, target_sat): :id: 886e9ea5-d917-40e0-a3b1-41254c4bf5bf - :Steps: + :steps: 1. Create Activation key 2. Create different hosts 3. Associate the hosts to Activation key @@ -869,8 +824,6 @@ def test_positive_add_host(session, module_org, rhel6_contenthost, target_sat): :expectedresults: Hosts are successfully associated to Activation key :parametrized: yes - - :CaseLevel: System """ ak = entities.ActivationKey( environment=entities.LifecycleEnvironment( @@ -897,7 +850,7 @@ def test_positive_delete_with_system(session, rhel6_contenthost, target_sat): :id: 86cd070e-cf46-4bb1-b555-e7cb42e4dc9f - :Steps: + :steps: 1. Create an Activation key 2. Register systems to it 3. Delete the Activation key @@ -905,8 +858,6 @@ def test_positive_delete_with_system(session, rhel6_contenthost, target_sat): :expectedresults: Activation key is deleted :parametrized: yes - - :CaseLevel: System """ name = gen_string('alpha') cv_name = gen_string('alpha') @@ -939,7 +890,7 @@ def test_negative_usage_limit(session, module_org, target_sat): :id: 9fe2d661-66f8-46a4-ae3f-0a9329494bdd - :Steps: + :steps: 1. Create Activation key 2. Update Usage Limit to a finite number 3. Register Systems to match the Usage Limit @@ -947,8 +898,6 @@ def test_negative_usage_limit(session, module_org, target_sat): Limit :expectedresults: System Registration fails. Appropriate error shown - - :CaseLevel: System """ name = gen_string('alpha') hosts_limit = '1' @@ -982,8 +931,6 @@ def test_positive_add_multiple_aks_to_system(session, module_org, rhel6_contenth :expectedresults: Multiple Activation keys are attached to a system :parametrized: yes - - :CaseLevel: System """ key_1_name = gen_string('alpha') key_2_name = gen_string('alpha') @@ -1046,8 +993,6 @@ def test_positive_host_associations(session, target_sat): :customerscenario: true :BZ: 1344033, 1372826, 1394388 - - :CaseLevel: System """ org = entities.Organization().create() org_entities = target_sat.cli_factory.setup_org_for_a_custom_repo( @@ -1110,8 +1055,6 @@ def test_positive_service_level_subscription_with_custom_product( :BZ: 1394357 :parametrized: yes - - :CaseLevel: System """ org = function_entitlement_manifest_org entities_ids = target_sat.cli_factory.setup_org_for_a_custom_repo( @@ -1155,15 +1098,13 @@ def test_positive_delete_manifest(session, function_entitlement_manifest_org): :id: 512d8e41-b937-451e-a9c6-840457d3d7d4 - :Steps: + :steps: 1. Create Activation key 2. Associate a manifest to the Activation Key 3. Delete the manifest :expectedresults: Deleting a manifest removes it from the Activation key - - :CaseLevel: Integration """ org = function_entitlement_manifest_org # Create activation key @@ -1202,7 +1143,7 @@ def test_positive_ak_with_custom_product_on_rhel6(session, rhel6_contenthost, ta :customerscenario: true - :Steps: + :steps: 1. Create a custom repo 2. Create ak and add custom repo to ak 3. Add subscriptions to the ak @@ -1211,8 +1152,6 @@ def test_positive_ak_with_custom_product_on_rhel6(session, rhel6_contenthost, ta :expectedresults: Host is registered successfully :bz: 2038388 - - :CaseLevel: Integration """ org = target_sat.api.Organization().create() entities_ids = target_sat.cli_factory.setup_org_for_a_custom_repo( diff --git a/tests/foreman/ui/test_ansible.py b/tests/foreman/ui/test_ansible.py index 378552b5dc..a7a2ed28c0 100644 --- a/tests/foreman/ui/test_ansible.py +++ b/tests/foreman/ui/test_ansible.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Ansible :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -29,7 +24,7 @@ def test_positive_create_and_delete_variable(target_sat): :id: 7006d7c7-788a-4447-a564-d6b03ec06aaf - :Steps: + :steps: 1. Import Ansible roles if none have been imported yet. 2. Create an Ansible variable with only a name and an assigned Ansible role. @@ -61,7 +56,7 @@ def test_positive_create_variable_with_overrides(target_sat): :id: 90acea37-4c2f-42e5-92a6-0c88148f4fb6 - :Steps: + :steps: 1. Import Ansible roles if none have been imported yet. 2. Create an Anible variable, populating all fields on the creation form. @@ -167,7 +162,7 @@ def test_positive_ansible_custom_role(target_sat, session, module_org, rhel_cont :customerscenario: true - :Steps: + :steps: 1. Register a content host with satellite 2. Create a custom role and import into satellite 3. Assign that role to a host @@ -249,9 +244,7 @@ def test_positive_host_role_information(target_sat, function_host): :id: 7da913ef-3b43-4bfa-9a45-d895431c8b56 - :CaseLevel: System - - :Steps: + :steps: 1. Register a RHEL host to Satellite. 2. Import all roles available by default. 3. Assign one role to the RHEL host. @@ -259,7 +252,6 @@ def test_positive_host_role_information(target_sat, function_host): 5. Select the 'Ansible' tab, then the 'Inventory' sub-tab. :expectedresults: Roles assigned directly to the Host are visible on the subtab. - """ SELECTED_ROLE = 'RedHatInsights.insights-client' @@ -289,9 +281,7 @@ def test_positive_role_variable_information(self): :id: 4ab2813a-6b83-4907-b104-0473465814f5 - :CaseLevel: System - - :Steps: + :steps: 1. Register a RHEL host to Satellite. 2. Import all roles available by default. 3. Create a host group and assign one of the Ansible roles to the host group. @@ -303,7 +293,6 @@ def test_positive_role_variable_information(self): 9. Select the 'Ansible' tab, then the 'Variables' sub-tab. :expectedresults: The variables information for the given Host is visible. - """ @@ -314,9 +303,7 @@ def test_positive_assign_role_in_new_ui(self): :id: 044f38b4-cff2-4ddc-b93c-7e9f2826d00d - :CaseLevel: System - - :Steps: + :steps: 1. Register a RHEL host to Satellite. 2. Import all roles available by default. 3. Navigate to the new UI for the given Host. @@ -325,7 +312,6 @@ def test_positive_assign_role_in_new_ui(self): 6. Using the popup, assign a role to the Host. :expectedresults: The Role is successfully assigned to the Host, and shows up on the UI - """ @@ -336,9 +322,7 @@ def test_positive_remove_role_in_new_ui(self): :id: d6de5130-45f6-4349-b490-fbde2aed082c - :CaseLevel: System - - :Steps: + :steps: 1. Register a RHEL host to Satellite. 2. Import all roles available by default. 3. Assign a role to the host. @@ -349,5 +333,4 @@ def test_positive_remove_role_in_new_ui(self): :expectedresults: The Role is successfully removed from the Host, and no longer shows up on the UI - """ diff --git a/tests/foreman/ui/test_architecture.py b/tests/foreman/ui/test_architecture.py index bafaa89f78..045d7f06cc 100644 --- a/tests/foreman/ui/test_architecture.py +++ b/tests/foreman/ui/test_architecture.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Hosts :Team: Endeavour -:TestType: Functional - :CaseImportance: Low -:Upstream: No """ from fauxfactory import gen_string from nailgun import entities @@ -30,8 +25,6 @@ def test_positive_end_to_end(session): :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ name = gen_string('alpha') diff --git a/tests/foreman/ui/test_audit.py b/tests/foreman/ui/test_audit.py index 822f7bcb1b..5f6b87780d 100644 --- a/tests/foreman/ui/test_audit.py +++ b/tests/foreman/ui/test_audit.py @@ -4,15 +4,10 @@ :CaseAutomation: Automated -:CaseLevel: Medium - :CaseComponent: AuditLog :Team: Endeavour -:TestType: Functional - -:Upstream: No """ from fauxfactory import gen_string from nailgun import entities @@ -40,8 +35,6 @@ def test_positive_create_event(session, module_org, module_location): :CaseAutomation: Automated - :CaseLevel: Integration - :CaseImportance: Medium :BZ: 1730360 @@ -87,8 +80,6 @@ def test_positive_audit_comment(session, module_org): :CaseAutomation: Automated - :CaseLevel: Component - :CaseImportance: Low """ name = gen_string('alpha') @@ -122,8 +113,6 @@ def test_positive_update_event(session, module_org): :CaseAutomation: Automated - :CaseLevel: Integration - :CaseImportance: Medium :bz: 2222890 @@ -156,8 +145,6 @@ def test_positive_delete_event(session, module_org): :CaseAutomation: Automated - :CaseLevel: Component - :CaseImportance: Medium """ architecture = entities.Architecture().create() @@ -183,8 +170,6 @@ def test_positive_add_event(session, module_org): :CaseAutomation: Automated - :CaseLevel: Integration - :CaseImportance: Medium """ cv = entities.ContentView(organization=module_org).create() diff --git a/tests/foreman/ui/test_bookmarks.py b/tests/foreman/ui/test_bookmarks.py index 180a0bf205..94e10d4f91 100644 --- a/tests/foreman/ui/test_bookmarks.py +++ b/tests/foreman/ui/test_bookmarks.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Search :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from airgun.exceptions import NoSuchElementException from airgun.session import Session @@ -71,8 +66,6 @@ def test_positive_end_to_end(session, ui_entity): :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ name = gen_string('alpha') @@ -105,7 +98,7 @@ def test_positive_create_bookmark_public(session, ui_entity, default_viewer_role :Setup: Create a non-admin user with 'viewer' role - :Steps: + :steps: 1. Navigate to the entity page 2. Choose "bookmark this search" from the search drop-down menu @@ -120,8 +113,6 @@ def test_positive_create_bookmark_public(session, ui_entity, default_viewer_role :expectedresults: No errors, public bookmarks is displayed for all users, non-public bookmark is displayed for creator but not for different user - - :CaseLevel: Integration """ public_name = gen_string('alphanumeric') nonpublic_name = gen_string('alphanumeric') @@ -151,7 +142,7 @@ def test_positive_update_bookmark_public( public and one private 2. Create a non-admin user with 'viewer' role - :Steps: + :steps: 1. Login to Satellite server (establish a UI session) as the pre-created user @@ -177,8 +168,6 @@ def test_positive_update_bookmark_public( :expectedresults: New public bookmark is listed, and the private one is hidden - :CaseLevel: Integration - :BZ: 2141187 :customerscenario: true @@ -222,15 +211,13 @@ def test_negative_delete_bookmark(ui_entity, default_viewer_role, test_name): 2. Create a non-admin user without destroy_bookmark role (e.g. viewer) - :Steps: + :steps: 1. Login to Satellite server (establish a UI session) as a non-admin user 2. List the bookmarks (Navigate to Administer -> Bookmarks) :expectedresults: The delete buttons are not displayed - - :CaseLevel: Integration """ bookmark = entities.Bookmark(controller=ui_entity['controller'], public=True).create() with Session( @@ -252,15 +239,13 @@ def test_negative_create_with_duplicate_name(session, ui_entity): 1. Create a bookmark of a random name with random query. - :Steps: + :steps: 1. Create new bookmark with duplicate name. :expectedresults: Bookmark can't be created, submit button is disabled :BZ: 1920566, 1992652 - - :CaseLevel: Integration """ query = gen_string('alphanumeric') bookmark = entities.Bookmark(controller=ui_entity['controller'], public=True).create() diff --git a/tests/foreman/ui/test_branding.py b/tests/foreman/ui/test_branding.py index 3067614e02..a7e08659d8 100644 --- a/tests/foreman/ui/test_branding.py +++ b/tests/foreman/ui/test_branding.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Branding :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from airgun.session import Session import pytest @@ -27,14 +22,12 @@ def test_verify_satellite_login_screen_info(target_sat): :id: f48110ad-29b4-49b1-972a-a70075a05732 - :Steps: Get the info from the login screen + :steps: Get the info from the login screen :expectedresults: 1. Correct Satellite version 2. If 'Beta' is present, should fail until a GA snap is received - :CaseLevel: System - :BZ: 1315849, 1367495, 1372436, 1502098, 1540710, 1582476, 1724738, 1959135, 2076979, 1687250, 1686540, 1742872, 1805642, 2105949 """ diff --git a/tests/foreman/ui/test_capsulecontent.py b/tests/foreman/ui/test_capsulecontent.py index 6d1f30bd95..55000ae73a 100644 --- a/tests/foreman/ui/test_capsulecontent.py +++ b/tests/foreman/ui/test_capsulecontent.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: System - :CaseComponent: Capsule-Content :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/foreman/ui/test_computeprofiles.py b/tests/foreman/ui/test_computeprofiles.py index 5aea38df2c..31075e7c1f 100644 --- a/tests/foreman/ui/test_computeprofiles.py +++ b/tests/foreman/ui/test_computeprofiles.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: ComputeResources :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string from nailgun import entities @@ -30,8 +25,6 @@ def test_positive_end_to_end(session, module_location, module_org): :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ name = gen_string('alpha') diff --git a/tests/foreman/ui/test_computeresource.py b/tests/foreman/ui/test_computeresource.py index 000f95951f..7bd9f2552c 100644 --- a/tests/foreman/ui/test_computeresource.py +++ b/tests/foreman/ui/test_computeresource.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Integration - :CaseComponent: ComputeResources :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from nailgun import entities import pytest @@ -62,8 +57,6 @@ def test_positive_end_to_end(session, rhev_data, module_org, module_location): :expectedresults: All expected CRUD actions finished successfully. - :CaseLevel: Integration - :CaseImportance: Critical """ name = gen_string('alpha') @@ -105,8 +98,6 @@ def test_positive_add_resource(session, rhev_data): :expectedresults: resource created successfully - :CaseLevel: Integration - :CaseImportance: Critical """ # Our RHEV testing uses custom cert which we specify manually. @@ -138,8 +129,6 @@ def test_positive_edit_resource_description(session, rhev_data): :parametrized: yes :expectedresults: resource updated successfully and has new description - - :CaseLevel: Integration """ name = gen_string('alpha') description = gen_string('alpha') @@ -173,8 +162,6 @@ def test_positive_list_resource_vms(session, rhev_data): :parametrized: yes :expectedresults: VMs listed for provided compute resource - - :CaseLevel: Integration """ name = gen_string('alpha') with session: @@ -205,8 +192,6 @@ def test_positive_resource_vm_power_management(session, rhev_data): :expectedresults: virtual machine is powered on or powered off depending on its initial state - - :CaseLevel: Integration """ name = gen_string('alpha') with session: @@ -249,8 +234,6 @@ def test_positive_VM_import(session, module_org, module_location, rhev_data): :expectedresults: VM is shown as Host in Foreman - :CaseLevel: Integration - :CaseImportance: Medium :BZ: 1636067 @@ -381,8 +364,6 @@ def test_positive_image_end_to_end(session, rhev_data, module_location, target_s :expectedresults: All expected CRUD actions finished successfully. - :CaseLevel: Integration - :CaseImportance: High """ cr_name = gen_string('alpha') diff --git a/tests/foreman/ui/test_computeresource_azurerm.py b/tests/foreman/ui/test_computeresource_azurerm.py index aab0bdf6c5..36228513ff 100644 --- a/tests/foreman/ui/test_computeresource_azurerm.py +++ b/tests/foreman/ui/test_computeresource_azurerm.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ComputeResources-Azure :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -91,7 +86,6 @@ def test_positive_end_to_end_azurerm_ft_host_provision( sat_azure_loc, module_azure_hg, ): - """Provision Host with hostgroup and Compute-profile using finish template on AzureRm compute resource @@ -101,8 +95,6 @@ def test_positive_end_to_end_azurerm_ft_host_provision( 1. Host is provisioned. 2. Host is deleted Successfully. - :CaseLevel: System - :BZ: 1850934 """ hostname = f'test-{gen_string("alpha")}' @@ -175,7 +167,6 @@ def test_positive_azurerm_host_provision_ud( sat_azure_loc, module_azure_hg, ): - """Provision a Host with hostgroup and Compute-profile using cloud-init image on AzureRm compute resource @@ -185,8 +176,6 @@ def test_positive_azurerm_host_provision_ud( :CaseImportance: Critical - :CaseLevel: System - :BZ: 1850934 """ diff --git a/tests/foreman/ui/test_computeresource_ec2.py b/tests/foreman/ui/test_computeresource_ec2.py index 94c50f6954..8f575bd4a8 100644 --- a/tests/foreman/ui/test_computeresource_ec2.py +++ b/tests/foreman/ui/test_computeresource_ec2.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: ComputeResources-EC2 :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string from nailgun import entities @@ -55,7 +50,7 @@ def test_positive_default_end_to_end_with_custom_profile( :id: 33f80a8f-2ecf-4f15-b0c3-aab5fe0ac8d3 - :Steps: + :steps: 1. Create an EC2 compute resource with default properties and taxonomies. 2. Update the compute resource name and add new taxonomies. @@ -65,8 +60,6 @@ def test_positive_default_end_to_end_with_custom_profile( :expectedresults: The EC2 compute resource is created, updated, compute profile associated and deleted. - :CaseLevel: Integration - :BZ: 1451626, 2032530 :CaseImportance: High @@ -163,8 +156,6 @@ def test_positive_create_ec2_with_custom_region(session, module_ec2_settings): :BZ: 1456942 - :CaseLevel: Integration - :CaseImportance: Critical """ cr_name = gen_string('alpha') diff --git a/tests/foreman/ui/test_computeresource_gce.py b/tests/foreman/ui/test_computeresource_gce.py index c4618bfb60..73f4fb11da 100644 --- a/tests/foreman/ui/test_computeresource_gce.py +++ b/tests/foreman/ui/test_computeresource_gce.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: ComputeResources-GCE :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import json import random @@ -43,7 +38,7 @@ def test_positive_default_end_to_end_with_custom_profile( :id: 59ffd83e-a984-4c22-b91b-cad055b4fbd7 - :Steps: + :steps: 1. Create an GCE compute resource with default properties. 2. Update the compute resource name and add new taxonomies. @@ -53,8 +48,6 @@ def test_positive_default_end_to_end_with_custom_profile( :expectedresults: The GCE compute resource is created, updated, compute profile associated and deleted. - :CaseLevel: Integration - :CaseImportance: Critical """ cr_name = gen_string('alpha') @@ -167,8 +160,6 @@ def test_positive_gce_provision_end_to_end( :id: 8d1877bb-fbc2-4969-a13e-e95e4df4f4cd :expectedresults: Host is provisioned successfully - - :CaseLevel: System """ name = f'test{gen_string("alpha", 4).lower()}' hostname = f'{name}.{gce_domain.name}' @@ -253,8 +244,6 @@ def test_positive_gce_cloudinit_provision_end_to_end( :id: 6ee63ec6-2e8e-4ed6-ae48-e68b078233c6 :expectedresults: Host is provisioned successfully - - :CaseLevel: System """ name = f'test{gen_string("alpha", 4).lower()}' hostname = f'{name}.{gce_domain.name}' diff --git a/tests/foreman/ui/test_computeresource_libvirt.py b/tests/foreman/ui/test_computeresource_libvirt.py index 2d05fa45bf..6938edd2fb 100644 --- a/tests/foreman/ui/test_computeresource_libvirt.py +++ b/tests/foreman/ui/test_computeresource_libvirt.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: ComputeResources-libvirt :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from random import choice @@ -44,8 +39,6 @@ def test_positive_end_to_end(session, module_target_sat, module_org, module_loca :expectedresults: All expected CRUD actions finished successfully. - :CaseLevel: Integration - :CaseImportance: High :BZ: 1662164 @@ -144,8 +137,6 @@ def test_positive_provision_end_to_end( :expectedresults: Host is provisioned successfully - :CaseLevel: System - :customerscenario: true :BZ: 1243223, 2236693 diff --git a/tests/foreman/ui/test_computeresource_vmware.py b/tests/foreman/ui/test_computeresource_vmware.py index 34d0127e98..f8a7ac9776 100644 --- a/tests/foreman/ui/test_computeresource_vmware.py +++ b/tests/foreman/ui/test_computeresource_vmware.py @@ -8,13 +8,8 @@ :Team: Rocket -:CaseLevel: Acceptance - -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from math import floor, log10 from random import choice @@ -92,8 +87,6 @@ def test_positive_end_to_end(session, module_org, module_location): :id: 47fc9e77-5b22-46b4-a76c-3217434fde2f :expectedresults: All expected CRUD actions finished successfully. - - :CaseLevel: Integration """ cr_name = gen_string('alpha') new_cr_name = gen_string('alpha') @@ -172,8 +165,6 @@ def test_positive_retrieve_virtual_machine_list(session): 2. Go to "Virtual Machines" tab. :expectedresults: The Virtual machines should be displayed - - :CaseLevel: Integration """ cr_name = gen_string('alpha') vm_name = settings.vmware.vm_name @@ -202,8 +193,6 @@ def test_positive_image_end_to_end(session, target_sat): :id: 6b7949ef-c684-40aa-b181-11f8d4cd39c6 :expectedresults: All expected CRUD actions finished successfully. - - :CaseLevel: Integration """ cr_name = gen_string('alpha') image_name = gen_string('alpha') @@ -263,8 +252,6 @@ def test_positive_resource_vm_power_management(session): :id: faeabe45-5112-43a6-bde9-f869dfb26cf5 :expectedresults: virtual machine is powered on or powered off depending on its initial state - - :CaseLevel: Integration """ cr_name = gen_string('alpha') vm_name = settings.vmware.vm_name @@ -321,8 +308,6 @@ def test_positive_select_vmware_custom_profile_guest_os_rhel7(session): :expectedresults: Guest OS RHEL7 is selected successfully. :BZ: 1315277 - - :CaseLevel: Integration """ cr_name = gen_string('alpha') guest_os_name = 'Red Hat Enterprise Linux 7 (64-bit)' @@ -363,8 +348,6 @@ def test_positive_access_vmware_with_custom_profile(session): :expectedresults: The Compute Resource created and associated to compute profile (3-Large) with provided values. - - :CaseLevel: Integration """ cr_name = gen_string('alpha') data_store_summary_string = _get_vmware_datastore_summary_string() @@ -487,8 +470,6 @@ def test_positive_virt_card(session, target_sat, module_location, module_org): :expectedresults: Virtualization card appears in the new Host UI for the VM - :CaseLevel: Integration - :CaseImportance: Medium """ # create entities for hostgroup diff --git a/tests/foreman/ui/test_config_group.py b/tests/foreman/ui/test_config_group.py index ada7fc5b8c..b38384d297 100644 --- a/tests/foreman/ui/test_config_group.py +++ b/tests/foreman/ui/test_config_group.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Puppet :Team: Rocket -:TestType: Functional - :CaseImportance: Low -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -34,8 +29,6 @@ def test_positive_end_to_end(session_puppet_enabled_sat, module_puppet_class): :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ name = gen_string('alpha') diff --git a/tests/foreman/ui/test_containerimagetag.py b/tests/foreman/ui/test_containerimagetag.py index a1e68bc7e6..86fb97ebab 100644 --- a/tests/foreman/ui/test_containerimagetag.py +++ b/tests/foreman/ui/test_containerimagetag.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: ContainerManagement-Content :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from nailgun import entities import pytest @@ -60,8 +55,6 @@ def test_positive_search(session, module_org, module_product, module_repository) :expectedresults: The docker image tag can be searched and found, details are read - :CaseLevel: Integration - :BZ: 2009069, 2242515 """ with session: diff --git a/tests/foreman/ui/test_contentcredentials.py b/tests/foreman/ui/test_contentcredentials.py index d53d84618f..4fa3f51998 100644 --- a/tests/foreman/ui/test_contentcredentials.py +++ b/tests/foreman/ui/test_contentcredentials.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ContentCredentials :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -44,8 +39,6 @@ def test_positive_end_to_end(session, target_sat, module_org, gpg_content): :id: d1a8cc1b-a072-465b-887d-5bca0acd21c3 :expectedresults: All expected CRUD actions finished successfully - - :CaseLevel: Integration """ name = gen_string('alpha') new_name = gen_string('alpha') @@ -123,8 +116,6 @@ def test_positive_add_empty_product(session, target_sat, module_org, gpg_content :id: e18ae9f5-43d9-4049-92ca-1eafaca05096 :expectedresults: gpg key is associated with product - - :CaseLevel: Integration """ prod_name = gen_string('alpha') gpg_key = target_sat.api.GPGKey(content=gpg_content, organization=module_org).create() @@ -146,8 +137,6 @@ def test_positive_add_product_with_repo(session, target_sat, module_org, gpg_con :expectedresults: gpg key is associated with product as well as with the repository - - :CaseLevel: Integration """ name = gen_string('alpha') gpg_key = target_sat.api.GPGKey( @@ -181,8 +170,6 @@ def test_positive_add_product_with_repos(session, target_sat, module_org, gpg_co :id: 0edffad7-0ab4-4bef-b16b-f6c8de55b0dc :expectedresults: gpg key is properly associated with repositories - - :CaseLevel: Integration """ name = gen_string('alpha') gpg_key = target_sat.api.GPGKey( @@ -211,8 +198,6 @@ def test_positive_add_repo_from_product_with_repo(session, target_sat, module_or :expectedresults: gpg key is associated with the repository but not with the product - - :CaseLevel: Integration """ name = gen_string('alpha') gpg_key = target_sat.api.GPGKey( @@ -244,8 +229,6 @@ def test_positive_add_repo_from_product_with_repos(session, target_sat, module_o :expectedresults: gpg key is associated with one of the repositories but not with the product - - :CaseLevel: Integration """ name = gen_string('alpha') gpg_key = target_sat.api.GPGKey( @@ -280,8 +263,6 @@ def test_positive_add_product_using_repo_discovery(session, gpg_path): the repositories :BZ: 1210180, 1461804, 1595792 - - :CaseLevel: Integration """ name = gen_string('alpha') product_name = gen_string('alpha') @@ -327,8 +308,6 @@ def test_positive_add_product_and_search(session, target_sat, module_org, gpg_co gpg key 'Product' tab :BZ: 1411800 - - :CaseLevel: Integration """ name = gen_string('alpha') gpg_key = target_sat.api.GPGKey( @@ -364,8 +343,6 @@ def test_positive_update_key_for_product_using_repo_discovery(session, gpg_path) repository before/after update :BZ: 1210180, 1461804 - - :CaseLevel: Integration """ name = gen_string('alpha') new_name = gen_string('alpha') @@ -416,8 +393,6 @@ def test_positive_update_key_for_empty_product(session, target_sat, module_org, :expectedresults: gpg key is associated with product before/after update - - :CaseLevel: Integration """ name = gen_string('alpha') new_name = gen_string('alpha') @@ -448,8 +423,6 @@ def test_positive_update_key_for_product_with_repo(session, target_sat, module_o :expectedresults: gpg key is associated with product as well as with repository after update - - :CaseLevel: Integration """ name = gen_string('alpha') new_name = gen_string('alpha') @@ -482,8 +455,6 @@ def test_positive_update_key_for_product_with_repos(session, target_sat, module_ :expectedresults: gpg key is associated with product as well as with repositories after update - - :CaseLevel: Integration """ name = gen_string('alpha') new_name = gen_string('alpha') @@ -518,8 +489,6 @@ def test_positive_update_key_for_repo_from_product_with_repo( :expectedresults: gpg key is associated with repository after update but not with product. - - :CaseLevel: Integration """ name = gen_string('alpha') new_name = gen_string('alpha') @@ -557,8 +526,6 @@ def test_positive_update_key_for_repo_from_product_with_repos( :expectedresults: gpg key is associated with single repository after update but not with product - - :CaseLevel: Integration """ name = gen_string('alpha') new_name = gen_string('alpha') diff --git a/tests/foreman/ui/test_contenthost.py b/tests/foreman/ui/test_contenthost.py index 28ea37df06..277ff05c6c 100644 --- a/tests/foreman/ui/test_contenthost.py +++ b/tests/foreman/ui/test_contenthost.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Hosts-Content :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from datetime import datetime, timedelta import re @@ -173,8 +168,6 @@ def test_positive_end_to_end( :expectedresults: content host details are the same as expected, package and errata installation are successful - :CaseLevel: System - :parametrized: yes :CaseImportance: Critical @@ -301,8 +294,6 @@ def test_positive_end_to_end_bulk_update(session, default_location, vm, target_s :BZ: 1712069, 1838800 :parametrized: yes - - :CaseLevel: System """ hc_name = gen_string('alpha') description = gen_string('alpha') @@ -385,8 +376,6 @@ def test_positive_search_by_subscription_status(session, default_location, vm): :BZ: 1406855, 1498827, 1495271 :parametrized: yes - - :CaseLevel: System """ with session: session.location.select(default_location.name) @@ -436,8 +425,6 @@ def test_positive_toggle_subscription_status(session, default_location, vm): :BZ: 1836868 - :CaseLevel: System - :parametrized: yes :CaseImportance: Medium @@ -494,8 +481,6 @@ def test_negative_install_package(session, default_location, vm): :expectedresults: Task finished with warning :parametrized: yes - - :CaseLevel: System """ with session: session.location.select(default_location.name) @@ -531,8 +516,6 @@ def test_positive_remove_package(session, default_location, vm): :expectedresults: Package was successfully removed :parametrized: yes - - :CaseLevel: System """ vm.download_install_rpm(settings.repos.yum_6.url, FAKE_0_CUSTOM_PACKAGE) with session: @@ -570,8 +553,6 @@ def test_positive_upgrade_package(session, default_location, vm): :expectedresults: Package was successfully upgraded :parametrized: yes - - :CaseLevel: System """ vm.run(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}') with session: @@ -610,8 +591,6 @@ def test_positive_install_package_group(session, default_location, vm): :expectedresults: Package group was successfully installed :parametrized: yes - - :CaseLevel: System """ with session: session.location.select(default_location.name) @@ -651,8 +630,6 @@ def test_positive_remove_package_group(session, default_location, vm): :expectedresults: Package group was successfully removed :parametrized: yes - - :CaseLevel: System """ with session: session.location.select(default_location.name) @@ -696,8 +673,6 @@ def test_positive_search_errata_non_admin( listed :parametrized: yes - - :CaseLevel: System """ vm.run(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}') with Session( @@ -751,8 +726,6 @@ def test_positive_ensure_errata_applicability_with_host_reregistered(session, de :BZ: 1463818 :parametrized: yes - - :CaseLevel: System """ vm.run(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}') result = vm.run(f'rpm -q {FAKE_1_CUSTOM_PACKAGE}') @@ -811,8 +784,6 @@ def test_positive_host_re_registration_with_host_rename( :BZ: 1762793 :parametrized: yes - - :CaseLevel: System """ vm.run(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}') result = vm.run(f'rpm -q {FAKE_1_CUSTOM_PACKAGE}') @@ -880,8 +851,6 @@ def test_positive_check_ignore_facts_os_setting(session, default_location, vm, m :BZ: 1155704 :parametrized: yes - - :CaseLevel: System """ major = str(gen_integer(15, 99)) minor = str(gen_integer(1, 9)) @@ -950,8 +919,6 @@ def test_positive_virt_who_hypervisor_subscription_status( :BZ: 1336924, 1860928 :parametrized: yes - - :CaseLevel: System """ org = entities.Organization().create() lce = entities.LifecycleEnvironment(organization=org).create() @@ -1035,8 +1002,6 @@ def test_module_stream_actions_on_content_host(session, default_location, vm_mod :expectedresults: Remote execution for module actions should succeed. :parametrized: yes - - :CaseLevel: System """ stream_version = '5.21' run_remote_command_on_content_host('dnf -y upload-profile', vm_module_streams) @@ -1157,8 +1122,6 @@ def test_module_streams_customize_action(session, default_location, vm_module_st :expectedresults: Remote execution for module actions should be succeed. - :CaseLevel: System - :parametrized: yes :CaseImportance: Medium @@ -1225,8 +1188,6 @@ def test_install_modular_errata(session, default_location, vm_module_streams): :expectedresults: Modular Errata should get installed on content host. :parametrized: yes - - :CaseLevel: System """ stream_version = '0' module_name = 'kangaroo' @@ -1306,8 +1267,6 @@ def test_module_status_update_from_content_host_to_satellite( :expectedresults: module stream status should get updated in Satellite :parametrized: yes - - :CaseLevel: System """ module_name = 'walrus' stream_version = '0.71' @@ -1373,8 +1332,6 @@ def test_module_status_update_without_force_upload_package_profile( :expectedresults: module stream status should get updated in Satellite - :CaseLevel: System - :parametrized: yes :CaseImportance: Medium @@ -1457,8 +1414,6 @@ def test_module_stream_update_from_satellite(session, default_location, vm_modul :expectedresults: module stream should get updated. :parametrized: yes - - :CaseLevel: System """ module_name = 'duck' stream_version = '0' @@ -1535,8 +1490,6 @@ def test_syspurpose_attributes_empty(session, default_location, vm_module_stream :expectedresults: Syspurpose attrs are empty, and syspurpose status is set as 'Not specified' - :CaseLevel: System - :parametrized: yes :CaseImportance: High @@ -1577,8 +1530,6 @@ def test_set_syspurpose_attributes_cli(session, default_location, vm_module_stre :expectedresults: Syspurpose attributes set for the content host - :CaseLevel: System - :parametrized: yes :CaseImportance: High @@ -1624,8 +1575,6 @@ def test_unset_syspurpose_attributes_cli(session, default_location, vm_module_st :expectedresults: Syspurpose attributes are empty - :CaseLevel: System - :parametrized: yes :CaseImportance: High @@ -1675,8 +1624,6 @@ def test_syspurpose_matched(session, default_location, vm_module_streams): :expectedresults: Syspurpose status is Matched - :CaseLevel: System - :parametrized: yes :CaseImportance: High @@ -1718,8 +1665,6 @@ def test_syspurpose_bulk_action(session, default_location, vm): :expectedresults: Syspurpose parameters are set and reflected on the host - :CaseLevel: System - :CaseImportance: High """ syspurpose_attributes = { @@ -1764,8 +1709,6 @@ def test_syspurpose_mismatched(session, default_location, vm_module_streams): :expectedresults: Syspurpose status is 'Mismatched' - :CaseLevel: System - :parametrized: yes :CaseImportance: High @@ -1851,8 +1794,6 @@ def test_search_for_virt_who_hypervisors(session, default_location): :customerscenario: true - :CaseLevel: System - :CaseImportance: Medium """ org = entities.Organization().create() diff --git a/tests/foreman/ui/test_contentview.py b/tests/foreman/ui/test_contentview.py index 83df54ba54..625d5fb927 100644 --- a/tests/foreman/ui/test_contentview.py +++ b/tests/foreman/ui/test_contentview.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ContentViews :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -32,8 +27,6 @@ def test_positive_create_cv(session, target_sat): :expectedresults: CV is visible in the UI, and matches the given name - :CaseLevel: System - :CaseImportance: High """ cv = gen_string('alpha') @@ -55,8 +48,6 @@ def test_no_blank_page_on_language_switch(session, target_sat, module_org): :expectedresults: CV UI is visible, and isn't a blank page - :CaseLevel: System - :BZ: 2163538 :customerscenario: true diff --git a/tests/foreman/ui/test_contentview_old.py b/tests/foreman/ui/test_contentview_old.py index cfc135c3c9..e69931568f 100644 --- a/tests/foreman/ui/test_contentview_old.py +++ b/tests/foreman/ui/test_contentview_old.py @@ -7,17 +7,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: ContentViews :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import datetime from random import randint @@ -78,8 +73,6 @@ def test_positive_add_custom_content(session): :expectedresults: Custom content can be seen in a view - :CaseLevel: Integration - :CaseImportance: Critical """ org = entities.Organization().create() @@ -113,8 +106,6 @@ def test_positive_end_to_end(session, module_org, target_sat): :expectedresults: content view is created, updated with repo publish and promoted to next selected env - :CaseLevel: Integration - :CaseImportance: High """ repo_name = gen_string('alpha') @@ -150,8 +141,6 @@ def test_positive_publish_version_changes_in_source_env(session, module_org): :expectedresults: Content view version is updated in source environment. - :CaseLevel: Integration - :CaseImportance: High """ lce = entities.LifecycleEnvironment(organization=module_org).create() @@ -203,8 +192,6 @@ def test_positive_repo_count_for_composite_cv(session, module_org, target_sat): :BZ: 1431778 - :CaseLevel: Integration - :CaseImportance: High """ lce = entities.LifecycleEnvironment(organization=module_org).create() @@ -252,8 +239,6 @@ def test_positive_create_composite( :expectedresults: Composite content views are created - :CaseLevel: System - :CaseImportance: High """ org = module_entitlement_manifest_org @@ -306,8 +291,6 @@ def test_positive_add_rh_content(session, function_entitlement_manifest_org, tar :expectedresults: RH Content can be seen in a view - :CaseLevel: Integration - :CaseImportance: Critical """ cv_name = gen_string('alpha') @@ -339,8 +322,6 @@ def test_positive_add_docker_repo(session, module_org, module_prod): :expectedresults: The repo is added to a non-composite content view - :CaseLevel: Integration - :CaseImportance: High """ content_view = entities.ContentView(composite=False, organization=module_org).create() @@ -363,8 +344,6 @@ def test_positive_add_docker_repos(session, module_org, module_prod): :expectedresults: The repos are added to a non-composite content view. - :CaseLevel: Integration - :CaseImportance: Low """ content_view = entities.ContentView(composite=False, organization=module_org).create() @@ -392,8 +371,6 @@ def test_positive_add_synced_docker_repo(session, module_org, module_prod): :expectedresults: Synchronized docker repository was successfully added to content view. - :CaseLevel: Integration - :CaseImportance: High """ content_view = entities.ContentView(composite=False, organization=module_org).create() @@ -418,8 +395,6 @@ def test_positive_add_docker_repo_to_ccv(session, module_org, module_prod): :expectedresults: The repository is added to a content view which is then added to a composite content view. - :CaseLevel: Integration - :CaseImportance: High """ content_view = entities.ContentView(composite=False, organization=module_org).create() @@ -446,8 +421,6 @@ def test_positive_add_docker_repos_to_ccv(session, module_org, module_prod): :expectedresults: The repository is added to a random number of content views which are then added to a composite content view. - :CaseLevel: Integration - :CaseImportance: Low """ cvs = [] @@ -481,8 +454,6 @@ def test_positive_publish_with_docker_repo(session, module_org, module_prod): :expectedresults: The repo is added to a content view which is then successfully published. - :CaseLevel: Integration - :CaseImportance: High """ content_view = entities.ContentView(composite=False, organization=module_org).create() @@ -507,8 +478,6 @@ def test_positive_publish_with_docker_repo_composite(session, module_org, module which is then published only once and then added to a composite content view which is also published only once. - :CaseLevel: Integration - :CaseImportance: High """ repo = entities.Repository( @@ -536,8 +505,6 @@ def test_positive_publish_multiple_with_docker_repo(session, module_org, module_ :expectedresults: Content view with docker repo is successfully published multiple times. - :CaseLevel: Integration - :CaseImportance: Low """ repo = entities.Repository( @@ -561,8 +528,6 @@ def test_positive_publish_multiple_with_docker_repo_composite(session, module_or :expectedresults: Composite content view with docker repo is successfully published multiple times. - :CaseLevel: Integration - :CaseImportance: Low """ repo = entities.Repository( @@ -590,8 +555,6 @@ def test_positive_promote_with_docker_repo(session, module_org, module_prod): :expectedresults: Docker repository is promoted to content view found in the specific lifecycle-environment. - :CaseLevel: Integration - :CaseImportance: High """ lce = entities.LifecycleEnvironment(organization=module_org).create() @@ -618,8 +581,6 @@ def test_positive_promote_multiple_with_docker_repo(session, module_org, module_ :expectedresults: Docker repository is promoted to content view found in the specific lifecycle-environments. - :CaseLevel: Integration - :CaseImportance: Low """ repo = entities.Repository( @@ -647,8 +608,6 @@ def test_positive_promote_with_docker_repo_composite(session, module_org, module :expectedresults: Docker repository is promoted to content view found in the specific lifecycle-environment. - :CaseLevel: Integration - :CaseImportance: High """ lce = entities.LifecycleEnvironment(organization=module_org).create() @@ -681,8 +640,6 @@ def test_positive_promote_multiple_with_docker_repo_composite(session, module_or :expectedresults: Docker repository is promoted to content view found in the specific lifecycle-environments. - :CaseLevel: Integration - :CaseImportance: Low """ repo = entities.Repository( @@ -713,8 +670,6 @@ def test_negative_add_components_to_non_composite(session): :expectedresults: User cannot add components to the view - :CaseLevel: Integration - :CaseImportance: Low """ cv1_name = gen_string('alpha') @@ -743,8 +698,6 @@ def test_positive_add_unpublished_cv_to_composite(session): :expectedresults: Non-composite content view is added to composite one - :CaseLevel: Integration - :CaseImportance: Low :BZ: 1367123 @@ -787,8 +740,6 @@ def test_positive_add_non_composite_cv_to_composite(session): composite content view. 3. Composite content view is successfully published - :CaseLevel: Integration - :BZ: 1367123 :CaseImportance: High @@ -834,8 +785,6 @@ def test_positive_check_composite_cv_addition_list_versions(session): :expectedresults: second non-composite content view version should be listed as default one to be added to composite view - :CaseLevel: Integration - :BZ: 1411074 :CaseImportance: Low @@ -873,8 +822,6 @@ def test_negative_add_dupe_repos(session, module_org, target_sat): :expectedresults: User cannot add repos multiple times to the view - :CaseLevel: Integration - :CaseImportance: Low """ cv_name = gen_string('alpha') @@ -901,8 +848,6 @@ def test_positive_publish_with_custom_content(session, module_org, target_sat): :expectedresults: Content view can be published - :CaseLevel: Integration - :CaseImportance: Critical """ repo_name = gen_string('alpha') @@ -930,8 +875,6 @@ def test_positive_publish_with_rh_content(session, function_entitlement_manifest :expectedresults: Content view can be published - :CaseLevel: Integration - :CaseImportance: Critical """ cv_name = gen_string('alpha') @@ -970,8 +913,6 @@ def test_positive_publish_composite_with_custom_content( :expectedresults: Composite content view can be published - :CaseLevel: Integration - :CaseImportance: High """ cv1_name = gen_string('alpha') @@ -1062,8 +1003,6 @@ def test_positive_publish_version_changes_in_target_env(session, module_org, tar :expectedresults: Content view version is updated in target environment. - :CaseLevel: Integration - :CaseImportance: High """ cv_name = gen_string('alpha') @@ -1114,8 +1053,6 @@ def test_positive_promote_with_custom_content(session, module_org, target_sat): :expectedresults: Content view can be promoted - :CaseLevel: Integration - :BZ: 1361793 :CaseImportance: Critical @@ -1159,8 +1096,6 @@ def test_positive_promote_with_rh_content(session, function_entitlement_manifest :expectedresults: Content view can be promoted - :CaseLevel: System - :CaseImportance: Critical """ cv_name = gen_string('alpha') @@ -1202,8 +1137,6 @@ def test_positive_promote_composite_with_custom_content( :expectedresults: Composite content view can be promoted - :CaseLevel: Integration - :CaseImportance: High """ cv1_name = gen_string('alpha') @@ -1334,8 +1267,6 @@ def test_negative_add_same_package_filter_twice(session, module_org, target_sat) :expectedresults: Same package filter can not be added again - :CaseLevel: Integration - :CaseImportance: High """ cv_name = gen_string('alpha') @@ -1371,7 +1302,7 @@ def test_positive_remove_cv_version_from_default_env(session, module_org, target :id: 43c83c15-c883-45a7-be05-d9b26da99e3c - :Steps: + :steps: 1. Create a content view 2. Add a yum repo to it @@ -1381,8 +1312,6 @@ def test_positive_remove_cv_version_from_default_env(session, module_org, target :expectedresults: content view version is removed from Library environment - :CaseLevel: Integration - :CaseImportance: Critical """ cv_name = gen_string('alpha') @@ -1411,7 +1340,7 @@ def test_positive_remove_promoted_cv_version_from_default_env(session, module_or :id: a8649444-b063-4fb4-b932-a3fae7d4021d - :Steps: + :steps: 1. Create a content view 2. Add a yum repos to the content view @@ -1424,8 +1353,6 @@ def test_positive_remove_promoted_cv_version_from_default_env(session, module_or 1. Content view version exist only in DEV and not in Library 2. The yum repos exists in content view version - :CaseLevel: Integration - :CaseImportance: High """ repo = target_sat.cli_factory.RepositoryCollection( @@ -1458,7 +1385,7 @@ def test_positive_remove_qe_promoted_cv_version_from_default_env(session, module :id: 71ad8b72-68c4-4c98-9387-077f54ef0184 - :Steps: + :steps: 1. Create a content view 2. Add docker repo(s) to it @@ -1470,8 +1397,6 @@ def test_positive_remove_qe_promoted_cv_version_from_default_env(session, module :expectedresults: Content view version exist only in DEV, QE and not in Library - :CaseLevel: Integration - :CaseImportance: Low """ dev_lce = entities.LifecycleEnvironment(organization=module_org).create() @@ -1528,7 +1453,7 @@ def test_positive_remove_cv_version_from_env(session, module_org, repos_collecti :id: d1da23ee-a5db-4990-9572-1a0919a9fe1c - :Steps: + :steps: 1. Create a content view 2. Add a yum repo and a docker repo to the content view @@ -1541,8 +1466,6 @@ def test_positive_remove_cv_version_from_env(session, module_org, repos_collecti :expectedresults: Content view version exist in Library, DEV, QE - :CaseLevel: Integration - :CaseImportance: High """ dev_lce = entities.LifecycleEnvironment(organization=module_org).create() @@ -1588,7 +1511,7 @@ def test_positive_delete_cv_promoted_to_multi_env(session, module_org, target_sa :id: f16f2db5-7f5b-4ebb-863e-6c18ff745ce4 - :Steps: + :steps: 1. Create a content view 2. Add a yum repo to the content view @@ -1599,8 +1522,6 @@ def test_positive_delete_cv_promoted_to_multi_env(session, module_org, target_sa :expectedresults: The content view doesn't exists. - :CaseLevel: Integration - :CaseImportance:High """ repo = target_sat.cli_factory.RepositoryCollection( @@ -1634,8 +1555,6 @@ def test_positive_delete_composite_version(session, module_org, target_sat): :expectedresults: Deletion was performed successfully - :CaseLevel: Integration - :BZ: 1276479 :CaseImportance: High @@ -1672,8 +1591,6 @@ def test_positive_delete_non_default_version(session, target_sat): :expectedresults: Deletion was performed successfully - :CaseLevel: Integration - :CaseImportance: Critical """ repo_name = gen_string('alpha') @@ -1706,8 +1623,6 @@ def test_positive_delete_version_with_ak(session): :expectedresults: Delete operation was performed successfully - :CaseLevel: Integration - :CaseImportance: High """ org = entities.Organization().create() @@ -1747,8 +1662,6 @@ def test_positive_clone_within_same_env(session, module_org, target_sat): :BZ: 1461017 - :CaseLevel: Integration - :CaseImportance: High """ repo_name = gen_string('alpha') @@ -1780,8 +1693,6 @@ def test_positive_clone_within_diff_env(session, module_org, target_sat): :BZ: 1461017 - :CaseLevel: Integration - :CaseImportance: High """ repo_name = gen_string('alpha') @@ -1820,8 +1731,6 @@ def test_positive_remove_filter(session, module_org): :expectedresults: content views filter removed successfully - :CaseLevel: Integration - :CaseImportance: Low """ filter_name = gen_string('alpha') @@ -1849,8 +1758,6 @@ def test_positive_add_package_filter(session, module_org, target_sat): :expectedresults: content views filter created and selected packages can be added for inclusion - :CaseLevel: Integration - :CaseImportance: High """ packages = ( @@ -1893,8 +1800,6 @@ def test_positive_add_package_inclusion_filter_and_publish(session, module_org, :expectedresults: Package is included in content view version - :CaseLevel: Integration - :CaseImportance: High """ filter_name = gen_string('alpha') @@ -1939,8 +1844,6 @@ def test_positive_add_package_exclusion_filter_and_publish(session, module_org, :expectedresults: Package is excluded from content view version - :CaseLevel: Integration - :CaseImportance: High """ filter_name = gen_string('alpha') @@ -1986,8 +1889,6 @@ def test_positive_remove_package_from_exclusion_filter(session, module_org, targ :expectedresults: Package was successfully removed from content view filter and is present in next published content view version - :CaseLevel: Integration - :CaseImportance: High """ filter_name = gen_string('alpha') @@ -2035,8 +1936,6 @@ def test_positive_update_inclusive_filter_package_version(session, module_org, t :expectedresults: Version was updated, next content view version contains package with updated version - :CaseLevel: Integration - :CaseImportance: High """ filter_name = gen_string('alpha') @@ -2099,8 +1998,6 @@ def test_positive_update_exclusive_filter_package_version(session, module_org, t :expectedresults: Version was updated, next content view version contains package with updated version - :CaseLevel: Integration - :CaseImportance: High """ filter_name = gen_string('alpha') @@ -2215,8 +2112,6 @@ def test_positive_edit_rh_custom_spin(session, target_sat): :expectedresults: edited content view save is successful and info is updated - :CaseLevel: System - :CaseImportance: High """ filter_name = gen_string('alpha') @@ -2276,8 +2171,6 @@ def test_positive_promote_with_rh_custom_spin(session, target_sat): :expectedresults: Content view can be promoted - :CaseLevel: Integration - :CaseImportance: Critical """ filter_name = gen_string('alpha') @@ -2368,8 +2261,6 @@ def test_positive_add_errata_filter(session, module_org, target_sat): :expectedresults: content views filter created and selected errata-id can be added for inclusion/exclusion - :CaseLevel: Integration - :CaseImportance: High """ filter_name = gen_string('alpha') @@ -2407,8 +2298,6 @@ def test_positive_add_module_stream_filter(session, module_org, target_sat): :expectedresults: content views filter created and selected module stream can be added for inclusion/exclusion - :CaseLevel: Integration - :CaseImportance: High """ filter_name = gen_string('alpha') @@ -2448,8 +2337,6 @@ def test_positive_add_package_group_filter(session, module_org, target_sat): :expectedresults: content views filter created and selected package groups can be added for inclusion/exclusion - :CaseLevel: Integration - :CaseImportance: Low """ filter_name = gen_string('alpha') @@ -2484,8 +2371,6 @@ def test_positive_update_filter_affected_repos(session, module_org, target_sat): version publishing only updated repos are affected by content view filter - :CaseLevel: Integration - :CaseImportance: High """ filter_name = gen_string('alpha') @@ -2550,8 +2435,6 @@ def test_positive_search_composite(session): :BZ: 1259374 - :CaseLevel: Integration - :CaseImportance: Low """ composite_name = gen_string('alpha') @@ -2584,8 +2467,6 @@ def test_positive_publish_with_repo_with_disabled_http(session, module_org, targ :BZ: 1355752 - :CaseLevel: Integration - :CaseImportance: Low """ repo_name = gen_string('alpha') @@ -2631,8 +2512,6 @@ def test_positive_subscribe_system_with_custom_content( :expectedresults: Systems can be subscribed to content view(s) - :CaseLevel: Integration - :parametrized: yes :CaseImportance: High @@ -2667,8 +2546,6 @@ def test_positive_delete_with_kickstart_repo_and_host_group( :BZ: 1417072 - :CaseLevel: Integration - :CaseImportance: High """ hg_name = gen_string('alpha') @@ -2744,8 +2621,6 @@ def test_positive_rh_mixed_content_end_to_end( :expectedresults: CV should be published and promoted with RH OSTree and all other contents. Then version is removed successfully. - :CaseLevel: System - :customerscenario: true :CaseImportance: High @@ -2799,8 +2674,6 @@ def test_positive_errata_inc_update_list_package(session, target_sat): in new content view version :CaseImportance: High - - :CaseLevel: Integration """ org = entities.Organization().create() product = entities.Product(organization=org).create() @@ -2858,7 +2731,7 @@ def test_positive_composite_child_inc_update(session, rhel7_contenthost, target_ :customerscenario: true - :Steps: + :steps: 1. Create a custom repo with filters that excludes the updated package 2. Create content view with custom repo publish and @@ -2887,8 +2760,6 @@ def test_positive_composite_child_inc_update(session, rhel7_contenthost, target_ :CaseImportance: Medium :parametrized: yes - - :CaseLevel: Integration """ org = entities.Organization().create() lce = entities.LifecycleEnvironment(organization=org).create() @@ -2982,8 +2853,6 @@ def test_positive_module_stream_end_to_end(session, module_org, target_sat): :expectedresults: Content view works properly with module_streams and count shown should be correct - :CaseLevel: Integration - :CaseImportance: Medium """ repo_name = gen_string('alpha') @@ -3025,8 +2894,6 @@ def test_positive_search_module_streams_in_content_view(session, module_org, tar :expectedresults: Searching for module streams should work inside content view version - :CaseLevel: Integration - :CaseImportance: Low """ repo_name = gen_string('alpha') @@ -3069,8 +2936,6 @@ def test_positive_non_admin_user_actions(session, module_org, test_name, target_ :BZ: 1461017 - :CaseLevel: Integration - :CaseImportance: Critical """ # note: the user to be created should not have permissions to access @@ -3160,8 +3025,6 @@ def test_positive_readonly_user_actions(module_org, test_name, target_sat): :expectedresults: User with read-only role for content view can view the repository in the content view - :CaseLevel: Integration - :CaseImportance: Critical """ user_login = gen_string('alpha') @@ -3214,8 +3077,6 @@ def test_negative_read_only_user_actions(session, module_org, test_name, target_ :BZ: 1922134 - :CaseLevel: Integration - :CaseImportance: Critical """ # create a content view read only user with lifecycle environment @@ -3318,8 +3179,6 @@ def test_negative_non_readonly_user_actions(module_org, test_name, target_sat): :expectedresults: the user cannot access content views web resources - :CaseLevel: Integration - :CaseImportance: High """ user_login = gen_string('alpha') @@ -3714,7 +3573,7 @@ def test_positive_no_duplicate_key_violate_unique_constraint_using_filters( :customerscenario: true - :Steps: + :steps: 1. Sync rhel tools 6.10 repo 2. Create cv and add rhel repo 3. Create include package filter for 'foreman-cli' and 'katello-agent' @@ -3739,8 +3598,6 @@ def test_positive_no_duplicate_key_violate_unique_constraint_using_filters( katello-host-tools-fact-plugin :CaseImportance: Medium - - :CaseLevel: Integration """ cv = gen_string('alpha') filter_name = gen_string('alpha') diff --git a/tests/foreman/ui/test_dashboard.py b/tests/foreman/ui/test_dashboard.py index bd11b7bb90..93f4b73019 100644 --- a/tests/foreman/ui/test_dashboard.py +++ b/tests/foreman/ui/test_dashboard.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Dashboard :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from airgun.session import Session from nailgun import entities @@ -35,7 +30,7 @@ def test_positive_host_configuration_status(session): :customerscenario: true - :Steps: + :steps: 1. Navigate to Monitor -> Dashboard 2. Review the Host Configuration Status @@ -45,8 +40,6 @@ def test_positive_host_configuration_status(session): :expectedresults: Each link shows the right info :BZ: 1631219 - - :CaseLevel: Integration """ org = entities.Organization().create() loc = entities.Location().create() @@ -106,15 +99,13 @@ def test_positive_host_configuration_chart(session): :id: b03314aa-4394-44e5-86da-c341c783003d - :Steps: + :steps: 1. Navigate to Monitor -> Dashboard 2. Review the Host Configuration Chart widget 3. Check that chart contains correct percentage value :expectedresults: Chart showing correct data - - :CaseLevel: Integration """ org = entities.Organization().create() loc = entities.Location().create() @@ -135,7 +126,7 @@ def test_positive_task_status(session): :id: fb667d6a-7255-4341-9f79-2f03d19e8e0f - :Steps: + :steps: 1. Navigate to Monitor -> Dashboard 2. Review the Latest Warning/Error Tasks widget @@ -148,8 +139,6 @@ def test_positive_task_status(session): from Tasks dashboard :BZ: 1718889 - - :CaseLevel: Integration """ url = 'www.non_existent_repo_url.org' org = entities.Organization().create() @@ -215,7 +204,7 @@ def test_positive_user_access_with_host_filter( :id: 24b4b371-cba0-4bc8-bc6a-294c62e0586d - :Steps: + :steps: 1. Specify proper filter with permission for your role 2. Create new user and assign role to it @@ -229,8 +218,6 @@ def test_positive_user_access_with_host_filter( :BZ: 1417114 :parametrized: yes - - :CaseLevel: System """ user_login = gen_string('alpha') user_password = gen_string('alphanumeric') @@ -280,12 +267,11 @@ def test_positive_user_access_with_host_filter( @pytest.mark.tier2 @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') def test_positive_sync_overview_widget(session, module_org, module_product): - """Check if the Sync Overview widget is working in the Dashboard UI :id: 553fbe33-0f6f-46fb-8d80-5d1d9ed483cf - :Steps: + :steps: 1. Sync some repositories 2. Navigate to Monitor -> Dashboard 3. Review the Sync Overview widget @@ -293,8 +279,6 @@ def test_positive_sync_overview_widget(session, module_org, module_product): :expectedresults: Correct data should appear in the widget :BZ: 1995424 - - :CaseLevel: Integration """ repo = entities.Repository(url=settings.repos.yum_1.url, product=module_product).create() with session: diff --git a/tests/foreman/ui/test_discoveredhost.py b/tests/foreman/ui/test_discoveredhost.py index 322571f595..fc3915f0fa 100644 --- a/tests/foreman/ui/test_discoveredhost.py +++ b/tests/foreman/ui/test_discoveredhost.py @@ -8,11 +8,6 @@ :Team: Rocket -:TestType: Functional - -:CaseLevel: System - -:Upstream: No """ from fauxfactory import gen_string import pytest diff --git a/tests/foreman/ui/test_discoveryrule.py b/tests/foreman/ui/test_discoveryrule.py index d61d5067f8..e2b0fcef95 100644 --- a/tests/foreman/ui/test_discoveryrule.py +++ b/tests/foreman/ui/test_discoveryrule.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: System - :CaseComponent: DiscoveryPlugin :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from airgun.session import Session from fauxfactory import gen_integer, gen_ipaddr, gen_string @@ -77,8 +72,6 @@ def test_positive_crud_with_non_admin_user( :id: 6a03983b-363d-4646-b277-34af5f5abc55 :expectedresults: All crud operations should work with non_admin user. - - :CaseLevel: Integration """ rule_name = gen_string('alpha') search = gen_string('alpha') @@ -138,8 +131,6 @@ def test_negative_delete_rule_with_non_admin_user( :expectedresults: User should validation error and rule should not be deleted successfully. - - :CaseLevel: Integration """ hg_name = gen_string('alpha') rule_name = gen_string('alpha') @@ -172,7 +163,7 @@ def test_positive_list_host_based_on_rule_search_query( :id: f7473fa2-7349-42d3-9cdb-f74b55d2f440 - :Steps: + :steps: 1. discovered host with cpu_count = 2 2. Define a rule 'rule1' with search query cpu_count = 2 diff --git a/tests/foreman/ui/test_domain.py b/tests/foreman/ui/test_domain.py index c082bef7d8..09e4864f07 100644 --- a/tests/foreman/ui/test_domain.py +++ b/tests/foreman/ui/test_domain.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Hosts :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string from nailgun import entities @@ -40,8 +35,6 @@ def test_positive_set_parameter(session, valid_domain_name, param_value): :parametrized: yes :expectedresults: Domain parameter is created. - - :CaseLevel: Integration """ new_param = {'name': gen_string('alpha', 255), 'value': param_value} with session: @@ -62,8 +55,6 @@ def test_negative_set_parameter(session, valid_domain_name): :expectedresults: Domain parameter is not updated. Error is raised - :CaseLevel: Integration - :CaseImportance: Medium """ update_values = { @@ -85,8 +76,6 @@ def test_negative_set_parameter_same(session, valid_domain_name): :expectedresults: Domain parameter with same values is not created. - :CaseLevel: Integration - :CaseImportance: Medium """ param_name = gen_string('alpha') @@ -108,8 +97,6 @@ def test_positive_remove_parameter(session, valid_domain_name): :expectedresults: Domain parameter is removed - :CaseLevel: Integration - :CaseImportance: Medium """ param_name = gen_string('alpha') @@ -133,8 +120,6 @@ def test_positive_end_to_end(session, module_org, module_location, valid_domain_ :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ dns_domain_name = valid_domain_name diff --git a/tests/foreman/ui/test_errata.py b/tests/foreman/ui/test_errata.py index b90705a6ab..35bd8bf2b0 100644 --- a/tests/foreman/ui/test_errata.py +++ b/tests/foreman/ui/test_errata.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: ErrataManagement :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from datetime import datetime @@ -278,8 +273,6 @@ def test_end_to_end( :BZ: 2029192 :customerscenario: true - - :CaseLevel: System """ ERRATA_DETAILS = { @@ -410,7 +403,7 @@ def test_content_host_errata_page_pagination(session, function_org_with_paramete :id: 6363eda7-a162-4a4a-b70f-75decbd8202e - :Steps: + :steps: 1. Install more than 20 packages that need errata 2. View Content Host's Errata page 3. Assert total_pages > 1 @@ -432,8 +425,6 @@ def test_content_host_errata_page_pagination(session, function_org_with_paramete :customerscenario: true :BZ: 1662254, 1846670 - - :CaseLevel: System """ org = function_org_with_parameter @@ -497,15 +488,13 @@ def test_positive_list(session, function_org_with_parameter, lce, target_sat): :Setup: Errata synced on satellite server. - :Steps: Create two Orgs each having a product synced which contains errata. + :steps: Create two Orgs each having a product synced which contains errata. :expectedresults: Check that the errata belonging to one Org is not showing in the other. :BZ: 1659941, 1837767 :customerscenario: true - - :CaseLevel: Integration """ org = function_org_with_parameter rc = target_sat.cli_factory.RepositoryCollection( @@ -551,12 +540,10 @@ def test_positive_list_permission( 2. Make sure that they both have errata. 3. Create a user with view access on one product and not on the other. - :Steps: Go to Content -> Errata. + :steps: Go to Content -> Errata. :expectedresults: Check that the new user is able to see errata for one product only. - - :CaseLevel: Integration """ module_org = module_org_with_parameter role = entities.Role().create() @@ -608,15 +595,13 @@ def test_positive_apply_for_all_hosts( :customerscenario: true - :Steps: + :steps: 1. Go to Content -> Errata. Select an erratum -> Content Hosts tab. 2. Select all Content Hosts and apply the erratum. :expectedresults: Check that the erratum is applied in all the content hosts. - - :CaseLevel: System """ with Broker( nick=module_repos_collection_with_setup.distro, host_class=ContentHost, _count=2 @@ -660,14 +645,12 @@ def test_positive_view_cve(session, module_repos_collection_with_setup): :Setup: Errata synced on satellite server. - :Steps: Go to Content -> Errata. Select an Errata. + :steps: Go to Content -> Errata. Select an Errata. :expectedresults: 1. Check if the CVE information is shown in Errata Details page. 2. Check if 'N/A' is displayed if CVE information is not present. - - :CaseLevel: Integration """ with session: errata_values = session.errata.read(RHVA_ERRATA_ID) @@ -706,12 +689,10 @@ def test_positive_filter_by_environment( :Setup: Errata synced on satellite server. - :Steps: Go to Content -> Errata. Select an Errata -> Content Hosts tab + :steps: Go to Content -> Errata. Select an Errata -> Content Hosts tab -> Filter content hosts by Environment. :expectedresults: Content hosts can be filtered by Environment. - - :CaseLevel: System """ module_org = module_org_with_parameter with Broker( @@ -781,14 +762,12 @@ def test_positive_content_host_previous_env( 1. Make sure multiple environments are present. 2. Content host's previous environments have additional errata. - :Steps: Go to Content Hosts -> Select content host -> Errata Tab -> + :steps: Go to Content Hosts -> Select content host -> Errata Tab -> Select Previous environments. :expectedresults: The errata from previous environments are displayed. :parametrized: yes - - :CaseLevel: System """ module_org = module_org_with_parameter hostname = vm.hostname @@ -840,13 +819,11 @@ def test_positive_content_host_library(session, module_org_with_parameter, vm): 1. Make sure multiple environments are present. 2. Content host's Library environment has additional errata. - :Steps: Go to Content Hosts -> Select content host -> Errata Tab -> Select 'Library'. + :steps: Go to Content Hosts -> Select content host -> Errata Tab -> Select 'Library'. :expectedresults: The errata from Library are displayed. :parametrized: yes - - :CaseLevel: System """ hostname = vm.hostname assert vm.execute(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}').status == 0 @@ -880,14 +857,12 @@ def test_positive_content_host_search_type(session, erratatype_vm): :customerscenario: true - :Steps: Search for errata on content host by type (e.g. 'type = security') + :steps: Search for errata on content host by type (e.g. 'type = security') Step 1 Search for "type = security", assert expected amount and IDs found Step 2 Search for "type = bugfix", assert expected amount and IDs found Step 3 Search for "type = enhancement", assert expected amount and IDs found :BZ: 1653293 - - :CaseLevel: Integration """ pkgs = ' '.join(FAKE_9_YUM_OUTDATED_PACKAGES) @@ -955,15 +930,13 @@ def test_positive_show_count_on_content_host_page( 1. Errata synced on satellite server. 2. Some content hosts are present. - :Steps: Go to Hosts -> Content Hosts. + :steps: Go to Hosts -> Content Hosts. :expectedresults: The available errata count is displayed. :BZ: 1484044, 1775427 :customerscenario: true - - :CaseLevel: System """ vm = erratatype_vm hostname = vm.hostname @@ -1013,13 +986,11 @@ def test_positive_show_count_on_content_host_details_page( 1. Errata synced on satellite server. 2. Some content hosts are present. - :Steps: Go to Hosts -> Content Hosts -> Select Content Host -> Details page. + :steps: Go to Hosts -> Content Hosts -> Select Content Host -> Details page. :expectedresults: The errata section should be displayed with Security, Bug fix, Enhancement. :BZ: 1484044 - - :CaseLevel: System """ vm = erratatype_vm hostname = vm.hostname @@ -1059,7 +1030,7 @@ def test_positive_filtered_errata_status_installable_param( :id: ed94cf34-b8b9-4411-8edc-5e210ea6af4f - :Steps: + :steps: 1. Prepare setup: Create Lifecycle Environment, Content View, Activation Key and all necessary repos @@ -1075,8 +1046,6 @@ def test_positive_filtered_errata_status_installable_param( :BZ: 1368254, 2013093 :CaseImportance: Medium - - :CaseLevel: System """ org = function_entitlement_manifest_org lce = entities.LifecycleEnvironment(organization=org).create() @@ -1175,7 +1144,7 @@ def test_content_host_errata_search_commands( :customerscenario: true - :Steps: + :steps: 1. host list --search "errata_status = security_needed" 2. host list --search "errata_status = errata_needed" 3. host list --search "applicable_errata = RHSA-2012:0055" diff --git a/tests/foreman/ui/test_hardwaremodel.py b/tests/foreman/ui/test_hardwaremodel.py index 4ec42851ab..38b42de6aa 100644 --- a/tests/foreman/ui/test_hardwaremodel.py +++ b/tests/foreman/ui/test_hardwaremodel.py @@ -4,15 +4,10 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Hosts :Team: Endeavour -:TestType: Functional - -:Upstream: No """ from fauxfactory import gen_string from nailgun import entities @@ -23,15 +18,12 @@ @pytest.mark.tier2 @pytest.mark.upgrade def test_positive_end_to_end(session, host_ui_options): - """Perform end to end testing for hardware model component :id: 93663cc9-7c8f-4f43-8050-444be1313bed :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: Medium :BZ:1758260 diff --git a/tests/foreman/ui/test_host.py b/tests/foreman/ui/test_host.py index be174e1ea1..e1b8082386 100644 --- a/tests/foreman/ui/test_host.py +++ b/tests/foreman/ui/test_host.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Hosts :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import copy import csv @@ -137,8 +132,6 @@ def test_positive_end_to_end(session, module_global_params, target_sat, host_ui_ and deleted. :BZ: 1419161 - - :CaseLevel: System """ api_values, host_name = host_ui_options global_params = [ @@ -199,8 +192,6 @@ def test_positive_read_from_details_page(session, module_host_template): :id: ffba5d40-918c-440e-afbb-6b910db3a8fb :expectedresults: Host is created and has expected content - - :CaseLevel: System """ template = module_host_template @@ -233,8 +224,6 @@ def test_positive_read_from_edit_page(session, host_ui_options): :id: 758fcab3-b363-4bfc-8f5d-173098a7e72d :expectedresults: Host is created and has expected content - - :CaseLevel: System """ api_values, host_name = host_ui_options with session: @@ -282,8 +271,6 @@ def test_positive_assign_taxonomies( :expectedresults: Host Assign Organization and Location actions are working as expected. - - :CaseLevel: Integration """ host = target_sat.api.Host(organization=module_org, location=smart_proxy_location).create() with session: @@ -345,8 +332,6 @@ def test_positive_assign_compliance_policy(session, scap_policy, target_sat, fun expected. :BZ: 1862135 - - :CaseLevel: Integration """ org = function_host.organization.read() loc = function_host.location.read() @@ -398,8 +383,6 @@ def test_positive_export(session, target_sat, function_org, function_location): :id: ffc512ad-982e-4b60-970a-41e940ebc74c :expectedresults: csv file contains same values as on web UI - - :CaseLevel: System """ hosts = [ target_sat.api.Host(organization=function_org, location=function_location).create() @@ -469,9 +452,6 @@ def test_negative_delete_primary_interface(session, host_ui_options): :BZ: 1417119 :expectedresults: Interface was not deleted - - - :CaseLevel: System """ values, host_name = host_ui_options interface_id = values['interfaces.interface.device_identifier'] @@ -498,8 +478,6 @@ def test_positive_view_hosts_with_non_admin_user( :expectedresults: user with only view_hosts, edit_hosts and view_organization permissions is able to read content hosts and hosts - - :CaseLevel: Component """ user_password = gen_string('alpha') role = target_sat.api.Role(organization=[module_org]).create() @@ -537,8 +515,6 @@ def test_positive_remove_parameter_non_admin_user( :expectedresults: user with sufficient permissions may remove host parameter - - :CaseLevel: System """ user_password = gen_string('alpha') parameter = {'name': gen_string('alpha'), 'value': gen_string('alpha')} @@ -593,8 +569,6 @@ def test_negative_remove_parameter_non_admin_user( :expectedresults: user with insufficient permissions is unable to remove host parameter, 'Remove' link is not visible for him - - :CaseLevel: System """ user_password = gen_string('alpha') @@ -649,8 +623,6 @@ def test_positive_check_permissions_affect_create_procedure( entities for create host procedure that he has access to :BZ: 1293716 - - :CaseLevel: System """ # Create two lifecycle environments lc_env = target_sat.api.LifecycleEnvironment(organization=function_org).create() @@ -765,8 +737,6 @@ def test_positive_search_by_parameter(session, module_org, smart_proxy_location, :expectedresults: Only one specific host is returned by search :BZ: 1725686 - - :CaseLevel: Integration """ param_name = gen_string('alpha') param_value = gen_string('alpha') @@ -800,8 +770,6 @@ def test_positive_search_by_parameter_with_different_values( :expectedresults: Only one specific host is returned by search :BZ: 1725686 - - :CaseLevel: Integration """ param_name = gen_string('alpha') param_values = [gen_string('alpha'), gen_string('alphanumeric')] @@ -836,8 +804,6 @@ def test_positive_search_by_parameter_with_prefix( :expectedresults: All assigned hosts to organization are returned by search - - :CaseLevel: Integration """ param_name = gen_string('alpha') param_value = gen_string('alpha') @@ -875,8 +841,6 @@ def test_positive_search_by_parameter_with_operator( search :BZ: 1463806 - - :CaseLevel: Integration """ param_name = gen_string('alpha') param_value = gen_string('alpha') @@ -917,8 +881,6 @@ def test_positive_search_with_org_and_loc_context( :BZ: 1405496 :customerscenario: true - - :CaseLevel: Integration """ host = target_sat.api.Host(organization=function_org, location=function_location).create() with session: @@ -942,8 +904,6 @@ def test_positive_search_by_org(session, smart_proxy_location, target_sat): result is returned :BZ: 1447958 - - :CaseLevel: Integration """ host = target_sat.api.Host(location=smart_proxy_location).create() org = host.organization.read() @@ -964,8 +924,6 @@ def test_positive_validate_inherited_cv_lce_ansiblerole(session, target_sat, mod :expectedresults: Host's lifecycle environment, content view and ansible role match the ones specified in hostgroup. - :CaseLevel: Integration - :customerscenario: true :BZ: 1391656, 2094912 @@ -1038,8 +996,6 @@ def test_positive_global_registration_form( :customerscenario: true :expectedresults: The curl command contains all required parameters - - :CaseLevel: Integration """ # rex and insights parameters are only specified in curl when differing from # inerited parameters @@ -1116,8 +1072,6 @@ def test_positive_global_registration_end_to_end( client work out of the box :parametrized: yes - - :CaseLevel: Integration """ # make sure global parameters for rex and insights are set to true insights_cp = ( @@ -1251,8 +1205,6 @@ def test_global_registration_form_populate( e.g. activation key, operating system, life-cycle environment, host parameters for remote-execution, insights setup. - :CaseLevel: Integration - :steps: 1. create and sync repository 2. create the content view and activation-key @@ -1330,8 +1282,6 @@ def test_global_registration_with_capsule_host( :expectedresults: Host is successfully registered with capsule host, remote execution and insights client work out of the box - :CaseLevel: Integration - :steps: 1. create and sync repository 2. create the content view and activation-key @@ -1424,8 +1374,6 @@ def test_global_registration_with_gpg_repo_and_default_package( :expectedresults: Host is successfully registered, gpg repo is enabled and default package is installed. - :CaseLevel: Integration - :steps: 1. create and sync repository 2. create the content view and activation-key @@ -1492,8 +1440,6 @@ def test_global_registration_upgrade_subscription_manager( :expectedresults: Host is successfully registered, repo is enabled on advanced tab and subscription-manager is updated. - :CaseLevel: Integration - :steps: 1. Create activation-key 2. Open the global registration form, add repo and activation key @@ -1545,8 +1491,6 @@ def test_global_re_registration_host_with_force_ignore_error_options( :expectedresults: Verify the force and ignore checkbox options - :CaseLevel: Integration - :steps: 1. create and sync repository 2. create the content view and activation-key @@ -1590,8 +1534,6 @@ def test_global_registration_token_restriction( :expectedresults: global registration token should be restricted for any api calls other than the registration - :CaseLevel: Integration - :steps: 1. open the global registration form and generate the curl token 2. use that curl token to execute other api calls e.g. GET /hosts, /users @@ -1631,8 +1573,6 @@ def test_positive_bulk_delete_host(session, smart_proxy_location, target_sat, fu :expectedresults: All selected hosts should be deleted successfully :BZ: 1368026 - - :CaseLevel: System """ host_template = target_sat.api.Host(organization=function_org, location=smart_proxy_location) host_template.create_missing() @@ -1668,8 +1608,6 @@ def test_positive_read_details_page_from_new_ui(session, host_ui_options): :id: ef0c5942-9049-11ec-8029-98fa9b6ecd5a :expectedresults: Host is created and has expected content - - :CaseLevel: System """ with session: api_values, host_name = host_ui_options @@ -1702,8 +1640,6 @@ def test_rex_new_ui(session, target_sat, rex_contenthost): :expectedresults: Remote execution succeeded and the job is visible on Recent jobs card on Overview tab - - :CaseLevel: System """ hostname = rex_contenthost.hostname job_args = { @@ -1740,8 +1676,6 @@ def test_positive_manage_table_columns(session, current_sat_org, current_sat_loc :expectedresults: Check if the custom columns were set properly, i.e., are displayed or not displayed in the table. - :CaseLevel: System - :BZ: 1813274 :customerscenario: true @@ -1791,8 +1725,6 @@ def test_positive_host_details_read_templates( :BZ: 2128038 :customerscenario: true - - :CaseLevel: System """ host = target_sat.api.Host().search(query={'search': f'name={target_sat.hostname}'})[0] api_templates = [template['name'] for template in host.list_provisioning_templates()] @@ -1843,7 +1775,6 @@ def test_positive_update_delete_package( 9. Delete the package :expectedresults: The package is updated and deleted - """ client = rhel_contenthost client.add_rex_key(target_sat) @@ -1961,7 +1892,6 @@ def test_positive_apply_erratum( 5. Select errata and apply via rex. :expectedresults: The erratum is applied - """ # install package client = rhel_contenthost @@ -2042,7 +1972,6 @@ def test_positive_crud_module_streams( 5. Reset the Module stream :expectedresults: Module streams can be enabled, installed, removed and reset using the new UI. - """ module_name = 'duck' client = rhel_contenthost @@ -2132,8 +2061,6 @@ def test_positive_inherit_puppet_env_from_host_group_when_action( :expectedresults: Expected puppet environment is inherited to the host :BZ: 1414914 - - :CaseLevel: System """ host = session_puppet_enabled_sat.api.Host( organization=module_puppet_org, location=module_puppet_loc @@ -2186,8 +2113,6 @@ def test_positive_create_with_puppet_class( :id: d883f169-1105-435c-8422-a7160055734a :expectedresults: Host is created and contains correct puppet class - - :CaseLevel: System """ host_template = session_puppet_enabled_sat.api.Host( @@ -2247,8 +2172,6 @@ def test_positive_inherit_puppet_env_from_host_group_when_create( :expectedresults: Expected puppet environment is inherited to the form :BZ: 1414914 - - :CaseLevel: Integration """ hg_name = gen_string('alpha') @@ -2300,8 +2223,6 @@ def test_positive_set_multi_line_and_with_spaces_parameter_value( 2. host parameter value is the same when restored from yaml format :BZ: 1315282 - - :CaseLevel: System """ host_template = session_puppet_enabled_sat.api.Host( organization=module_puppet_org, location=module_puppet_loc @@ -2360,9 +2281,7 @@ def test_positive_tracer_enable_reload(tracer_install_host, target_sat): :Team: Phoenix-subscriptions - :CaseLevel: System - - :Steps: + :steps: 1. Register a RHEL host to Satellite. 2. Prepare katello-tracer to be installed 3. Navigate to the Traces tab in New Host UI @@ -2370,7 +2289,6 @@ def test_positive_tracer_enable_reload(tracer_install_host, target_sat): :expectedresults: The Tracer tab message updates accordingly during the process, and displays the state the correct Title - """ host = ( target_sat.api.Host().search(query={'search': tracer_install_host.hostname})[0].read_json() @@ -2408,8 +2326,6 @@ def test_positive_host_registration_with_non_admin_user( :id: 35458bbc-4556-41b9-ba26-ae0b15179731 :expectedresults: User with register hosts permission able to register hosts. - - :CaseLevel: Component """ user_password = gen_string('alpha') org = module_sca_manifest_org @@ -2460,8 +2376,6 @@ def test_all_hosts_delete(session, target_sat, function_org, function_location, :CaseComponent:Hosts-Content :Team: Phoenix-subscriptions - - :CaseLevel: System """ host = target_sat.api.Host(organization=function_org, location=function_location).create() with target_sat.ui_session() as session: @@ -2481,8 +2395,6 @@ def test_all_hosts_bulk_delete(session, target_sat, function_org, function_locat :CaseComponent:Hosts-Content :Team: Phoenix-subscriptions - - :CaseLevel: System """ for _ in range(10): target_sat.api.Host(organization=function_org, location=function_location).create() diff --git a/tests/foreman/ui/test_hostcollection.py b/tests/foreman/ui/test_hostcollection.py index ae673f7650..a480db5385 100644 --- a/tests/foreman/ui/test_hostcollection.py +++ b/tests/foreman/ui/test_hostcollection.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: HostCollections :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import time @@ -221,8 +216,6 @@ def test_positive_end_to_end( :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ hc_name = gen_string('alpha') @@ -273,8 +266,6 @@ def test_negative_install_via_remote_execution( :expectedresults: The package is not installed, and the job invocation status contains some expected values: hosts information, jos status. - - :CaseLevel: Integration """ hosts = [] for _ in range(2): @@ -313,8 +304,6 @@ def test_negative_install_via_custom_remote_execution( :expectedresults: The package is not installed, and the job invocation status contains some expected values: hosts information, jos status. - - :CaseLevel: Integration """ hosts = [] for _ in range(2): @@ -348,8 +337,6 @@ def test_positive_add_host(session, module_target_sat): :id: 80824c9f-15a1-4f76-b7ac-7d9ca9f6ed9e :expectedresults: Host is added to Host Collection successfully - - :CaseLevel: System """ hc_name = gen_string('alpha') org = module_target_sat.api.Organization().create() @@ -384,8 +371,6 @@ def test_positive_install_package( :expectedresults: Package was successfully installed on all the hosts in host collection - - :CaseLevel: System """ with session: session.organization.select(org_name=module_org_with_parameter.name) @@ -410,8 +395,6 @@ def test_positive_remove_package( :expectedresults: Package was successfully removed from all the hosts in host collection - - :CaseLevel: System """ _install_package_with_assertion(vm_content_hosts, constants.FAKE_0_CUSTOM_PACKAGE) with session: @@ -438,8 +421,6 @@ def test_positive_upgrade_package( :expectedresults: Package was successfully upgraded on all the hosts in host collection - - :CaseLevel: System """ _install_package_with_assertion(vm_content_hosts, constants.FAKE_1_CUSTOM_PACKAGE) with session: @@ -465,8 +446,6 @@ def test_positive_install_package_group( :expectedresults: Package group was successfully installed on all the hosts in host collection - - :CaseLevel: System """ with session: session.organization.select(org_name=module_org_with_parameter.name) @@ -492,8 +471,6 @@ def test_positive_remove_package_group( :expectedresults: Package group was successfully removed on all the hosts in host collection - - :CaseLevel: System """ for client in vm_content_hosts: result = client.run(f'yum groups install -y {constants.FAKE_0_CUSTOM_PACKAGE_GROUP_NAME}') @@ -525,8 +502,6 @@ def test_positive_install_errata( :expectedresults: Errata was successfully installed in all the hosts in host collection - - :CaseLevel: System """ _install_package_with_assertion(vm_content_hosts, constants.FAKE_1_CUSTOM_PACKAGE) with session: @@ -594,8 +569,6 @@ def test_positive_change_assigned_content( names :BZ: 1315280 - - :CaseLevel: System """ new_lce_name = gen_string('alpha') new_cv_name = gen_string('alpha') @@ -663,7 +636,7 @@ def test_negative_hosts_limit( :id: 57b70977-2110-47d9-be3b-461ad15c70c7 - :Steps: + :steps: 1. Create Host Collection entity that can contain only one Host (using Host Limit field) 2. Create Host and add it to Host Collection. Check that it was @@ -673,8 +646,6 @@ def test_negative_hosts_limit( :expectedresults: Second host is not added to Host Collection and appropriate error is shown - - :CaseLevel: System """ hc_name = gen_string('alpha') org = module_target_sat.api.Organization().create() @@ -728,7 +699,7 @@ def test_positive_install_module_stream( :id: e5d882e0-3520-4cb6-8629-ef4c18692868 - :Steps: + :steps: 1. Run dnf upload profile to sync module streams from hosts to Satellite 2. Navigate to host_collection 3. Install the module stream duck @@ -737,8 +708,6 @@ def test_positive_install_module_stream( :expectedresults: Module-Stream should get installed on all the hosts in host collection - - :CaseLevel: System """ _run_remote_command_on_content_hosts('dnf -y upload-profile', vm_content_hosts_module_stream) with session: @@ -778,7 +747,7 @@ def test_positive_install_modular_errata( :id: 8d6fb447-af86-4084-a147-7910f0cecdef - :Steps: + :steps: 1. Generate modular errata by installing older version of module stream 2. Run dnf upload-profile 3. Install the modular errata by 'remote execution' @@ -786,8 +755,6 @@ def test_positive_install_modular_errata( :expectedresults: Modular Errata should get installed on all hosts in host collection. - - :CaseLevel: System """ stream = "0" version = "20180704111719" diff --git a/tests/foreman/ui/test_hostgroup.py b/tests/foreman/ui/test_hostgroup.py index c8a1d23a89..718b5091fc 100644 --- a/tests/foreman/ui/test_hostgroup.py +++ b/tests/foreman/ui/test_hostgroup.py @@ -6,15 +6,10 @@ :CaseComponent: HostGroup -:CaseLevel: Integration - :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string from nailgun import entities @@ -179,7 +174,7 @@ def test_positive_create_new_host(): :id: 49704437-5ca1-46cb-b74e-de58396add37 - :Steps: + :steps: 1. Create hostgroup with the Content Source field populated. 2. Create host from Hosts > Create Host, selecting the hostgroup in the Host Group field. @@ -202,7 +197,7 @@ def test_positive_nested_host_groups( :id: 547f8e72-df65-48eb-aeb1-6b5fd3cbf4e5 - :Steps: + :steps: 1. Create the parent host-group. 2. Create, Update and Delete the nested host-group. @@ -276,7 +271,7 @@ def test_positive_clone_host_groups( :id: 9f02dcc5-98aa-48bd-8114-edd3a0be65c1 - :Steps: + :steps: 1. Create the host-group. 2. Clone the host-group created in step 1 3. Update and Delete the cloned host-group. diff --git a/tests/foreman/ui/test_http_proxy.py b/tests/foreman/ui/test_http_proxy.py index abe02f1200..cc995e84da 100644 --- a/tests/foreman/ui/test_http_proxy.py +++ b/tests/foreman/ui/test_http_proxy.py @@ -2,19 +2,14 @@ :Requirement: HttpProxy -:CaseLevel: Acceptance - :CaseComponent: Repositories :team: Phoenix-content -:TestType: Functional - :CaseImportance: High :CaseAutomation: Automated -:Upstream: No """ from fauxfactory import gen_integer, gen_string, gen_url import pytest @@ -32,8 +27,6 @@ def test_positive_create_update_delete(module_org, module_location, target_sat): :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ http_proxy_name = gen_string('alpha', 15) @@ -196,7 +189,7 @@ def test_set_default_http_proxy(module_org, module_location, setting_update, tar :id: e93733e1-5c05-4b7f-89e4-253b9ce55a5a - :Steps: + :steps: 1. Navigate to Infrastructure > Http Proxies 2. Create a Http Proxy 3. GoTo to Administer > Settings > content tab @@ -210,8 +203,6 @@ def test_set_default_http_proxy(module_org, module_location, setting_update, tar :expectedresults: Setting "Default HTTP Proxy" to "no global default" result in success.''' :CaseImportance: Medium - - :CaseLevel: Acceptance """ property_name = setting_update.name @@ -242,12 +233,11 @@ def test_set_default_http_proxy(module_org, module_location, setting_update, tar def test_check_http_proxy_value_repository_details( function_org, function_location, function_product, setting_update, target_sat ): - """Deleted Global Http Proxy is reflected in repository details page". :id: 3f64255a-ef6c-4acb-b99b-e5579133b564 - :Steps: + :steps: 1. Create Http Proxy (Go to Infrastructure > Http Proxies > New Http Proxy) 2. GoTo to Administer > Settings > content tab 3. Update the "Default HTTP Proxy" with created above. @@ -264,8 +254,6 @@ def test_check_http_proxy_value_repository_details( 2. "HTTP Proxy" field in repository details page should be set to Global Default (None). :CaseImportance: Medium - - :CaseLevel: Acceptance """ property_name = setting_update.name @@ -310,7 +298,7 @@ def test_http_proxy_containing_special_characters(): :customerscenario: true - :Steps: + :steps: 1. Navigate to Infrastructure > Http Proxies 2. Create HTTP Proxy with special characters in password. 3. Go To to Administer > Settings > content tab diff --git a/tests/foreman/ui/test_jobinvocation.py b/tests/foreman/ui/test_jobinvocation.py index bb773841ef..c98e512f52 100644 --- a/tests/foreman/ui/test_jobinvocation.py +++ b/tests/foreman/ui/test_jobinvocation.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: RemoteExecution :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from inflection import camelize import pytest @@ -42,7 +37,7 @@ def test_positive_run_default_job_template_by_ip( :Setup: Use pre-defined job template. - :Steps: + :steps: 1. Set remote_execution_connect_by_ip on host to true 2. Navigate to an individual host and click Run Job @@ -52,8 +47,6 @@ def test_positive_run_default_job_template_by_ip( :expectedresults: Verify the job was successfully ran against the host :parametrized: yes - - :CaseLevel: System """ hostname = module_rhel_client_by_ip.hostname with session: @@ -83,7 +76,7 @@ def test_positive_run_custom_job_template_by_ip( :Setup: Create a working job template. - :Steps: + :steps: 1. Set remote_execution_connect_by_ip on host to true 2. Navigate to an individual host and click Run Job @@ -93,8 +86,6 @@ def test_positive_run_custom_job_template_by_ip( :expectedresults: Verify the job was successfully ran against the host :parametrized: yes - - :CaseLevel: System """ hostname = module_rhel_client_by_ip.hostname job_template_name = gen_string('alpha') @@ -139,7 +130,7 @@ def test_positive_schedule_recurring_host_job(self): :Team: Rocket - :Steps: + :steps: 1. Register a RHEL host to Satellite. 2. Import all roles available by default. 3. Assign a role to host. @@ -151,7 +142,6 @@ def test_positive_schedule_recurring_host_job(self): :expectedresults: The scheduled Job appears in the Job Invocation list at the appointed time - """ @@ -166,7 +156,7 @@ def test_positive_schedule_recurring_hostgroup_job(self): :Team: Rocket - :Steps: + :steps: 1. Register a RHEL host to Satellite. 2. Import all roles available by default. 3. Assign a role to host. @@ -178,5 +168,4 @@ def test_positive_schedule_recurring_hostgroup_job(self): :expectedresults: The scheduled Job appears in the Job Invocation list at the appointed time - """ diff --git a/tests/foreman/ui/test_jobtemplate.py b/tests/foreman/ui/test_jobtemplate.py index 798400aa97..e2be74da64 100644 --- a/tests/foreman/ui/test_jobtemplate.py +++ b/tests/foreman/ui/test_jobtemplate.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: RemoteExecution :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -29,8 +24,6 @@ def test_positive_end_to_end(session, module_org, module_location, target_sat): :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ template_name = gen_string('alpha') diff --git a/tests/foreman/ui/test_ldap_authentication.py b/tests/foreman/ui/test_ldap_authentication.py index b72d1bbcd8..e882f1c489 100644 --- a/tests/foreman/ui/test_ldap_authentication.py +++ b/tests/foreman/ui/test_ldap_authentication.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Integration - :CaseComponent: LDAP :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import os @@ -144,8 +139,6 @@ def test_positive_end_to_end(session, ldap_auth_source, ldap_tear_down): :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High :parametrized: yes @@ -247,7 +240,7 @@ def test_positive_add_katello_role( :id: aa5e3bf4-cb42-43a4-93ea-a2eea54b847a - :Steps: + :steps: 1. Create an UserGroup. 2. Assign some foreman roles to UserGroup. 3. Create and associate an External UserGroup. @@ -503,7 +496,7 @@ def test_positive_add_admin_role_with_org_loc( :setup: LDAP Auth Source should be created with Org and Location Associated. - :Steps: + :steps: 1. Create an UserGroup. 2. Assign admin role to UserGroup. 3. Create and associate an External UserGroup. @@ -563,7 +556,7 @@ def test_positive_add_foreman_role_with_org_loc( :setup: LDAP Auth Source should be created with Org and Location Associated. - :Steps: + :steps: 1. Create an UserGroup. 2. Assign some foreman roles to UserGroup. @@ -629,7 +622,7 @@ def test_positive_add_katello_role_with_org( :setup: LDAP Auth Source should be created with Organization associated. - :Steps: + :steps: 1. Create an UserGroup. 2. Assign some katello roles to UserGroup. 3. Create and associate an External UserGroup. @@ -955,7 +948,7 @@ def test_onthefly_functionality(session, ldap_auth_source, ldap_tear_down): :id: 6998de30-ef77-11ea-a0ce-0c7a158cbff4 - :Steps: + :steps: 1. Create an auth source with onthefly disabled 2. Try login with a user from auth source @@ -1043,7 +1036,7 @@ def test_verify_attribute_of_users_are_updated(session, ldap_auth_source, ldap_t :customerscenario: true - :Steps: + :steps: 1. Create authsource with onthefly disabled 2. Create a user manually and select the authsource created 3. Attributes of the user (like names and email) should be synced. @@ -1220,7 +1213,7 @@ def test_positive_group_sync_open_ldap_authsource( :BZ: 1883209 - :Steps: + :steps: 1. Create an UserGroup. 2. Assign some foreman roles to UserGroup. 3. Create and associate an External OpenLDAP UserGroup. @@ -1267,7 +1260,7 @@ def test_verify_group_permissions( :id: 7e2ef59c-0c68-11eb-b6f3-0c7a158cbff4 - :Steps: + :steps: 1. Create two usergroups and link it with external group having a user in common 2. Give those usergroup different permissions @@ -1315,7 +1308,7 @@ def test_verify_ldap_filters_ipa( :id: 0052b272-08b1-11eb-80c6-0c7a158cbff4 - :Steps: + :steps: 1. Create authsource with onthefly enabled and ldap filter 2. Verify login from users according to the filter diff --git a/tests/foreman/ui/test_lifecycleenvironment.py b/tests/foreman/ui/test_lifecycleenvironment.py index 5ff44751f6..e99d9f9c89 100644 --- a/tests/foreman/ui/test_lifecycleenvironment.py +++ b/tests/foreman/ui/test_lifecycleenvironment.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: LifecycleEnvironments :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from airgun.session import Session from navmazing import NavigationTriesExceeded @@ -42,8 +37,6 @@ def test_positive_end_to_end(session): :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ lce_name = gen_string('alpha') @@ -79,8 +72,6 @@ def test_positive_create_chain(session): :id: ed3d2c88-ef0a-4a1a-9f11-5bdb2119fc18 :expectedresults: Environment is created - - :CaseLevel: Integration """ lce_path_name = gen_string('alpha') lce_name = gen_string('alpha') @@ -120,8 +111,6 @@ def test_positive_search_lce_content_view_packages_by_full_name(session, module_ :expectedresults: only the searched packages where found :BZ: 1432155 - - :CaseLevel: System """ packages = [ {'name': FAKE_0_CUSTOM_PACKAGE_NAME, 'full_names': [FAKE_0_CUSTOM_PACKAGE]}, @@ -173,8 +162,6 @@ def test_positive_search_lce_content_view_packages_by_name(session, module_org, :expectedresults: only the searched packages where found :BZ: 1432155 - - :CaseLevel: System """ packages = [ {'name': FAKE_0_CUSTOM_PACKAGE_NAME, 'packages_count': 1}, @@ -218,8 +205,6 @@ def test_positive_search_lce_content_view_module_streams_by_name(session, module 5. Search by module stream names :expectedresults: only the searched module streams where found - - :CaseLevel: System """ module_streams = [ {'name': FAKE_1_CUSTOM_PACKAGE_NAME, 'streams_count': 2}, @@ -254,7 +239,7 @@ def test_positive_custom_user_view_lce(session, test_name, target_sat): :BZ: 1420511 - :Steps: + :steps: As an admin user: @@ -281,8 +266,6 @@ def test_positive_custom_user_view_lce(session, test_name, target_sat): :expectedresults: The additional lifecycle environment is viewable and accessible by the custom user. - - :CaseLevel: Integration """ role_name = gen_string('alpha') lce_name = gen_string('alpha') diff --git a/tests/foreman/ui/test_location.py b/tests/foreman/ui/test_location.py index 1142dbe878..98d2d2a874 100644 --- a/tests/foreman/ui/test_location.py +++ b/tests/foreman/ui/test_location.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: OrganizationsandLocations :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_ipaddr, gen_string from nailgun import entities @@ -34,8 +29,6 @@ def test_positive_end_to_end(session): :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: Critical """ loc_parent = entities.Location().create() @@ -125,8 +118,6 @@ def test_positive_update_with_all_users(session): was enabled and then disabled afterwards :BZ: 1321543, 1479736, 1479736 - - :CaseLevel: Integration """ user = entities.User().create() loc = entities.Location().create() @@ -161,8 +152,6 @@ def test_positive_add_org_hostgroup_template(session): :expectedresults: organization, hostgroup, provisioning template are added to location - - :CaseLevel: Integration """ org = entities.Organization().create() loc = entities.Location().create() @@ -203,8 +192,6 @@ def test_positive_update_compresource(session): :id: 1d24414a-666d-490d-89b9-cd0704684cdd :expectedresults: compute resource is added and removed from the location - - :CaseLevel: Integration """ url = LIBVIRT_RESOURCE_URL % settings.libvirt.libvirt_hostname resource = entities.LibvirtComputeResource(url=url).create() diff --git a/tests/foreman/ui/test_media.py b/tests/foreman/ui/test_media.py index db78fe4b41..75a39f80ed 100644 --- a/tests/foreman/ui/test_media.py +++ b/tests/foreman/ui/test_media.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Hosts :Team: Endeavour -:TestType: Functional - :CaseImportance: Low -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -32,8 +27,6 @@ def test_positive_end_to_end(session, module_org, module_location): :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ name = gen_string('alpha') diff --git a/tests/foreman/ui/test_modulestreams.py b/tests/foreman/ui/test_modulestreams.py index 23461437f4..f8a67ed15c 100644 --- a/tests/foreman/ui/test_modulestreams.py +++ b/tests/foreman/ui/test_modulestreams.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Repositories :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string from nailgun import entities @@ -56,8 +51,6 @@ def test_positive_module_stream_details_search_in_repo(session, module_org, modu :expectedresults: Content search functionality works as intended and expected module_streams are present inside of repository - :CaseLevel: Integration - :BZ: 1948758 """ with session: diff --git a/tests/foreman/ui/test_operatingsystem.py b/tests/foreman/ui/test_operatingsystem.py index 3a17236911..1324b55623 100644 --- a/tests/foreman/ui/test_operatingsystem.py +++ b/tests/foreman/ui/test_operatingsystem.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Provisioning :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -31,8 +26,6 @@ def test_positive_end_to_end(session, module_org, module_location, target_sat): :expectedresults: All scenarios flows work properly - :CaseLevel: Integration - :CaseImportance: Critical """ name = gen_string('alpha') @@ -155,8 +148,6 @@ def test_positive_verify_os_name(session, target_sat): :BZ: 1778503 - :CaseLevel: Component - :CaseImportance: Low """ name = gen_string('alpha') diff --git a/tests/foreman/ui/test_organization.py b/tests/foreman/ui/test_organization.py index 1f8887410b..480400fd67 100644 --- a/tests/foreman/ui/test_organization.py +++ b/tests/foreman/ui/test_organization.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: OrganizationsandLocations :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string from nailgun import entities @@ -59,8 +54,6 @@ def test_positive_end_to_end(session): :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: Critical """ name = gen_string('alpha') @@ -208,8 +201,6 @@ def test_positive_create_with_all_users(session): :expectedresults: Organization and user entities assigned to each other :BZ: 1321543 - - :CaseLevel: Integration """ user = entities.User().create() org = entities.Organization().create() @@ -233,8 +224,6 @@ def test_positive_update_compresource(session): :id: a49349b9-4637-4ef6-b65b-bd3eccb5a12a :expectedresults: Compute resource is added and then removed. - - :CaseLevel: Integration """ url = f'{LIBVIRT_RESOURCE_URL}{settings.libvirt.libvirt_hostname}' resource = entities.LibvirtComputeResource(url=url).create() @@ -265,8 +254,6 @@ def test_positive_delete_with_manifest_lces(session, target_sat, function_entitl :expectedresults: Organization is deleted successfully. - :CaseLevel: Integration - :CaseImportance: Critical """ org = function_entitlement_manifest_org @@ -294,8 +281,6 @@ def test_positive_download_debug_cert_after_refresh( :expectedresults: Scenario passed successfully - :CaseLevel: Integration - :CaseImportance: High """ org = function_entitlement_manifest_org @@ -317,14 +302,12 @@ def test_positive_errata_view_organization_switch( :id: faad9cf3-f8d5-49a6-87d1-431837b67675 - :Steps: Create an Organization having a product synced which contains errata. + :steps: Create an Organization having a product synced which contains errata. :expectedresults: Verify that the errata belonging to one Organization is not showing in the Default organization. :CaseImportance: High - - :CaseLevel: Integration """ rc = module_target_sat.cli_factory.RepositoryCollection( repositories=[module_target_sat.cli_factory.YumRepository(settings.repos.yum_3.url)] @@ -346,7 +329,7 @@ def test_positive_product_view_organization_switch(session, module_org, module_p :id: 50cc459a-3a23-433a-99b9-9f3b929e6d64 - :Steps: + :steps: 1. Create an Organization having a product and verify that product is present in the Organization. 2. Switch the Organization to default and verify that product is not visible in it. @@ -354,8 +337,6 @@ def test_positive_product_view_organization_switch(session, module_org, module_p :expectedresults: Verify that the Product belonging to one Organization is not visible in another organization. - :CaseLevel: Integration - :CaseImportance: High """ with session: diff --git a/tests/foreman/ui/test_oscapcontent.py b/tests/foreman/ui/test_oscapcontent.py index 21e6367de0..5669fb9e85 100644 --- a/tests/foreman/ui/test_oscapcontent.py +++ b/tests/foreman/ui/test_oscapcontent.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: SCAPPlugin :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import os @@ -45,7 +40,7 @@ def test_positive_end_to_end( :id: 9870555d-0b60-41ab-a481-81d4d3f78fec - :Steps: + :steps: 1. Create an openscap content. 2. Read values from created entity. @@ -53,8 +48,6 @@ def test_positive_end_to_end( 4. Delete openscap content :expectedresults: All expected CRUD actions finished successfully - - :CaseLevel: Integration """ title = gen_string('alpha') new_title = gen_string('alpha') @@ -93,7 +86,7 @@ def test_negative_create_with_same_name(session, oscap_content_path, default_org :id: f5c6491d-b83c-4ca2-afdf-4bb93e6dd92b - :Steps: + :steps: 1. Create an openscap content. 2. Provide all the appropriate parameters. @@ -128,7 +121,7 @@ def test_external_disa_scap_content(session, default_org, default_location): :id: 5f29254e-7c15-45e1-a2ec-4da1d3d8d74d - :Steps: + :steps: 1. Create an openscap content with external DISA SCAP content. 2. Assert that openscap content has been created. diff --git a/tests/foreman/ui/test_oscappolicy.py b/tests/foreman/ui/test_oscappolicy.py index 37196d8e2c..712e6f3748 100644 --- a/tests/foreman/ui/test_oscappolicy.py +++ b/tests/foreman/ui/test_oscappolicy.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: SCAPPlugin :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from nailgun import entities import pytest @@ -47,7 +42,7 @@ def test_positive_check_dashboard( :customerscenario: true - :Steps: + :steps: 1. Create new host group 2. Create new host using host group from step 1 @@ -58,8 +53,6 @@ def test_positive_check_dashboard( data :BZ: 1424936 - - :CaseLevel: Integration """ name = gen_string('alpha') oscap_content_title = gen_string('alpha') @@ -124,8 +117,6 @@ def test_positive_end_to_end( :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: Critical """ name = '{} {}'.format(gen_string('alpha'), gen_string('alpha')) diff --git a/tests/foreman/ui/test_oscaptailoringfile.py b/tests/foreman/ui/test_oscaptailoringfile.py index 011cb9bff0..0f6bdcdfc6 100644 --- a/tests/foreman/ui/test_oscaptailoringfile.py +++ b/tests/foreman/ui/test_oscaptailoringfile.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: SCAPPlugin :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from nailgun import entities import pytest @@ -30,8 +25,6 @@ def test_positive_end_to_end(session, tailoring_file_path, default_org, default_ :id: 9aebccb8-6837-4583-8a8a-8883480ab688 :expectedresults: All expected CRUD actions finished successfully - - :CaseLevel: Integration """ name = gen_string('alpha') new_name = gen_string('alpha') diff --git a/tests/foreman/ui/test_package.py b/tests/foreman/ui/test_package.py index 257e571dc7..643608811d 100644 --- a/tests/foreman/ui/test_package.py +++ b/tests/foreman/ui/test_package.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Repositories :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string from nailgun import entities @@ -82,8 +77,6 @@ def test_positive_search_in_repo(session, module_org, module_yum_repo): :expectedresults: Content search functionality works as intended and expected packages are present inside of repository - - :CaseLevel: Integration """ with session: session.organization.select(org_name=module_org.name) @@ -108,8 +101,6 @@ def test_positive_search_in_multiple_repos(session, module_org, module_yum_repo, expected packages are present inside of repositories :BZ: 1514457 - - :CaseLevel: Integration """ with session: session.organization.select(org_name=module_org.name) @@ -139,8 +130,6 @@ def test_positive_check_package_details(session, module_org, module_yum_repo): :expectedresults: Package is present inside of repository and has all expected values in details section - :CaseLevel: Integration - :customerscenario: true """ with session: @@ -181,8 +170,6 @@ def test_positive_check_custom_package_details(session, module_org, module_yum_r :expectedresults: Package is present inside of repository and it possible to view its details - :CaseLevel: Integration - :customerscenario: true :BZ: 1387766, 1394390 @@ -210,8 +197,6 @@ def test_positive_rh_repo_search_and_check_file_list(session, module_org, module :expectedresults: Content search functionality works as intended and package contains expected list of files - - :CaseLevel: System """ with session: session.organization.select(org_name=module_org.name) diff --git a/tests/foreman/ui/test_partitiontable.py b/tests/foreman/ui/test_partitiontable.py index e36d448698..127dc1ec67 100644 --- a/tests/foreman/ui/test_partitiontable.py +++ b/tests/foreman/ui/test_partitiontable.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Hosts :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -37,8 +32,6 @@ def test_positive_create_default_for_organization(session): :expectedresults: New partition table is created and is present in the list of selected partition tables for any new organization - :CaseLevel: Integration - :CaseImportance: Medium """ name = gen_string('alpha') @@ -66,8 +59,6 @@ def test_positive_create_custom_organization(session): :expectedresults: New partition table is created and is not present in the list of selected partition tables for any new organization - :CaseLevel: Integration - :CaseImportance: Medium """ name = gen_string('alpha') @@ -95,8 +86,6 @@ def test_positive_create_default_for_location(session): :expectedresults: New partition table is created and is present in the list of selected partition tables for any new location - :CaseLevel: Integration - :CaseImportance: Medium """ name = gen_string('alpha') @@ -124,8 +113,6 @@ def test_positive_create_custom_location(session): :expectedresults: New partition table is created and is not present in the list of selected partition tables for any new location - :CaseLevel: Integration - :CaseImportance: Medium """ name = gen_string('alpha') @@ -152,8 +139,6 @@ def test_positive_delete_with_lock_and_unlock(session): :expectedresults: New partition table is created and not deleted when locked and only deleted after unlock - :CaseLevel: Integration - :CaseImportance: Medium """ name = gen_string('alpha') @@ -182,8 +167,6 @@ def test_positive_clone(session): :expectedresults: New partition table is created and cloned successfully - :CaseLevel: Integration - :CaseImportance: Medium """ name = gen_string('alpha') @@ -219,8 +202,6 @@ def test_positive_end_to_end(session, module_org, module_location, template_data :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ name = gen_string('alpha') diff --git a/tests/foreman/ui/test_product.py b/tests/foreman/ui/test_product.py index a70623620f..71a468ccb8 100644 --- a/tests/foreman/ui/test_product.py +++ b/tests/foreman/ui/test_product.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Repositories :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from datetime import timedelta @@ -46,8 +41,6 @@ def test_positive_end_to_end(session, module_org): :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: Critical """ product_name = gen_string('alpha') @@ -113,8 +106,6 @@ def test_positive_create_in_different_orgs(session, product_name): :expectedresults: Product is created successfully in both organizations. - - :CaseLevel: Integration """ orgs = [entities.Organization().create() for _ in range(2)] with session: @@ -134,8 +125,6 @@ def test_positive_product_create_with_create_sync_plan(session, module_org): :expectedresults: Ensure sync get created and assigned to Product. - :CaseLevel: Integration - :CaseImportance: Medium """ product_name = gen_string('alpha') @@ -180,7 +169,7 @@ def test_positive_bulk_action_advanced_sync(session, module_org): :customerscenario: true - :Steps: + :steps: 1. Enable or create a repository and sync it. 2. Navigate to Content > Product > click on the product. 3. Click Select Action > Advanced Sync. diff --git a/tests/foreman/ui/test_provisioningtemplate.py b/tests/foreman/ui/test_provisioningtemplate.py index 1b957fb454..bc88d687f8 100644 --- a/tests/foreman/ui/test_provisioningtemplate.py +++ b/tests/foreman/ui/test_provisioningtemplate.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: ProvisioningTemplates :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -50,13 +45,11 @@ def test_positive_clone(module_org, module_location, target_sat, clone_setup): :id: 912f1619-4bb0-4e0f-88ce-88b5726fdbe0 - :Steps: + :steps: 1. Go to Provisioning template UI 2. Choose a template and attempt to clone it :expectedresults: The template is cloned - - :CaseLevel: Integration """ clone_name = gen_string('alpha') with target_sat.ui_session() as session: @@ -81,13 +74,11 @@ def test_positive_clone_locked(target_sat): :id: 2df8550a-fe7d-405f-ab48-2896554cda12 - :Steps: + :steps: 1. Go to Provisioning template UI 2. Choose a locked provisioning template and attempt to clone it :expectedresults: The template is cloned - - :CaseLevel: Integration """ clone_name = gen_string('alpha') with target_sat.ui_session() as session: @@ -112,8 +103,6 @@ def test_positive_end_to_end(module_org, module_location, template_data, target_ :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ name = gen_string('alpha') @@ -190,7 +179,7 @@ def test_positive_verify_supported_templates_rhlogo(target_sat, module_org, modu :id: 2df8550a-fe7d-405f-ab48-2896554cda14 - :Steps: + :steps: 1. Go to Provisioning template UI 2. Choose a any provisioning template and check if its supported or not diff --git a/tests/foreman/ui/test_puppetclass.py b/tests/foreman/ui/test_puppetclass.py index 5c5fdb98d7..b44ad73e7a 100644 --- a/tests/foreman/ui/test_puppetclass.py +++ b/tests/foreman/ui/test_puppetclass.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Puppet :Team: Rocket -:TestType: Functional - :CaseImportance: Low -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -29,8 +24,6 @@ def test_positive_end_to_end(session_puppet_enabled_sat, module_puppet_org, modu :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ name = gen_string('alpha') diff --git a/tests/foreman/ui/test_puppetenvironment.py b/tests/foreman/ui/test_puppetenvironment.py index 6d11797d1f..57502a5119 100644 --- a/tests/foreman/ui/test_puppetenvironment.py +++ b/tests/foreman/ui/test_puppetenvironment.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Puppet :Team: Rocket -:TestType: Functional - :CaseImportance: Low -:Upstream: No """ import pytest @@ -31,8 +26,6 @@ def test_positive_end_to_end(session_puppet_enabled_sat, module_puppet_org, modu :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ name = gen_string('alpha') @@ -74,8 +67,6 @@ def test_positive_availability_for_host_and_hostgroup_in_multiple_orgs( :BZ: 543178 - :CaseLevel: Integration - :CaseImportance: High """ env_name = gen_string('alpha') diff --git a/tests/foreman/ui/test_registration.py b/tests/foreman/ui/test_registration.py index b70bcb4187..7796d2a596 100644 --- a/tests/foreman/ui/test_registration.py +++ b/tests/foreman/ui/test_registration.py @@ -2,8 +2,6 @@ :Requirement: Registration -:CaseLevel: Acceptance - :CaseComponent: Registration :CaseAutomation: Automated @@ -11,10 +9,6 @@ :CaseImportance: Critical :Team: Rocket - -:TestType: Functional - -:Upstream: No """ from airgun.exceptions import DisabledWidgetError import pytest @@ -35,8 +29,6 @@ def test_positive_verify_default_values_for_global_registration( :expectedresults: Default fields in the form should be auto-populated e.g. organization, location, rex, insights setup, etc - :CaseLevel: Component - :steps: 1. Check for the default values in the global registration template """ @@ -75,8 +67,6 @@ def test_positive_org_loc_change_for_registration( :expectedresults: organization and location is updated correctly on the global registration page as well as in the command. - :CaseLevel: Component - :CaseImportance: Medium """ new_org = target_sat.api.Organization().create() diff --git a/tests/foreman/ui/test_remoteexecution.py b/tests/foreman/ui/test_remoteexecution.py index 59fd554c14..5d9f3900f9 100644 --- a/tests/foreman/ui/test_remoteexecution.py +++ b/tests/foreman/ui/test_remoteexecution.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: RemoteExecution :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import datetime import time @@ -35,7 +30,7 @@ def test_positive_run_default_job_template_by_ip(session, rex_contenthost, modul :Setup: Use pre-defined job template. - :Steps: + :steps: 1. Navigate to an individual host and click Run Job 2. Select the job and appropriate template @@ -48,8 +43,6 @@ def test_positive_run_default_job_template_by_ip(session, rex_contenthost, modul :bz: 1898656 :customerscenario: true - - :CaseLevel: Integration """ hostname = rex_contenthost.hostname with session: @@ -90,7 +83,7 @@ def test_positive_run_custom_job_template_by_ip(session, module_org, rex_content :Setup: Create a working job template. - :Steps: + :steps: 1. Set remote_execution_connect_by_ip on host to true 2. Navigate to an individual host and click Run Job @@ -100,8 +93,6 @@ def test_positive_run_custom_job_template_by_ip(session, module_org, rex_content :expectedresults: Verify the job was successfully ran against the host :parametrized: yes - - :CaseLevel: System """ hostname = rex_contenthost.hostname @@ -147,7 +138,7 @@ def test_positive_run_job_template_multiple_hosts_by_ip( :Setup: Create a working job template. - :Steps: + :steps: 1. Set remote_execution_connect_by_ip on hosts to true 2. Navigate to the hosts page and select at least two hosts @@ -156,8 +147,6 @@ def test_positive_run_job_template_multiple_hosts_by_ip( 5. Run the job :expectedresults: Verify the job was successfully ran against the hosts - - :CaseLevel: System """ host_names = [] for vm in registered_hosts: @@ -196,7 +185,7 @@ def test_positive_run_scheduled_job_template_by_ip(session, module_org, rex_cont :Setup: Use pre-defined job template. - :Steps: + :steps: 1. Set remote_execution_connect_by_ip on host to true 2. Navigate to an individual host and click Run Job @@ -211,8 +200,6 @@ def test_positive_run_scheduled_job_template_by_ip(session, module_org, rex_cont 2. Verify the job was successfully ran after the designated time :parametrized: yes - - :CaseLevel: System """ job_time = 10 * 60 hostname = rex_contenthost.hostname @@ -280,7 +267,7 @@ def test_positive_ansible_job_check_mode(session): :id: 7aeb7253-e555-4e28-977f-71f16d3c32e2 - :Steps: + :steps: 1. Set the value of the ansible_roles_check_mode parameter to true on a host 2. Associate one or more Ansible roles with the host @@ -289,8 +276,6 @@ def test_positive_ansible_job_check_mode(session): :expectedresults: Verify that the roles were run in check mode (i.e. no changes were made on the host) - :CaseLevel: System - :CaseAutomation: NotAutomated :CaseComponent: Ansible @@ -306,7 +291,7 @@ def test_positive_ansible_config_report_failed_tasks_errors(session): :id: 1a91e534-143f-4f35-953a-7ad8b7d2ddf3 - :Steps: + :steps: 1. Import Ansible roles 2. Assign Ansible roles to a host @@ -314,8 +299,6 @@ def test_positive_ansible_config_report_failed_tasks_errors(session): :expectedresults: Verify that any task failures are listed as errors in the config report - :CaseLevel: System - :CaseAutomation: NotAutomated :CaseComponent: Ansible @@ -331,7 +314,7 @@ def test_positive_ansible_config_report_changes_notice(session): :id: 8c90f179-8b70-4932-a477-75dc3566c437 - :Steps: + :steps: 1. Import Ansible Roles 2. Assign Ansible roles to a host @@ -340,8 +323,6 @@ def test_positive_ansible_config_report_changes_notice(session): :expectedresults: Verify that any tasks that make changes on the host are listed as notice in the config report - :CaseLevel: System - :CaseAutomation: NotAutomated :CaseComponent: Ansible @@ -357,14 +338,12 @@ def test_positive_ansible_variables_imported_with_roles(session): :id: 107c53e8-5a8a-4291-bbde-fbd66a0bb85e - :Steps: + :steps: 1. Import Ansible roles :expectedresults: Verify that any variables in the role were also imported to Satellite - :CaseLevel: System - :CaseAutomation: NotAutomated :CaseComponent: Ansible @@ -380,14 +359,12 @@ def test_positive_roles_import_in_background(session): :id: 4f1c7b76-9c67-42b2-9a73-980ca1f05abc - :Steps: + :steps: 1. Import Ansible roles :expectedresults: Verify that the UI is accessible while roles are importing - :CaseLevel: System - :CaseAutomation: NotAutomated :CaseComponent: Ansible @@ -403,15 +380,13 @@ def test_positive_ansible_roles_ignore_list(session): :id: 6fa1d8f0-b583-4a07-88eb-c9ae7fcd0219 - :Steps: + :steps: 1. Add roles to the ignore list in Administer > Settings > Ansible 2. Navigate to Configure > Roles :expectedresults: Verify that any roles on the ignore list are not available for import - :CaseLevel: System - :CaseAutomation: NotAutomated :CaseComponent: Ansible @@ -428,7 +403,7 @@ def test_positive_ansible_variables_installed_with_collection(session): :id: 7ff88022-fe9b-482f-a6bb-3922036a1e1c - :Steps: + :steps: 1. Install an Ansible collection 2. Navigate to Configure > Variables @@ -436,8 +411,6 @@ def test_positive_ansible_variables_installed_with_collection(session): :expectedresults: Verify that any variables associated with the collection are present on Configure > Variables - :CaseLevel: System - :CaseAutomation: NotAutomated :CaseComponent: Ansible @@ -453,7 +426,7 @@ def test_positive_install_ansible_collection_via_job_invocation(session): :id: d4096aef-f6fc-41b6-ae56-d19b1f49cd42 - :Steps: + :steps: 1. Enable a host for remote execution 2. Navigate to Hosts > Schedule Remote Job @@ -464,8 +437,6 @@ def test_positive_install_ansible_collection_via_job_invocation(session): :expectedresults: The Ansible collection is successfully installed on the host - :CaseLevel: System - :CaseAutomation: NotAutomated :CaseComponent: Ansible @@ -481,7 +452,7 @@ def test_positive_set_ansible_role_order_per_host(session): :id: 24fbcd60-7cd1-46ff-86ac-16d6b436202c - :Steps: + :steps: 1. Enable a host for remote execution 2. Navigate to Hosts > All Hosts > $hostname > Edit > Ansible Roles @@ -491,8 +462,6 @@ def test_positive_set_ansible_role_order_per_host(session): :expectedresults: The roles are run in the specified order - :CaseLevel: System - :CaseAutomation: NotAutomated :CaseComponent: Ansible @@ -508,7 +477,7 @@ def test_positive_set_ansible_role_order_per_hostgroup(session): :id: 9eb5bc8e-081a-45b9-8751-f4220c944da6 - :Steps: + :steps: 1. Enable a host for remote execution 2. Create a host group @@ -520,8 +489,6 @@ def test_positive_set_ansible_role_order_per_hostgroup(session): :expectedresults: The roles are run in the specified order - :CaseLevel: System - :CaseAutomation: NotAutomated :CaseComponent: Ansible @@ -537,7 +504,7 @@ def test_positive_matcher_field_highlight(session): :id: 67b45cfe-31bb-41a8-b88e-27917c68f33e - :Steps: + :steps: 1. Navigate to Configure > Variables > $variablename 2. Select the "Override" checkbox in the "Default Behavior" section @@ -548,8 +515,6 @@ def test_positive_matcher_field_highlight(session): :expectedresults: The background of each field turns yellow when a change is made - :CaseLevel: System - :CaseAutomation: NotAutomated :CaseComponent: Ansible diff --git a/tests/foreman/ui/test_reporttemplates.py b/tests/foreman/ui/test_reporttemplates.py index 1de3847884..f8fbfff52d 100644 --- a/tests/foreman/ui/test_reporttemplates.py +++ b/tests/foreman/ui/test_reporttemplates.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Integration - :CaseComponent: Reporting :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import csv import json @@ -145,8 +140,6 @@ def test_positive_end_to_end(session, module_org, module_location): :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: Critical """ name = gen_string('alpha') @@ -245,8 +238,6 @@ def test_positive_generate_registered_hosts_report(target_sat, module_org, modul :expectedresults: The Host - Registered Content Hosts report is generated (with host filter) and it contains created host with correct data - :CaseLevel: Integration - :CaseImportance: High """ # generate Host Status report @@ -300,8 +291,6 @@ def test_positive_generate_subscriptions_report_json( :expectedresults: The Subscriptions report is generated in JSON - :CaseLevel: Integration - :CaseImportance: Medium """ # generate Subscriptions report @@ -496,6 +485,7 @@ def test_negative_nonauthor_of_report_cant_download_it(session): 4. Wait for dynflow 5. As a different user, try to download the generated report :expectedresults: Report can't be downloaded. Error. + :CaseImportance: High """ diff --git a/tests/foreman/ui/test_repositories.py b/tests/foreman/ui/test_repositories.py index 7ad4ac8efc..55f69a165d 100644 --- a/tests/foreman/ui/test_repositories.py +++ b/tests/foreman/ui/test_repositories.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Integration - :CaseComponent: Repositories :team: Phoenix-content -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ import pytest diff --git a/tests/foreman/ui/test_repository.py b/tests/foreman/ui/test_repository.py index 8395d09696..08d44cc052 100644 --- a/tests/foreman/ui/test_repository.py +++ b/tests/foreman/ui/test_repository.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Repositories :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from datetime import datetime, timedelta from random import randint, shuffle @@ -65,8 +60,6 @@ def test_positive_create_in_different_orgs(session, module_org): :expectedresults: Repository is created successfully for both organizations - - :CaseLevel: Integration """ repo_name = gen_string('alpha') org2 = entities.Organization().create() @@ -100,8 +93,6 @@ def test_positive_create_as_non_admin_user(module_org, test_name, target_sat): :expectedresults: Repository successfully created :BZ: 1426393 - - :CaseLevel: Integration """ user_login = gen_string('alpha') user_password = gen_string('alphanumeric') @@ -152,8 +143,6 @@ def test_positive_create_yum_repo_same_url_different_orgs(session, module_prod): :id: f4cb00ed-6faf-4c79-9f66-76cd333299cb :expectedresults: Repositories are created and have equal number of packages. - - :CaseLevel: Integration """ # Create first repository repo = entities.Repository(product=module_prod, url=settings.repos.yum_0.url).create() @@ -191,8 +180,6 @@ def test_positive_create_as_non_admin_user_with_cv_published(module_org, test_na :expectedresults: New repository successfully created by non admin user :BZ: 1447829 - - :CaseLevel: Integration """ user_login = gen_string('alpha') user_password = gen_string('alphanumeric') @@ -262,8 +249,6 @@ def test_positive_discover_repo_via_existing_product(session, module_org): :id: 9181950c-a756-456f-a46a-059e7a2add3c :expectedresults: Repository is discovered and created - - :CaseLevel: Integration """ repo_name = 'fakerepo01' product = entities.Product(organization=module_org).create() @@ -290,8 +275,6 @@ def test_positive_discover_repo_via_new_product(session, module_org): :id: dc5281f8-1a8a-4a17-b746-728f344a1504 :expectedresults: Repository is discovered and created - - :CaseLevel: Integration """ product_name = gen_string('alpha') repo_name = 'fakerepo01' @@ -319,11 +302,9 @@ def test_positive_discover_module_stream_repo_via_existing_product(session, modu :id: e7b9e2c4-7ecd-4cde-8f74-961fbac8919c - :CaseLevel: Integration - :BZ: 1676642 - :Steps: + :steps: 1. Create a product. 2. From Content > Products, click on the Repo Discovery button. 3. Enter a url containing a yum repository with module streams, e.g., @@ -361,8 +342,6 @@ def test_positive_sync_custom_repo_yum(session, module_org): :id: afa218f4-e97a-4240-a82a-e69538d837a1 :expectedresults: Sync procedure for specific yum repository is successful - - :CaseLevel: Integration """ product = entities.Product(organization=module_org).create() repo = entities.Repository(url=settings.repos.yum_1.url, product=product).create() @@ -385,8 +364,6 @@ def test_positive_sync_custom_repo_docker(session, module_org): :expectedresults: Sync procedure for specific docker repository is successful - - :CaseLevel: Integration """ product = entities.Product(organization=module_org).create() repo = entities.Repository( @@ -411,8 +388,6 @@ def test_positive_resync_custom_repo_after_invalid_update(session, module_org): procedure for specific yum repository is successful :BZ: 1487173, 1262313 - - :CaseLevel: Integration """ product = entities.Product(organization=module_org).create() repo = entities.Repository(url=settings.repos.yum_1.url, product=product).create() @@ -441,8 +416,6 @@ def test_positive_resynchronize_rpm_repo(session, module_prod): :expectedresults: Repository has updated non-zero package count - :CaseLevel: Integration - :BZ: 1318004 """ repo = entities.Repository( @@ -476,8 +449,6 @@ def test_positive_end_to_end_custom_yum_crud(session, module_org, module_prod): :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ repo_name = gen_string('alpha') @@ -542,8 +513,6 @@ def test_positive_end_to_end_custom_module_streams_crud(session, module_org, mod :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ repo_name = gen_string('alpha') @@ -588,8 +557,6 @@ def test_positive_upstream_with_credentials(session, module_prod): 2. The custom repository upstream credentials are updated. 3. The credentials are cleared. - :CaseLevel: Integration - :CaseImportance: High :BZ: 1433481, 1743271 @@ -648,8 +615,7 @@ def test_positive_upstream_with_credentials(session, module_prod): # # :expectedresults: All expected CRUD actions finished successfully # -# :CaseLevel: Integration -# +# # # :CaseImportance: High # # :BZ: 1467722 @@ -688,10 +654,7 @@ def test_positive_sync_ansible_collection_gallaxy_repo(session, module_prod): :expectedresults: All content synced successfully - :CaseLevel: Integration - :CaseImportance: High - """ repo_name = f'gallaxy-{gen_string("alpha")}' requirements = ''' @@ -728,8 +691,6 @@ def test_positive_no_errors_on_repo_scan(target_sat, function_sca_manifest_org): :customerscenario: True :BZ: 1994212 - - :CaseLevel: Integration """ sat_rpm_extras = target_sat.cli_factory.RHELServerExtras(cdn=True) with target_sat.ui_session() as session: @@ -749,8 +710,6 @@ def test_positive_reposet_disable(session, target_sat, function_entitlement_mani :id: de596c56-1327-49e8-86d5-a1ab907f26aa :expectedresults: RH repo was disabled - - :CaseLevel: Integration """ org = function_entitlement_manifest_org sat_tools_repo = target_sat.cli_factory.SatelliteToolsRepository(distro='rhel7', cdn=True) @@ -797,8 +756,6 @@ def test_positive_reposet_disable_after_manifest_deleted( :expectedresults: RH repo was disabled :BZ: 1344391 - - :CaseLevel: Integration """ org = function_entitlement_manifest_org sub = entities.Subscription(organization=org) @@ -849,8 +806,6 @@ def test_positive_delete_random_docker_repo(session, module_org): :expectedresults: Random repository can be deleted from random product without altering the other products. - - :CaseLevel: Integration """ entities_list = [] products = [entities.Product(organization=module_org).create() for _ in range(randint(2, 5))] @@ -879,8 +834,6 @@ def test_positive_delete_rhel_repo(session, module_entitlement_manifest_org, tar :expectedresults: Repository can be successfully deleted - :CaseLevel: Integration - :BZ: 1152672 """ @@ -929,8 +882,6 @@ def test_positive_recommended_repos(session, module_entitlement_manifest_org): 1. Shows repositories as per On/Off 'Recommended Repositories'. 2. Check last Satellite version Capsule/Tools repos do not exist. - :CaseLevel: Integration - :BZ: 1776108 """ with session: @@ -963,7 +914,7 @@ def test_positive_upload_resigned_rpm(): :customerscenario: true - :Steps: + :steps: 1. Buld or prepare an unsigned rpm. 2. Create a gpg key. 3. Use the gpg key to sign the rpm with sha1. @@ -989,7 +940,7 @@ def test_positive_remove_srpm_change_checksum(): :BZ: 1850914 - :Steps: + :steps: 1. Sync a repository that contains rpms and srpms and uses sha1 repodata. 2. Re-sync the repository after an srpm has been removed and its repodata regenerated using sha256. @@ -1011,7 +962,7 @@ def test_positive_repo_discovery_change_ssl(): :BZ: 1789848 - :Steps: + :steps: 1. Navigate to Content > Products > click on 'Repo Discovery'. 2. Set the repository type to 'Yum Repositories'. 3. Enter an upstream URL to discover and click on 'Discover'. @@ -1035,7 +986,7 @@ def test_positive_remove_credentials(session, function_product, function_org, fu :customerscenario: true - :Steps: + :steps: 1. Create a custom repository, with a repository type of 'yum' and an upstream username and password. 3. Remove the saved credentials by clicking the delete icon next to the 'Upstream @@ -1079,7 +1030,7 @@ def test_sync_status_persists_after_task_delete(session, module_prod, module_org :customerscenario: true - :Steps: + :steps: 1. Sync a custom Repo. 2. Navigate to Content > Sync Status. Assert status is Synced. 3. Use foreman-rake console to delete the Sync task. @@ -1136,7 +1087,7 @@ def test_positive_sync_status_repo_display(): :customerscenario: true - :Steps: + :steps: 1. Import manifest and enable RHEL 8 repositories. 2. Navigate to Content > Sync Status. @@ -1157,7 +1108,7 @@ def test_positive_search_enabled_kickstart_repos(): :BZ: 1724807, 1829817 - :Steps: + :steps: 1. Import a manifest 2. Navigate to Content > Red Hat Repositories, and enable some kickstart repositories. 3. In the search bar on the right side, select 'Enabled/Both'. @@ -1180,7 +1131,7 @@ def test_positive_rpm_metadata_display(): :BZ: 1904369 - :Steps: + :steps: 1. Enable and sync a repository, e.g., 'Red Hat Satellite Tools 6.9 for RHEL 7 Server RPMs x86_64'. 2. Navigate to Content > Packages > click on a package in the repository (e.g., @@ -1210,7 +1161,7 @@ def test_positive_select_org_in_any_context(): :BZ: 1860957 - :Steps: + :steps: 1. Set "Any organization" and "Any location" on top 2. Click on Content -> "Sync Status" 3. "Select an Organization" page will come up. @@ -1236,7 +1187,7 @@ def test_positive_sync_repo_and_verify_checksum(session, module_org): :BZ: 1951626 - :Steps: + :steps: 1. Enable and sync repository 2. Go to Products -> Select Action -> Verify Content Checksum diff --git a/tests/foreman/ui/test_rhc.py b/tests/foreman/ui/test_rhc.py index 36d3d64875..d9aa8e1a11 100644 --- a/tests/foreman/ui/test_rhc.py +++ b/tests/foreman/ui/test_rhc.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: RHCloud-CloudConnector :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from datetime import datetime, timedelta @@ -120,7 +115,7 @@ def test_positive_configure_cloud_connector( :id: 67e45cfe-31bb-51a8-b88f-27918c68f32e - :Steps: + :steps: 1. Navigate to Configure > Inventory Upload 2. Click Configure Cloud Connector @@ -128,8 +123,6 @@ def test_positive_configure_cloud_connector( :expectedresults: The Cloud Connector has been installed and the service is running - :CaseLevel: Integration - :CaseImportance: Critical :BZ: 1818076 diff --git a/tests/foreman/ui/test_rhcloud_insights.py b/tests/foreman/ui/test_rhcloud_insights.py index 153e2a1187..9dcd309055 100644 --- a/tests/foreman/ui/test_rhcloud_insights.py +++ b/tests/foreman/ui/test_rhcloud_insights.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: System - :CaseComponent: RHCloud-Inventory :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from datetime import datetime @@ -46,7 +41,7 @@ def test_rhcloud_insights_e2e( :id: d952e83c-3faf-4299-a048-2eb6ccb8c9c2 - :Steps: + :steps: 1. Prepare misconfigured machine and upload its data to Insights. 2. In Satellite UI, go to Configure -> Insights -> Sync recommendations. 3. Run remediation for "OpenSSH config permissions" recommendation against host. @@ -141,7 +136,7 @@ def test_insights_reporting_status(): :id: 75629a08-b585-472b-a295-ce497075e519 - :Steps: + :steps: 1. Register a satellite content host with insights. 2. Change 48 hours of wait time to 4 minutes in insights_client_report_status.rb file. See foreman_rh_cloud PR#596. @@ -167,7 +162,7 @@ def test_recommendation_sync_for_satellite(): :id: ee3feba3-c255-42f1-8293-b04d540dcca5 - :Steps: + :steps: 1. Register Satellite with insights.(satellite-installer --register-with-insights) 2. Add RH cloud token in settings. 3. Go to Configure > Insights > Click on Sync recommendations button. @@ -194,7 +189,7 @@ def test_host_sorting_based_on_recommendation_count(): :id: b1725ec1-60db-422e-809d-f81d99ae156e - :Steps: + :steps: 1. Register few satellite content host with insights. 2. Sync Insights recommendations. 3. Go to Hosts > All Host @@ -227,7 +222,7 @@ def test_host_details_page( :customerscenario: true - :Steps: + :steps: 1. Prepare misconfigured machine and upload its data to Insights. 2. Sync insights recommendations. 3. Sync RH Cloud inventory status. diff --git a/tests/foreman/ui/test_rhcloud_inventory.py b/tests/foreman/ui/test_rhcloud_inventory.py index 743ef8925d..e242366bf0 100644 --- a/tests/foreman/ui/test_rhcloud_inventory.py +++ b/tests/foreman/ui/test_rhcloud_inventory.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: System - :CaseComponent: RHCloud-Inventory :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from datetime import datetime, timedelta @@ -150,7 +145,7 @@ def test_rh_cloud_inventory_settings( :customerscenario: true - :Steps: + :steps: 1. Prepare machine and upload its data to Insights. 2. Go to Configure > Inventory upload > enable “Obfuscate host names” setting. @@ -294,7 +289,7 @@ def test_failed_inventory_upload(): :id: 230d3fc3-2810-4385-b07b-30f9bf632488 - :Steps: + :steps: 1. Register a satellite content host with insights. 2. Change 'DEST' from /var/lib/foreman/red_hat_inventory/uploads/uploader.sh to an invalid url. @@ -318,7 +313,7 @@ def test_rhcloud_inventory_without_manifest(session, module_org, target_sat): :id: 1d90bb24-2380-4653-8ed6-a084fce66d1e - :Steps: + :steps: 1. Don't import manifest to satellite. 3. Go to Configure > Inventory upload > Click on restart button. diff --git a/tests/foreman/ui/test_role.py b/tests/foreman/ui/test_role.py index 86b93fd7ba..dd7c9c9ddf 100644 --- a/tests/foreman/ui/test_role.py +++ b/tests/foreman/ui/test_role.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: UsersRoles :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import random @@ -37,8 +32,6 @@ def test_positive_end_to_end(session, module_org, module_location): :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :customerscenario: true :BZ: 1353788 diff --git a/tests/foreman/ui/test_settings.py b/tests/foreman/ui/test_settings.py index e59693a980..87682a55db 100644 --- a/tests/foreman/ui/test_settings.py +++ b/tests/foreman/ui/test_settings.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: Settings :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import math @@ -64,8 +59,6 @@ def test_positive_update_restrict_composite_view(session, setting_update, repo_s :expectedresults: Parameter is updated successfully :CaseImportance: Critical - - :CaseLevel: Acceptance """ property_name = setting_update.name composite_cv = entities.ContentView(composite=True, organization=repo_setup['org']).create() @@ -110,7 +103,6 @@ def test_positive_httpd_proxy_url_update(session, setting_update): :BZ: 1677282 :CaseImportance: Medium - """ property_name = setting_update.name with session: @@ -214,8 +206,6 @@ def test_positive_update_login_page_footer_text(session, setting_update): :customerscenario: true :BZ: 2157869 - - :CaseLevel: Acceptance """ property_name = setting_update.name default_value = setting_update.default @@ -259,8 +249,6 @@ def test_negative_settings_access_to_non_admin(module_target_sat): :expectedresults: Administer -> Settings tab should not be available to non admin users :CaseImportance: Medium - - :CaseLevel: Acceptance """ login = gen_string('alpha') password = gen_string('alpha') @@ -306,8 +294,6 @@ def test_positive_update_email_delivery_method_smtp(): :CaseImportance: Critical - :CaseLevel: Acceptance - :CaseAutomation: NotAutomated """ @@ -341,8 +327,6 @@ def test_negative_update_email_delivery_method_smtp(): :CaseImportance: Critical - :CaseLevel: Acceptance - :CaseAutomation: NotAutomated """ @@ -372,8 +356,6 @@ def test_positive_update_email_delivery_method_sendmail(session, target_sat): :BZ: 2080324 :CaseImportance: Critical - - :CaseLevel: Acceptance """ property_name = "Email" mail_config_default_param = { @@ -436,8 +418,6 @@ def test_negative_update_email_delivery_method_sendmail(): :CaseImportance: Critical - :CaseLevel: Acceptance - :CaseAutomation: NotAutomated """ @@ -468,8 +448,6 @@ def test_positive_email_yaml_config_precedence(): :CaseImportance: Critical - :CaseLevel: Acceptance - :CaseAutomation: NotAutomated """ @@ -481,7 +459,7 @@ def test_negative_update_hostname_with_empty_fact(session, setting_update): :id: e0eaab69-4926-4c1e-b111-30c51ede273e - :Steps: + :steps: 1. Goto settings ->Discovered tab -> Hostname_facts 2. Set empty hostname_facts (without any value) @@ -494,7 +472,6 @@ def test_negative_update_hostname_with_empty_fact(session, setting_update): :expectedresults: Error should be raised on setting empty value for hostname_facts setting - """ new_hostname = "" property_name = setting_update.name @@ -512,7 +489,7 @@ def test_positive_entries_per_page(session, setting_update): :id: 009026b6-7550-40aa-9f78-5eb7f7e3800f - :Steps: + :steps: 1. Navigate to Administer > Settings > General tab 2. Update the entries per page value 3. GoTo Monitor > Tasks Table > Pagination @@ -529,8 +506,6 @@ def test_positive_entries_per_page(session, setting_update): :BZ: 1746221 :CaseImportance: Medium - - :CaseLevel: Acceptance """ property_name = setting_update.name property_value = 19 diff --git a/tests/foreman/ui/test_smartclassparameter.py b/tests/foreman/ui/test_smartclassparameter.py index 98c3ba430c..adc5169f2a 100644 --- a/tests/foreman/ui/test_smartclassparameter.py +++ b/tests/foreman/ui/test_smartclassparameter.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Puppet :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from random import choice, uniform @@ -80,8 +75,6 @@ def test_positive_end_to_end(session_puppet_enabled_sat, module_puppet_classes, :expectedresults: All expected basic actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ sc_param = sc_params_list.pop() @@ -201,8 +194,6 @@ def test_positive_create_matcher_attribute_priority( :expectedresults: The YAML output has the value only for fqdn matcher. - :CaseLevel: Integration - :BZ: 1241249 :CaseImportance: Critical @@ -380,8 +371,6 @@ def test_positive_update_matcher_from_attribute( 1. The host/hostgroup is saved with changes. 2. Matcher value in parameter is updated from fqdn/hostgroup. - :CaseLevel: Integration - :CaseImportance: Critical """ sc_param = sc_params_list.pop() @@ -448,8 +437,6 @@ def test_positive_impact_parameter_delete_attribute( 1. The matcher for deleted attribute removed from parameter. 2. On recreating attribute, the matcher should not reappear in parameter. - - :CaseLevel: Integration """ sc_param = sc_params_list.pop() matcher_value = gen_string('alpha') @@ -522,8 +509,6 @@ def test_positive_hidden_value_in_attribute( 4. And the value shown hidden. 5. Parameter is successfully unhidden. - :CaseLevel: Integration - :CaseImportance: Critical """ sc_param = sc_params_list.pop() diff --git a/tests/foreman/ui/test_subnet.py b/tests/foreman/ui/test_subnet.py index f188820d4b..45886c3ec8 100644 --- a/tests/foreman/ui/test_subnet.py +++ b/tests/foreman/ui/test_subnet.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Networking :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_ipaddr import pytest @@ -40,8 +35,6 @@ def test_positive_end_to_end(session, module_target_sat, module_dom): :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ name = gen_string('alpha') diff --git a/tests/foreman/ui/test_subscription.py b/tests/foreman/ui/test_subscription.py index 337ae56d98..f98a2ccde4 100644 --- a/tests/foreman/ui/test_subscription.py +++ b/tests/foreman/ui/test_subscription.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: SubscriptionManagement :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from tempfile import mkstemp import time @@ -150,8 +145,6 @@ def test_positive_access_with_non_admin_user_without_manifest(test_name, target_ :BZ: 1417082 - :CaseLevel: Integration - :CaseImportance: Critical """ org = entities.Organization().create() @@ -197,8 +190,6 @@ def test_positive_access_with_non_admin_user_with_manifest( :customerscenario: true - :CaseLevel: Integration - :CaseImportance: Critical """ org = function_entitlement_manifest_org @@ -237,8 +228,6 @@ def test_positive_access_manifest_as_another_admin_user( :customerscenario: true - :CaseLevel: Integration - :CaseImportance: High """ org = entities.Organization().create() @@ -299,8 +288,6 @@ def test_positive_view_vdc_subscription_products( :BZ: 1366327 :parametrized: yes - - :CaseLevel: System """ org = function_entitlement_manifest_org lce = entities.LifecycleEnvironment(organization=org).create() @@ -359,8 +346,6 @@ def test_positive_view_vdc_guest_subscription_products( :BZ: 1395788, 1506636, 1487317 :parametrized: yes - - :CaseLevel: System """ org = function_entitlement_manifest_org lce = entities.LifecycleEnvironment(organization=org).create() diff --git a/tests/foreman/ui/test_sync.py b/tests/foreman/ui/test_sync.py index 30ccce8c95..b7fdc4eb57 100644 --- a/tests/foreman/ui/test_sync.py +++ b/tests/foreman/ui/test_sync.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Repositories :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string from nailgun import entities @@ -70,8 +65,6 @@ def test_positive_sync_rh_repos(session, target_sat, module_entitlement_manifest :id: e30f6509-0b65-4bcc-a522-b4f3089d3911 :expectedresults: Sync procedure for RedHat Repos is successful - - :CaseLevel: Integration """ repos = ( target_sat.cli_factory.SatelliteCapsuleRepository(cdn=True), @@ -113,8 +106,6 @@ def test_positive_sync_custom_ostree_repo(session, module_custom_product): :customerscenario: true - :CaseLevel: Integration - :BZ: 1625783 """ repo = entities.Repository( @@ -139,7 +130,7 @@ def test_positive_sync_rh_ostree_repo(session, target_sat, module_entitlement_ma :id: 4d28fff0-5fda-4eee-aa0c-c5af02c31de5 - :Steps: + :steps: 1. Import a valid manifest 2. Enable the OStree repo and sync it @@ -147,8 +138,6 @@ def test_positive_sync_rh_ostree_repo(session, target_sat, module_entitlement_ma :expectedresults: ostree repo should be synced successfully from CDN - :CaseLevel: Integration - :BZ: 1625783 """ target_sat.api_factory.enable_rhrepo_and_fetchid( @@ -175,8 +164,6 @@ def test_positive_sync_docker_via_sync_status(session, module_org): :expectedresults: Sync procedure for specific docker repository is successful - - :CaseLevel: Integration """ product = entities.Product(organization=module_org).create() repo_name = gen_string('alphanumeric') diff --git a/tests/foreman/ui/test_syncplan.py b/tests/foreman/ui/test_syncplan.py index 10e1221cb0..ae4737fc9e 100644 --- a/tests/foreman/ui/test_syncplan.py +++ b/tests/foreman/ui/test_syncplan.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: SyncPlans :team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from datetime import datetime, timedelta import time @@ -61,8 +56,6 @@ def test_positive_end_to_end(session, module_org, target_sat): :customerscenario: true - :CaseLevel: Integration - :BZ: 1693795 """ plan_name = gen_string('alpha') @@ -115,8 +108,6 @@ def test_positive_end_to_end_custom_cron(session): :id: 48c88529-6318-47b0-97bc-eb46aae0294a :expectedresults: All CRUD actions for component finished successfully - - :CaseLevel: Integration """ plan_name = gen_string('alpha') description = gen_string('alpha') @@ -198,8 +189,6 @@ def test_positive_synchronize_custom_product_custom_cron_real_time(session, modu :id: c551ef9a-6e5a-435a-b24d-e86de203a2bb :expectedresults: Product is synchronized successfully. - - :CaseLevel: System """ plan_name = gen_string('alpha') product = entities.Product(organization=module_org).create() @@ -266,8 +255,6 @@ def test_positive_synchronize_custom_product_custom_cron_past_sync_date( :id: 4d9ed0bf-a63c-44de-846d-7cf302273bcc :expectedresults: Product is synchronized successfully. - - :CaseLevel: System """ plan_name = gen_string('alpha') product = entities.Product(organization=module_org).create() diff --git a/tests/foreman/ui/test_templatesync.py b/tests/foreman/ui/test_templatesync.py index cfbea828a9..7f0cc0e70a 100644 --- a/tests/foreman/ui/test_templatesync.py +++ b/tests/foreman/ui/test_templatesync.py @@ -4,15 +4,10 @@ :CaseAutomation: Automated -:CaseLevel: Integration - :CaseComponent: TemplatesPlugin :Team: Endeavour -:TestType: Functional - -:Upstream: No """ from fauxfactory import gen_string from nailgun import entities @@ -45,7 +40,7 @@ def test_positive_import_templates(session, templates_org, templates_loc): :bz: 1778181, 1778139 - :Steps: + :steps: 1. Navigate to Host -> Sync Templates, and choose Import. 2. Select fields: @@ -102,7 +97,7 @@ def test_positive_export_templates(session, create_import_export_local_dir, targ :bz: 1778139 - :Steps: + :steps: 1. Navigate to Host -> Sync Templates, and choose Export. 2. Select fields: @@ -163,7 +158,7 @@ def test_positive_export_filtered_templates_to_git(session, git_repository, git_ :id: e4de338a-9ab9-492e-ac42-6cc2ebcd1792 - :Steps: + :steps: 1. Export only the templates matching with regex e.g: `^atomic.*` to git repo. :expectedresults: diff --git a/tests/foreman/ui/test_user.py b/tests/foreman/ui/test_user.py index 892024ffc8..21147e88ad 100644 --- a/tests/foreman/ui/test_user.py +++ b/tests/foreman/ui/test_user.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: UsersRoles :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import random @@ -36,8 +31,6 @@ def test_positive_end_to_end(session, target_sat, test_name, module_org, module_ :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ name = gen_string('alpha') @@ -111,8 +104,6 @@ def test_positive_create_with_multiple_roles(session, target_sat): :expectedresults: User is created successfully and has proper roles assigned - - :CaseLevel: Integration """ name = gen_string('alpha') role1 = gen_string('alpha') @@ -142,8 +133,6 @@ def test_positive_create_with_all_roles(session): :id: 814593ca-1566-45ea-9eff-e880183b1ee3 :expectedresults: User is created successfully - - :CaseLevel: Integration """ name = gen_string('alpha') password = gen_string('alpha') @@ -169,8 +158,6 @@ def test_positive_create_with_multiple_orgs(session, target_sat): :id: d74c0284-3995-4a4a-8746-00858282bf5d :expectedresults: User is created successfully - - :CaseLevel: Integration """ name = gen_string('alpha') org_name1 = gen_string('alpha') @@ -205,8 +192,6 @@ def test_positive_update_with_multiple_roles(session, target_sat): :id: 127fb368-09fd-4f10-8319-566a1bcb5cd2 :expectedresults: User is updated successfully - - :CaseLevel: Integration """ name = gen_string('alpha') role_names = [target_sat.api.Role().create().name for _ in range(3)] @@ -233,8 +218,6 @@ def test_positive_update_with_all_roles(session): :id: cd7a9cfb-a700-45f2-a11d-bba6be3c810d :expectedresults: User is updated successfully - - :CaseLevel: Integration """ name = gen_string('alpha') password = gen_string('alpha') @@ -260,8 +243,6 @@ def test_positive_update_orgs(session, target_sat): :id: a207188d-1ad1-4ff1-9906-bae1d91104fd :expectedresults: User is updated - - :CaseLevel: Integration """ name = gen_string('alpha') password = gen_string('alpha') @@ -295,8 +276,6 @@ def test_positive_create_product_with_limited_user_permission( :customerscenario: true - :CaseLevel: Component - :CaseImportance: High :BZ: 1771937 @@ -344,8 +323,6 @@ def test_personal_access_token_admin(): 1. Should show output of the api endpoint 2. When revoked, authentication error - :CaseLevel: System - :CaseImportance: High """ @@ -369,8 +346,6 @@ def test_positive_personal_access_token_user_with_role(): 2. When an incorrect role and end point is used, missing permission should be displayed. - :CaseLevel: System - :CaseImportance: High """ @@ -389,7 +364,5 @@ def test_expired_personal_access_token(): :expectedresults: Authentication error - :CaseLevel: System - :CaseImportance: Medium """ diff --git a/tests/foreman/ui/test_usergroup.py b/tests/foreman/ui/test_usergroup.py index f5e2eaa9a9..092126ae86 100644 --- a/tests/foreman/ui/test_usergroup.py +++ b/tests/foreman/ui/test_usergroup.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: UsersRoles :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string, gen_utf8 from nailgun import entities @@ -29,8 +24,6 @@ def test_positive_delete_with_user(session, module_org, module_location): :id: 2bda3db5-f54f-412f-831f-8e005631f271 :expectedresults: Usergroup is deleted but added user is not - - :CaseLevel: Integration """ user_name = gen_string('alpha') group_name = gen_utf8(smp=False) @@ -60,8 +53,6 @@ def test_positive_end_to_end(session, module_org, module_location): :expectedresults: All expected CRUD actions finished successfully - :CaseLevel: Integration - :CaseImportance: High """ name = gen_string('alpha') diff --git a/tests/foreman/ui/test_webhook.py b/tests/foreman/ui/test_webhook.py index f3df30aef7..c0e3b470c2 100644 --- a/tests/foreman/ui/test_webhook.py +++ b/tests/foreman/ui/test_webhook.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: HooksandWebhooks :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string, gen_url import pytest diff --git a/tests/foreman/virtwho/api/test_esx.py b/tests/foreman/virtwho/api/test_esx.py index 1eda85fde0..cdea45e72b 100644 --- a/tests/foreman/virtwho/api/test_esx.py +++ b/tests/foreman/virtwho/api/test_esx.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -43,8 +38,6 @@ def test_positive_deploy_configure_by_id_script( :expectedresults: Config can be created and deployed - :CaseLevel: Integration - :CaseImportance: High """ assert virtwho_config_api.status == 'unknown' @@ -94,8 +87,6 @@ def test_positive_debug_option( :expectedresults: debug option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ options = {'true': '1', 'false': '0', '1': '1', '0': '0'} @@ -120,8 +111,6 @@ def test_positive_interval_option( :expectedresults: interval option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ options = { @@ -155,8 +144,6 @@ def test_positive_hypervisor_id_option( :expectedresults: hypervisor_id option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ # esx and rhevm support hwuuid option @@ -183,8 +170,6 @@ def test_positive_filter_option( :expectedresults: filter and filter_hosts can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ whitelist = {'filtering_mode': '1', 'whitelist': '.*redhat.com'} @@ -235,8 +220,6 @@ def test_positive_proxy_option( :expectedresults: http_proxy/https_proxy and no_proxy option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium :BZ: 1902199 @@ -282,8 +265,6 @@ def test_positive_configure_organization_list( :expectedresults: Config can be searched in org list - :CaseLevel: Integration - :CaseImportance: Medium """ command = get_configure_command(virtwho_config_api.id, default_org.name) @@ -303,8 +284,6 @@ def test_positive_deploy_configure_hypervisor_password_with_special_characters( :expectedresults: Config can be created and deployed without any error - :CaseLevel: Integration - :CaseImportance: High :BZ: 1870816,1959136 @@ -358,8 +337,6 @@ def test_positive_remove_env_option( the option "env=" should be removed from etc/virt-who.d/virt-who.conf /var/log/messages should not display warning message - :CaseLevel: Integration - :customerscenario: true :CaseImportance: Medium diff --git a/tests/foreman/virtwho/api/test_esx_sca.py b/tests/foreman/virtwho/api/test_esx_sca.py index 3ac780254f..290e67242f 100644 --- a/tests/foreman/virtwho/api/test_esx_sca.py +++ b/tests/foreman/virtwho/api/test_esx_sca.py @@ -4,15 +4,10 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :Team: Phoenix -:TestType: Functional - -:Upstream: No """ import pytest @@ -41,8 +36,6 @@ def test_positive_deploy_configure_by_id_script( :expectedresults: Config can be created and deployed - :CaseLevel: Integration - :CaseImportance: High """ assert virtwho_config_api.status == 'unknown' @@ -65,8 +58,6 @@ def test_positive_debug_option( :expectedresults: debug option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ options = {'0': '0', '1': '1', 'false': '0', 'true': '1'} @@ -91,8 +82,6 @@ def test_positive_interval_option( :expectedresults: interval option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ options = { @@ -126,8 +115,6 @@ def test_positive_hypervisor_id_option( :expectedresults: hypervisor_id option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ for value in ['uuid', 'hostname']: @@ -156,8 +143,6 @@ def test_positive_filter_option( 1. filter and filter_hosts can be updated. 2. create virt-who config with filter and filter_hosts options work well. - :CaseLevel: Integration - :CaseImportance: Medium """ regex = '.*redhat.com' @@ -253,8 +238,6 @@ def test_positive_proxy_option(self, module_sca_manifest_org, form_data_api, tar 1. http_proxy and no_proxy option can be updated. 2. create virt-who config with http_proxy and no_proxy options work well. - :CaseLevel: Integration - :CaseImportance: Medium :BZ: 1902199 @@ -330,8 +313,6 @@ def test_positive_configure_organization_list( :expectedresults: Config can be searched in org list - :CaseLevel: Integration - :CaseImportance: Medium """ command = get_configure_command(virtwho_config_api.id, module_sca_manifest_org.name) @@ -351,8 +332,6 @@ def test_positive_deploy_configure_hypervisor_password_with_special_characters( :expectedresults: Config can be created and deployed without any error - :CaseLevel: Integration - :CaseImportance: High :BZ: 1870816,1959136 @@ -406,8 +385,6 @@ def test_positive_remove_env_option( 1. the option "env=" should be removed from etc/virt-who.d/virt-who.conf 2. /var/log/messages should not display warning message - :CaseLevel: Integration - :customerscenario: true :CaseImportance: Medium diff --git a/tests/foreman/virtwho/api/test_hyperv.py b/tests/foreman/virtwho/api/test_hyperv.py index e76e12f266..6d93f1ddb9 100644 --- a/tests/foreman/virtwho/api/test_hyperv.py +++ b/tests/foreman/virtwho/api/test_hyperv.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -39,8 +34,6 @@ def test_positive_deploy_configure_by_id_script( :expectedresults: Config can be created and deployed - :CaseLevel: Integration - :CaseImportance: High """ assert virtwho_config_api.status == 'unknown' @@ -90,8 +83,6 @@ def test_positive_hypervisor_id_option( :expectedresults: hypervisor_id option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ values = ['uuid', 'hostname'] diff --git a/tests/foreman/virtwho/api/test_hyperv_sca.py b/tests/foreman/virtwho/api/test_hyperv_sca.py index 68dd7c0e4f..715ac92cd1 100644 --- a/tests/foreman/virtwho/api/test_hyperv_sca.py +++ b/tests/foreman/virtwho/api/test_hyperv_sca.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -38,8 +33,6 @@ def test_positive_deploy_configure_by_id_script( :expectedresults: Config can be created and deployed - :CaseLevel: Integration - :CaseImportance: High """ assert virtwho_config_api.status == 'unknown' @@ -62,8 +55,6 @@ def test_positive_hypervisor_id_option( :expectedresults: hypervisor_id option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ for value in ['uuid', 'hostname']: diff --git a/tests/foreman/virtwho/api/test_kubevirt.py b/tests/foreman/virtwho/api/test_kubevirt.py index b1bfe96a34..ef1e7ac578 100644 --- a/tests/foreman/virtwho/api/test_kubevirt.py +++ b/tests/foreman/virtwho/api/test_kubevirt.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -40,8 +35,6 @@ def test_positive_deploy_configure_by_id_script( :expectedresults: Config can be created and deployed - :CaseLevel: Integration - :CaseImportance: High """ assert virtwho_config_api.status == 'unknown' @@ -91,8 +84,6 @@ def test_positive_hypervisor_id_option( :expectedresults: hypervisor_id option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ values = ['uuid', 'hostname'] diff --git a/tests/foreman/virtwho/api/test_kubevirt_sca.py b/tests/foreman/virtwho/api/test_kubevirt_sca.py index 364a637be5..51628052cd 100644 --- a/tests/foreman/virtwho/api/test_kubevirt_sca.py +++ b/tests/foreman/virtwho/api/test_kubevirt_sca.py @@ -4,15 +4,10 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - -:Upstream: No """ import pytest @@ -36,8 +31,6 @@ def test_positive_deploy_configure_by_id_script( :expectedresults: Config can be created and deployed - :CaseLevel: Integration - :CaseImportance: High """ assert virtwho_config_api.status == 'unknown' @@ -60,8 +53,6 @@ def test_positive_hypervisor_id_option( :expectedresults: hypervisor_id option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ for value in ['uuid', 'hostname']: diff --git a/tests/foreman/virtwho/api/test_libvirt.py b/tests/foreman/virtwho/api/test_libvirt.py index 2d05ebd5e4..b551e0e81d 100644 --- a/tests/foreman/virtwho/api/test_libvirt.py +++ b/tests/foreman/virtwho/api/test_libvirt.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -39,8 +34,6 @@ def test_positive_deploy_configure_by_id_script( :expectedresults: Config can be created and deployed - :CaseLevel: Integration - :CaseImportance: High """ assert virtwho_config_api.status == 'unknown' @@ -90,8 +83,6 @@ def test_positive_hypervisor_id_option( :expectedresults: hypervisor_id option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ values = ['uuid', 'hostname'] diff --git a/tests/foreman/virtwho/api/test_libvirt_sca.py b/tests/foreman/virtwho/api/test_libvirt_sca.py index d805b4da5e..f88edd8d47 100644 --- a/tests/foreman/virtwho/api/test_libvirt_sca.py +++ b/tests/foreman/virtwho/api/test_libvirt_sca.py @@ -4,15 +4,10 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - -:Upstream: No """ import pytest @@ -36,8 +31,6 @@ def test_positive_deploy_configure_by_id_script( :expectedresults: Config can be created and deployed - :CaseLevel: Integration - :CaseImportance: High """ assert virtwho_config_api.status == 'unknown' @@ -58,8 +51,6 @@ def test_positive_hypervisor_id_option( :expectedresults: hypervisor_id option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ for value in ['uuid', 'hostname']: diff --git a/tests/foreman/virtwho/api/test_nutanix.py b/tests/foreman/virtwho/api/test_nutanix.py index c065f164a5..e40433b1c5 100644 --- a/tests/foreman/virtwho/api/test_nutanix.py +++ b/tests/foreman/virtwho/api/test_nutanix.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -43,8 +38,6 @@ def test_positive_deploy_configure_by_id_script( :expectedresults: Config can be created and deployed - :CaseLevel: Integration - :CaseImportance: High """ assert virtwho_config_api.status == 'unknown' @@ -98,8 +91,6 @@ def test_positive_hypervisor_id_option( :expectedresults: hypervisor_id option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ values = ['uuid', 'hostname'] @@ -126,8 +117,6 @@ def test_positive_prism_central_deploy_configure_by_id_script( Config can be created and deployed The prism_central has been set in /etc/virt-who.d/vir-who.conf file - :CaseLevel: Integration - :CaseImportance: High """ form_data_api['prism_flavor'] = "central" @@ -198,8 +187,6 @@ def test_positive_prism_central_prism_central_option( :expectedresults: prism_flavor option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ value = 'central' @@ -228,7 +215,6 @@ def test_positive_ahv_internal_debug_option( 5. message Host UUID {system_uuid} found for VM: {guest_uuid} exist in rhsm.log 6. ahv_internal_debug bas been set to true in virt-who-config-X.conf 7. warning message does not exist in log file /var/log/rhsm/rhsm.log - :CaseLevel: Integration :CaseImportance: Medium diff --git a/tests/foreman/virtwho/api/test_nutanix_sca.py b/tests/foreman/virtwho/api/test_nutanix_sca.py index c075db7f79..14b6d2a04f 100644 --- a/tests/foreman/virtwho/api/test_nutanix_sca.py +++ b/tests/foreman/virtwho/api/test_nutanix_sca.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :Team: Phoenix -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -39,8 +34,6 @@ def test_positive_deploy_configure_by_id_script( :expectedresults: Config can be created and deployed - :CaseLevel: Integration - :CaseImportance: High """ assert virtwho_config_api.status == 'unknown' @@ -63,8 +56,6 @@ def test_positive_hypervisor_id_option( :expectedresults: hypervisor_id option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ for value in ['uuid', 'hostname']: @@ -90,8 +81,6 @@ def test_positive_prism_central_deploy_configure_by_id_script( Config can be created and deployed The prism_central has been set in /etc/virt-who.d/vir-who.conf file - :CaseLevel: Integration - :CaseImportance: High """ form_data_api['prism_flavor'] = "central" @@ -135,8 +124,6 @@ def test_positive_prism_central_prism_central_option( :expectedresults: prism_flavor option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ value = 'central' diff --git a/tests/foreman/virtwho/cli/test_esx.py b/tests/foreman/virtwho/cli/test_esx.py index b8e110af4f..c661d31cd6 100644 --- a/tests/foreman/virtwho/cli/test_esx.py +++ b/tests/foreman/virtwho/cli/test_esx.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import re @@ -48,8 +43,6 @@ def test_positive_deploy_configure_by_id_script( :expectedresults: Config can be created and deployed - :CaseLevel: Integration - :CaseImportance: High """ assert virtwho_config_cli['status'] == 'No Report Yet' @@ -92,8 +85,6 @@ def test_positive_debug_option(self, default_org, form_data_cli, target_sat): :expectedresults: debug option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ virtwho_config = target_sat.cli.VirtWhoConfig.create(form_data_cli)['general-information'] @@ -123,8 +114,6 @@ def test_positive_interval_option( :expectedresults: interval option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ options = { @@ -155,8 +144,6 @@ def test_positive_hypervisor_id_option( :expectedresults: hypervisor_id option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ # esx and rhevm support hwuuid option @@ -184,8 +171,6 @@ def test_positive_filter_option( :expectedresults: filter and filter_hosts can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ regex = '.*redhat.com' @@ -237,8 +222,6 @@ def test_positive_proxy_option( :expectedresults: http_proxy and no_proxy option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium :BZ: 1902199 @@ -281,8 +264,6 @@ def test_positive_rhsm_option(self, default_org, form_data_cli, virtwho_config_c rhsm_hostname, rhsm_prefix are ecpected rhsm_username is not a login account - :CaseLevel: Integration - :CaseImportance: Medium """ config_file = get_configure_file(virtwho_config_cli['id']) @@ -304,8 +285,6 @@ def test_positive_post_hypervisors(self, function_org, target_sat): :expectedresults: hypervisor/guest json can be posted and the task is success status - :CaseLevel: Integration - :customerscenario: true :CaseImportance: Medium @@ -335,8 +314,6 @@ def test_positive_foreman_packages_protection( virt-who packages can be installed the virt-who plugin can be deployed successfully - :CaseLevel: Integration - :customerscenario: true :CaseImportance: Medium @@ -366,8 +343,6 @@ def test_positive_deploy_configure_hypervisor_password_with_special_characters( :expectedresults: Config can be created and deployed without any error - :CaseLevel: Integration - :CaseImportance: High :BZ: 1870816,1959136 @@ -416,8 +391,6 @@ def test_positive_remove_env_option( the option "env=" should be removed from etc/virt-who.d/virt-who.conf /var/log/messages should not display warning message - :CaseLevel: Integration - :CaseImportance: Medium :BZ: 1834897 diff --git a/tests/foreman/virtwho/cli/test_esx_sca.py b/tests/foreman/virtwho/cli/test_esx_sca.py index 1a54ae9d56..b09cabef91 100644 --- a/tests/foreman/virtwho/cli/test_esx_sca.py +++ b/tests/foreman/virtwho/cli/test_esx_sca.py @@ -4,15 +4,10 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :Team: Phoenix -:TestType: Functional - -:Upstream: No """ import re @@ -49,8 +44,6 @@ def test_positive_deploy_configure_by_id_script( 1. Config can be created and deployed 2. Config can be created, fetch and deploy - :CaseLevel: Integration - :CaseImportance: High """ assert virtwho_config_cli['status'] == 'No Report Yet' @@ -69,8 +62,6 @@ def test_positive_hypervisor_id_option( :expectedresults: hypervisor_id option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ for value in ['uuid', 'hostname']: @@ -96,8 +87,6 @@ def test_positive_debug_option( :expectedresults: debug option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ assert virtwho_config_cli['name'] == form_data_cli['name'] @@ -120,8 +109,6 @@ def test_positive_name_option( :expectedresults: name option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ assert virtwho_config_cli['name'] == form_data_cli['name'] @@ -145,8 +132,6 @@ def test_positive_interval_option( :expectedresults: interval option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ options = { @@ -187,8 +172,6 @@ def test_positive_filter_option( 1. filter and filter_hosts can be updated. 2. create virt-who config with filter and filter_hosts options work well. - :CaseLevel: Integration - :CaseImportance: Medium """ regex = '.*redhat.com' @@ -273,8 +256,6 @@ def test_positive_proxy_option( 1. http_proxy and no_proxy option can be updated. 2. create virt-who config with http_proxy and no_proxy options work well. - :CaseLevel: Integration - :CaseImportance: Medium :BZ: 1902199 @@ -355,8 +336,6 @@ def test_positive_rhsm_option( 1. rhsm_hostname, rhsm_prefix are expected 2. rhsm_username is not a login account - :CaseLevel: Integration - :CaseImportance: Medium """ config_file = get_configure_file(virtwho_config_cli['id']) @@ -378,8 +357,6 @@ def test_positive_post_hypervisors(self, function_org, target_sat): :expectedresults: hypervisor/guest json can be posted and the task is success status - :CaseLevel: Integration - :customerscenario: true :CaseImportance: Medium @@ -409,8 +386,6 @@ def test_positive_foreman_packages_protection( 1. virt-who packages can be installed 2. the virt-who plugin can be deployed successfully - :CaseLevel: Integration - :customerscenario: true :CaseImportance: Medium @@ -437,8 +412,6 @@ def test_positive_deploy_configure_hypervisor_password_with_special_characters( :expectedresults: Config can be created and deployed without any error - :CaseLevel: Integration - :CaseImportance: High :BZ: 1870816,1959136 @@ -493,8 +466,6 @@ def test_positive_remove_env_option( 1. the option "env=" should be removed from etc/virt-who.d/virt-who.conf 2. /var/log/messages should not display warning message - :CaseLevel: Integration - :CaseImportance: Medium :BZ: 1834897 diff --git a/tests/foreman/virtwho/cli/test_hyperv.py b/tests/foreman/virtwho/cli/test_hyperv.py index ffc421506f..657ee3e04f 100644 --- a/tests/foreman/virtwho/cli/test_hyperv.py +++ b/tests/foreman/virtwho/cli/test_hyperv.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -41,8 +36,6 @@ def test_positive_deploy_configure_by_id_script( 1. Config can be created and deployed 2. Config can be created, fetch and deploy - :CaseLevel: Integration - :CaseImportance: High """ assert virtwho_config_cli['status'] == 'No Report Yet' @@ -81,8 +74,6 @@ def test_positive_hypervisor_id_option( :expectedresults: hypervisor_id option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ values = ['uuid', 'hostname'] diff --git a/tests/foreman/virtwho/cli/test_hyperv_sca.py b/tests/foreman/virtwho/cli/test_hyperv_sca.py index 4b2725c543..7c59213485 100644 --- a/tests/foreman/virtwho/cli/test_hyperv_sca.py +++ b/tests/foreman/virtwho/cli/test_hyperv_sca.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -40,8 +35,6 @@ def test_positive_deploy_configure_by_id_script( 1. Config can be created and deployed 2. Config can be created, fetch and deploy - :CaseLevel: Integration - :CaseImportance: High """ assert virtwho_config_cli['status'] == 'No Report Yet' @@ -61,8 +54,6 @@ def test_positive_hypervisor_id_option( :expectedresults: hypervisor_id option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ for value in ['uuid', 'hostname']: diff --git a/tests/foreman/virtwho/cli/test_kubevirt.py b/tests/foreman/virtwho/cli/test_kubevirt.py index 4b8a5c57f0..f29a22e4a1 100644 --- a/tests/foreman/virtwho/cli/test_kubevirt.py +++ b/tests/foreman/virtwho/cli/test_kubevirt.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -41,8 +36,6 @@ def test_positive_deploy_configure_by_id_script( 1. Config can be created and deployed 2. Config can be created, fetch and deploy - :CaseLevel: Integration - :CaseImportance: High """ assert virtwho_config_cli['status'] == 'No Report Yet' @@ -81,8 +74,6 @@ def test_positive_hypervisor_id_option( :expectedresults: hypervisor_id option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ values = ['uuid', 'hostname'] diff --git a/tests/foreman/virtwho/cli/test_kubevirt_sca.py b/tests/foreman/virtwho/cli/test_kubevirt_sca.py index 2d7fd4fca9..d682b5f915 100644 --- a/tests/foreman/virtwho/cli/test_kubevirt_sca.py +++ b/tests/foreman/virtwho/cli/test_kubevirt_sca.py @@ -4,15 +4,10 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - -:Upstream: No """ import pytest @@ -38,8 +33,6 @@ def test_positive_deploy_configure_by_id_script( 1. Config can be created and deployed 2. Config can be created, fetch and deploy - :CaseLevel: Integration - :CaseImportance: High """ assert virtwho_config_cli['status'] == 'No Report Yet' @@ -57,8 +50,6 @@ def test_positive_hypervisor_id_option( :id: b60f449d-6698-4a3a-be07-7440c2d9ba20 :expectedresults: hypervisor_id option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ for value in ['uuid', 'hostname']: diff --git a/tests/foreman/virtwho/cli/test_libvirt.py b/tests/foreman/virtwho/cli/test_libvirt.py index 5c9cfda2db..70ac4056fa 100644 --- a/tests/foreman/virtwho/cli/test_libvirt.py +++ b/tests/foreman/virtwho/cli/test_libvirt.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -41,8 +36,6 @@ def test_positive_deploy_configure_by_id_script( 1. Config can be created and deployed 2. Config can be created, fetch and deploy - :CaseLevel: Integration - :CaseImportance: High """ assert virtwho_config_cli['status'] == 'No Report Yet' @@ -81,8 +74,6 @@ def test_positive_hypervisor_id_option( :expectedresults: hypervisor_id option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ values = ['uuid', 'hostname'] diff --git a/tests/foreman/virtwho/cli/test_libvirt_sca.py b/tests/foreman/virtwho/cli/test_libvirt_sca.py index 3532bb7983..2bfeda3080 100644 --- a/tests/foreman/virtwho/cli/test_libvirt_sca.py +++ b/tests/foreman/virtwho/cli/test_libvirt_sca.py @@ -4,15 +4,10 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - -:Upstream: No """ import pytest @@ -38,8 +33,6 @@ def test_positive_deploy_configure_by_id_script( 1. Config can be created and deployed 2. Config can be created, fetch and deploy - :CaseLevel: Integration - :CaseImportance: High """ assert virtwho_config_cli['status'] == 'No Report Yet' @@ -58,8 +51,6 @@ def test_positive_hypervisor_id_option( :expectedresults: hypervisor_id option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ for value in ['uuid', 'hostname']: diff --git a/tests/foreman/virtwho/cli/test_nutanix.py b/tests/foreman/virtwho/cli/test_nutanix.py index 052101f792..b5478912ab 100644 --- a/tests/foreman/virtwho/cli/test_nutanix.py +++ b/tests/foreman/virtwho/cli/test_nutanix.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -44,8 +39,6 @@ def test_positive_deploy_configure_by_id_script( 1. Config can be created and deployed 2. Config can be created, fetch and deploy - :CaseLevel: Integration - :CaseImportance: High """ assert virtwho_config_cli['status'] == 'No Report Yet' @@ -84,8 +77,6 @@ def test_positive_hypervisor_id_option( :expectedresults: hypervisor_id option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ values = ['uuid', 'hostname'] @@ -115,8 +106,6 @@ def test_positive_prism_central_deploy_configure_by_id_script( Config can be created and deployed The prism_central has been set in /etc/virt-who.d/vir-who.conf file - :CaseLevel: Integration - :CaseImportance: High """ form_data_cli['prism-flavor'] = "central" @@ -171,8 +160,6 @@ def test_positive_prism_central_prism_central_option( :expectedresults: prism_central option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ value = 'central' @@ -207,11 +194,11 @@ def test_positive_ahv_internal_debug_option( 5. message Host UUID {system_uuid} found for VM: {guest_uuid} exist in rhsm.log 6. ahv_internal_debug bas been set to true in virt-who-config-X.conf 7. warning message does not exist in log file /var/log/rhsm/rhsm.log - :CaseLevel: Integration :CaseImportance: Medium :BZ: 2141719 + :customerscenario: true """ command = get_configure_command(virtwho_config_cli['id'], default_org.name) diff --git a/tests/foreman/virtwho/cli/test_nutanix_sca.py b/tests/foreman/virtwho/cli/test_nutanix_sca.py index f41daa8d75..360aac0f67 100644 --- a/tests/foreman/virtwho/cli/test_nutanix_sca.py +++ b/tests/foreman/virtwho/cli/test_nutanix_sca.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :Team: Phoenix -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -41,8 +36,6 @@ def test_positive_deploy_configure_by_id_script( 1. Config can be created and deployed 2. Config can be created, fetch and deploy - :CaseLevel: Integration - :CaseImportance: High """ assert virtwho_config_cli['status'] == 'No Report Yet' @@ -61,8 +54,6 @@ def test_positive_hypervisor_id_option( :expectedresults: hypervisor_id option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ for value in ['uuid', 'hostname']: @@ -92,8 +83,6 @@ def test_positive_prism_central_deploy_configure_by_id_script( 2. The prism_central has been set in /etc/virt-who.d/vir-who.conf file 3. Config can be created, fetch and deploy - :CaseLevel: Integration - :CaseImportance: High """ form_data_cli['prism-flavor'] = "central" @@ -135,8 +124,6 @@ def test_positive_prism_element_prism_central_option( :expectedresults: prism_central option can be updated. - :CaseLevel: Integration - :CaseImportance: Medium """ value = 'central' diff --git a/tests/foreman/virtwho/conftest.py b/tests/foreman/virtwho/conftest.py index 8e422b2294..133fa0026a 100644 --- a/tests/foreman/virtwho/conftest.py +++ b/tests/foreman/virtwho/conftest.py @@ -49,7 +49,6 @@ def test_foo(session): with session: # your ui test steps here session.architecture.create({'name': 'bar'}) - """ return Session(test_name, module_user.login, module_user.password) @@ -97,6 +96,5 @@ def test_foo(session): with session: # your ui test steps here session.architecture.create({'name': 'bar'}) - """ return Session(test_name, module_user_sca.login, module_user_sca.password) diff --git a/tests/foreman/virtwho/ui/test_esx.py b/tests/foreman/virtwho/ui/test_esx.py index 7c669a6202..5baba61e97 100644 --- a/tests/foreman/virtwho/ui/test_esx.py +++ b/tests/foreman/virtwho/ui/test_esx.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from datetime import datetime @@ -59,8 +54,6 @@ def test_positive_deploy_configure_by_id_script( 4. Virtual sku can be generated and attached 5. Config can be deleted - :CaseLevel: Integration - :CaseImportance: High """ hypervisor_name, guest_name = deploy_type_ui @@ -93,8 +86,6 @@ def test_positive_debug_option(self, default_org, virtwho_config_ui, org_session 1. if debug is checked, VIRTWHO_DEBUG=1 in /etc/sysconfig/virt-who 2. if debug is unchecked, VIRTWHO_DEBUG=0 in /etc/sysconfig/virt-who - :CaseLevel: Integration - :CaseImportance: Medium """ name = form_data_ui['name'] @@ -124,8 +115,6 @@ def test_positive_interval_option( VIRTWHO_INTERVAL can be changed in /etc/sysconfig/virt-who if the dropdown option is selected to Every 2/4/8/12/24 hours, Every 2/3 days. - :CaseLevel: Integration - :CaseImportance: Medium """ name = form_data_ui['name'] @@ -162,8 +151,6 @@ def test_positive_hypervisor_id_option( hypervisor_id can be changed in virt-who-config-{}.conf if the dropdown option is selected to uuid/hwuuid/hostname. - :CaseLevel: Integration - :CaseImportance: Medium """ name = form_data_ui['name'] @@ -193,8 +180,6 @@ def test_positive_filtering_option( 1. if filtering is selected to Whitelist, 'Filter hosts' can be set. 2. if filtering is selected to Blacklist, 'Exclude hosts' can be set. - :CaseLevel: Integration - :CaseImportance: Medium :BZ: 1735670 @@ -239,8 +224,6 @@ def test_positive_proxy_option(self, default_org, virtwho_config_ui, org_session :expectedresults: http_proxy/https_proxy and NO_PROXY will be setting in /etc/sysconfig/virt-who. - :CaseLevel: Integration - :CaseImportance: Medium """ https_proxy, https_proxy_name, https_proxy_id = create_http_proxy(org=default_org) @@ -279,8 +262,6 @@ def test_positive_virtwho_roles(self, org_session): :expectedresults: 'Virt-who Manager', 'Virt-who Reporter', 'Virt-who Viewer' existing - :CaseLevel: Integration - :CaseImportance: Low """ roles = { @@ -311,7 +292,7 @@ def test_positive_virtwho_configs_widget(self, default_org, org_session, form_da :id: 5d61ce00-a640-4823-89d4-7b1d02b50ea6 - :Steps: + :steps: 1. Create a Virt-who Configuration 2. Navigate Monitor -> Dashboard @@ -319,8 +300,6 @@ def test_positive_virtwho_configs_widget(self, default_org, org_session, form_da :expectedresults: The widget is updated with all details. - :CaseLevel: Integration - :CaseImportance: Low """ org_name = gen_string('alpha') @@ -572,8 +551,6 @@ def test_positive_overview_label_name(self, default_org, form_data_ui, org_sessi :BZ: 1649928 - :CaseLevel: Integration - :customerscenario: true :CaseImportance: Medium @@ -638,8 +615,6 @@ def test_positive_last_checkin_status( :BZ: 1652323 - :CaseLevel: Integration - :customerscenario: true :CaseImportance: Medium @@ -674,8 +649,6 @@ def test_positive_deploy_configure_hypervisor_password_with_special_characters( :expectedresults: Config can be created and deployed without any error - :CaseLevel: Integration - :CaseImportance: High :BZ: 1870816,1959136 @@ -730,8 +703,6 @@ def test_positive_remove_env_option( the option "env=" should be removed from etc/virt-who.d/virt-who.conf /var/log/messages should not display warning message - :CaseLevel: Integration - :CaseImportance: Medium :BZ: 1834897 diff --git a/tests/foreman/virtwho/ui/test_esx_sca.py b/tests/foreman/virtwho/ui/test_esx_sca.py index 068b8c9c84..c0f09e740e 100644 --- a/tests/foreman/virtwho/ui/test_esx_sca.py +++ b/tests/foreman/virtwho/ui/test_esx_sca.py @@ -4,15 +4,10 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - -:Upstream: No """ from datetime import datetime @@ -57,8 +52,6 @@ def test_positive_deploy_configure_by_id_script( 4. Virtual sku can be generated and attached 5. Config can be deleted - :CaseLevel: Integration - :CaseImportance: High """ assert org_session.virtwho_configure.search(form_data_ui['name'])[0]['Status'] == 'ok' @@ -75,8 +68,6 @@ def test_positive_debug_option( 1. if debug is checked, VIRTWHO_DEBUG=1 in /etc/sysconfig/virt-who 2. if debug is unchecked, VIRTWHO_DEBUG=0 in /etc/sysconfig/virt-who - :CaseLevel: Integration - :CaseImportance: Medium """ name = form_data_ui['name'] @@ -106,8 +97,6 @@ def test_positive_interval_option( VIRTWHO_INTERVAL can be changed in /etc/sysconfig/virt-who if the dropdown option is selected to Every 2/4/8/12/24 hours, Every 2/3 days. - :CaseLevel: Integration - :CaseImportance: Medium """ name = form_data_ui['name'] @@ -144,8 +133,6 @@ def test_positive_hypervisor_id_option( hypervisor_id can be changed in virt-who-config-{}.conf if the dropdown option is selected to uuid/hwuuid/hostname. - :CaseLevel: Integration - :CaseImportance: Medium """ name = form_data_ui['name'] @@ -181,7 +168,6 @@ def test_positive_filtering_option( 'Filter hosts' can be set. 4. Create virtwho config if filtering is selected to Blacklist, 'Exclude hosts' can be set. - :CaseLevel: Integration :CaseImportance: Medium @@ -267,8 +253,6 @@ def test_positive_last_checkin_status( :BZ: 1652323 - :CaseLevel: Integration - :customerscenario: true :CaseImportance: Medium @@ -305,8 +289,6 @@ def test_positive_remove_env_option( 1. the option "env=" should be removed from etc/virt-who.d/virt-who.conf 2. /var/log/messages should not display warning message - :CaseLevel: Integration - :CaseImportance: Medium :BZ: 1834897 @@ -344,8 +326,6 @@ def test_positive_virtwho_roles(self, org_session): :expectedresults: 'Virt-who Manager', 'Virt-who Reporter', 'Virt-who Viewer' existing - :CaseLevel: Integration - :CaseImportance: Low """ roles = { @@ -385,8 +365,6 @@ def test_positive_delete_configure(self, module_sca_manifest_org, org_session, f 1. Verify the virt-who server can no longer connect to the Satellite. - :CaseLevel: Integration - :CaseImportance: Low """ name = gen_string('alpha') @@ -417,8 +395,6 @@ def test_positive_virtwho_reporter_role( to upload the report, it can be used if you configure virt-who manually and want to use user that has locked down account. - :CaseLevel: Integration - :CaseImportance: Low """ username = gen_string('alpha') @@ -477,8 +453,6 @@ def test_positive_virtwho_viewer_role( including their configuration scripts, which means viewers could still deploy the virt-who instances for existing virt-who configurations. - :CaseLevel: Integration - :CaseImportance: Low """ username = gen_string('alpha') @@ -541,7 +515,6 @@ def test_positive_virtwho_manager_role( :expectedresults: Virt-who Manager Role granting all permissions to manage virt-who configurations, user needs this role to create, delete or update configurations. - :CaseLevel: Integration :CaseImportance: Low """ @@ -605,8 +578,6 @@ def test_positive_deploy_configure_hypervisor_password_with_special_characters( :expectedresults: Config can be created and deployed without any error - :CaseLevel: Integration - :CaseImportance: High :BZ: 1870816,1959136 diff --git a/tests/foreman/virtwho/ui/test_hyperv.py b/tests/foreman/virtwho/ui/test_hyperv.py index a35878e2fc..8348540326 100644 --- a/tests/foreman/virtwho/ui/test_hyperv.py +++ b/tests/foreman/virtwho/ui/test_hyperv.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -45,8 +40,6 @@ def test_positive_deploy_configure_by_id_script( 4. Virtual sku can be generated and attached 5. Config can be deleted - :CaseLevel: Integration - :CaseImportance: High """ hypervisor_name, guest_name = deploy_type_ui @@ -81,8 +74,6 @@ def test_positive_hypervisor_id_option( hypervisor_id can be changed in virt-who-config-{}.conf if the dropdown option is selected to uuid/hwuuid/hostname. - :CaseLevel: Integration - :CaseImportance: Medium """ name = form_data_ui['name'] diff --git a/tests/foreman/virtwho/ui/test_hyperv_sca.py b/tests/foreman/virtwho/ui/test_hyperv_sca.py index 3e7b0f01c5..a5b560c99a 100644 --- a/tests/foreman/virtwho/ui/test_hyperv_sca.py +++ b/tests/foreman/virtwho/ui/test_hyperv_sca.py @@ -4,15 +4,10 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - -:Upstream: No """ import pytest @@ -42,8 +37,6 @@ def test_positive_deploy_configure_by_id_script( 4. Virtual sku can be generated and attached 5. Config can be deleted - :CaseLevel: Integration - :CaseImportance: High """ assert org_session.virtwho_configure.search(form_data_ui['name'])[0]['Status'] == 'ok' @@ -60,8 +53,6 @@ def test_positive_hypervisor_id_option( 1. hypervisor_id can be changed in virt-who-config-{}.conf if the dropdown option is selected to uuid/hwuuid/hostname. - :CaseLevel: Integration - :CaseImportance: Medium """ name = form_data_ui['name'] diff --git a/tests/foreman/virtwho/ui/test_kubevirt.py b/tests/foreman/virtwho/ui/test_kubevirt.py index 19d5bce7f6..e12c4774fc 100644 --- a/tests/foreman/virtwho/ui/test_kubevirt.py +++ b/tests/foreman/virtwho/ui/test_kubevirt.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -45,8 +40,6 @@ def test_positive_deploy_configure_by_id_script( 4. Virtual sku can be generated and attached 5. Config can be deleted - :CaseLevel: Integration - :CaseImportance: High """ hypervisor_name, guest_name = deploy_type_ui @@ -81,8 +74,6 @@ def test_positive_hypervisor_id_option( hypervisor_id can be changed in virt-who-config-{}.conf if the dropdown option is selected to uuid/hwuuid/hostname. - :CaseLevel: Integration - :CaseImportance: Medium """ name = form_data_ui['name'] diff --git a/tests/foreman/virtwho/ui/test_kubevirt_sca.py b/tests/foreman/virtwho/ui/test_kubevirt_sca.py index 6ad0bdf1f9..a155492986 100644 --- a/tests/foreman/virtwho/ui/test_kubevirt_sca.py +++ b/tests/foreman/virtwho/ui/test_kubevirt_sca.py @@ -4,15 +4,10 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - -:Upstream: No """ import pytest @@ -42,8 +37,6 @@ def test_positive_deploy_configure_by_id_script( 4. Virtual sku can be generated and attached 5. Config can be deleted - :CaseLevel: Integration - :CaseImportance: High """ assert org_session.virtwho_configure.search(form_data_ui['name'])[0]['Status'] == 'ok' @@ -60,8 +53,6 @@ def test_positive_hypervisor_id_option( 1. hypervisor_id can be changed in virt-who-config-{}.conf if the dropdown option is selected to uuid/hwuuid/hostname. - :CaseLevel: Integration - :CaseImportance: Medium """ name = form_data_ui['name'] diff --git a/tests/foreman/virtwho/ui/test_libvirt.py b/tests/foreman/virtwho/ui/test_libvirt.py index 86b3d3e653..a66bf1737b 100644 --- a/tests/foreman/virtwho/ui/test_libvirt.py +++ b/tests/foreman/virtwho/ui/test_libvirt.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -45,8 +40,6 @@ def test_positive_deploy_configure_by_id_script( 4. Virtual sku can be generated and attached 5. Config can be deleted - :CaseLevel: Integration - :CaseImportance: High """ hypervisor_name, guest_name = deploy_type_ui @@ -81,8 +74,6 @@ def test_positive_hypervisor_id_option( hypervisor_id can be changed in virt-who-config-{}.conf if the dropdown option is selected to uuid/hwuuid/hostname. - :CaseLevel: Integration - :CaseImportance: Medium """ name = form_data_ui['name'] diff --git a/tests/foreman/virtwho/ui/test_libvirt_sca.py b/tests/foreman/virtwho/ui/test_libvirt_sca.py index b6d3366974..ffef902441 100644 --- a/tests/foreman/virtwho/ui/test_libvirt_sca.py +++ b/tests/foreman/virtwho/ui/test_libvirt_sca.py @@ -4,15 +4,10 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - -:Upstream: No """ import pytest @@ -42,8 +37,6 @@ def test_positive_deploy_configure_by_id_script( 4. Virtual sku can be generated and attached 5. Config can be deleted - :CaseLevel: Integration - :CaseImportance: High """ assert org_session.virtwho_configure.search(form_data_ui['name'])[0]['Status'] == 'ok' @@ -60,8 +53,6 @@ def test_positive_hypervisor_id_option( 1. hypervisor_id can be changed in virt-who-config-{}.conf if the dropdown option is selected to uuid/hwuuid/hostname. - :CaseLevel: Integration - :CaseImportance: Medium """ name = form_data_ui['name'] diff --git a/tests/foreman/virtwho/ui/test_nutanix.py b/tests/foreman/virtwho/ui/test_nutanix.py index 652f335455..7ec05f191d 100644 --- a/tests/foreman/virtwho/ui/test_nutanix.py +++ b/tests/foreman/virtwho/ui/test_nutanix.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -49,8 +44,6 @@ def test_positive_deploy_configure_by_id_script( 4. Virtual sku can be generated and attached 5. Config can be deleted - :CaseLevel: Integration - :CaseImportance: High """ hypervisor_name, guest_name = deploy_type_ui @@ -85,8 +78,6 @@ def test_positive_hypervisor_id_option( hypervisor_id can be changed in virt-who-config-{}.conf if the dropdown option is selected to uuid/hwuuid/hostname. - :CaseLevel: Integration - :CaseImportance: Medium """ name = form_data_ui['name'] @@ -121,8 +112,6 @@ def test_positive_prism_central_deploy_configure_by_id_script( 5. Virtual sku can be generated and attached 6. Config can be deleted - :CaseLevel: Integration - :CaseImportance: High """ name = gen_string('alpha') @@ -180,8 +169,6 @@ def test_positive_prism_central_prism_flavor_option( prism_flavor can be changed in virt-who-config-{}.conf if the dropdown option is selected to prism central. - :CaseLevel: Integration - :CaseImportance: Medium """ name = form_data_ui['name'] @@ -216,7 +203,6 @@ def test_positive_ahv_internal_debug_option( 5. message Host UUID {system_uuid} found for VM: {guest_uuid} exist in rhsm.log 6. ahv_internal_debug bas been set to true in virt-who-config-X.conf 7. warning message does not exist in log file /var/log/rhsm/rhsm.log - :CaseLevel: Integration :CaseImportance: Medium diff --git a/tests/foreman/virtwho/ui/test_nutanix_sca.py b/tests/foreman/virtwho/ui/test_nutanix_sca.py index 89bae08771..bb2483195d 100644 --- a/tests/foreman/virtwho/ui/test_nutanix_sca.py +++ b/tests/foreman/virtwho/ui/test_nutanix_sca.py @@ -4,15 +4,10 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :Team: Phoenix-subscriptions -:TestType: Functional - -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -45,8 +40,6 @@ def test_positive_deploy_configure_by_id_script( 3. Report is sent to satellite 4. Config can be deleted - :CaseLevel: Integration - :CaseImportance: High """ assert org_session.virtwho_configure.search(form_data_ui['name'])[0]['Status'] == 'ok' @@ -63,8 +56,6 @@ def test_positive_hypervisor_id_option( 1. hypervisor_id can be changed in virt-who-config-{}.conf if the dropdown option is selected to uuid/hwuuid/hostname. - :CaseLevel: Integration - :CaseImportance: Medium """ name = form_data_ui['name'] @@ -101,8 +92,6 @@ def test_positive_prism_central_deploy_configure_by_id_script( 5. Virtual sku can be generated and attached 6. Config can be deleted - :CaseLevel: Integration - :CaseImportance: High """ name = gen_string('alpha') @@ -147,8 +136,6 @@ def test_positive_prism_central_prism_flavor_option( 1. prism_flavor can be changed in virt-who-config-{}.conf if the dropdown option is selected to prism central. - :CaseLevel: Integration - :CaseImportance: Medium """ name = form_data_ui['name'] @@ -184,8 +171,6 @@ def test_positive_ahv_internal_debug_option( 6. ahv_internal_debug bas been set to true in virt-who-config-X.conf 7. warning message does not exist in log file /var/log/rhsm/rhsm.log - :CaseLevel: Integration - :CaseImportance: Medium :BZ: 2141719 diff --git a/tests/upgrades/test_activation_key.py b/tests/upgrades/test_activation_key.py index e58c06fee1..bac55d78c3 100644 --- a/tests/upgrades/test_activation_key.py +++ b/tests/upgrades/test_activation_key.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: ActivationKeys :Team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest from requests.exceptions import HTTPError diff --git a/tests/upgrades/test_bookmarks.py b/tests/upgrades/test_bookmarks.py index a3f330e756..b0d04cfa98 100644 --- a/tests/upgrades/test_bookmarks.py +++ b/tests/upgrades/test_bookmarks.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Search :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest @@ -34,7 +29,7 @@ def test_pre_create_public_disable_bookmark(self, request, target_sat): :id: preupgrade-13904b14-6340-4b85-a56f-98080cf50a92 - :Steps: + :steps: 1. Create public disabled bookmarks before the upgrade for all system entities using available bookmark data. @@ -71,7 +66,7 @@ def test_post_create_public_disable_bookmark(self, dependent_scenario_name, targ :id: postupgrade-13904b14-6340-4b85-a56f-98080cf50a92 - :Steps: + :steps: 1. Check the bookmark status after post-upgrade. 2. Remove the bookmark. @@ -105,7 +100,7 @@ def test_pre_create_public_enable_bookmark(self, request, target_sat): :id: preupgrade-93c419db-66b4-4c9a-a82a-a6a68703881f - :Steps: + :steps: 1. Create public enable bookmarks before the upgrade for all system entities using available bookmark data. 2. Check the bookmark attribute(controller, name, query public) status @@ -140,7 +135,7 @@ def test_post_create_public_enable_bookmark(self, dependent_scenario_name, targe :id: postupgrade-93c419db-66b4-4c9a-a82a-a6a68703881f - :Steps: + :steps: 1. Check the bookmark status after post-upgrade. 2. Remove the bookmark. diff --git a/tests/upgrades/test_capsule.py b/tests/upgrades/test_capsule.py index e4f2d8a072..a520a316c1 100644 --- a/tests/upgrades/test_capsule.py +++ b/tests/upgrades/test_capsule.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Capsule :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import os diff --git a/tests/upgrades/test_classparameter.py b/tests/upgrades/test_classparameter.py index 689374d7db..ba63148b10 100644 --- a/tests/upgrades/test_classparameter.py +++ b/tests/upgrades/test_classparameter.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Puppet :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import json diff --git a/tests/upgrades/test_client.py b/tests/upgrades/test_client.py index a113017240..c89496485b 100644 --- a/tests/upgrades/test_client.py +++ b/tests/upgrades/test_client.py @@ -7,17 +7,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Hosts-Content :Team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/upgrades/test_contentview.py b/tests/upgrades/test_contentview.py index 2f50ee5db3..9b7fa90bb5 100644 --- a/tests/upgrades/test_contentview.py +++ b/tests/upgrades/test_contentview.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: ContentViews :Team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_alpha import pytest diff --git a/tests/upgrades/test_discovery.py b/tests/upgrades/test_discovery.py index 157b04cc4b..c85e02e01f 100644 --- a/tests/upgrades/test_discovery.py +++ b/tests/upgrades/test_discovery.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: DiscoveryImage :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import re diff --git a/tests/upgrades/test_errata.py b/tests/upgrades/test_errata.py index 864f884c3d..90dec2b305 100644 --- a/tests/upgrades/test_errata.py +++ b/tests/upgrades/test_errata.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: ErrataManagement :Team: Phoenix-content -:TestType: Functional - :CaseImportance: Critical -:Upstream: No """ import pytest from wait_for import wait_for diff --git a/tests/upgrades/test_host.py b/tests/upgrades/test_host.py index a53a36814f..642fef7f2b 100644 --- a/tests/upgrades/test_host.py +++ b/tests/upgrades/test_host.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Hosts :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest @@ -114,9 +109,7 @@ def test_pre_create_gce_cr_and_host( :id: 889975f2-56ca-4584-95a7-21c513969630 - :CaseLevel: Component - - ::CaseImportance: Critical + :CaseImportance: Critical :steps: 1. Create a GCE Compute Resource diff --git a/tests/upgrades/test_hostcontent.py b/tests/upgrades/test_hostcontent.py index 172039c193..0a6a60e2a9 100644 --- a/tests/upgrades/test_hostcontent.py +++ b/tests/upgrades/test_hostcontent.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Hosts-Content :Team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/upgrades/test_hostgroup.py b/tests/upgrades/test_hostgroup.py index c09de90e18..a6d67a106d 100644 --- a/tests/upgrades/test_hostgroup.py +++ b/tests/upgrades/test_hostgroup.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: HostGroup :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest diff --git a/tests/upgrades/test_performance_tuning.py b/tests/upgrades/test_performance_tuning.py index 16033bbd52..94e40a33ba 100644 --- a/tests/upgrades/test_performance_tuning.py +++ b/tests/upgrades/test_performance_tuning.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Installer :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import filecmp diff --git a/tests/upgrades/test_provisioningtemplate.py b/tests/upgrades/test_provisioningtemplate.py index b5bc11af36..9d681a56ea 100644 --- a/tests/upgrades/test_provisioningtemplate.py +++ b/tests/upgrades/test_provisioningtemplate.py @@ -8,13 +8,8 @@ :Team: Rocket -:TestType: Functional - -:CaseLevel: Integration - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest diff --git a/tests/upgrades/test_puppet.py b/tests/upgrades/test_puppet.py index 96af4c82de..5cf7b4e9ae 100644 --- a/tests/upgrades/test_puppet.py +++ b/tests/upgrades/test_puppet.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Puppet :Team: Rocket -:TestType: Functional - :CaseImportance: Medium -:Upstream: No """ import pytest diff --git a/tests/upgrades/test_remoteexecution.py b/tests/upgrades/test_remoteexecution.py index bf8e4b1353..6aeaecb863 100644 --- a/tests/upgrades/test_remoteexecution.py +++ b/tests/upgrades/test_remoteexecution.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: RemoteExecution :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/upgrades/test_repository.py b/tests/upgrades/test_repository.py index 998db385ad..31233d820c 100644 --- a/tests/upgrades/test_repository.py +++ b/tests/upgrades/test_repository.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Repositories :Team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/upgrades/test_role.py b/tests/upgrades/test_role.py index 2202ade883..c2ee4b25d2 100644 --- a/tests/upgrades/test_role.py +++ b/tests/upgrades/test_role.py @@ -4,17 +4,12 @@ :CaseAutomation: NotAutomated -:CaseLevel: Acceptance - :CaseComponent: UsersRoles :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/upgrades/test_satellite_maintain.py b/tests/upgrades/test_satellite_maintain.py index 81af10fdf1..5091f8508f 100644 --- a/tests/upgrades/test_satellite_maintain.py +++ b/tests/upgrades/test_satellite_maintain.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: ForemanMaintain :Team: Platform -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import re diff --git a/tests/upgrades/test_satellitesync.py b/tests/upgrades/test_satellitesync.py index dcbc7866f8..ad9356d2f9 100644 --- a/tests/upgrades/test_satellitesync.py +++ b/tests/upgrades/test_satellitesync.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Component - :CaseComponent: InterSatelliteSync :Team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/upgrades/test_subnet.py b/tests/upgrades/test_subnet.py index 63813c06de..0fbc2f3827 100644 --- a/tests/upgrades/test_subnet.py +++ b/tests/upgrades/test_subnet.py @@ -4,17 +4,12 @@ :CaseAutomation: NotAutomated -:CaseLevel: Acceptance - :CaseComponent: Networking :Team: Rocket -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/upgrades/test_subscription.py b/tests/upgrades/test_subscription.py index 9515af048e..70e8b53f9c 100644 --- a/tests/upgrades/test_subscription.py +++ b/tests/upgrades/test_subscription.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: SubscriptionManagement :Team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from manifester import Manifester import pytest diff --git a/tests/upgrades/test_syncplan.py b/tests/upgrades/test_syncplan.py index ba14f9de83..5939c8e16d 100644 --- a/tests/upgrades/test_syncplan.py +++ b/tests/upgrades/test_syncplan.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: SyncPlans :Team: Phoenix-content -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_choice import pytest diff --git a/tests/upgrades/test_user.py b/tests/upgrades/test_user.py index cd3a8e5529..b21da9b5ba 100644 --- a/tests/upgrades/test_user.py +++ b/tests/upgrades/test_user.py @@ -4,17 +4,12 @@ :CaseAutomation: NotAutomated -:CaseLevel: Acceptance - :CaseComponent: UsersRoles :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ import pytest diff --git a/tests/upgrades/test_usergroup.py b/tests/upgrades/test_usergroup.py index aaa337d316..0832602dbb 100644 --- a/tests/upgrades/test_usergroup.py +++ b/tests/upgrades/test_usergroup.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: UsersRoles :Team: Endeavour -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest diff --git a/tests/upgrades/test_virtwho.py b/tests/upgrades/test_virtwho.py index 99606f2f06..ca785ab014 100644 --- a/tests/upgrades/test_virtwho.py +++ b/tests/upgrades/test_virtwho.py @@ -4,17 +4,12 @@ :CaseAutomation: Automated -:CaseLevel: Acceptance - :CaseComponent: Virt-whoConfigurePlugin :Team: Phoenix-subscriptions -:TestType: Functional - :CaseImportance: High -:Upstream: No """ from fauxfactory import gen_string import pytest From fb3453a38a3b44fae39024487d7c7306fb41f08e Mon Sep 17 00:00:00 2001 From: Shweta Singh Date: Mon, 8 Jan 2024 23:00:28 +0530 Subject: [PATCH 63/93] Update manifest fixture in registration test to resolve conflict (#13616) Update manifest fixture in test --- tests/foreman/api/test_registration.py | 4 ++-- tests/foreman/cli/test_registration.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/foreman/api/test_registration.py b/tests/foreman/api/test_registration.py index 9a3b98e355..a07627e85c 100644 --- a/tests/foreman/api/test_registration.py +++ b/tests/foreman/api/test_registration.py @@ -26,7 +26,7 @@ @pytest.mark.e2e @pytest.mark.no_containers def test_host_registration_end_to_end( - module_entitlement_manifest_org, + module_sca_manifest_org, module_location, module_activation_key, module_target_sat, @@ -46,7 +46,7 @@ def test_host_registration_end_to_end( :customerscenario: true """ - org = module_entitlement_manifest_org + org = module_sca_manifest_org command = module_target_sat.api.RegistrationCommand( organization=org, activation_keys=[module_activation_key.name], diff --git a/tests/foreman/cli/test_registration.py b/tests/foreman/cli/test_registration.py index f4260cb118..528c8ef722 100644 --- a/tests/foreman/cli/test_registration.py +++ b/tests/foreman/cli/test_registration.py @@ -23,7 +23,7 @@ @pytest.mark.e2e @pytest.mark.no_containers def test_host_registration_end_to_end( - module_entitlement_manifest_org, + module_sca_manifest_org, module_location, module_activation_key, module_target_sat, @@ -43,7 +43,7 @@ def test_host_registration_end_to_end( :customerscenario: true """ - org = module_entitlement_manifest_org + org = module_sca_manifest_org result = rhel_contenthost.register( org, module_location, [module_activation_key.name], module_target_sat ) From cd0476f76737235a5852e73dc81e360414253ed0 Mon Sep 17 00:00:00 2001 From: Peter Ondrejka Date: Mon, 8 Jan 2024 18:32:04 +0100 Subject: [PATCH 64/93] fix assert_job_invocation_status calls (#13647) --- tests/foreman/cli/test_remoteexecution.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/foreman/cli/test_remoteexecution.py b/tests/foreman/cli/test_remoteexecution.py index 5d6d86bb84..8686da54cc 100644 --- a/tests/foreman/cli/test_remoteexecution.py +++ b/tests/foreman/cli/test_remoteexecution.py @@ -456,7 +456,9 @@ def test_positive_run_recurring_job_with_max_iterations(self, rex_contenthost, t } ) result = target_sat.cli.JobInvocation.info({'id': invocation_command['id']}) - assert_job_invocation_status(invocation_command['id'], client.hostname, 'queued') + assert_job_invocation_status( + target_sat, invocation_command['id'], client.hostname, 'queued' + ) sleep(150) rec_logic = target_sat.cli.RecurringLogic.info({'id': result['recurring-logic-id']}) assert rec_logic['state'] == 'finished' @@ -539,7 +541,9 @@ def test_positive_time_expressions(self, rex_contenthost, target_sat): } ) result = target_sat.cli.JobInvocation.info({'id': invocation_command['id']}) - assert_job_invocation_status(invocation_command['id'], client.hostname, 'queued') + assert_job_invocation_status( + target_sat, invocation_command['id'], client.hostname, 'queued' + ) rec_logic = target_sat.cli.RecurringLogic.info({'id': result['recurring-logic-id']}) assert ( rec_logic['next-occurrence'] == exp[1] @@ -1449,7 +1453,9 @@ def test_positive_run_pull_job_on_offline_host( } ) # assert the job is waiting to be picked up by client - assert_job_invocation_status(invocation_command['id'], rhel_contenthost.hostname, 'running') + assert_job_invocation_status( + module_target_sat, invocation_command['id'], rhel_contenthost.hostname, 'running' + ) # start client on host result = rhel_contenthost.execute('systemctl start yggdrasild') assert result.status == 0, f'Failed to start yggdrasil on client: {result.stderr}' From d0b6ebba27553f503e5707b6bdc7e0cf0a49a8f0 Mon Sep 17 00:00:00 2001 From: Peter Ondrejka Date: Mon, 8 Jan 2024 18:46:36 +0100 Subject: [PATCH 65/93] fixing a forgotten make_job_invocaiton call (#13648) --- tests/foreman/cli/test_remoteexecution.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/foreman/cli/test_remoteexecution.py b/tests/foreman/cli/test_remoteexecution.py index 8686da54cc..def7f8688e 100644 --- a/tests/foreman/cli/test_remoteexecution.py +++ b/tests/foreman/cli/test_remoteexecution.py @@ -1369,7 +1369,7 @@ def test_positive_run_job_on_host_registered_to_pull_provider( module_target_sat, make_user_job['id'], rhel_contenthost.hostname ) # create a file as new user - invocation_command = module_target_sat.make_job_invocation( + invocation_command = module_target_sat.cli_factory.job_invocation( { 'job-template': 'Run Command - Script Default', 'inputs': f"command=touch /home/{username}/{filename}", From 07fa9bcb0ec24c12885df11fd1c87f5e2339f19a Mon Sep 17 00:00:00 2001 From: vsedmik <46570670+vsedmik@users.noreply.github.com> Date: Mon, 8 Jan 2024 21:36:47 +0100 Subject: [PATCH 66/93] Small fix for SyncPlan test (#13661) --- tests/foreman/cli/test_syncplan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/foreman/cli/test_syncplan.py b/tests/foreman/cli/test_syncplan.py index 1fdd8bf0c1..86f33b68ff 100644 --- a/tests/foreman/cli/test_syncplan.py +++ b/tests/foreman/cli/test_syncplan.py @@ -361,7 +361,7 @@ def test_positive_info_with_assigned_product(module_org, module_target_sat): module_target_sat.cli.Product.set_sync_plan( {'id': product['id'], 'sync-plan-id': sync_plan['id']} ) - updated_plan = module_target_sat.info({'id': sync_plan['id']}) + updated_plan = module_target_sat.cli.SyncPlan.info({'id': sync_plan['id']}) assert len(updated_plan['products']) == 2 assert {prod['name'] for prod in updated_plan['products']} == {prod1, prod2} From 5175c38efa3503273b1ffff8b2c5d6f7e0875218 Mon Sep 17 00:00:00 2001 From: Omkar Khatavkar Date: Tue, 9 Jan 2024 14:59:25 +0530 Subject: [PATCH 67/93] Removing the direct Airgun imports from robottelo (#13273) --- pytest_fixtures/core/ui.py | 29 + tests/foreman/ui/test_activationkey.py | 140 ++-- tests/foreman/ui/test_bookmarks.py | 28 +- tests/foreman/ui/test_branding.py | 3 +- tests/foreman/ui/test_contenthost.py | 48 +- tests/foreman/ui/test_contentview_old.py | 606 +++++++++++------- tests/foreman/ui/test_dashboard.py | 42 +- tests/foreman/ui/test_discoveryrule.py | 9 +- tests/foreman/ui/test_errata.py | 52 +- tests/foreman/ui/test_host.py | 15 +- tests/foreman/ui/test_ldap_authentication.py | 183 +++--- tests/foreman/ui/test_lifecycleenvironment.py | 3 +- tests/foreman/ui/test_repository.py | 113 ++-- tests/foreman/ui/test_role.py | 60 +- tests/foreman/ui/test_settings.py | 22 +- tests/foreman/ui/test_subscription.py | 52 +- tests/foreman/ui/test_user.py | 7 +- tests/foreman/virtwho/conftest.py | 9 +- tests/foreman/virtwho/ui/test_esx.py | 17 +- 19 files changed, 827 insertions(+), 611 deletions(-) diff --git a/pytest_fixtures/core/ui.py b/pytest_fixtures/core/ui.py index f87f4cec0a..298632f59f 100644 --- a/pytest_fixtures/core/ui.py +++ b/pytest_fixtures/core/ui.py @@ -2,6 +2,7 @@ import pytest from requests.exceptions import HTTPError +from robottelo.hosts import Satellite from robottelo.logging import logger @@ -70,3 +71,31 @@ def test_foo(autosession): """ with target_sat.ui_session(test_name, ui_user.login, ui_user.password) as started_session: yield started_session + + +@pytest.fixture(autouse=True) +def ui_session_record_property(request, record_property): + """ + Autouse fixture to set the record_property attribute for Satellite instances in the test. + + This fixture iterates over all fixtures in the current test node + (excluding the current fixture) and sets the record_property attribute + for instances of the Satellite class. + + Args: + request: The pytest request object. + record_property: The value to set for the record_property attribute. + """ + test_directories = [ + 'tests/foreman/destructive', + 'tests/foreman/ui', + 'tests/foreman/sanity', + 'tests/foreman/virtwho', + ] + test_file_path = request.node.fspath.strpath + if any(directory in test_file_path for directory in test_directories): + for fixture in request.node.fixturenames: + if request.fixturename != fixture: + if isinstance(request.getfixturevalue(fixture), Satellite): + sat = request.getfixturevalue(fixture) + sat.record_property = record_property diff --git a/tests/foreman/ui/test_activationkey.py b/tests/foreman/ui/test_activationkey.py index dd2d77f579..7630a1761b 100644 --- a/tests/foreman/ui/test_activationkey.py +++ b/tests/foreman/ui/test_activationkey.py @@ -13,10 +13,8 @@ """ import random -from airgun.session import Session from broker import Broker from fauxfactory import gen_string -from nailgun import entities import pytest from robottelo import constants @@ -28,7 +26,7 @@ @pytest.mark.e2e @pytest.mark.tier2 @pytest.mark.upgrade -def test_positive_end_to_end_crud(session, module_org): +def test_positive_end_to_end_crud(session, module_org, module_target_sat): """Perform end to end testing for activation key component :id: b6b98c45-e41e-4c7a-9be4-997273b7e24d @@ -39,7 +37,7 @@ def test_positive_end_to_end_crud(session, module_org): """ name = gen_string('alpha') new_name = gen_string('alpha') - cv = entities.ContentView(organization=module_org).create() + cv = module_target_sat.api.ContentView(organization=module_org).create() cv.publish() with session: # Create activation key with content view and LCE assigned @@ -89,7 +87,7 @@ def test_positive_end_to_end_register( :CaseImportance: High """ org = function_entitlement_manifest_org - lce = entities.LifecycleEnvironment(organization=org).create() + lce = target_sat.api.LifecycleEnvironment(organization=org).create() repos_collection.setup_content(org.id, lce.id, upload_manifest=False) ak_name = repos_collection.setup_content_data['activation_key']['name'] @@ -171,7 +169,7 @@ def test_positive_search_scoped(session, module_org, target_sat): @pytest.mark.tier2 @pytest.mark.upgrade -def test_positive_create_with_host_collection(session, module_org): +def test_positive_create_with_host_collection(session, module_org, module_target_sat): """Create Activation key with Host Collection :id: 0e4ad2b4-47a7-4087-828f-2b0535a97b69 @@ -179,7 +177,7 @@ def test_positive_create_with_host_collection(session, module_org): :expectedresults: Activation key is created """ name = gen_string('alpha') - hc = entities.HostCollection(organization=module_org).create() + hc = module_target_sat.api.HostCollection(organization=module_org).create() with session: session.activationkey.create({'name': name, 'lce': {constants.ENVIRONMENT: True}}) assert session.activationkey.search(name)[0]['Name'] == name @@ -226,21 +224,21 @@ def test_positive_add_host_collection_non_admin(module_org, test_name, target_sa :BZ: 1473212 """ ak_name = gen_string('alpha') - hc = entities.HostCollection(organization=module_org).create() + hc = target_sat.api.HostCollection(organization=module_org).create() # Create non-admin user with specified permissions - roles = [entities.Role().create()] + roles = [target_sat.api.Role().create()] user_permissions = { 'Katello::ActivationKey': constants.PERMISSIONS['Katello::ActivationKey'], 'Katello::HostCollection': constants.PERMISSIONS['Katello::HostCollection'], } - viewer_role = entities.Role().search(query={'search': 'name="Viewer"'})[0] + viewer_role = target_sat.api.Role().search(query={'search': 'name="Viewer"'})[0] roles.append(viewer_role) target_sat.api_factory.create_role_permissions(roles[0], user_permissions) password = gen_string('alphanumeric') - user = entities.User( + user = target_sat.api.User( admin=False, role=roles, password=password, organization=[module_org] ).create() - with Session(test_name, user=user.login, password=password) as session: + with target_sat.ui_session(test_name, user=user.login, password=password) as session: session.activationkey.create({'name': ak_name, 'lce': {constants.ENVIRONMENT: True}}) assert session.activationkey.search(ak_name)[0]['Name'] == ak_name session.activationkey.add_host_collection(ak_name, hc.name) @@ -260,21 +258,21 @@ def test_positive_remove_host_collection_non_admin(module_org, test_name, target listed """ ak_name = gen_string('alpha') - hc = entities.HostCollection(organization=module_org).create() + hc = target_sat.api.HostCollection(organization=module_org).create() # Create non-admin user with specified permissions - roles = [entities.Role().create()] + roles = [target_sat.api.Role().create()] user_permissions = { 'Katello::ActivationKey': constants.PERMISSIONS['Katello::ActivationKey'], 'Katello::HostCollection': constants.PERMISSIONS['Katello::HostCollection'], } - viewer_role = entities.Role().search(query={'search': 'name="Viewer"'})[0] + viewer_role = target_sat.api.Role().search(query={'search': 'name="Viewer"'})[0] roles.append(viewer_role) target_sat.api_factory.create_role_permissions(roles[0], user_permissions) password = gen_string('alphanumeric') - user = entities.User( + user = target_sat.api.User( admin=False, role=roles, password=password, organization=[module_org] ).create() - with Session(test_name, user=user.login, password=password) as session: + with target_sat.ui_session(test_name, user=user.login, password=password) as session: session.activationkey.create({'name': ak_name, 'lce': {constants.ENVIRONMENT: True}}) assert session.activationkey.search(ak_name)[0]['Name'] == ak_name session.activationkey.add_host_collection(ak_name, hc.name) @@ -545,8 +543,8 @@ def test_positive_add_rh_and_custom_products( custom_product_name = gen_string('alpha') repo_name = gen_string('alpha') org = function_entitlement_manifest_org - product = entities.Product(name=custom_product_name, organization=org).create() - repo = entities.Repository(name=repo_name, product=product).create() + product = target_sat.api.Product(name=custom_product_name, organization=org).create() + repo = target_sat.api.Repository(name=repo_name, product=product).create() rhel_repo_id = target_sat.api_factory.enable_rhrepo_and_fetchid( basearch=rh_repo['basearch'], org_id=org.id, @@ -556,7 +554,7 @@ def test_positive_add_rh_and_custom_products( releasever=rh_repo['releasever'], ) for repo_id in [rhel_repo_id, repo.id]: - entities.Repository(id=repo_id).sync() + target_sat.api.Repository(id=repo_id).sync() with session: session.organization.select(org.name) session.activationkey.create( @@ -599,19 +597,21 @@ def test_positive_fetch_product_content(target_sat, function_entitlement_manifes reposet=constants.REPOSET['rhst7'], releasever=None, ) - rh_repo = entities.Repository(id=rh_repo_id).read() + rh_repo = target_sat.api.Repository(id=rh_repo_id).read() rh_repo.sync() - custom_product = entities.Product(organization=org).create() - custom_repo = entities.Repository( + custom_product = target_sat.api.Product(organization=org).create() + custom_repo = target_sat.api.Repository( name=gen_string('alphanumeric').upper(), # first letter is always # uppercase on product content page, workarounding it for # successful checks product=custom_product, ).create() custom_repo.sync() - cv = entities.ContentView(organization=org, repository=[rh_repo_id, custom_repo.id]).create() + cv = target_sat.api.ContentView( + organization=org, repository=[rh_repo_id, custom_repo.id] + ).create() cv.publish() - ak = entities.ActivationKey(content_view=cv, organization=org).create() + ak = target_sat.api.ActivationKey(content_view=cv, organization=org).create() with session: session.organization.select(org.name) for subscription in (constants.DEFAULT_SUBSCRIPTION_NAME, custom_product.name): @@ -624,7 +624,7 @@ def test_positive_fetch_product_content(target_sat, function_entitlement_manifes @pytest.mark.e2e @pytest.mark.tier2 @pytest.mark.upgrade -def test_positive_access_non_admin_user(session, test_name): +def test_positive_access_non_admin_user(session, test_name, target_sat): """Access activation key that has specific name and assigned environment by user that has filter configured for that specific activation key @@ -639,24 +639,26 @@ def test_positive_access_non_admin_user(session, test_name): """ ak_name = gen_string('alpha') non_searchable_ak_name = gen_string('alpha') - org = entities.Organization().create() + org = target_sat.api.Organization().create() envs_list = ['STAGING', 'DEV', 'IT', 'UAT', 'PROD'] for name in envs_list: - entities.LifecycleEnvironment(name=name, organization=org).create() + target_sat.api.LifecycleEnvironment(name=name, organization=org).create() env_name = random.choice(envs_list) - cv = entities.ContentView(organization=org).create() + cv = target_sat.api.ContentView(organization=org).create() cv.publish() content_view_version = cv.read().version[0] content_view_version.promote( - data={'environment_ids': [entities.LifecycleEnvironment(name=env_name).search()[0].id]} + data={ + 'environment_ids': [target_sat.api.LifecycleEnvironment(name=env_name).search()[0].id] + } ) # Create new role - role = entities.Role().create() + role = target_sat.api.Role().create() # Create filter with predefined activation keys search criteria envs_condition = ' or '.join(['environment = ' + s for s in envs_list]) - entities.Filter( + target_sat.api.Filter( organization=[org], - permission=entities.Permission().search( + permission=target_sat.api.Permission().search( filters={'name': 'view_activation_keys'}, query={'search': 'resource_type="Katello::ActivationKey"'}, ), @@ -665,20 +667,24 @@ def test_positive_access_non_admin_user(session, test_name): ).create() # Add permissions for Organization and Location - entities.Filter( - permission=entities.Permission().search(query={'search': 'resource_type="Organization"'}), + target_sat.api.Filter( + permission=target_sat.api.Permission().search( + query={'search': 'resource_type="Organization"'} + ), role=role, ).create() - entities.Filter( - permission=entities.Permission().search(query={'search': 'resource_type="Location"'}), + target_sat.api.Filter( + permission=target_sat.api.Permission().search(query={'search': 'resource_type="Location"'}), role=role, ).create() # Create new user with a configured role - default_loc = entities.Location().search(query={'search': f'name="{constants.DEFAULT_LOC}"'})[0] + default_loc = target_sat.api.Location().search( + query={'search': f'name="{constants.DEFAULT_LOC}"'} + )[0] user_login = gen_string('alpha') user_password = gen_string('alpha') - entities.User( + target_sat.api.User( role=[role], admin=False, login=user_login, @@ -699,7 +705,7 @@ def test_positive_access_non_admin_user(session, test_name): env_name ][env_name] - with Session(test_name, user=user_login, password=user_password) as session: + with target_sat.ui_session(test_name, user=user_login, password=user_password) as session: session.organization.select(org.name) session.location.select(constants.DEFAULT_LOC) assert session.activationkey.search(ak_name)[0]['Name'] == ak_name @@ -710,7 +716,7 @@ def test_positive_access_non_admin_user(session, test_name): @pytest.mark.tier2 -def test_positive_remove_user(session, module_org, test_name): +def test_positive_remove_user(session, module_org, test_name, module_target_sat): """Delete any user who has previously created an activation key and check that activation key still exists @@ -723,9 +729,11 @@ def test_positive_remove_user(session, module_org, test_name): ak_name = gen_string('alpha') # Create user password = gen_string('alpha') - user = entities.User(admin=True, default_organization=module_org, password=password).create() + user = module_target_sat.api.User( + admin=True, default_organization=module_org, password=password + ).create() # Create Activation Key using new user credentials - with Session(test_name, user.login, password) as non_admin_session: + with module_target_sat.ui_session(test_name, user.login, password) as non_admin_session: non_admin_session.activationkey.create( {'name': ak_name, 'lce': {constants.ENVIRONMENT: True}} ) @@ -737,7 +745,7 @@ def test_positive_remove_user(session, module_org, test_name): @pytest.mark.tier2 -def test_positive_add_docker_repo_cv(session, module_org): +def test_positive_add_docker_repo_cv(session, module_org, module_target_sat): """Add docker repository to a non-composite content view and publish it. Then create an activation key and associate it with the Docker content view. @@ -747,13 +755,13 @@ def test_positive_add_docker_repo_cv(session, module_org): :expectedresults: Content view with docker repo can be added to activation key """ - lce = entities.LifecycleEnvironment(organization=module_org).create() - repo = entities.Repository( + lce = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() + repo = module_target_sat.api.Repository( content_type=constants.REPO_TYPE['docker'], - product=entities.Product(organization=module_org).create(), + product=module_target_sat.api.Product(organization=module_org).create(), url=constants.CONTAINER_REGISTRY_HUB, ).create() - content_view = entities.ContentView( + content_view = module_target_sat.api.ContentView( composite=False, organization=module_org, repository=[repo] ).create() content_view.publish() @@ -770,7 +778,7 @@ def test_positive_add_docker_repo_cv(session, module_org): @pytest.mark.tier2 -def test_positive_add_docker_repo_ccv(session, module_org): +def test_positive_add_docker_repo_ccv(session, module_org, module_target_sat): """Add docker repository to a non-composite content view and publish it. Then add this content view to a composite content view and publish it. Create an activation key and associate it with the composite Docker content @@ -781,19 +789,19 @@ def test_positive_add_docker_repo_ccv(session, module_org): :expectedresults: Docker-based content view can be added to activation key """ - lce = entities.LifecycleEnvironment(organization=module_org).create() - repo = entities.Repository( + lce = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() + repo = module_target_sat.api.Repository( content_type=constants.REPO_TYPE['docker'], - product=entities.Product(organization=module_org).create(), + product=module_target_sat.api.Product(organization=module_org).create(), url=constants.CONTAINER_REGISTRY_HUB, ).create() - content_view = entities.ContentView( + content_view = module_target_sat.api.ContentView( composite=False, organization=module_org, repository=[repo] ).create() content_view.publish() cvv = content_view.read().version[0].read() cvv.promote(data={'environment_ids': lce.id, 'force': False}) - composite_cv = entities.ContentView( + composite_cv = module_target_sat.api.ContentView( component=[cvv], composite=True, organization=module_org ).create() composite_cv.publish() @@ -825,8 +833,8 @@ def test_positive_add_host(session, module_org, rhel6_contenthost, target_sat): :parametrized: yes """ - ak = entities.ActivationKey( - environment=entities.LifecycleEnvironment( + ak = target_sat.api.ActivationKey( + environment=target_sat.api.LifecycleEnvironment( name=constants.ENVIRONMENT, organization=module_org ).search()[0], organization=module_org, @@ -863,7 +871,7 @@ def test_positive_delete_with_system(session, rhel6_contenthost, target_sat): cv_name = gen_string('alpha') env_name = gen_string('alpha') product_name = gen_string('alpha') - org = entities.Organization().create() + org = target_sat.api.Organization().create() # Helper function to create and promote CV to next environment repo_id = target_sat.api_factory.create_sync_custom_repo( product_name=product_name, org_id=org.id @@ -994,12 +1002,12 @@ def test_positive_host_associations(session, target_sat): :BZ: 1344033, 1372826, 1394388 """ - org = entities.Organization().create() + org = target_sat.api.Organization().create() org_entities = target_sat.cli_factory.setup_org_for_a_custom_repo( {'url': settings.repos.yum_1.url, 'organization-id': org.id} ) - ak1 = entities.ActivationKey(id=org_entities['activationkey-id']).read() - ak2 = entities.ActivationKey( + ak1 = target_sat.api.ActivationKey(id=org_entities['activationkey-id']).read() + ak2 = target_sat.api.ActivationKey( content_view=org_entities['content-view-id'], environment=org_entities['lifecycle-environment-id'], organization=org.id, @@ -1060,10 +1068,10 @@ def test_positive_service_level_subscription_with_custom_product( entities_ids = target_sat.cli_factory.setup_org_for_a_custom_repo( {'url': settings.repos.yum_1.url, 'organization-id': org.id} ) - product = entities.Product(id=entities_ids['product-id']).read() - activation_key = entities.ActivationKey(id=entities_ids['activationkey-id']).read() + product = target_sat.api.Product(id=entities_ids['product-id']).read() + activation_key = target_sat.api.ActivationKey(id=entities_ids['activationkey-id']).read() # add the default RH subscription - subscription = entities.Subscription(organization=org).search( + subscription = target_sat.api.Subscription(organization=org).search( query={'search': f'name="{constants.DEFAULT_SUBSCRIPTION_NAME}"'} )[0] activation_key.add_subscriptions(data={'quantity': 1, 'subscription_id': subscription.id}) @@ -1093,7 +1101,7 @@ def test_positive_service_level_subscription_with_custom_product( @pytest.mark.run_in_one_thread @pytest.mark.tier2 -def test_positive_delete_manifest(session, function_entitlement_manifest_org): +def test_positive_delete_manifest(session, function_entitlement_manifest_org, target_sat): """Check if deleting a manifest removes it from Activation key :id: 512d8e41-b937-451e-a9c6-840457d3d7d4 @@ -1108,9 +1116,9 @@ def test_positive_delete_manifest(session, function_entitlement_manifest_org): """ org = function_entitlement_manifest_org # Create activation key - activation_key = entities.ActivationKey(organization=org).create() + activation_key = target_sat.api.ActivationKey(organization=org).create() # Associate a manifest to the activation key - subscription = entities.Subscription(organization=org).search( + subscription = target_sat.api.Subscription(organization=org).search( query={'search': f'name="{constants.DEFAULT_SUBSCRIPTION_NAME}"'} )[0] activation_key.add_subscriptions(data={'quantity': 1, 'subscription_id': subscription.id}) diff --git a/tests/foreman/ui/test_bookmarks.py b/tests/foreman/ui/test_bookmarks.py index 94e10d4f91..f2622ae84a 100644 --- a/tests/foreman/ui/test_bookmarks.py +++ b/tests/foreman/ui/test_bookmarks.py @@ -12,9 +12,7 @@ """ from airgun.exceptions import NoSuchElementException -from airgun.session import Session from fauxfactory import gen_string -from nailgun import entities import pytest from robottelo.config import user_nailgun_config @@ -91,7 +89,9 @@ def test_positive_end_to_end(session, ui_entity): @pytest.mark.tier2 -def test_positive_create_bookmark_public(session, ui_entity, default_viewer_role, test_name): +def test_positive_create_bookmark_public( + session, ui_entity, default_viewer_role, test_name, module_target_sat +): """Create and check visibility of the (non)public bookmarks :id: 93139529-7690-429b-83fe-3dcbac4f91dc @@ -123,7 +123,9 @@ def test_positive_create_bookmark_public(session, ui_entity, default_viewer_role {'name': name, 'query': gen_string('alphanumeric'), 'public': name == public_name} ) assert any(d['Name'] == name for d in session.bookmark.search(name)) - with Session(test_name, default_viewer_role.login, default_viewer_role.password) as session: + with module_target_sat.ui_session( + test_name, default_viewer_role.login, default_viewer_role.password + ) as session: assert any(d['Name'] == public_name for d in session.bookmark.search(public_name)) assert not session.bookmark.search(nonpublic_name) @@ -182,7 +184,7 @@ def test_positive_update_bookmark_public( controller=ui_entity['controller'], public=name == public_name, ).create() - with Session( + with target_sat.ui_session( test_name, default_viewer_role.login, default_viewer_role.password ) as non_admin_session: assert any(d['Name'] == public_name for d in non_admin_session.bookmark.search(public_name)) @@ -190,7 +192,7 @@ def test_positive_update_bookmark_public( with session: session.bookmark.update(public_name, {'public': False}) session.bookmark.update(nonpublic_name, {'public': True}) - with Session( + with target_sat.ui_session( test_name, default_viewer_role.login, default_viewer_role.password ) as non_admin_session: assert any( @@ -200,7 +202,7 @@ def test_positive_update_bookmark_public( @pytest.mark.tier2 -def test_negative_delete_bookmark(ui_entity, default_viewer_role, test_name): +def test_negative_delete_bookmark(ui_entity, default_viewer_role, test_name, module_target_sat): """Simple removal of a bookmark query without permissions :id: 1a94bf2b-bcc6-4663-b70d-e13244a0783b @@ -219,8 +221,10 @@ def test_negative_delete_bookmark(ui_entity, default_viewer_role, test_name): :expectedresults: The delete buttons are not displayed """ - bookmark = entities.Bookmark(controller=ui_entity['controller'], public=True).create() - with Session( + bookmark = module_target_sat.api.Bookmark( + controller=ui_entity['controller'], public=True + ).create() + with module_target_sat.ui_session( test_name, default_viewer_role.login, default_viewer_role.password ) as non_admin_session: assert non_admin_session.bookmark.search(bookmark.name)[0]['Name'] == bookmark.name @@ -230,7 +234,7 @@ def test_negative_delete_bookmark(ui_entity, default_viewer_role, test_name): @pytest.mark.tier2 -def test_negative_create_with_duplicate_name(session, ui_entity): +def test_negative_create_with_duplicate_name(session, ui_entity, module_target_sat): """Create bookmark with duplicate name :id: 18168c9c-bdd1-4839-a506-cf9b06c4ab44 @@ -248,7 +252,9 @@ def test_negative_create_with_duplicate_name(session, ui_entity): :BZ: 1920566, 1992652 """ query = gen_string('alphanumeric') - bookmark = entities.Bookmark(controller=ui_entity['controller'], public=True).create() + bookmark = module_target_sat.api.Bookmark( + controller=ui_entity['controller'], public=True + ).create() with session: existing_bookmark = session.bookmark.search(bookmark.name)[0] assert existing_bookmark['Name'] == bookmark.name diff --git a/tests/foreman/ui/test_branding.py b/tests/foreman/ui/test_branding.py index a7e08659d8..8fe30b1c2e 100644 --- a/tests/foreman/ui/test_branding.py +++ b/tests/foreman/ui/test_branding.py @@ -11,7 +11,6 @@ :CaseImportance: High """ -from airgun.session import Session import pytest @@ -31,7 +30,7 @@ def test_verify_satellite_login_screen_info(target_sat): :BZ: 1315849, 1367495, 1372436, 1502098, 1540710, 1582476, 1724738, 1959135, 2076979, 1687250, 1686540, 1742872, 1805642, 2105949 """ - with Session(login=False) as session: + with target_sat.ui_session(login=False) as session: version = session.login.read_sat_version() assert f'Version {target_sat.version}' == version['login_text'] assert 'Beta' not in version['login_text'], '"Beta" should not be there' diff --git a/tests/foreman/ui/test_contenthost.py b/tests/foreman/ui/test_contenthost.py index 277ff05c6c..ec2c6de469 100644 --- a/tests/foreman/ui/test_contenthost.py +++ b/tests/foreman/ui/test_contenthost.py @@ -15,9 +15,7 @@ import re from urllib.parse import urlparse -from airgun.session import Session from fauxfactory import gen_integer, gen_string -from nailgun import entities import pytest from robottelo.config import setting_is_set, settings @@ -44,8 +42,10 @@ @pytest.fixture(scope='module', autouse=True) -def host_ui_default(): - settings_object = entities.Setting().search(query={'search': 'name=host_details_ui'})[0] +def host_ui_default(module_target_sat): + settings_object = module_target_sat.api.Setting().search( + query={'search': 'name=host_details_ui'} + )[0] settings_object.value = 'No' settings_object.update({'value'}) yield @@ -54,10 +54,10 @@ def host_ui_default(): @pytest.fixture(scope='module') -def module_org(): - org = entities.Organization(simple_content_access=False).create() +def module_org(module_target_sat): + org = module_target_sat.api.Organization(simple_content_access=False).create() # adding remote_execution_connect_by_ip=Yes at org level - entities.Parameter( + module_target_sat.api.Parameter( name='remote_execution_connect_by_ip', value='Yes', organization=org.id, @@ -82,9 +82,9 @@ def vm_module_streams(module_repos_collection_with_manifest, rhel8_contenthost, return rhel8_contenthost -def set_ignore_facts_for_os(value=False): +def set_ignore_facts_for_os(module_target_sat, value=False): """Helper to set 'ignore_facts_for_operatingsystem' setting""" - ignore_setting = entities.Setting().search( + ignore_setting = module_target_sat.api.Setting().search( query={'search': 'name="ignore_facts_for_operatingsystem"'} )[0] ignore_setting.value = str(value) @@ -659,7 +659,7 @@ def test_positive_remove_package_group(session, default_location, vm): indirect=True, ) def test_positive_search_errata_non_admin( - session, default_location, vm, test_name, default_viewer_role + default_location, vm, test_name, default_viewer_role, module_target_sat ): """Search for host's errata by non-admin user with enough permissions @@ -675,7 +675,7 @@ def test_positive_search_errata_non_admin( :parametrized: yes """ vm.run(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}') - with Session( + with module_target_sat.ui_session( test_name, user=default_viewer_role.login, password=default_viewer_role.password ) as session: session.location.select(default_location.name) @@ -822,7 +822,9 @@ def test_positive_host_re_registration_with_host_rename( ], indirect=True, ) -def test_positive_check_ignore_facts_os_setting(session, default_location, vm, module_org, request): +def test_positive_check_ignore_facts_os_setting( + session, default_location, vm, module_org, request, module_target_sat +): """Verify that 'Ignore facts for operating system' setting works properly @@ -855,9 +857,9 @@ def test_positive_check_ignore_facts_os_setting(session, default_location, vm, m major = str(gen_integer(15, 99)) minor = str(gen_integer(1, 9)) expected_os = f'RedHat {major}.{minor}' - set_ignore_facts_for_os(False) + set_ignore_facts_for_os(module_target_sat, False) host = ( - entities.Host() + module_target_sat.api.Host() .search(query={'search': f'name={vm.hostname} and organization_id={module_org.id}'})[0] .read() ) @@ -866,7 +868,7 @@ def test_positive_check_ignore_facts_os_setting(session, default_location, vm, m # Get host current operating system value os = session.contenthost.read(vm.hostname, widget_names='details')['details']['os'] # Change necessary setting to true - set_ignore_facts_for_os(True) + set_ignore_facts_for_os(module_target_sat, True) # Add cleanup function to roll back setting to default value request.addfinalizer(set_ignore_facts_for_os) # Read all facts for corresponding host @@ -883,7 +885,7 @@ def test_positive_check_ignore_facts_os_setting(session, default_location, vm, m # Check that host OS was not changed due setting was set to true assert os == updated_os # Put it to false and re-run the process - set_ignore_facts_for_os(False) + set_ignore_facts_for_os(module_target_sat, False) host.upload_facts(data={'name': vm.hostname, 'facts': facts}) session.contenthost.search('') updated_os = session.contenthost.read(vm.hostname, widget_names='details')['details']['os'] @@ -920,8 +922,8 @@ def test_positive_virt_who_hypervisor_subscription_status( :parametrized: yes """ - org = entities.Organization().create() - lce = entities.LifecycleEnvironment(organization=org).create() + org = target_sat.api.Organization().create() + lce = target_sat.api.LifecycleEnvironment(organization=org).create() # TODO move this to either hack around virt-who service or use an env-* compute resource provisioning_server = settings.libvirt.libvirt_hostname # Create a new virt-who config @@ -992,7 +994,9 @@ def test_positive_virt_who_hypervisor_subscription_status( ], indirect=True, ) -def test_module_stream_actions_on_content_host(session, default_location, vm_module_streams): +def test_module_stream_actions_on_content_host( + session, default_location, vm_module_streams, module_target_sat +): """Check remote execution for module streams actions e.g. install, remove, disable works on content host. Verify that correct stream module stream get installed/removed. @@ -1005,7 +1009,7 @@ def test_module_stream_actions_on_content_host(session, default_location, vm_mod """ stream_version = '5.21' run_remote_command_on_content_host('dnf -y upload-profile', vm_module_streams) - entities.Parameter( + module_target_sat.api.Parameter( name='remote_execution_connect_by_ip', value='Yes', parameter_type='boolean', @@ -1782,7 +1786,7 @@ def test_pagination_multiple_hosts_multiple_pages(session, module_host_template, @pytest.mark.tier3 -def test_search_for_virt_who_hypervisors(session, default_location): +def test_search_for_virt_who_hypervisors(session, default_location, module_target_sat): """ Search the virt_who hypervisors with hypervisor=True or hypervisor=False. @@ -1796,7 +1800,7 @@ def test_search_for_virt_who_hypervisors(session, default_location): :CaseImportance: Medium """ - org = entities.Organization().create() + org = module_target_sat.api.Organization().create() with session: session.organization.select(org.name) session.location.select(default_location.name) diff --git a/tests/foreman/ui/test_contentview_old.py b/tests/foreman/ui/test_contentview_old.py index e69931568f..0b84677125 100644 --- a/tests/foreman/ui/test_contentview_old.py +++ b/tests/foreman/ui/test_contentview_old.py @@ -18,8 +18,6 @@ from random import randint from airgun.exceptions import InvalidElementStateException, NoSuchElementException -from airgun.session import Session -from nailgun import entities from nailgun.entity_mixins import call_entity_method_with_timeout from navmazing import NavigationTriesExceeded from productmd.common import parse_nvra @@ -54,17 +52,17 @@ @pytest.fixture(scope='module') -def module_org(): - return entities.Organization().create() +def module_org(module_target_sat): + return module_target_sat.api.Organization().create() @pytest.fixture(scope='module') -def module_prod(module_org): - return entities.Product(organization=module_org).create() +def module_prod(module_org, module_target_sat): + return module_target_sat.api.Product(organization=module_org).create() @pytest.mark.tier2 -def test_positive_add_custom_content(session): +def test_positive_add_custom_content(session, module_target_sat): """Associate custom content in a view :id: 7128fc8b-0e8c-4f00-8541-2ca2399650c8 @@ -75,11 +73,11 @@ def test_positive_add_custom_content(session): :CaseImportance: Critical """ - org = entities.Organization().create() + org = module_target_sat.api.Organization().create() cv_name = gen_string('alpha') repo_name = gen_string('alpha') - product = entities.Product(organization=org).create() - entities.Repository(name=repo_name, product=product).create() + product = module_target_sat.api.Product(organization=org).create() + module_target_sat.api.Repository(name=repo_name, product=product).create() with session: session.organization.select(org_name=org.name) session.contentview.create({'name': cv_name}) @@ -91,7 +89,7 @@ def test_positive_add_custom_content(session): @pytest.mark.tier2 @pytest.mark.upgrade -def test_positive_end_to_end(session, module_org, target_sat): +def test_positive_end_to_end(session, module_target_sat, module_org, target_sat): """Create content view with yum repo, publish it and promote it to Library +1 env @@ -129,7 +127,7 @@ def test_positive_end_to_end(session, module_org, target_sat): @pytest.mark.tier2 -def test_positive_publish_version_changes_in_source_env(session, module_org): +def test_positive_publish_version_changes_in_source_env(session, module_target_sat, module_org): """When publishing new version to environment, version gets updated :id: 576ac8b4-7efe-4267-a672-868a5f3eb28a @@ -143,8 +141,8 @@ def test_positive_publish_version_changes_in_source_env(session, module_org): :CaseImportance: High """ - lce = entities.LifecycleEnvironment(organization=module_org).create() - cv = entities.ContentView(organization=module_org).create() + lce = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() + cv = module_target_sat.api.ContentView(organization=module_org).create() with session: result = session.contentview.publish(cv.name) assert result['Version'] == 'Version 1.0' @@ -180,7 +178,7 @@ def test_positive_publish_version_changes_in_source_env(session, module_org): @pytest.mark.tier2 -def test_positive_repo_count_for_composite_cv(session, module_org, target_sat): +def test_positive_repo_count_for_composite_cv(session, module_target_sat, module_org, target_sat): """Create some content views with synchronized repositories and promoted to one lce. Add them to composite content view and check repo count for it. @@ -194,7 +192,7 @@ def test_positive_repo_count_for_composite_cv(session, module_org, target_sat): :CaseImportance: High """ - lce = entities.LifecycleEnvironment(organization=module_org).create() + lce = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() ccv_name = gen_string('alpha') repo_name = gen_string('alpha') # Create a product and sync'ed repository @@ -204,7 +202,7 @@ def test_positive_repo_count_for_composite_cv(session, module_org, target_sat): session.contentview.create({'name': ccv_name, 'composite_view': True}) # Create three content-views and add synced repo to them for _ in range(3): - cv_name = entities.ContentView(organization=module_org).create().name + cv_name = module_target_sat.api.ContentView(organization=module_org).create().name assert session.contentview.search(cv_name)[0]['Name'] == cv_name # Add repository to selected CV session.contentview.add_yum_repo(cv_name, repo_name) @@ -252,7 +250,7 @@ def test_positive_create_composite( 'basearch': 'x86_64', 'releasever': None, } - docker_repo = entities.Repository( + docker_repo = target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=module_prod, content_type=REPO_TYPE['docker'] ).create() @@ -282,7 +280,9 @@ def test_positive_create_composite( @pytest.mark.run_in_one_thread @pytest.mark.skip_if_not_set('fake_manifest') @pytest.mark.tier2 -def test_positive_add_rh_content(session, function_entitlement_manifest_org, target_sat): +def test_positive_add_rh_content( + session, module_target_sat, function_entitlement_manifest_org, target_sat +): """Add Red Hat content to a content view :id: c370fd79-0c0d-4685-99cb-848556c786c1 @@ -315,7 +315,7 @@ def test_positive_add_rh_content(session, function_entitlement_manifest_org, tar @pytest.mark.tier2 -def test_positive_add_docker_repo(session, module_org, module_prod): +def test_positive_add_docker_repo(session, module_target_sat, module_org, module_prod): """Add one Docker-type repository to a non-composite content view :id: 2868cfd5-d27e-4db9-b4a3-2827e31d1601 @@ -324,8 +324,10 @@ def test_positive_add_docker_repo(session, module_org, module_prod): :CaseImportance: High """ - content_view = entities.ContentView(composite=False, organization=module_org).create() - repo = entities.Repository( + content_view = module_target_sat.api.ContentView( + composite=False, organization=module_org + ).create() + repo = module_target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=module_prod, content_type=REPO_TYPE['docker'] ).create() with session: @@ -335,7 +337,7 @@ def test_positive_add_docker_repo(session, module_org, module_prod): @pytest.mark.tier2 -def test_positive_add_docker_repos(session, module_org, module_prod): +def test_positive_add_docker_repos(session, module_target_sat, module_org, module_prod): """Add multiple Docker-type repositories to a non-composite content view. @@ -346,9 +348,11 @@ def test_positive_add_docker_repos(session, module_org, module_prod): :CaseImportance: Low """ - content_view = entities.ContentView(composite=False, organization=module_org).create() + content_view = module_target_sat.api.ContentView( + composite=False, organization=module_org + ).create() repos = [ - entities.Repository( + module_target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=module_prod, content_type=REPO_TYPE['docker'] ).create() for _ in range(randint(2, 3)) @@ -363,7 +367,7 @@ def test_positive_add_docker_repos(session, module_org, module_prod): @pytest.mark.tier2 -def test_positive_add_synced_docker_repo(session, module_org, module_prod): +def test_positive_add_synced_docker_repo(session, module_target_sat, module_org, module_prod): """Create and sync a docker repository, then add it to content view :id: 338a7ed4-9e10-4bc0-8666-5c8cd0ff0504 @@ -373,8 +377,10 @@ def test_positive_add_synced_docker_repo(session, module_org, module_prod): :CaseImportance: High """ - content_view = entities.ContentView(composite=False, organization=module_org).create() - repo = entities.Repository( + content_view = module_target_sat.api.ContentView( + composite=False, organization=module_org + ).create() + repo = module_target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=module_prod, content_type=REPO_TYPE['docker'] ).create() with session: @@ -387,7 +393,7 @@ def test_positive_add_synced_docker_repo(session, module_org, module_prod): @pytest.mark.tier2 -def test_positive_add_docker_repo_to_ccv(session, module_org, module_prod): +def test_positive_add_docker_repo_to_ccv(session, module_target_sat, module_org, module_prod): """Add one docker repository to a composite content view :id: 76b68407-b429-4ad7-b8b5-bfde327a0404 @@ -397,9 +403,13 @@ def test_positive_add_docker_repo_to_ccv(session, module_org, module_prod): :CaseImportance: High """ - content_view = entities.ContentView(composite=False, organization=module_org).create() - composite_cv = entities.ContentView(composite=True, organization=module_org).create() - repo = entities.Repository( + content_view = module_target_sat.api.ContentView( + composite=False, organization=module_org + ).create() + composite_cv = module_target_sat.api.ContentView( + composite=True, organization=module_org + ).create() + repo = module_target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=module_prod, content_type=REPO_TYPE['docker'] ).create() with session: @@ -413,7 +423,7 @@ def test_positive_add_docker_repo_to_ccv(session, module_org, module_prod): @pytest.mark.tier2 -def test_positive_add_docker_repos_to_ccv(session, module_org, module_prod): +def test_positive_add_docker_repos_to_ccv(session, module_target_sat, module_org, module_prod): """Add multiple docker repositories to a composite content view. :id: 30187102-7106-45de-a68b-e32fbaecedb9 @@ -425,15 +435,17 @@ def test_positive_add_docker_repos_to_ccv(session, module_org, module_prod): """ cvs = [] for _ in range(randint(2, 3)): - repo = entities.Repository( + repo = module_target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=module_prod, content_type=REPO_TYPE['docker'] ).create() - content_view = entities.ContentView( + content_view = module_target_sat.api.ContentView( composite=False, organization=module_org, repository=[repo] ).create() content_view.publish() cvs.append(content_view.name) - composite_cv = entities.ContentView(composite=True, organization=module_org).create() + composite_cv = module_target_sat.api.ContentView( + composite=True, organization=module_org + ).create() with session: for cv in cvs: session.contentview.add_cv(composite_cv.name, cv) @@ -446,7 +458,7 @@ def test_positive_add_docker_repos_to_ccv(session, module_org, module_prod): @pytest.mark.tier2 -def test_positive_publish_with_docker_repo(session, module_org, module_prod): +def test_positive_publish_with_docker_repo(session, module_target_sat, module_org, module_prod): """Add docker repository to content view and publish it once. :id: 2004b2d4-177b-47de-9e61-bcfb58f05f88 @@ -456,8 +468,10 @@ def test_positive_publish_with_docker_repo(session, module_org, module_prod): :CaseImportance: High """ - content_view = entities.ContentView(composite=False, organization=module_org).create() - repo = entities.Repository( + content_view = module_target_sat.api.ContentView( + composite=False, organization=module_org + ).create() + repo = module_target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=module_prod, content_type=REPO_TYPE['docker'] ).create() with session: @@ -469,7 +483,9 @@ def test_positive_publish_with_docker_repo(session, module_org, module_prod): @pytest.mark.tier2 -def test_positive_publish_with_docker_repo_composite(session, module_org, module_prod): +def test_positive_publish_with_docker_repo_composite( + session, module_target_sat, module_org, module_prod +): """Add docker repository to composite content view and publish it once. :id: 7aad525a-a9d3-4100-9611-ca02c6a95a22 @@ -480,14 +496,16 @@ def test_positive_publish_with_docker_repo_composite(session, module_org, module :CaseImportance: High """ - repo = entities.Repository( + repo = module_target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=module_prod, content_type=REPO_TYPE['docker'] ).create() - content_view = entities.ContentView( + content_view = module_target_sat.api.ContentView( composite=False, organization=module_org, repository=[repo] ).create() content_view.publish() - composite_cv = entities.ContentView(composite=True, organization=module_org).create() + composite_cv = module_target_sat.api.ContentView( + composite=True, organization=module_org + ).create() with session: session.contentview.add_cv(composite_cv.name, content_view.name) result = session.contentview.publish(composite_cv.name) @@ -497,7 +515,9 @@ def test_positive_publish_with_docker_repo_composite(session, module_org, module @pytest.mark.tier2 -def test_positive_publish_multiple_with_docker_repo(session, module_org, module_prod): +def test_positive_publish_multiple_with_docker_repo( + session, module_target_sat, module_org, module_prod +): """Add docker repository to content view and publish it multiple times. :id: acc703b7-6e99-48d7-96ce-ea0985409ef9 @@ -507,10 +527,10 @@ def test_positive_publish_multiple_with_docker_repo(session, module_org, module_ :CaseImportance: Low """ - repo = entities.Repository( + repo = module_target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=module_prod, content_type=REPO_TYPE['docker'] ).create() - content_view = entities.ContentView( + content_view = module_target_sat.api.ContentView( composite=False, organization=module_org, repository=[repo] ).create() with session: @@ -520,7 +540,9 @@ def test_positive_publish_multiple_with_docker_repo(session, module_org, module_ @pytest.mark.tier2 -def test_positive_publish_multiple_with_docker_repo_composite(session, module_org, module_prod): +def test_positive_publish_multiple_with_docker_repo_composite( + session, module_target_sat, module_org, module_prod +): """Add docker repository to composite content view and publish it multiple times. :id: 07755bff-9071-45e5-b861-77a5c2fed3d9 @@ -530,14 +552,16 @@ def test_positive_publish_multiple_with_docker_repo_composite(session, module_or :CaseImportance: Low """ - repo = entities.Repository( + repo = module_target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=module_prod, content_type=REPO_TYPE['docker'] ).create() - content_view = entities.ContentView( + content_view = module_target_sat.api.ContentView( composite=False, organization=module_org, repository=[repo] ).create() content_view.publish() - composite_cv = entities.ContentView(composite=True, organization=module_org).create() + composite_cv = module_target_sat.api.ContentView( + composite=True, organization=module_org + ).create() with session: session.contentview.add_cv(composite_cv.name, content_view.name) for version in range(randint(2, 5)): @@ -546,7 +570,7 @@ def test_positive_publish_multiple_with_docker_repo_composite(session, module_or @pytest.mark.tier2 -def test_positive_promote_with_docker_repo(session, module_org, module_prod): +def test_positive_promote_with_docker_repo(session, module_target_sat, module_org, module_prod): """Add docker repository to content view and publish it. Then promote it to the next available lifecycle environment. @@ -557,11 +581,11 @@ def test_positive_promote_with_docker_repo(session, module_org, module_prod): :CaseImportance: High """ - lce = entities.LifecycleEnvironment(organization=module_org).create() - repo = entities.Repository( + lce = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() + repo = module_target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=module_prod, content_type=REPO_TYPE['docker'] ).create() - content_view = entities.ContentView( + content_view = module_target_sat.api.ContentView( composite=False, organization=module_org, repository=[repo] ).create() content_view.publish() @@ -572,7 +596,9 @@ def test_positive_promote_with_docker_repo(session, module_org, module_prod): @pytest.mark.tier2 -def test_positive_promote_multiple_with_docker_repo(session, module_org, module_prod): +def test_positive_promote_multiple_with_docker_repo( + session, module_target_sat, module_org, module_prod +): """Add docker repository to content view and publish it. Then promote it to multiple available lifecycle-environments. @@ -583,23 +609,25 @@ def test_positive_promote_multiple_with_docker_repo(session, module_org, module_ :CaseImportance: Low """ - repo = entities.Repository( + repo = module_target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=module_prod, content_type=REPO_TYPE['docker'] ).create() - content_view = entities.ContentView( + content_view = module_target_sat.api.ContentView( composite=False, organization=module_org, repository=[repo] ).create() content_view.publish() with session: for _ in range(randint(2, 3)): - lce = entities.LifecycleEnvironment(organization=module_org).create() + lce = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() result = session.contentview.promote(content_view.name, VERSION, lce.name) assert f'Promoted to {lce.name}' in result['Status'] assert lce.name in result['Environments'] @pytest.mark.tier2 -def test_positive_promote_with_docker_repo_composite(session, module_org, module_prod): +def test_positive_promote_with_docker_repo_composite( + session, module_target_sat, module_org, module_prod +): """Add docker repository to composite content view and publish it. Then promote it to the next available lifecycle-environment. @@ -610,16 +638,16 @@ def test_positive_promote_with_docker_repo_composite(session, module_org, module :CaseImportance: High """ - lce = entities.LifecycleEnvironment(organization=module_org).create() - repo = entities.Repository( + lce = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() + repo = module_target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=module_prod, content_type=REPO_TYPE['docker'] ).create() - content_view = entities.ContentView( + content_view = module_target_sat.api.ContentView( composite=False, organization=module_org, repository=[repo] ).create() content_view.publish() content_view = content_view.read() - composite_cv = entities.ContentView( + composite_cv = module_target_sat.api.ContentView( component=[content_view.version[-1]], composite=True, organization=module_org ).create() composite_cv.publish() @@ -631,7 +659,9 @@ def test_positive_promote_with_docker_repo_composite(session, module_org, module @pytest.mark.tier2 @pytest.mark.upgrade -def test_positive_promote_multiple_with_docker_repo_composite(session, module_org, module_prod): +def test_positive_promote_multiple_with_docker_repo_composite( + session, module_target_sat, module_org, module_prod +): """Add docker repository to composite content view and publish it Then promote it to the multiple available lifecycle environments. @@ -642,28 +672,28 @@ def test_positive_promote_multiple_with_docker_repo_composite(session, module_or :CaseImportance: Low """ - repo = entities.Repository( + repo = module_target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=module_prod, content_type=REPO_TYPE['docker'] ).create() - content_view = entities.ContentView( + content_view = module_target_sat.api.ContentView( composite=False, organization=module_org, repository=[repo] ).create() content_view.publish() content_view = content_view.read() - composite_cv = entities.ContentView( + composite_cv = module_target_sat.api.ContentView( component=[content_view.version[-1]], composite=True, organization=module_org ).create() composite_cv.publish() with session: for _ in range(randint(2, 3)): - lce = entities.LifecycleEnvironment(organization=module_org).create() + lce = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() result = session.contentview.promote(composite_cv.name, VERSION, lce.name) assert f'Promoted to {lce.name}' in result['Status'] assert lce.name in result['Environments'] @pytest.mark.tier2 -def test_negative_add_components_to_non_composite(session): +def test_negative_add_components_to_non_composite(session, module_target_sat): """Attempt to associate components to a non-composite content view :id: fa3e6aea-7ee3-46a6-a5ba-248de3c20a8f @@ -685,7 +715,7 @@ def test_negative_add_components_to_non_composite(session): @pytest.mark.tier2 -def test_positive_add_unpublished_cv_to_composite(session): +def test_positive_add_unpublished_cv_to_composite(session, module_target_sat): """Attempt to associate unpublished non-composite content view with composite content view. @@ -716,7 +746,7 @@ def test_positive_add_unpublished_cv_to_composite(session): @pytest.mark.tier3 -def test_positive_add_non_composite_cv_to_composite(session): +def test_positive_add_non_composite_cv_to_composite(session, module_target_sat): """Attempt to associate both published and unpublished non-composite content views with composite content view. @@ -775,7 +805,7 @@ def test_positive_add_non_composite_cv_to_composite(session): @pytest.mark.tier3 -def test_positive_check_composite_cv_addition_list_versions(session): +def test_positive_check_composite_cv_addition_list_versions(session, module_target_sat): """Create new content view and publish two times. After that remove first content view version from the list and try to add that view to composite one. Check what content view version is going to be added @@ -814,7 +844,7 @@ def test_positive_check_composite_cv_addition_list_versions(session): @pytest.mark.tier2 -def test_negative_add_dupe_repos(session, module_org, target_sat): +def test_negative_add_dupe_repos(session, module_target_sat, module_org, target_sat): """attempt to associate the same repo multiple times within a content view @@ -839,7 +869,7 @@ def test_negative_add_dupe_repos(session, module_org, target_sat): @pytest.mark.tier2 -def test_positive_publish_with_custom_content(session, module_org, target_sat): +def test_positive_publish_with_custom_content(session, module_target_sat, module_org, target_sat): """Attempt to publish a content view containing custom content :id: 66b5efc7-2e43-438e-bd80-a754814222f9 @@ -866,7 +896,9 @@ def test_positive_publish_with_custom_content(session, module_org, target_sat): @pytest.mark.run_in_one_thread @pytest.mark.skip_if_not_set('fake_manifest') @pytest.mark.tier2 -def test_positive_publish_with_rh_content(session, function_entitlement_manifest_org, target_sat): +def test_positive_publish_with_rh_content( + session, module_target_sat, function_entitlement_manifest_org, target_sat +): """Attempt to publish a content view containing RH content :id: bd24dc13-b6c4-4a9b-acb2-cd6df30f436c @@ -923,7 +955,7 @@ def test_positive_publish_composite_with_custom_content( custom_repo1_url = settings.repos.yum_0.url custom_repo2_url = settings.repos.yum_1.url org = function_entitlement_manifest_org - product = entities.Product(organization=org).create() + product = target_sat.api.Product(organization=org).create() rh7_repo = { 'name': REPOS['rhst7']['name'], 'product': PRDS['rhel'], @@ -932,10 +964,10 @@ def test_positive_publish_composite_with_custom_content( 'releasever': None, } # Create docker repos and sync - docker_repo1 = entities.Repository( + docker_repo1 = target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=product, content_type=REPO_TYPE['docker'] ).create() - docker_repo2 = entities.Repository( + docker_repo2 = target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=product, content_type=REPO_TYPE['docker'] ).create() docker_repo1.sync() @@ -985,7 +1017,9 @@ def test_positive_publish_composite_with_custom_content( @pytest.mark.tier2 -def test_positive_publish_version_changes_in_target_env(session, module_org, target_sat): +def test_positive_publish_version_changes_in_target_env( + session, module_target_sat, module_org, target_sat +): # Dev notes: # If Dev has version x, then when I promote version y into # Dev, version x goes away (ie when I promote version 1 to Dev, @@ -1010,7 +1044,7 @@ def test_positive_publish_version_changes_in_target_env(session, module_org, tar versions_count = 3 versions = (f'Version {ver + 1}.0' for ver in range(versions_count)) # create environment lifecycle - lce = entities.LifecycleEnvironment(organization=module_org).create() + lce = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() repo_names = [gen_string('alphanumeric') for _ in range(versions_count)] # before each content view publishing add a new repository for repo_name in repo_names: @@ -1043,7 +1077,7 @@ def test_positive_publish_version_changes_in_target_env(session, module_org, tar @pytest.mark.tier2 -def test_positive_promote_with_custom_content(session, module_org, target_sat): +def test_positive_promote_with_custom_content(session, module_target_sat, module_org, target_sat): """Attempt to promote a content view containing custom content, check dashboard @@ -1059,7 +1093,7 @@ def test_positive_promote_with_custom_content(session, module_org, target_sat): """ repo_name = gen_string('alpha') cv_name = gen_string('alpha') - lce = entities.LifecycleEnvironment(organization=module_org).create() + lce = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() target_sat.api_factory.create_sync_custom_repo(module_org.id, repo_name=repo_name) with session: session.contentview.create({'name': cv_name}) @@ -1079,7 +1113,7 @@ def test_positive_promote_with_custom_content(session, module_org, target_sat): assert cv_name in values['content_views'][1]['Content View'] assert values['content_views'][1]['Task'] == 'Published new version' assert 'Success' in values['content_views'][1]['Status'] - entities.LifecycleEnvironment(id=lce.id).delete() + module_target_sat.api.LifecycleEnvironment(id=lce.id).delete() values = session.dashboard.search(f'lifecycle_environment={lce.name}') assert cv_name in values['ContentViews']['content_views'][0]['Content View'] @@ -1087,7 +1121,9 @@ def test_positive_promote_with_custom_content(session, module_org, target_sat): @pytest.mark.run_in_one_thread @pytest.mark.skip_if_not_set('fake_manifest') @pytest.mark.tier2 -def test_positive_promote_with_rh_content(session, function_entitlement_manifest_org, target_sat): +def test_positive_promote_with_rh_content( + session, module_target_sat, function_entitlement_manifest_org, target_sat +): """Attempt to promote a content view containing RH content :id: 82f71639-3580-49fd-bd5a-8dba568b98d1 @@ -1108,7 +1144,7 @@ def test_positive_promote_with_rh_content(session, function_entitlement_manifest } org = function_entitlement_manifest_org target_sat.api_factory.enable_sync_redhat_repo(rh_repo, org.id) - lce = entities.LifecycleEnvironment(organization=org).create() + lce = module_target_sat.api.LifecycleEnvironment(organization=org).create() with session: session.organization.select(org.name) session.contentview.create({'name': cv_name}) @@ -1147,7 +1183,7 @@ def test_positive_promote_composite_with_custom_content( custom_repo1_url = settings.repos.yum_0.url custom_repo2_url = settings.repos.yum_1.url org = function_entitlement_manifest_org - product = entities.Product(organization=org).create() + product = target_sat.api.Product(organization=org).create() rh7_repo = { 'name': REPOS['rhst7']['name'], 'product': PRDS['rhel'], @@ -1156,7 +1192,7 @@ def test_positive_promote_composite_with_custom_content( 'releasever': None, } # create a life cycle environment - lce = entities.LifecycleEnvironment(organization=org).create() + lce = target_sat.api.LifecycleEnvironment(organization=org).create() # Enable and sync RH repository target_sat.api_factory.enable_sync_redhat_repo(rh7_repo, org.id) # Create custom yum repositories @@ -1166,10 +1202,10 @@ def test_positive_promote_composite_with_custom_content( ): target_sat.api_factory.create_sync_custom_repo(repo_name=name, repo_url=url, org_id=org.id) # Create docker repo and sync - docker_repo1 = entities.Repository( + docker_repo1 = target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=product, content_type=REPO_TYPE['docker'] ).create() - docker_repo2 = entities.Repository( + docker_repo2 = target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=product, content_type=REPO_TYPE['docker'], @@ -1217,7 +1253,9 @@ def test_positive_promote_composite_with_custom_content( @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(session, target_sat): +def test_positive_publish_rh_content_with_errata_by_date_filter( + session, module_target_sat, target_sat +): """Publish a CV, containing only RH repo, having errata excluding by date filter @@ -1234,19 +1272,21 @@ def test_positive_publish_rh_content_with_errata_by_date_filter(session, target_ :CaseImportance: High """ version = 'Version 2.0' - org = entities.Organization().create() - lce = entities.LifecycleEnvironment(organization=org).create() + org = module_target_sat.api.Organization().create() + lce = module_target_sat.api.LifecycleEnvironment(organization=org).create() repos_collection = target_sat.cli_factory.RepositoryCollection( distro='rhel6', repositories=[target_sat.cli_factory.VirtualizationAgentsRepository()] ) repos_collection.setup_content( org.id, lce.id, download_policy='immediate', upload_manifest=True ) - cv = entities.ContentView(id=repos_collection.setup_content_data['content_view']['id']).read() - cvf = entities.ErratumContentViewFilter( + cv = module_target_sat.api.ContentView( + id=repos_collection.setup_content_data['content_view']['id'] + ).read() + cvf = module_target_sat.api.ErratumContentViewFilter( content_view=cv, inclusion=False, repository=[repos_collection.repos_info[0]['id']] ).create() - entities.ContentViewFilterRule( + module_target_sat.api.ContentViewFilterRule( content_view_filter=cvf, start_date='2011-01-01', types=['security', 'enhancement', 'bugfix'], @@ -1260,7 +1300,7 @@ def test_positive_publish_rh_content_with_errata_by_date_filter(session, target_ @pytest.mark.tier3 -def test_negative_add_same_package_filter_twice(session, module_org, target_sat): +def test_negative_add_same_package_filter_twice(session, module_target_sat, module_org, target_sat): """Update version of package inside exclusive cv package filter :id: 5a97de5a-679e-4150-adf7-b4a28290b834 @@ -1297,7 +1337,9 @@ def test_negative_add_same_package_filter_twice(session, module_org, target_sat) @pytest.mark.tier2 -def test_positive_remove_cv_version_from_default_env(session, module_org, target_sat): +def test_positive_remove_cv_version_from_default_env( + session, module_target_sat, module_org, target_sat +): """Remove content view version from Library environment :id: 43c83c15-c883-45a7-be05-d9b26da99e3c @@ -1335,7 +1377,9 @@ def test_positive_remove_cv_version_from_default_env(session, module_org, target @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(session, module_org, target_sat): +def test_positive_remove_promoted_cv_version_from_default_env( + session, module_target_sat, module_org, target_sat +): """Remove promoted content view version from Library environment :id: a8649444-b063-4fb4-b932-a3fae7d4021d @@ -1380,7 +1424,9 @@ def test_positive_remove_promoted_cv_version_from_default_env(session, module_or @pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier2 -def test_positive_remove_qe_promoted_cv_version_from_default_env(session, module_org, target_sat): +def test_positive_remove_qe_promoted_cv_version_from_default_env( + session, module_target_sat, module_org, target_sat +): """Remove QE promoted content view version from Library environment :id: 71ad8b72-68c4-4c98-9387-077f54ef0184 @@ -1399,8 +1445,10 @@ def test_positive_remove_qe_promoted_cv_version_from_default_env(session, module :CaseImportance: Low """ - dev_lce = entities.LifecycleEnvironment(organization=module_org).create() - qe_lce = entities.LifecycleEnvironment(organization=module_org, prior=dev_lce).create() + dev_lce = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() + qe_lce = module_target_sat.api.LifecycleEnvironment( + organization=module_org, prior=dev_lce + ).create() repo = target_sat.cli_factory.RepositoryCollection( repositories=[ target_sat.cli_factory.DockerRepository( @@ -1411,7 +1459,7 @@ def test_positive_remove_qe_promoted_cv_version_from_default_env(session, module repo.setup(module_org.id) repo_name = repo.repos_info[0]['name'] cv, lce = repo.setup_content_view(module_org.id, dev_lce.id) - cvv = entities.ContentView(id=cv['id']).read().version[0] + cvv = module_target_sat.api.ContentView(id=cv['id']).read().version[0] cvv.promote(data={'environment_ids': qe_lce.id}) with session: cv_values = session.contentview.read(cv['name']) @@ -1448,7 +1496,9 @@ def test_positive_remove_qe_promoted_cv_version_from_default_env(session, module ], indirect=True, ) -def test_positive_remove_cv_version_from_env(session, module_org, repos_collection): +def test_positive_remove_cv_version_from_env( + session, module_target_sat, module_org, repos_collection +): """Remove promoted content view version from environment :id: d1da23ee-a5db-4990-9572-1a0919a9fe1c @@ -1468,8 +1518,10 @@ def test_positive_remove_cv_version_from_env(session, module_org, repos_collecti :CaseImportance: High """ - dev_lce = entities.LifecycleEnvironment(organization=module_org).create() - qe_lce = entities.LifecycleEnvironment(organization=module_org, prior=dev_lce).create() + dev_lce = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() + qe_lce = module_target_sat.api.LifecycleEnvironment( + organization=module_org, prior=dev_lce + ).create() repos_collection.setup(module_org.id) yum_repo_name = [ repo['name'] for repo in repos_collection.repos_info if repo['content-type'] == 'yum' @@ -1478,7 +1530,7 @@ def test_positive_remove_cv_version_from_env(session, module_org, repos_collecti repo['name'] for repo in repos_collection.repos_info if repo['content-type'] == 'docker' ][0] cv, lce = repos_collection.setup_content_view(module_org.id, dev_lce.id) - cvv = entities.ContentView(id=cv['id']).read().version[0] + cvv = module_target_sat.api.ContentView(id=cv['id']).read().version[0] cvv.promote(data={'environment_ids': qe_lce.id}) with session: cvv = session.contentview.read_version(cv['name'], VERSION) @@ -1505,7 +1557,9 @@ def test_positive_remove_cv_version_from_env(session, module_org, repos_collecti @pytest.mark.upgrade @pytest.mark.tier2 @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') -def test_positive_delete_cv_promoted_to_multi_env(session, module_org, target_sat): +def test_positive_delete_cv_promoted_to_multi_env( + session, module_target_sat, module_org, target_sat +): """Delete published content view with version promoted to multiple environments @@ -1548,7 +1602,7 @@ def test_positive_delete_cv_promoted_to_multi_env(session, module_org, target_sa @pytest.mark.tier2 @pytest.mark.upgrade -def test_positive_delete_composite_version(session, module_org, target_sat): +def test_positive_delete_composite_version(session, module_target_sat, module_org, target_sat): """Delete a composite content-view version associated to 'Library' :id: b2d9b21d-1e0d-40f1-9bbc-3c88cddd4f5e @@ -1583,7 +1637,7 @@ def test_positive_delete_composite_version(session, module_org, target_sat): @pytest.mark.tier2 -def test_positive_delete_non_default_version(session, target_sat): +def test_positive_delete_non_default_version(session, module_target_sat, target_sat): """Delete a content-view version associated to non-default environment @@ -1594,11 +1648,13 @@ def test_positive_delete_non_default_version(session, target_sat): :CaseImportance: Critical """ repo_name = gen_string('alpha') - org = entities.Organization().create() + org = module_target_sat.api.Organization().create() target_sat.api_factory.create_sync_custom_repo(org.id, repo_name=repo_name) - repo = entities.Repository(name=repo_name).search(query={'organization_id': org.id})[0] - cv = entities.ContentView(organization=org, repository=[repo]).create() - lce = entities.LifecycleEnvironment(organization=org).create() + repo = module_target_sat.api.Repository(name=repo_name).search( + query={'organization_id': org.id} + )[0] + cv = module_target_sat.api.ContentView(organization=org, repository=[repo]).create() + lce = module_target_sat.api.LifecycleEnvironment(organization=org).create() with session: session.organization.select(org.name) # Publish and promote CV to next environment @@ -1616,7 +1672,7 @@ def test_positive_delete_non_default_version(session, target_sat): @pytest.mark.upgrade @pytest.mark.tier2 -def test_positive_delete_version_with_ak(session): +def test_positive_delete_version_with_ak(session, module_target_sat): """Delete a content-view version that had associated activation key to it :id: 0da50b26-f82b-4663-9372-4c39270d4323 @@ -1625,13 +1681,13 @@ def test_positive_delete_version_with_ak(session): :CaseImportance: High """ - org = entities.Organization().create() - cv = entities.ContentView(organization=org).create() + org = module_target_sat.api.Organization().create() + cv = module_target_sat.api.ContentView(organization=org).create() cv.publish() cvv = cv.read().version[0].read() - lc_env = entities.LifecycleEnvironment(organization=org).create() + lc_env = module_target_sat.api.LifecycleEnvironment(organization=org).create() cvv.promote(data={'environment_ids': lc_env.id}) - ak = entities.ActivationKey( + ak = module_target_sat.api.ActivationKey( name=gen_string('alphanumeric'), environment=lc_env.id, organization=org, content_view=cv ).create() with session: @@ -1652,7 +1708,7 @@ def test_positive_delete_version_with_ak(session): @pytest.mark.tier2 -def test_positive_clone_within_same_env(session, module_org, target_sat): +def test_positive_clone_within_same_env(session, module_target_sat, module_org, target_sat): """attempt to create new content view based on existing view within environment @@ -1682,7 +1738,7 @@ def test_positive_clone_within_same_env(session, module_org, target_sat): @pytest.mark.tier2 -def test_positive_clone_within_diff_env(session, module_org, target_sat): +def test_positive_clone_within_diff_env(session, module_target_sat, module_org, target_sat): """attempt to create new content view based on existing view, inside a different environment @@ -1698,10 +1754,12 @@ def test_positive_clone_within_diff_env(session, module_org, target_sat): repo_name = gen_string('alpha') copy_cv_name = gen_string('alpha') target_sat.api_factory.create_sync_custom_repo(module_org.id, repo_name=repo_name) - repo = entities.Repository(name=repo_name).search(query={'organization_id': module_org.id})[0] - cv = entities.ContentView(organization=module_org, repository=[repo]).create() - lce = entities.LifecycleEnvironment(organization=module_org).create() - copy_lce = entities.LifecycleEnvironment(organization=module_org).create() + repo = module_target_sat.api.Repository(name=repo_name).search( + query={'organization_id': module_org.id} + )[0] + cv = module_target_sat.api.ContentView(organization=module_org, repository=[repo]).create() + lce = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() + copy_lce = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() with session: # publish the content view result = session.contentview.publish(cv.name) @@ -1724,7 +1782,7 @@ def test_positive_clone_within_diff_env(session, module_org, target_sat): @pytest.mark.tier2 -def test_positive_remove_filter(session, module_org): +def test_positive_remove_filter(session, module_target_sat, module_org): """Create empty content views filter and remove it :id: 6c6deae7-13f1-4638-a960-d3565d93fd64 @@ -1734,7 +1792,7 @@ def test_positive_remove_filter(session, module_org): :CaseImportance: Low """ filter_name = gen_string('alpha') - cv = entities.ContentView(organization=module_org).create() + cv = module_target_sat.api.ContentView(organization=module_org).create() with session: session.contentviewfilter.create( cv.name, @@ -1750,7 +1808,7 @@ def test_positive_remove_filter(session, module_org): @pytest.mark.tier2 -def test_positive_add_package_filter(session, module_org, target_sat): +def test_positive_add_package_filter(session, module_target_sat, module_org, target_sat): """Add package to content views filter :id: 1cc8d921-92e5-4b51-8050-a7e775095f97 @@ -1769,8 +1827,10 @@ def test_positive_add_package_filter(session, module_org, target_sat): filter_name = gen_string('alpha') repo_name = gen_string('alpha') target_sat.api_factory.create_sync_custom_repo(module_org.id, repo_name=repo_name) - repo = entities.Repository(name=repo_name).search(query={'organization_id': module_org.id})[0] - cv = entities.ContentView(organization=module_org, repository=[repo]).create() + repo = module_target_sat.api.Repository(name=repo_name).search( + query={'organization_id': module_org.id} + )[0] + cv = module_target_sat.api.ContentView(organization=module_org, repository=[repo]).create() with session: session.contentviewfilter.create( cv.name, @@ -1792,7 +1852,9 @@ def test_positive_add_package_filter(session, module_org, target_sat): @pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier3 -def test_positive_add_package_inclusion_filter_and_publish(session, module_org, target_sat): +def test_positive_add_package_inclusion_filter_and_publish( + session, module_target_sat, module_org, target_sat +): """Add package to inclusion content views filter, publish CV and verify package was actually filtered @@ -1807,8 +1869,10 @@ def test_positive_add_package_inclusion_filter_and_publish(session, module_org, package1_name = 'cow' package2_name = 'bear' target_sat.api_factory.create_sync_custom_repo(module_org.id, repo_name=repo_name) - repo = entities.Repository(name=repo_name).search(query={'organization_id': module_org.id})[0] - cv = entities.ContentView(organization=module_org, repository=[repo]).create() + repo = module_target_sat.api.Repository(name=repo_name).search( + query={'organization_id': module_org.id} + )[0] + cv = module_target_sat.api.ContentView(organization=module_org, repository=[repo]).create() with session: session.contentviewfilter.create( cv.name, @@ -1836,7 +1900,9 @@ def test_positive_add_package_inclusion_filter_and_publish(session, module_org, @pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier3 -def test_positive_add_package_exclusion_filter_and_publish(session, module_org, target_sat): +def test_positive_add_package_exclusion_filter_and_publish( + session, module_target_sat, module_org, target_sat +): """Add package to exclusion content views filter, publish CV and verify package was actually filtered @@ -1851,8 +1917,10 @@ def test_positive_add_package_exclusion_filter_and_publish(session, module_org, package1_name = 'cow' package2_name = 'bear' target_sat.api_factory.create_sync_custom_repo(module_org.id, repo_name=repo_name) - repo = entities.Repository(name=repo_name).search(query={'organization_id': module_org.id})[0] - cv = entities.ContentView(organization=module_org, repository=[repo]).create() + repo = module_target_sat.api.Repository(name=repo_name).search( + query={'organization_id': module_org.id} + )[0] + cv = module_target_sat.api.ContentView(organization=module_org, repository=[repo]).create() with session: session.contentviewfilter.create( cv.name, @@ -1881,7 +1949,9 @@ def test_positive_add_package_exclusion_filter_and_publish(session, module_org, @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(session, module_org, target_sat): +def test_positive_remove_package_from_exclusion_filter( + session, module_target_sat, module_org, target_sat +): """Remove package from content view exclusion filter :id: 2f0adc16-2305-4adf-8582-82e6110fa385 @@ -1928,7 +1998,9 @@ def test_positive_remove_package_from_exclusion_filter(session, module_org, targ @pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier3 -def test_positive_update_inclusive_filter_package_version(session, module_org, target_sat): +def test_positive_update_inclusive_filter_package_version( + session, module_target_sat, module_org, target_sat +): """Update version of package inside inclusive cv package filter :id: 8d6801de-ab82-49d6-bdeb-0f6e5c95b906 @@ -1942,8 +2014,10 @@ def test_positive_update_inclusive_filter_package_version(session, module_org, t repo_name = gen_string('alpha') package_name = 'walrus' target_sat.api_factory.create_sync_custom_repo(module_org.id, repo_name=repo_name) - repo = entities.Repository(name=repo_name).search(query={'organization_id': module_org.id})[0] - cv = entities.ContentView(organization=module_org, repository=[repo]).create() + repo = module_target_sat.api.Repository(name=repo_name).search( + query={'organization_id': module_org.id} + )[0] + cv = module_target_sat.api.ContentView(organization=module_org, repository=[repo]).create() with session: session.contentviewfilter.create( cv.name, @@ -1990,7 +2064,9 @@ def test_positive_update_inclusive_filter_package_version(session, module_org, t @pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier3 -def test_positive_update_exclusive_filter_package_version(session, module_org, target_sat): +def test_positive_update_exclusive_filter_package_version( + session, module_target_sat, module_org, target_sat +): """Update version of package inside exclusive cv package filter :id: a8aa8864-190a-46c3-aeed-4953c8f3f601 @@ -2004,8 +2080,10 @@ def test_positive_update_exclusive_filter_package_version(session, module_org, t repo_name = gen_string('alpha') package_name = 'walrus' target_sat.api_factory.create_sync_custom_repo(module_org.id, repo_name=repo_name) - repo = entities.Repository(name=repo_name).search(query={'organization_id': module_org.id})[0] - cv = entities.ContentView(organization=module_org, repository=[repo]).create() + repo = module_target_sat.api.Repository(name=repo_name).search( + query={'organization_id': module_org.id} + )[0] + cv = module_target_sat.api.ContentView(organization=module_org, repository=[repo]).create() with session: session.contentviewfilter.create( cv.name, @@ -2053,7 +2131,9 @@ def test_positive_update_exclusive_filter_package_version(session, module_org, t @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(session, module_org, target_sat): +def test_positive_add_all_security_errata_by_date_range_filter( + session, module_target_sat, module_org, target_sat +): """Create erratum date range filter to include only security errata and publish new content view version @@ -2104,7 +2184,7 @@ def test_positive_add_all_security_errata_by_date_range_filter(session, module_o @pytest.mark.run_in_one_thread @pytest.mark.skip_if_not_set('fake_manifest') @pytest.mark.tier3 -def test_positive_edit_rh_custom_spin(session, target_sat): +def test_positive_edit_rh_custom_spin(session, module_target_sat, target_sat): """Edit content views for a custom rh spin. For example, modify a filter. :id: 05639074-ef6d-4c6b-8ff6-53033821e686 @@ -2117,13 +2197,15 @@ def test_positive_edit_rh_custom_spin(session, target_sat): filter_name = gen_string('alpha') start_date = datetime.date(2016, 1, 1) end_date = datetime.date(2016, 6, 1) - org = entities.Organization().create() - lce = entities.LifecycleEnvironment(organization=org).create() + org = module_target_sat.api.Organization().create() + lce = module_target_sat.api.LifecycleEnvironment(organization=org).create() repos_collection = target_sat.cli_factory.RepositoryCollection( distro='rhel7', repositories=[target_sat.cli_factory.SatelliteToolsRepository()] ) repos_collection.setup_content(org.id, lce.id, upload_manifest=True) - cv = entities.ContentView(id=repos_collection.setup_content_data['content_view']['id']).read() + cv = module_target_sat.api.ContentView( + id=repos_collection.setup_content_data['content_view']['id'] + ).read() with session: session.organization.select(org.name) session.contentviewfilter.create( @@ -2163,7 +2245,7 @@ def test_positive_edit_rh_custom_spin(session, target_sat): @pytest.mark.skip_if_not_set('fake_manifest') @pytest.mark.upgrade @pytest.mark.tier2 -def test_positive_promote_with_rh_custom_spin(session, target_sat): +def test_positive_promote_with_rh_custom_spin(session, module_target_sat, target_sat): """attempt to promote a content view containing a custom RH spin - i.e., contains filters. @@ -2174,13 +2256,15 @@ def test_positive_promote_with_rh_custom_spin(session, target_sat): :CaseImportance: Critical """ filter_name = gen_string('alpha') - org = entities.Organization().create() - lce = entities.LifecycleEnvironment(organization=org).create() + org = module_target_sat.api.Organization().create() + lce = module_target_sat.api.LifecycleEnvironment(organization=org).create() repos_collection = target_sat.cli_factory.RepositoryCollection( distro='rhel7', repositories=[target_sat.cli_factory.SatelliteToolsRepository()] ) repos_collection.setup_content(org.id, lce.id, upload_manifest=True) - cv = entities.ContentView(id=repos_collection.setup_content_data['content_view']['id']).read() + cv = module_target_sat.api.ContentView( + id=repos_collection.setup_content_data['content_view']['id'] + ).read() with session: session.organization.select(org.name) # add a package exclude filter @@ -2208,7 +2292,7 @@ def test_positive_promote_with_rh_custom_spin(session, target_sat): @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_org): +def test_positive_add_all_security_errata_by_id_filter(session, module_target_sat, module_org): """Create erratum filter to include only security errata and publish new content view version @@ -2224,10 +2308,12 @@ def test_positive_add_all_security_errata_by_id_filter(session, module_org): """ version = 'Version 2.0' filter_name = gen_string('alphanumeric') - product = entities.Product(organization=module_org).create() - repo = entities.Repository(product=product, url=settings.repos.yum_9.url).create() + product = module_target_sat.api.Product(organization=module_org).create() + repo = module_target_sat.api.Repository(product=product, url=settings.repos.yum_9.url).create() repo.sync() - content_view = entities.ContentView(organization=module_org, repository=[repo]).create() + content_view = module_target_sat.api.ContentView( + organization=module_org, repository=[repo] + ).create() content_view.publish() with session: session.contentviewfilter.create( @@ -2253,7 +2339,7 @@ def test_positive_add_all_security_errata_by_id_filter(session, module_org): @pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier3 -def test_positive_add_errata_filter(session, module_org, target_sat): +def test_positive_add_errata_filter(session, module_target_sat, module_org, target_sat): """add errata to content views filter :id: bb9eef30-62c4-435c-9573-9f31210b8d7d @@ -2266,8 +2352,10 @@ def test_positive_add_errata_filter(session, module_org, target_sat): filter_name = gen_string('alpha') repo_name = gen_string('alpha') target_sat.api_factory.create_sync_custom_repo(module_org.id, repo_name=repo_name) - repo = entities.Repository(name=repo_name).search(query={'organization_id': module_org.id})[0] - cv = entities.ContentView(organization=module_org, repository=[repo]).create() + repo = module_target_sat.api.Repository(name=repo_name).search( + query={'organization_id': module_org.id} + )[0] + cv = module_target_sat.api.ContentView(organization=module_org, repository=[repo]).create() with session: session.contentviewfilter.create( cv.name, @@ -2290,7 +2378,7 @@ def test_positive_add_errata_filter(session, module_org, target_sat): @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_org, target_sat): +def test_positive_add_module_stream_filter(session, module_target_sat, module_org, target_sat): """add module stream filter in a content view :id: 343c543e-5773-4ea4-aff4-27e0ed6be19e @@ -2305,8 +2393,10 @@ def test_positive_add_module_stream_filter(session, module_org, target_sat): target_sat.api_factory.create_sync_custom_repo( module_org.id, repo_name=repo_name, repo_url=settings.repos.module_stream_1.url ) - repo = entities.Repository(name=repo_name).search(query={'organization_id': module_org.id})[0] - cv = entities.ContentView(organization=module_org, repository=[repo]).create() + repo = module_target_sat.api.Repository(name=repo_name).search( + query={'organization_id': module_org.id} + )[0] + cv = module_target_sat.api.ContentView(organization=module_org, repository=[repo]).create() with session: session.contentviewfilter.create( cv.name, @@ -2329,7 +2419,7 @@ def test_positive_add_module_stream_filter(session, module_org, target_sat): @pytest.mark.tier3 -def test_positive_add_package_group_filter(session, module_org, target_sat): +def test_positive_add_package_group_filter(session, module_target_sat, module_org, target_sat): """add package group to content views filter :id: 8c02a432-8b2a-4ba3-9613-7070b2dc2bcb @@ -2343,8 +2433,10 @@ def test_positive_add_package_group_filter(session, module_org, target_sat): repo_name = gen_string('alpha') package_group = 'mammals' target_sat.api_factory.create_sync_custom_repo(module_org.id, repo_name=repo_name) - repo = entities.Repository(name=repo_name).search(query={'organization_id': module_org.id})[0] - cv = entities.ContentView(organization=module_org, repository=[repo]).create() + repo = module_target_sat.api.Repository(name=repo_name).search( + query={'organization_id': module_org.id} + )[0] + cv = module_target_sat.api.ContentView(organization=module_org, repository=[repo]).create() with session: session.contentviewfilter.create( cv.name, @@ -2362,7 +2454,7 @@ def test_positive_add_package_group_filter(session, module_org, target_sat): @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_org, target_sat): +def test_positive_update_filter_affected_repos(session, module_target_sat, module_org, target_sat): """Update content view package filter affected repos :id: 8f095b11-fd63-4a23-9586-a85d6191314f @@ -2382,9 +2474,15 @@ def test_positive_update_filter_affected_repos(session, module_org, target_sat): module_org.id, repo_name=repo1_name, repo_url=settings.repos.yum_3.url ) target_sat.api_factory.create_sync_custom_repo(module_org.id, repo_name=repo2_name) - repo1 = entities.Repository(name=repo1_name).search(query={'organization_id': module_org.id})[0] - repo2 = entities.Repository(name=repo2_name).search(query={'organization_id': module_org.id})[0] - cv = entities.ContentView(organization=module_org, repository=[repo1, repo2]).create() + repo1 = module_target_sat.api.Repository(name=repo1_name).search( + query={'organization_id': module_org.id} + )[0] + repo2 = module_target_sat.api.Repository(name=repo2_name).search( + query={'organization_id': module_org.id} + )[0] + cv = module_target_sat.api.ContentView( + organization=module_org, repository=[repo1, repo2] + ).create() with session: # create a filter that affects a subset of repos in the cv session.contentviewfilter.create( @@ -2424,7 +2522,7 @@ def test_positive_update_filter_affected_repos(session, module_org, target_sat): @pytest.mark.tier3 -def test_positive_search_composite(session): +def test_positive_search_composite(session, module_target_sat): """Search for content view by its composite property criteria :id: 214a721b-3993-4251-9b7c-0f6d2446c1d1 @@ -2446,7 +2544,9 @@ def test_positive_search_composite(session): @pytest.mark.tier3 -def test_positive_publish_with_repo_with_disabled_http(session, module_org, target_sat): +def test_positive_publish_with_repo_with_disabled_http( + session, module_target_sat, module_org, target_sat +): """Attempt to publish content view with repository that set 'Unprotected' to False @@ -2516,8 +2616,8 @@ def test_positive_subscribe_system_with_custom_content( :CaseImportance: High """ - org = entities.Organization().create() - lce = entities.LifecycleEnvironment(organization=org).create() + org = target_sat.api.Organization().create() + lce = target_sat.api.LifecycleEnvironment(organization=org).create() repos_collection.setup_content(org.id, lce.id, upload_manifest=True) repos_collection.setup_virtual_machine(rhel7_contenthost) assert rhel7_contenthost.subscribed @@ -2550,16 +2650,16 @@ def test_positive_delete_with_kickstart_repo_and_host_group( """ hg_name = gen_string('alpha') sat_hostname = target_sat.hostname - org = entities.Organization().create() + org = target_sat.api.Organization().create() # Create a new Lifecycle environment - lc_env = entities.LifecycleEnvironment(organization=org).create() + lc_env = target_sat.api.LifecycleEnvironment(organization=org).create() # Create a Product and Kickstart Repository for OS distribution content - product = entities.Product(organization=org).create() - repo = entities.Repository(product=product, url=settings.repos.rhel7_os).create() + product = target_sat.api.Product(organization=org).create() + repo = target_sat.api.Repository(product=product, url=settings.repos.rhel7_os).create() # Repo sync procedure call_entity_method_with_timeout(repo.sync, timeout=3600) # Create, Publish and promote CV - content_view = entities.ContentView(organization=org).create() + content_view = target_sat.api.ContentView(organization=org).create() content_view.repository = [repo] content_view = content_view.update(['repository']) content_view.publish() @@ -2567,13 +2667,15 @@ def test_positive_delete_with_kickstart_repo_and_host_group( content_view.version[0].promote(data={'environment_ids': lc_env.id}) cv_name = content_view.name # Get the Partition table ID - ptable = entities.PartitionTable().search(query={'search': f'name="{DEFAULT_PTABLE}"'})[0] + ptable = target_sat.api.PartitionTable().search(query={'search': f'name="{DEFAULT_PTABLE}"'})[0] # Get the arch ID arch = ( - entities.Architecture().search(query={'search': f'name="{DEFAULT_ARCHITECTURE}"'})[0].read() + target_sat.api.Architecture() + .search(query={'search': f'name="{DEFAULT_ARCHITECTURE}"'})[0] + .read() ) # Get the OS ID - os = entities.OperatingSystem().search( + os = target_sat.api.OperatingSystem().search( query={'search': 'name="RedHat" AND (major="6" OR major="7")'} )[0] # Update the OS to associate arch and ptable @@ -2626,7 +2728,7 @@ def test_positive_rh_mixed_content_end_to_end( :CaseImportance: High """ cv_name = gen_string('alpha') - docker_repo = entities.Repository( + docker_repo = target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=module_prod, content_type=REPO_TYPE['docker'] ).create() rh_st_repo = { @@ -2638,7 +2740,7 @@ def test_positive_rh_mixed_content_end_to_end( } target_sat.api_factory.enable_sync_redhat_repo(rh_st_repo, module_entitlement_manifest_org.id) docker_repo.sync() - lce = entities.LifecycleEnvironment(organization=module_entitlement_manifest_org).create() + lce = target_sat.api.LifecycleEnvironment(organization=module_entitlement_manifest_org).create() with session: session.organization.select(module_org.name) session.contentview.create({'name': cv_name}) @@ -2661,7 +2763,7 @@ def test_positive_rh_mixed_content_end_to_end( @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, target_sat): +def test_positive_errata_inc_update_list_package(session, module_target_sat, target_sat): """Publish incremental update with a new errata for a custom repo :BZ: 1489778 @@ -2675,11 +2777,11 @@ def test_positive_errata_inc_update_list_package(session, target_sat): :CaseImportance: High """ - org = entities.Organization().create() - product = entities.Product(organization=org).create() + org = module_target_sat.api.Organization().create() + product = module_target_sat.api.Product(organization=org).create() yum_repo_name = gen_string('alpha') # Creates custom yum repository - yum_repo = entities.Repository( + yum_repo = module_target_sat.api.Repository( name=yum_repo_name, url=settings.repos.yum_1.url, content_type=REPO_TYPE['yum'], @@ -2687,18 +2789,18 @@ def test_positive_errata_inc_update_list_package(session, target_sat): ).create() product.sync() # creating cv, cv filter, and publish cv - cv = entities.ContentView(organization=org, repository=[yum_repo]).create() - cvf = entities.RPMContentViewFilter( + cv = module_target_sat.api.ContentView(organization=org, repository=[yum_repo]).create() + cvf = module_target_sat.api.RPMContentViewFilter( content_view=cv, inclusion=True, name=gen_string('alphanumeric') ).create() - entities.ContentViewFilterRule( + module_target_sat.api.ContentViewFilterRule( content_view_filter=cvf, name='walrus', version='0.71', ).create() cv.publish() # Get published content-view version info - cvvs = entities.ContentView(id=cv.id).read().version + cvvs = module_target_sat.api.ContentView(id=cv.id).read().version assert len(cvvs) == 1 cvv = cvvs[0].read() result = ContentView.version_incremental_update( @@ -2707,7 +2809,7 @@ def test_positive_errata_inc_update_list_package(session, target_sat): result = [line.strip() for line_dict in result for line in line_dict.values()] with session: session.organization.select(org.name) - cvv = entities.ContentView(id=cv.id).read().version[1].read() + cvv = module_target_sat.api.ContentView(id=cv.id).read().version[1].read() version = session.contentview.read_version(cv.name, f'Version {cvv.version}') errata = version['errata']['table'] assert len(errata) == 1 @@ -2721,7 +2823,9 @@ def test_positive_errata_inc_update_list_package(session, target_sat): @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(session, rhel7_contenthost, target_sat): +def test_positive_composite_child_inc_update( + session, module_target_sat, rhel7_contenthost, target_sat +): """Incremental update with a new errata on a child content view should trigger incremental update of parent composite content view @@ -2761,12 +2865,12 @@ def test_positive_composite_child_inc_update(session, rhel7_contenthost, target_ :parametrized: yes """ - org = entities.Organization().create() - lce = entities.LifecycleEnvironment(organization=org).create() - product = entities.Product(organization=org).create() + org = module_target_sat.api.Organization().create() + lce = module_target_sat.api.LifecycleEnvironment(organization=org).create() + product = module_target_sat.api.Product(organization=org).create() yum_repo_name = gen_string('alpha') # Creates custom yum repository - yum_repo = entities.Repository( + yum_repo = module_target_sat.api.Repository( name=yum_repo_name, url=settings.repos.yum_1.url, content_type=REPO_TYPE['yum'], @@ -2774,17 +2878,17 @@ def test_positive_composite_child_inc_update(session, rhel7_contenthost, target_ ).create() product.sync() # creating cv, cv filter, and publish cv - cv = entities.ContentView(organization=org, repository=[yum_repo]).create() - cvf = entities.RPMContentViewFilter( + cv = module_target_sat.api.ContentView(organization=org, repository=[yum_repo]).create() + cvf = module_target_sat.api.RPMContentViewFilter( content_view=cv, inclusion=False, name=gen_string('alphanumeric') ).create() - entities.ContentViewFilterRule( + module_target_sat.api.ContentViewFilterRule( content_view_filter=cvf, name='walrus', version='5.21', ).create() cv.publish() - cvv = entities.ContentView(id=cv.id).read().version[0] + cvv = module_target_sat.api.ContentView(id=cv.id).read().version[0] cvv.promote(data={'environment_ids': lce.id}) # Setup tools repo and add it to ak repos_collection = target_sat.cli_factory.RepositoryCollection( @@ -2801,10 +2905,10 @@ def test_positive_composite_child_inc_update(session, rhel7_contenthost, target_ result = target_sat.execute(command) assert result.status == 0 # Create composite cv - composite_cv = entities.ContentView(composite=True, organization=org).create() + composite_cv = module_target_sat.api.ContentView(composite=True, organization=org).create() # Adds all repos to composite cv composite_cv.component = [ - entities.ContentView(id=content_data['content_view']['id']).read().version[0], + module_target_sat.api.ContentView(id=content_data['content_view']['id']).read().version[0], cvv, ] composite_cv = composite_cv.update(['component']) @@ -2812,7 +2916,7 @@ def test_positive_composite_child_inc_update(session, rhel7_contenthost, target_ composite_cv.publish() composite_cv.read().version[0].promote(data={'environment_ids': lce.id}) # Update AK to use composite cv - entities.ActivationKey( + module_target_sat.api.ActivationKey( id=content_data['activation_key']['id'], content_view=composite_cv ).update(['content_view']) repos_collection.setup_virtual_machine(rhel7_contenthost) @@ -2838,7 +2942,7 @@ def test_positive_composite_child_inc_update(session, rhel7_contenthost, target_ @pytest.mark.tier3 @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') -def test_positive_module_stream_end_to_end(session, module_org, target_sat): +def test_positive_module_stream_end_to_end(session, module_target_sat, module_org, target_sat): """Create content view with custom module_stream contents, publish and promote it to Library +1 env. Then disassociate repository from that content view @@ -2886,7 +2990,9 @@ def test_positive_module_stream_end_to_end(session, module_org, target_sat): @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(session, module_org, target_sat): +def test_positive_search_module_streams_in_content_view( + session, module_target_sat, module_org, target_sat +): """Search module streams in content view version :id: 7f5273ff-e80f-459d-adf4-b517b6d60fdc @@ -2901,8 +3007,10 @@ def test_positive_search_module_streams_in_content_view(session, module_org, tar target_sat.api_factory.create_sync_custom_repo( module_org.id, repo_name=repo_name, repo_url=settings.repos.module_stream_1.url ) - repo = entities.Repository(name=repo_name).search(query={'organization_id': module_org.id})[0] - cv = entities.ContentView(organization=module_org, repository=[repo]).create() + repo = module_target_sat.api.Repository(name=repo_name).search( + query={'organization_id': module_org.id} + )[0] + cv = module_target_sat.api.ContentView(organization=module_org, repository=[repo]).create() with session: result = session.contentview.publish(cv.name) assert result['Version'] == VERSION @@ -2918,7 +3026,9 @@ def test_positive_search_module_streams_in_content_view(session, module_org, tar @pytest.mark.tier2 -def test_positive_non_admin_user_actions(session, module_org, test_name, target_sat): +def test_positive_non_admin_user_actions( + session, module_target_sat, module_org, test_name, target_sat +): """Attempt to manage content views :id: c4d270fc-a3e6-4ae2-a338-41d864a5622a @@ -2946,9 +3056,9 @@ def test_positive_non_admin_user_actions(session, module_org, test_name, target_ cv_copy_name = gen_string('alpha') user_login = gen_string('alpha') user_password = gen_string('alphanumeric') - lce = entities.LifecycleEnvironment(organization=module_org).create() + lce = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() # create a role with all content views permissions - role = entities.Role().create() + role = module_target_sat.api.Role().create() target_sat.api_factory.create_role_permissions( role, {'Katello::ContentView': PERMISSIONS['Katello::ContentView']} ) @@ -2963,7 +3073,7 @@ def test_positive_non_admin_user_actions(session, module_org, test_name, target_ search=f'name = {ENVIRONMENT} or name = {lce.name}', ) # create a user and assign the above created role - entities.User( + module_target_sat.api.User( default_organization=module_org, organization=[module_org], role=[role], @@ -2981,7 +3091,7 @@ def test_positive_non_admin_user_actions(session, module_org, test_name, target_ session.contentview.copy(cv_name, cv_copy_name) assert session.contentview.search(cv_copy_name)[0]['Name'] == cv_copy_name # login as the user created above - with Session(test_name, user=user_login, password=user_password) as session: + with target_sat.ui_session(test_name, user=user_login, password=user_password) as session: with pytest.raises(NavigationTriesExceeded): session.organization.create({'name': gen_string('alpha'), 'label': gen_string('alpha')}) # assert the user can view all the content views created @@ -3030,13 +3140,13 @@ def test_positive_readonly_user_actions(module_org, test_name, target_sat): user_login = gen_string('alpha') user_password = gen_string('alphanumeric') # create a role with content views read only permissions - role = entities.Role().create() + role = target_sat.api.Role().create() target_sat.api_factory.create_role_permissions( role, {'Katello::ContentView': ['view_content_views']} ) target_sat.api_factory.create_role_permissions(role, {'Katello::Product': ['view_products']}) # create a user and assign the above created role - entities.User( + target_sat.api.User( default_organization=module_org, organization=[module_org], role=[role], @@ -3044,11 +3154,11 @@ def test_positive_readonly_user_actions(module_org, test_name, target_sat): password=user_password, ).create() repo_id = target_sat.api_factory.create_sync_custom_repo(module_org.id) - yum_repo = entities.Repository(id=repo_id).read() - cv = entities.ContentView(organization=module_org, repository=[yum_repo]).create() + yum_repo = target_sat.api.Repository(id=repo_id).read() + cv = target_sat.api.ContentView(organization=module_org, repository=[yum_repo]).create() cv.publish() # login as the user created above - with Session(test_name, user=user_login, password=user_password) as session: + with target_sat.ui_session(test_name, user=user_login, password=user_password) as session: with pytest.raises(NavigationTriesExceeded): session.location.create({'name': gen_string('alpha'), 'label': gen_string('alpha')}) assert session.contentview.search(cv.name)[0]['Name'] == cv.name @@ -3059,7 +3169,9 @@ def test_positive_readonly_user_actions(module_org, test_name, target_sat): @pytest.mark.tier2 -def test_negative_read_only_user_actions(session, module_org, test_name, target_sat): +def test_negative_read_only_user_actions( + session, module_target_sat, module_org, test_name, target_sat +): """Attempt to manage content views :id: aae6eede-b40e-4e06-a5f7-59d9251aa35d @@ -3084,9 +3196,9 @@ def test_negative_read_only_user_actions(session, module_org, test_name, target_ # promote_or_remove_content_views_to_environments user_login = gen_string('alpha') user_password = gen_string('alphanumeric') - lce = entities.LifecycleEnvironment(organization=module_org).create() + lce = module_target_sat.api.LifecycleEnvironment(organization=module_org).create() # create a role with content views read only permissions - role = entities.Role().create() + role = module_target_sat.api.Role().create() target_sat.api_factory.create_role_permissions( role, {'Katello::ContentView': ['view_content_views']} ) @@ -3101,7 +3213,7 @@ def test_negative_read_only_user_actions(session, module_org, test_name, target_ search=f'name = {ENVIRONMENT} or name = {lce.name}', ) # create a user and assign the above created role - entities.User( + module_target_sat.api.User( default_organization=module_org, organization=[module_org], role=[role], @@ -3109,11 +3221,13 @@ def test_negative_read_only_user_actions(session, module_org, test_name, target_ password=user_password, ).create() repo_id = target_sat.api_factory.create_sync_custom_repo(module_org.id) - yum_repo = entities.Repository(id=repo_id).read() + yum_repo = module_target_sat.api.Repository(id=repo_id).read() repo_name = 'fakerepo01' - cv = entities.ContentView(organization=module_org, repository=[yum_repo]).create() + cv = module_target_sat.api.ContentView(organization=module_org, repository=[yum_repo]).create() # login as the user created above - with Session(test_name, user=user_login, password=user_password) as custom_session: + with target_sat.ui_session( + test_name, user=user_login, password=user_password + ) as custom_session: with pytest.raises(NavigationTriesExceeded): custom_session.location.create( {'name': gen_string('alpha'), 'label': gen_string('alpha')} @@ -3129,7 +3243,7 @@ def test_negative_read_only_user_actions(session, module_org, test_name, target_ with session: result = session.contentview.publish(cv.name) assert result['Version'] == VERSION - with Session(test_name, user=user_login, password=user_password) as session: + with target_sat.ui_session(test_name, user=user_login, password=user_password) as session: # Cannot create content view with pytest.raises(NoSuchElementException) as context: session.contentview.create({'name': gen_string('alpha')}) @@ -3185,9 +3299,9 @@ def test_negative_non_readonly_user_actions(module_org, test_name, target_sat): user_password = gen_string('alphanumeric') # create a role with all content views permissions except # view_content_views - lce = entities.LifecycleEnvironment(organization=module_org).create() - cv = entities.ContentView(organization=module_org).create() - role = entities.Role().create() + lce = target_sat.api.LifecycleEnvironment(organization=module_org).create() + cv = target_sat.api.ContentView(organization=module_org).create() + role = target_sat.api.Role().create() target_sat.api_factory.create_role_permissions( role, { @@ -3211,7 +3325,7 @@ def test_negative_non_readonly_user_actions(module_org, test_name, target_sat): search=f'name = {ENVIRONMENT} or name = {lce.name}', ) # create a user and assign the above created role - entities.User( + target_sat.api.User( default_organization=module_org, organization=[module_org], role=[role], @@ -3219,7 +3333,7 @@ def test_negative_non_readonly_user_actions(module_org, test_name, target_sat): password=user_password, ).create() # login as the user created above - with Session(test_name, user=user_login, password=user_password) as session: + with target_sat.ui_session(test_name, user=user_login, password=user_password) as session: with pytest.raises(NavigationTriesExceeded): session.user.create( { @@ -3237,7 +3351,9 @@ def test_negative_non_readonly_user_actions(module_org, test_name, target_sat): @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(session, module_org, target_sat): +def test_positive_conservative_solve_dependencies( + session, module_target_sat, module_org, target_sat +): """Performing solve dependencies on a package that is required by another package. Then performing solve dependencies on a root package with its corresponding dependency. @@ -3386,7 +3502,7 @@ def test_positive_conservative_dep_solving_with_multiversion_packages( @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_org, target_sat): +def test_positive_depsolve_with_module_errata(session, module_target_sat, module_org, target_sat): """Allowing users to filter module streams in content views. This test case does not test against RHEL8 repos because it is known that RHEL8 filtering with depsolving creates inconsistent results. The custom repo used in this test case has consistent results based @@ -3463,7 +3579,7 @@ def test_positive_depsolve_with_module_errata(session, module_org, target_sat): @pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier2 -def test_positive_filter_by_pkg_group_name(session, module_org, target_sat): +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. :id: c7021f46-0168-44f7-a863-4aa34533efdb @@ -3504,7 +3620,7 @@ def test_positive_filter_by_pkg_group_name(session, module_org, target_sat): @pytest.mark.skip_if_open('BZ:2086957') @pytest.mark.tier3 -def test_positive_inc_update_should_not_fail(session, module_org): +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 :BZ: 2041497 @@ -3525,10 +3641,10 @@ def test_positive_inc_update_should_not_fail(session, module_org): :CaseImportance: High """ package1_name = 'bear' - product = entities.Product(organization=module_org).create() + product = module_target_sat.api.Product(organization=module_org).create() yum_repo_name = gen_string('alpha') # Creates custom yum repository - yum_repo = entities.Repository( + yum_repo = module_target_sat.api.Repository( name=yum_repo_name, url=settings.repos.yum_1.url, content_type=REPO_TYPE['yum'], @@ -3539,9 +3655,9 @@ def test_positive_inc_update_should_not_fail(session, module_org): package_id = yum_repo.packages()['results'][0]['id'] yum_repo.remove_content(data={'ids': [package_id]}) assert yum_repo.packages()['total'] == 31 - cv = entities.ContentView(organization=module_org, repository=[yum_repo]).create() + cv = module_target_sat.api.ContentView(organization=module_org, repository=[yum_repo]).create() cv.publish() - cvvs = entities.ContentView(id=cv.id).read().version + cvvs = module_target_sat.api.ContentView(id=cv.id).read().version assert len(cvvs) == 1 yum_repo.sync() assert yum_repo.packages()['total'] == 32 @@ -3552,7 +3668,7 @@ def test_positive_inc_update_should_not_fail(session, module_org): result = [line.strip() for line_dict in result for line in line_dict.values()] assert result[2] == FAKE_0_CUSTOM_PACKAGE with session: - cvv = entities.ContentView(id=cv.id).read().version[1].read() + cvv = module_target_sat.api.ContentView(id=cv.id).read().version[1].read() assert cvv.version == '1.1' packages = session.contentview.search_version_package( cv.name, 'Version 1.1', f'name= "{package1_name}"' @@ -3679,7 +3795,7 @@ def test_positive_no_duplicate_key_violate_unique_constraint_using_filters( @pytest.mark.tier2 -def test_positive_inc_publish_cv(session, module_org): +def test_positive_inc_publish_cv(session, module_target_sat, module_org): """Ensure that the content count gets updated when doing incremental update :BZ: 2032098 @@ -3700,17 +3816,17 @@ def test_positive_inc_publish_cv(session, module_org): :CaseImportance: High """ package_name = 'bear' - product = entities.Product(organization=module_org).create() + product = module_target_sat.api.Product(organization=module_org).create() yum_repo_name = gen_string('alpha') filter_name = gen_string('alpha') - yum_repo = entities.Repository( + yum_repo = module_target_sat.api.Repository( name=yum_repo_name, url=settings.repos.yum_1.url, content_type=REPO_TYPE['yum'], product=product, ).create() yum_repo.sync() - cv = entities.ContentView(organization=module_org, repository=[yum_repo]).create() + cv = module_target_sat.api.ContentView(organization=module_org, repository=[yum_repo]).create() with session: session.contentviewfilter.create( cv.name, @@ -3724,10 +3840,10 @@ def test_positive_inc_publish_cv(session, module_org): cv.name, filter_name, package_name, None, ('Equal To', '4.1-1') ) session.contentview.publish(cv.name) - cvv = entities.ContentView(id=cv.id).read().version[0].read() + cvv = module_target_sat.api.ContentView(id=cv.id).read().version[0].read() assert cvv.package_count == 31 ContentView.version_incremental_update( {'content-view-version-id': cvv.id, 'errata-ids': settings.repos.yum_1.errata[0]} ) - cvv = entities.ContentView(id=cv.id).read().version[1].read() + cvv = module_target_sat.api.ContentView(id=cv.id).read().version[1].read() assert cvv.package_count == 32 diff --git a/tests/foreman/ui/test_dashboard.py b/tests/foreman/ui/test_dashboard.py index 93f4b73019..0dc1bb0fcc 100644 --- a/tests/foreman/ui/test_dashboard.py +++ b/tests/foreman/ui/test_dashboard.py @@ -11,8 +11,6 @@ :CaseImportance: High """ -from airgun.session import Session -from nailgun import entities from nailgun.entity_mixins import TaskFailedError import pytest @@ -23,7 +21,7 @@ @pytest.mark.tier2 -def test_positive_host_configuration_status(session): +def test_positive_host_configuration_status(session, target_sat): """Check if the Host Configuration Status Widget links are working :id: ffb0a6a1-2b65-4578-83c7-61492122d865 @@ -41,9 +39,9 @@ def test_positive_host_configuration_status(session): :BZ: 1631219 """ - org = entities.Organization().create() - loc = entities.Location().create() - host = entities.Host(organization=org, location=loc).create() + org = target_sat.api.Organization().create() + loc = target_sat.api.Location().create() + host = target_sat.api.Host(organization=org, location=loc).create() criteria_list = [ 'Hosts that had performed modifications without error', 'Hosts in error state', @@ -94,7 +92,7 @@ def test_positive_host_configuration_status(session): @pytest.mark.tier2 -def test_positive_host_configuration_chart(session): +def test_positive_host_configuration_chart(session, target_sat): """Check if the Host Configuration Chart is working in the Dashboard UI :id: b03314aa-4394-44e5-86da-c341c783003d @@ -107,9 +105,9 @@ def test_positive_host_configuration_chart(session): :expectedresults: Chart showing correct data """ - org = entities.Organization().create() - loc = entities.Location().create() - entities.Host(organization=org, location=loc).create() + org = target_sat.api.Organization().create() + loc = target_sat.api.Location().create() + target_sat.api.Host(organization=org, location=loc).create() with session: session.organization.select(org_name=org.name) session.location.select(loc_name=loc.name) @@ -120,7 +118,7 @@ def test_positive_host_configuration_chart(session): @pytest.mark.upgrade @pytest.mark.run_in_one_thread @pytest.mark.tier2 -def test_positive_task_status(session): +def test_positive_task_status(session, target_sat): """Check if the Task Status is working in the Dashboard UI and filter from Tasks index page is working correctly @@ -141,9 +139,11 @@ def test_positive_task_status(session): :BZ: 1718889 """ url = 'www.non_existent_repo_url.org' - org = entities.Organization().create() - product = entities.Product(organization=org).create() - repo = entities.Repository(url=f'http://{url}', product=product, content_type='yum').create() + org = target_sat.api.Organization().create() + product = target_sat.api.Product(organization=org).create() + repo = target_sat.api.Repository( + url=f'http://{url}', product=product, content_type='yum' + ).create() with pytest.raises(TaskFailedError): repo.sync() with session: @@ -222,9 +222,9 @@ def test_positive_user_access_with_host_filter( user_login = gen_string('alpha') user_password = gen_string('alphanumeric') org = function_entitlement_manifest_org - lce = entities.LifecycleEnvironment(organization=org).create() + lce = target_sat.api.LifecycleEnvironment(organization=org).create() # create a role with necessary permissions - role = entities.Role().create() + role = target_sat.api.Role().create() user_permissions = { 'Organization': ['view_organizations'], 'Location': ['view_locations'], @@ -233,7 +233,7 @@ def test_positive_user_access_with_host_filter( } target_sat.api_factory.create_role_permissions(role, user_permissions) # create a user and assign the above created role - entities.User( + target_sat.api.User( default_organization=org, organization=[org], default_location=module_location, @@ -242,7 +242,7 @@ def test_positive_user_access_with_host_filter( login=user_login, password=user_password, ).create() - with Session(test_name, user=user_login, password=user_password) as session: + with target_sat.ui_session(test_name, user=user_login, password=user_password) as session: assert session.dashboard.read('HostConfigurationStatus')['total_count'] == 0 assert len(session.dashboard.read('LatestErrata')['erratas']) == 0 rhel_contenthost.add_rex_key(target_sat) @@ -266,7 +266,7 @@ def test_positive_user_access_with_host_filter( @pytest.mark.tier2 @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') -def test_positive_sync_overview_widget(session, module_org, module_product): +def test_positive_sync_overview_widget(session, module_product, module_target_sat): """Check if the Sync Overview widget is working in the Dashboard UI :id: 553fbe33-0f6f-46fb-8d80-5d1d9ed483cf @@ -280,7 +280,9 @@ def test_positive_sync_overview_widget(session, module_org, module_product): :BZ: 1995424 """ - repo = entities.Repository(url=settings.repos.yum_1.url, product=module_product).create() + repo = module_target_sat.api.Repository( + url=settings.repos.yum_1.url, product=module_product + ).create() with session: session.repository.synchronize(module_product.name, repo.name) sync_params = session.dashboard.read('SyncOverview')['syncs'] diff --git a/tests/foreman/ui/test_discoveryrule.py b/tests/foreman/ui/test_discoveryrule.py index e2b0fcef95..0ca5af8712 100644 --- a/tests/foreman/ui/test_discoveryrule.py +++ b/tests/foreman/ui/test_discoveryrule.py @@ -11,7 +11,6 @@ :CaseImportance: High """ -from airgun.session import Session from fauxfactory import gen_integer, gen_ipaddr, gen_string import pytest @@ -82,7 +81,9 @@ def test_positive_crud_with_non_admin_user( new_priority = str(gen_integer(101, 200)) hg = module_target_sat.api.HostGroup(organization=[module_org]).create() new_hg_name = module_target_sat.api.HostGroup(organization=[module_org]).create() - with Session(user=manager_user.login, password=manager_user.password) as session: + with module_target_sat.ui_session( + user=manager_user.login, password=manager_user.password + ) as session: session.location.select(loc_name=module_location.name) session.discoveryrule.create( { @@ -145,7 +146,9 @@ def test_negative_delete_rule_with_non_admin_user( organization=[module_org], location=[module_location], ).create() - with Session(user=reader_user.login, password=reader_user.password) as session: + with module_target_sat.ui_session( + user=reader_user.login, password=reader_user.password + ) as session: with pytest.raises(ValueError): # noqa: PT011 - TODO Adarsh determine better exception session.discoveryrule.delete(dr.name) dr_val = session.discoveryrule.read_all() diff --git a/tests/foreman/ui/test_errata.py b/tests/foreman/ui/test_errata.py index 35bd8bf2b0..7e0a300b32 100644 --- a/tests/foreman/ui/test_errata.py +++ b/tests/foreman/ui/test_errata.py @@ -13,12 +13,10 @@ """ from datetime import datetime -from airgun.session import Session from broker import Broker from dateutil.parser import parse from fauxfactory import gen_string from manifester import Manifester -from nailgun import entities import pytest from robottelo.config import settings @@ -54,9 +52,9 @@ pytestmark = [pytest.mark.run_in_one_thread] -def _generate_errata_applicability(hostname): +def _generate_errata_applicability(hostname, module_target_sat): """Force host to generate errata applicability""" - host = entities.Host().search(query={'search': f'name={hostname}'})[0].read() + host = module_target_sat.api.Host().search(query={'search': f'name={hostname}'})[0].read() host.errata_applicability(synchronous=False) @@ -123,9 +121,9 @@ def erratatype_vm(module_repos_collection_with_setup, target_sat): @pytest.fixture -def errata_status_installable(): +def errata_status_installable(module_target_sat): """Fixture to allow restoring errata_status_installable setting after usage""" - errata_status_installable = entities.Setting().search( + errata_status_installable = module_target_sat.api.Setting().search( query={'search': 'name="errata_status_installable"'} )[0] original_value = errata_status_installable.value @@ -528,7 +526,7 @@ def test_positive_list(session, function_org_with_parameter, lce, target_sat): indirect=True, ) def test_positive_list_permission( - test_name, module_org_with_parameter, module_repos_collection_with_setup + test_name, module_org_with_parameter, module_repos_collection_with_setup, module_target_sat ): """Show errata only if the User has permissions to view them @@ -546,23 +544,25 @@ def test_positive_list_permission( product only. """ module_org = module_org_with_parameter - role = entities.Role().create() - entities.Filter( + role = module_target_sat.api.Role().create() + module_target_sat.api.Filter( organization=[module_org], - permission=entities.Permission().search( + permission=module_target_sat.api.Permission().search( query={'search': 'resource_type="Katello::Product"'} ), role=role, search='name = "{}"'.format(PRDS['rhel']), ).create() user_password = gen_string('alphanumeric') - user = entities.User( + user = module_target_sat.api.User( default_organization=module_org, organization=[module_org], role=[role], password=user_password, ).create() - with Session(test_name, user=user.login, password=user_password) as session: + with module_target_sat.ui_session( + test_name, user=user.login, password=user_password + ) as session: assert ( session.errata.search(RHVA_ERRATA_ID, applicable=False)[0]['Errata ID'] == RHVA_ERRATA_ID @@ -702,14 +702,16 @@ def test_positive_filter_by_environment( module_repos_collection_with_setup.setup_virtual_machine(client) assert client.execute(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}').status == 0 # Promote the latest content view version to a new lifecycle environment - content_view = entities.ContentView( + content_view = target_sat.api.ContentView( id=module_repos_collection_with_setup.setup_content_data['content_view']['id'] ).read() content_view_version = content_view.version[-1].read() lce = content_view_version.environment[-1].read() - new_lce = entities.LifecycleEnvironment(organization=module_org, prior=lce).create() + new_lce = target_sat.api.LifecycleEnvironment(organization=module_org, prior=lce).create() content_view_version.promote(data={'environment_ids': new_lce.id}) - host = entities.Host().search(query={'search': f'name={clients[0].hostname}'})[0].read() + host = ( + target_sat.api.Host().search(query={'search': f'name={clients[0].hostname}'})[0].read() + ) host.content_facet_attributes = { 'content_view_id': content_view.id, 'lifecycle_environment_id': new_lce.id, @@ -750,7 +752,7 @@ def test_positive_filter_by_environment( indirect=True, ) def test_positive_content_host_previous_env( - session, module_org_with_parameter, module_repos_collection_with_setup, vm + session, module_org_with_parameter, module_repos_collection_with_setup, vm, module_target_sat ): """Check if the applicable errata are available from the content host's previous environment @@ -773,14 +775,16 @@ def test_positive_content_host_previous_env( hostname = vm.hostname assert vm.execute(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}').status == 0 # Promote the latest content view version to a new lifecycle environment - content_view = entities.ContentView( + content_view = module_target_sat.api.ContentView( id=module_repos_collection_with_setup.setup_content_data['content_view']['id'] ).read() content_view_version = content_view.version[-1].read() lce = content_view_version.environment[-1].read() - new_lce = entities.LifecycleEnvironment(organization=module_org, prior=lce).create() + new_lce = module_target_sat.api.LifecycleEnvironment( + organization=module_org, prior=lce + ).create() content_view_version.promote(data={'environment_ids': new_lce.id}) - host = entities.Host().search(query={'search': f'name={hostname}'})[0].read() + host = module_target_sat.api.Host().search(query={'search': f'name={hostname}'})[0].read() host.content_facet_attributes = { 'content_view_id': content_view.id, 'lifecycle_environment_id': new_lce.id, @@ -1048,7 +1052,7 @@ def test_positive_filtered_errata_status_installable_param( :CaseImportance: Medium """ org = function_entitlement_manifest_org - lce = entities.LifecycleEnvironment(organization=org).create() + lce = target_sat.api.LifecycleEnvironment(organization=org).create() repos_collection = target_sat.cli_factory.RepositoryCollection( distro='rhel7', repositories=[ @@ -1065,16 +1069,16 @@ def test_positive_filtered_errata_status_installable_param( assert client.execute(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}').status == 0 # Adding content view filter and content view filter rule to exclude errata for the # installed package. - content_view = entities.ContentView( + content_view = target_sat.api.ContentView( id=repos_collection.setup_content_data['content_view']['id'] ).read() - cv_filter = entities.ErratumContentViewFilter( + cv_filter = target_sat.api.ErratumContentViewFilter( content_view=content_view, inclusion=False ).create() - errata = entities.Errata(content_view_version=content_view.version[-1]).search( + errata = target_sat.api.Errata(content_view_version=content_view.version[-1]).search( query=dict(search=f'errata_id="{CUSTOM_REPO_ERRATA_ID}"') )[0] - entities.ContentViewFilterRule(content_view_filter=cv_filter, errata=errata).create() + target_sat.api.ContentViewFilterRule(content_view_filter=cv_filter, errata=errata).create() content_view.publish() content_view = content_view.read() content_view_version = content_view.version[-1] diff --git a/tests/foreman/ui/test_host.py b/tests/foreman/ui/test_host.py index e1b8082386..6cbb3a47ff 100644 --- a/tests/foreman/ui/test_host.py +++ b/tests/foreman/ui/test_host.py @@ -18,7 +18,6 @@ import re from airgun.exceptions import DisabledWidgetError, NoSuchElementException -from airgun.session import Session import pytest from wait_for import wait_for import yaml @@ -496,7 +495,7 @@ def test_positive_view_hosts_with_non_admin_user( created_host = target_sat.api.Host( location=smart_proxy_location, organization=module_org ).create() - with Session(test_name, user=user.login, password=user_password) as session: + with target_sat.ui_session(test_name, user=user.login, password=user_password) as session: host = session.host.get_details(created_host.name, widget_names='breadcrumb') assert host['breadcrumb'] == created_host.name content_host = session.contenthost.read(created_host.name, widget_names='breadcrumb') @@ -545,7 +544,7 @@ def test_positive_remove_parameter_non_admin_user( organization=module_org, host_parameters_attributes=[parameter], ).create() - with Session(test_name, user=user.login, password=user_password) as session: + with target_sat.ui_seesion(test_name, user=user.login, password=user_password) as session: values = session.host.read(host.name, 'parameters') assert values['parameters']['host_params'][0] == parameter session.host.update(host.name, {'parameters.host_params': []}) @@ -600,7 +599,7 @@ def test_negative_remove_parameter_non_admin_user( organization=module_org, host_parameters_attributes=[parameter], ).create() - with Session(test_name, user=user.login, password=user_password) as session: + with target_sat.ui_session(test_name, user=user.login, password=user_password) as session: values = session.host.read(host.name, 'parameters') assert values['parameters']['host_params'][0] == parameter with pytest.raises(NoSuchElementException) as context: @@ -709,7 +708,7 @@ def test_positive_check_permissions_affect_create_procedure( 'other_fields_values': {'host.lce': filter_lc_env.name}, }, ] - with Session(test_name, user=user.login, password=user_password) as session: + with target_sat.ui_session(test_name, user=user.login, password=user_password) as session: for host_field in host_fields: values = {host_field['name']: host_field['unexpected_value']} values.update(host_field.get('other_fields_values', {})) @@ -2348,7 +2347,7 @@ def test_positive_host_registration_with_non_admin_user( role = target_sat.cli.Role.info({'name': 'Register hosts'}) target_sat.cli.User.add_role({'id': user.id, 'role-id': role['id']}) - with Session(test_name, user=user.login, password=user_password) as session: + with target_sat.ui_session(test_name, user=user.login, password=user_password) as session: cmd = session.host_new.get_register_command( { @@ -2366,7 +2365,7 @@ def test_positive_host_registration_with_non_admin_user( @pytest.mark.tier2 -def test_all_hosts_delete(session, target_sat, function_org, function_location, new_host_ui): +def test_all_hosts_delete(target_sat, function_org, function_location, new_host_ui): """Create a host and delete it through All Hosts UI :id: 42b4560c-bb57-4c58-928e-e5fd5046b93f @@ -2385,7 +2384,7 @@ def test_all_hosts_delete(session, target_sat, function_org, function_location, @pytest.mark.tier2 -def test_all_hosts_bulk_delete(session, target_sat, function_org, function_location, new_host_ui): +def test_all_hosts_bulk_delete(target_sat, function_org, function_location, new_host_ui): """Create several hosts, and delete them via Bulk Actions in All Hosts UI :id: af1b4a66-dd83-47c3-904b-e8627119cc53 diff --git a/tests/foreman/ui/test_ldap_authentication.py b/tests/foreman/ui/test_ldap_authentication.py index e882f1c489..8c799a72dc 100644 --- a/tests/foreman/ui/test_ldap_authentication.py +++ b/tests/foreman/ui/test_ldap_authentication.py @@ -13,9 +13,7 @@ """ import os -from airgun.session import Session from fauxfactory import gen_url -from nailgun import entities from navmazing import NavigationTriesExceeded import pyotp import pytest @@ -55,43 +53,43 @@ def set_certificate_in_satellite(server_type, target_sat, hostname=None): @pytest.fixture -def ldap_usergroup_name(): +def ldap_usergroup_name(target_sat): """Return some random usergroup name, and attempt to delete such usergroup when test finishes. """ usergroup_name = gen_string('alphanumeric') yield usergroup_name - user_groups = entities.UserGroup().search(query={'search': f'name="{usergroup_name}"'}) + user_groups = target_sat.api.UserGroup().search(query={'search': f'name="{usergroup_name}"'}) if user_groups: user_groups[0].delete() @pytest.fixture -def ldap_tear_down(): +def ldap_tear_down(target_sat): """Teardown the all ldap settings user, usergroup and ldap delete""" yield - ldap_auth_sources = entities.AuthSourceLDAP().search() + ldap_auth_sources = target_sat.api.AuthSourceLDAP().search() for ldap_auth in ldap_auth_sources: - users = entities.User(auth_source=ldap_auth).search() + users = target_sat.api.User(auth_source=ldap_auth).search() for user in users: user.delete() ldap_auth.delete() @pytest.fixture -def external_user_count(): +def external_user_count(target_sat): """return the external auth source user count""" - users = entities.User().search() + users = target_sat.api.User().search() return len([user for user in users if user.auth_source_name == 'External']) @pytest.fixture -def groups_teardown(): +def groups_teardown(target_sat): """teardown for groups created for external/remote groups""" yield # tier down groups for group_name in ('sat_users', 'sat_admins', EXTERNAL_GROUP_NAME): - user_groups = entities.UserGroup().search(query={'search': f'name="{group_name}"'}) + user_groups = target_sat.api.UserGroup().search(query={'search': f'name="{group_name}"'}) if user_groups: user_groups[0].delete() @@ -172,7 +170,7 @@ def test_positive_end_to_end(session, ldap_auth_source, ldap_tear_down): @pytest.mark.parametrize('ldap_auth_source', ['AD', 'IPA', 'OPENLDAP'], indirect=True) @pytest.mark.tier2 @pytest.mark.upgrade -def test_positive_create_org_and_loc(session, ldap_auth_source, ldap_tear_down): +def test_positive_create_org_and_loc(session, ldap_auth_source, ldap_tear_down, target_sat): """Create LDAP auth_source with org and loc assigned. :id: 4f595af4-fc01-44c6-a614-a9ec827e3c3c @@ -190,8 +188,8 @@ def test_positive_create_org_and_loc(session, ldap_auth_source, ldap_tear_down): :parametrized: yes """ ldap_data, auth_source = ldap_auth_source - org = entities.Organization().create() - loc = entities.Location().create() + org = target_sat.api.Organization().create() + loc = target_sat.api.Location().create() ldap_auth_name = gen_string('alphanumeric') with session: session.ldapauthentication.create( @@ -256,7 +254,7 @@ def test_positive_add_katello_role( auth_source_name = f'LDAP-{auth_source.name}' ak_name = gen_string('alpha') user_permissions = {'Katello::ActivationKey': PERMISSIONS['Katello::ActivationKey']} - katello_role = entities.Role().create() + katello_role = target_sat.api.Role().create() target_sat.api_factory.create_role_permissions(katello_role, user_permissions) with session: session.usergroup.create( @@ -269,7 +267,9 @@ def test_positive_add_katello_role( ) assert session.usergroup.search(ldap_usergroup_name)[0]['Name'] == ldap_usergroup_name session.usergroup.refresh_external_group(ldap_usergroup_name, EXTERNAL_GROUP_NAME) - with Session(test_name, ldap_data['ldap_user_name'], ldap_data['ldap_user_passwd']) as session: + with target_sat.ui_session( + test_name, ldap_data['ldap_user_name'], ldap_data['ldap_user_passwd'] + ) as session: with pytest.raises(NavigationTriesExceeded): session.architecture.search('') session.activationkey.create({'name': ak_name}) @@ -308,8 +308,8 @@ def test_positive_update_external_roles( ak_name = gen_string('alpha') auth_source_name = f'LDAP-{auth_source.name}' location_name = gen_string('alpha') - foreman_role = entities.Role().create() - katello_role = entities.Role().create() + foreman_role = target_sat.api.Role().create() + katello_role = target_sat.api.Role().create() foreman_permissions = {'Location': PERMISSIONS['Location']} katello_permissions = {'Katello::ActivationKey': PERMISSIONS['Katello::ActivationKey']} target_sat.api_factory.create_role_permissions(foreman_role, foreman_permissions) @@ -324,19 +324,23 @@ def test_positive_update_external_roles( } ) assert session.usergroup.search(ldap_usergroup_name)[0]['Name'] == ldap_usergroup_name - with Session( + with target_sat.ui_session( test_name, ldap_data['ldap_user_name'], ldap_data['ldap_user_passwd'] ) as ldapsession: with pytest.raises(NavigationTriesExceeded): ldapsession.architecture.search('') ldapsession.location.create({'name': location_name}) - location = entities.Location().search(query={'search': f'name="{location_name}"'})[0] + location = target_sat.api.Location().search( + query={'search': f'name="{location_name}"'} + )[0] assert location.name == location_name session.usergroup.update( ldap_usergroup_name, {'roles.resources.assigned': [katello_role.name]} ) session.usergroup.refresh_external_group(ldap_usergroup_name, EXTERNAL_GROUP_NAME) - with Session(test_name, ldap_data['ldap_user_name'], ldap_data['ldap_user_passwd']) as session: + with target_sat.ui_session( + test_name, ldap_data['ldap_user_name'], ldap_data['ldap_user_passwd'] + ) as session: session.activationkey.create({'name': ak_name}) assert session.activationkey.search(ak_name)[0]['Name'] == ak_name current_user = session.activationkey.read(ak_name, 'current_user')['current_user'] @@ -374,7 +378,7 @@ def test_positive_delete_external_roles( ldap_data, auth_source = ldap_auth_source auth_source_name = f'LDAP-{auth_source.name}' location_name = gen_string('alpha') - foreman_role = entities.Role().create() + foreman_role = target_sat.api.Role().create() foreman_permissions = {'Location': PERMISSIONS['Location']} target_sat.api_factory.create_role_permissions(foreman_role, foreman_permissions) with session: @@ -387,18 +391,20 @@ def test_positive_delete_external_roles( } ) assert session.usergroup.search(ldap_usergroup_name)[0]['Name'] == ldap_usergroup_name - with Session( + with target_sat.ui_session( test_name, ldap_data['ldap_user_name'], ldap_data['ldap_user_passwd'] ) as ldapsession: with pytest.raises(NavigationTriesExceeded): ldapsession.architecture.search('') ldapsession.location.create({'name': location_name}) - location = entities.Location().search(query={'search': f'name="{location_name}"'})[0] + location = target_sat.api.Location().search( + query={'search': f'name="{location_name}"'} + )[0] assert location.name == location_name session.usergroup.update( ldap_usergroup_name, {'roles.resources.unassigned': [foreman_role.name]} ) - with Session( + with target_sat.ui_session( test_name, ldap_data['ldap_user_name'], ldap_data['ldap_user_passwd'] ) as ldapsession: with pytest.raises(NavigationTriesExceeded): @@ -441,8 +447,8 @@ def test_positive_update_external_user_roles( ak_name = gen_string('alpha') auth_source_name = f'LDAP-{auth_source.name}' location_name = gen_string('alpha') - foreman_role = entities.Role().create() - katello_role = entities.Role().create() + foreman_role = target_sat.api.Role().create() + katello_role = target_sat.api.Role().create() foreman_permissions = {'Location': PERMISSIONS['Location']} katello_permissions = {'Katello::ActivationKey': PERMISSIONS['Katello::ActivationKey']} target_sat.api_factory.create_role_permissions(foreman_role, foreman_permissions) @@ -457,17 +463,21 @@ def test_positive_update_external_user_roles( } ) assert session.usergroup.search(ldap_usergroup_name)[0]['Name'] == ldap_usergroup_name - with Session( + with target_sat.ui_session( test_name, ldap_data['ldap_user_name'], ldap_data['ldap_user_passwd'] ) as ldapsession: ldapsession.location.create({'name': location_name}) - location = entities.Location().search(query={'search': f'name="{location_name}"'})[0] + location = target_sat.api.Location().search( + query={'search': f'name="{location_name}"'} + )[0] assert location.name == location_name session.location.select(ANY_CONTEXT['location']) session.user.update( ldap_data['ldap_user_name'], {'roles.resources.assigned': [katello_role.name]} ) - with Session(test_name, ldap_data['ldap_user_name'], ldap_data['ldap_user_passwd']) as session: + with target_sat.ui_session( + test_name, ldap_data['ldap_user_name'], ldap_data['ldap_user_passwd'] + ) as session: with pytest.raises(NavigationTriesExceeded): ldapsession.architecture.search('') session.activationkey.create({'name': ak_name}) @@ -485,6 +495,7 @@ def test_positive_add_admin_role_with_org_loc( module_org, ldap_tear_down, ldap_auth_source, + target_sat, ): """Associate Admin role to User Group with org and loc set. [belonging to external User Group.] @@ -521,7 +532,9 @@ def test_positive_add_admin_role_with_org_loc( } ) assert session.usergroup.search(ldap_usergroup_name)[0]['Name'] == ldap_usergroup_name - with Session(test_name, ldap_data['ldap_user_name'], ldap_data['ldap_user_passwd']) as session: + with target_sat.ui_session( + test_name, ldap_data['ldap_user_name'], ldap_data['ldap_user_passwd'] + ) as session: session.location.create({'name': location_name}) assert session.location.search(location_name)[0]['Name'] == location_name location = session.location.read(location_name, ['current_user', 'primary']) @@ -576,7 +589,7 @@ def test_positive_add_foreman_role_with_org_loc( 'Location': ['assign_locations'], 'Organization': ['assign_organizations'], } - foreman_role = entities.Role().create() + foreman_role = module_target_sat.api.Role().create() module_target_sat.api_factory.create_role_permissions(foreman_role, user_permissions) with session: session.usergroup.create( @@ -589,7 +602,7 @@ def test_positive_add_foreman_role_with_org_loc( ) assert session.usergroup.search(ldap_usergroup_name)[0]['Name'] == ldap_usergroup_name session.usergroup.refresh_external_group(ldap_usergroup_name, EXTERNAL_GROUP_NAME) - with Session( + with module_target_sat.ui_session( test_name, ldap_data['ldap_user_name'], ldap_data['ldap_user_passwd'] ) as ldapsession: with pytest.raises(NavigationTriesExceeded): @@ -641,9 +654,9 @@ def test_positive_add_katello_role_with_org( 'Location': ['assign_locations'], 'Organization': ['assign_organizations'], } - katello_role = entities.Role().create() + katello_role = target_sat.api.Role().create() target_sat.api_factory.create_role_permissions(katello_role, user_permissions) - different_org = entities.Organization().create() + different_org = target_sat.api.Organization().create() with session: session.usergroup.create( { @@ -655,7 +668,7 @@ def test_positive_add_katello_role_with_org( ) assert session.usergroup.search(ldap_usergroup_name)[0]['Name'] == ldap_usergroup_name session.usergroup.refresh_external_group(ldap_usergroup_name, EXTERNAL_GROUP_NAME) - with Session( + with target_sat.ui_session( test_name, ldap_data['ldap_user_name'], ldap_data['ldap_user_passwd'] ) as ldapsession: with pytest.raises(NavigationTriesExceeded): @@ -666,7 +679,7 @@ def test_positive_add_katello_role_with_org( session.organization.select(different_org.name) assert not session.activationkey.search(ak_name)[0]['Name'] == ak_name ak = ( - entities.ActivationKey(organization=module_org) + target_sat.api.ActivationKey(organization=module_org) .search(query={'search': f'name={ak_name}'})[0] .read() ) @@ -699,7 +712,7 @@ def test_positive_create_user_in_ldap_mode(session, ldap_auth_source, ldap_tear_ @pytest.mark.parametrize('ldap_auth_source', ['AD', 'IPA'], indirect=True) @pytest.mark.tier2 -def test_positive_login_user_no_roles(test_name, ldap_tear_down, ldap_auth_source): +def test_positive_login_user_no_roles(test_name, ldap_tear_down, ldap_auth_source, target_sat): """Login with LDAP Auth for user with no roles/rights :id: 7dc8d9a7-ff08-4d8e-a842-d370ffd69741 @@ -716,7 +729,7 @@ def test_positive_login_user_no_roles(test_name, ldap_tear_down, ldap_auth_sourc :parametrized: yes """ ldap_data, auth_source = ldap_auth_source - with Session( + with target_sat.ui_session( test_name, ldap_data['ldap_user_name'], ldap_data['ldap_user_passwd'] ) as ldapsession: ldapsession.task.read_all() @@ -743,17 +756,17 @@ def test_positive_login_user_basic_roles( """ ldap_data, auth_source = ldap_auth_source name = gen_string('alpha') - role = entities.Role().create() + role = target_sat.api.Role().create() permissions = {'Architecture': PERMISSIONS['Architecture']} target_sat.api_factory.create_role_permissions(role, permissions) - with Session( + with target_sat.ui_session( test_name, ldap_data['ldap_user_name'], ldap_data['ldap_user_passwd'] ) as ldapsession: with pytest.raises(NavigationTriesExceeded): ldapsession.usergroup.search('') with session: session.user.update(ldap_data['ldap_user_name'], {'roles.resources.assigned': [role.name]}) - with Session( + with target_sat.ui_session( test_name, ldap_data['ldap_user_name'], ldap_data['ldap_user_passwd'] ) as ldapsession: ldapsession.architecture.create({'name': name}) @@ -763,7 +776,7 @@ def test_positive_login_user_basic_roles( @pytest.mark.upgrade @pytest.mark.tier2 def test_positive_login_user_password_otp( - auth_source_ipa, default_ipa_host, test_name, ldap_tear_down + auth_source_ipa, default_ipa_host, test_name, ldap_tear_down, target_sat ): """Login with password with time based OTP @@ -781,16 +794,20 @@ def test_positive_login_user_password_otp( otp_pass = ( f"{default_ipa_host.ldap_user_passwd}{generate_otp(default_ipa_host.time_based_secret)}" ) - with Session(test_name, default_ipa_host.ipa_otp_username, otp_pass) as ldapsession: + with target_sat.ui_session( + test_name, default_ipa_host.ipa_otp_username, otp_pass + ) as ldapsession: with pytest.raises(NavigationTriesExceeded): ldapsession.user.search('') - users = entities.User().search(query={'search': f'login="{default_ipa_host.ipa_otp_username}"'}) + users = target_sat.api.User().search( + query={'search': f'login="{default_ipa_host.ipa_otp_username}"'} + ) assert users[0].login == default_ipa_host.ipa_otp_username @pytest.mark.tier2 def test_negative_login_user_with_invalid_password_otp( - auth_source_ipa, default_ipa_host, test_name, ldap_tear_down + auth_source_ipa, default_ipa_host, test_name, ldap_tear_down, target_sat ): """Login with password with time based OTP @@ -808,7 +825,9 @@ def test_negative_login_user_with_invalid_password_otp( password_with_otp = ( f"{default_ipa_host.ldap_user_passwd}{gen_string(str_type='numeric', length=6)}" ) - with Session(test_name, default_ipa_host.ipa_otp_username, password_with_otp) as ldapsession: + with target_sat.ui_session( + test_name, default_ipa_host.ipa_otp_username, password_with_otp + ) as ldapsession: with pytest.raises(NavigationTriesExceeded) as error: ldapsession.user.search('') assert error.typename == 'NavigationTriesExceeded' @@ -836,7 +855,7 @@ def test_positive_test_connection_functionality(session, ldap_auth_source): @pytest.mark.parametrize('ldap_auth_source', ['AD', 'IPA', 'OPENLDAP'], indirect=True) @pytest.mark.tier2 -def test_negative_login_with_incorrect_password(test_name, ldap_auth_source): +def test_negative_login_with_incorrect_password(test_name, ldap_auth_source, target_sat): """Attempt to login in Satellite an user with the wrong password :id: 3f09de90-a656-11ea-aa43-4ceb42ab8dbc @@ -853,7 +872,7 @@ def test_negative_login_with_incorrect_password(test_name, ldap_auth_source): """ ldap_data, auth_source = ldap_auth_source incorrect_password = gen_string('alphanumeric') - with Session( + with target_sat.ui_session( test_name, user=ldap_data['ldap_user_name'], password=incorrect_password ) as ldapsession: with pytest.raises(NavigationTriesExceeded) as error: @@ -862,7 +881,9 @@ def test_negative_login_with_incorrect_password(test_name, ldap_auth_source): @pytest.mark.tier2 -def test_negative_login_with_disable_user(default_ipa_host, auth_source_ipa, ldap_tear_down): +def test_negative_login_with_disable_user( + default_ipa_host, auth_source_ipa, ldap_tear_down, target_sat +): """Disabled IDM user cannot login :id: 49f28006-aa1f-11ea-90d3-4ceb42ab8dbc @@ -873,7 +894,7 @@ def test_negative_login_with_disable_user(default_ipa_host, auth_source_ipa, lda :expectedresults: Login fails """ - with Session( + with target_sat.ui_session( user=default_ipa_host.disabled_user_ipa, password=default_ipa_host.ldap_user_passwd ) as ldapsession: with pytest.raises(NavigationTriesExceeded) as error: @@ -883,7 +904,7 @@ def test_negative_login_with_disable_user(default_ipa_host, auth_source_ipa, lda @pytest.mark.tier2 def test_email_of_the_user_should_be_copied( - session, default_ipa_host, auth_source_ipa, ldap_tear_down + session, default_ipa_host, auth_source_ipa, ldap_tear_down, target_sat ): """Email of the user created in idm server ( set as external authorization source ) should be copied to the satellite. @@ -904,7 +925,7 @@ def test_email_of_the_user_should_be_copied( if 'Email' in line: _, result = line.split(': ', 2) break - with Session( + with target_sat.ui_session( user=default_ipa_host.ldap_user_name, password=default_ipa_host.ldap_user_passwd ) as ldapsession: ldapsession.bookmark.search('controller = hosts') @@ -931,10 +952,10 @@ def test_deleted_idm_user_should_not_be_able_to_login( """ test_user = gen_string('alpha') default_ipa_host.create_user(test_user) - with Session(user=test_user, password=settings.ipa.password) as ldapsession: + with target_sat.ui_session(user=test_user, password=settings.ipa.password) as ldapsession: ldapsession.bookmark.search('controller = hosts') default_ipa_host.delete_user(test_user) - with Session(user=test_user, password=settings.ipa.password) as ldapsession: + with target_sat.ui_session(user=test_user, password=settings.ipa.password) as ldapsession: with pytest.raises(NavigationTriesExceeded) as error: ldapsession.user.search('') assert error.typename == 'NavigationTriesExceeded' @@ -942,7 +963,7 @@ def test_deleted_idm_user_should_not_be_able_to_login( @pytest.mark.parametrize('ldap_auth_source', ['AD', 'IPA', 'OPENLDAP'], indirect=True) @pytest.mark.tier2 -def test_onthefly_functionality(session, ldap_auth_source, ldap_tear_down): +def test_onthefly_functionality(session, ldap_auth_source, ldap_tear_down, target_sat): """User will not be created automatically in Satellite if onthefly is disabled @@ -977,7 +998,7 @@ def test_onthefly_functionality(session, ldap_auth_source, ldap_tear_down): 'attribute_mappings.mail': LDAP_ATTR['mail'], } ) - with Session( + with target_sat.ui_session( user=ldap_data['ldap_user_name'], password=ldap_data['ldap_user_passwd'] ) as ldapsession: with pytest.raises(NavigationTriesExceeded) as error: @@ -1028,7 +1049,9 @@ def test_timeout_and_cac_card_ejection(): @pytest.mark.parametrize('ldap_auth_source', ['AD', 'IPA', 'OPENLDAP'], indirect=True) @pytest.mark.tier2 @pytest.mark.skip_if_open('BZ:1670397') -def test_verify_attribute_of_users_are_updated(session, ldap_auth_source, ldap_tear_down): +def test_verify_attribute_of_users_are_updated( + session, ldap_auth_source, ldap_tear_down, target_sat +): """Verify if attributes of LDAP user are updated upon first login when onthefly is disabled @@ -1076,7 +1099,7 @@ def test_verify_attribute_of_users_are_updated(session, ldap_auth_source, ldap_t 'roles.admin': True, } ) - with Session( + with target_sat.ui_session( user=ldap_data['ldap_user_name'], password=ldap_data['ldap_user_passwd'] ) as ldapsession: with pytest.raises(NavigationTriesExceeded) as error: @@ -1093,7 +1116,7 @@ def test_verify_attribute_of_users_are_updated(session, ldap_auth_source, ldap_t @pytest.mark.parametrize('ldap_auth_source', ['AD', 'IPA', 'OPENLDAP'], indirect=True) @pytest.mark.tier2 def test_login_failure_if_internal_user_exist( - session, test_name, ldap_auth_source, module_org, module_location, ldap_tear_down + session, test_name, ldap_auth_source, module_org, module_location, ldap_tear_down, target_sat ): """Verify the failure of login for the AD/IPA user in case same username internal user exists @@ -1115,19 +1138,21 @@ def test_login_failure_if_internal_user_exist( try: internal_username = ldap_data['ldap_user_name'] internal_password = gen_string('alphanumeric') - user = entities.User( + user = target_sat.api.User( admin=True, default_organization=module_org, default_location=module_location, login=internal_username, password=internal_password, ).create() - with Session(test_name, internal_username, ldap_data['ldap_user_passwd']) as ldapsession: + with target_sat.ui_session( + test_name, internal_username, ldap_data['ldap_user_passwd'] + ) as ldapsession: with pytest.raises(NavigationTriesExceeded) as error: ldapsession.user.search('') assert error.typename == 'NavigationTriesExceeded' finally: - entities.User(id=user.id).delete() + target_sat.api.User(id=user.id).delete() @pytest.mark.skip_if_open("BZ:1812688") @@ -1165,7 +1190,7 @@ def test_userlist_with_external_admin( auth_source_name = f'LDAP-{auth_source_ipa.name}' user_permissions = {'Katello::ActivationKey': PERMISSIONS['Katello::ActivationKey']} - katello_role = entities.Role().create() + katello_role = target_sat.api.Role().create() target_sat.api_factory.create_role_permissions(katello_role, user_permissions) with session: session.usergroup.create( @@ -1184,12 +1209,14 @@ def test_userlist_with_external_admin( 'external_groups.auth_source': auth_source_name, } ) - with Session(user=idm_user, password=settings.server.ssh_password) as ldapsession: + with target_sat.ui_session(user=idm_user, password=settings.server.ssh_password) as ldapsession: assert idm_user in ldapsession.task.read_all()['current_user'] # verify the users count with local admin and remote/external admin - with Session(user=idm_admin, password=settings.server.ssh_password) as remote_admin_session: - with Session( + with target_sat.ui_session( + user=idm_admin, password=settings.server.ssh_password + ) as remote_admin_session: + with target_sat.ui_session( user=settings.server.admin_username, password=settings.server.admin_password ) as local_admin_session: assert local_admin_session.user.search(idm_user)[0]['Username'] == idm_user @@ -1224,7 +1251,7 @@ def test_positive_group_sync_open_ldap_authsource( ak_name = gen_string('alpha') auth_source_name = f'LDAP-{auth_source_open_ldap.name}' user_permissions = {'Katello::ActivationKey': PERMISSIONS['Katello::ActivationKey']} - katello_role = entities.Role().create() + katello_role = target_sat.api.Role().create() target_sat.api_factory.create_role_permissions(katello_role, user_permissions) with session: session.usergroup.create( @@ -1238,7 +1265,7 @@ def test_positive_group_sync_open_ldap_authsource( assert session.usergroup.search(ldap_usergroup_name)[0]['Name'] == ldap_usergroup_name session.usergroup.refresh_external_group(ldap_usergroup_name, EXTERNAL_GROUP_NAME) user_name = open_ldap_data.open_ldap_user - with Session(test_name, user_name, open_ldap_data.password) as session: + with target_sat.ui_session(test_name, user_name, open_ldap_data.password) as session: with pytest.raises(NavigationTriesExceeded): session.architecture.search('') session.activationkey.create({'name': ak_name}) @@ -1274,7 +1301,7 @@ def test_verify_group_permissions( idm_users = settings.ipa.group_users auth_source_name = f'LDAP-{auth_source_ipa.name}' user_permissions = {None: ['access_dashboard']} - katello_role = entities.Role().create() + katello_role = target_sat.api.Role().create() target_sat.api_factory.create_role_permissions(katello_role, user_permissions) with session: session.usergroup.create( @@ -1294,15 +1321,17 @@ def test_verify_group_permissions( } ) location_name = gen_string('alpha') - with Session(user=idm_users[1], password=settings.server.ssh_password) as ldapsession: + with target_sat.ui_session( + user=idm_users[1], password=settings.server.ssh_password + ) as ldapsession: ldapsession.location.create({'name': location_name}) - location = entities.Location().search(query={'search': f'name="{location_name}"'})[0] + location = target_sat.api.Location().search(query={'search': f'name="{location_name}"'})[0] assert location.name == location_name @pytest.mark.tier2 def test_verify_ldap_filters_ipa( - session, ipa_add_user, auth_source_ipa, default_ipa_host, ldap_tear_down + session, ipa_add_user, auth_source_ipa, default_ipa_host, ldap_tear_down, target_sat ): """Verifying ldap filters in authsource to restrict access @@ -1319,7 +1348,9 @@ def test_verify_ldap_filters_ipa( # 'test_user' able to login before the filter is applied. test_user = ipa_add_user - with Session(user=test_user, password=default_ipa_host.ldap_user_passwd) as ldapsession: + with target_sat.ui_session( + user=test_user, password=default_ipa_host.ldap_user_passwd + ) as ldapsession: ldapsession.task.read_all() # updating the authsource with filter @@ -1328,7 +1359,9 @@ def test_verify_ldap_filters_ipa( session.ldapauthentication.update(auth_source_ipa.name, {'account.ldap_filter': ldap_data}) # 'test_user' not able login as it gets filtered out - with Session(user=test_user, password=default_ipa_host.ldap_user_passwd) as ldapsession: + with target_sat.ui_session( + user=test_user, password=default_ipa_host.ldap_user_passwd + ) as ldapsession: with pytest.raises(NavigationTriesExceeded) as error: ldapsession.user.search('') assert error.typename == 'NavigationTriesExceeded' diff --git a/tests/foreman/ui/test_lifecycleenvironment.py b/tests/foreman/ui/test_lifecycleenvironment.py index e99d9f9c89..9c389fdd19 100644 --- a/tests/foreman/ui/test_lifecycleenvironment.py +++ b/tests/foreman/ui/test_lifecycleenvironment.py @@ -11,7 +11,6 @@ :CaseImportance: High """ -from airgun.session import Session from navmazing import NavigationTriesExceeded import pytest @@ -298,7 +297,7 @@ def test_positive_custom_user_view_lce(session, test_name, target_sat): lce_values = session.lifecycleenvironment.read_all() assert lce_name in lce_values['lce'] # ensure the created user also can find the created lifecycle environment link - with Session(test_name, user_login, user_password) as non_admin_session: + with target_sat.ui_session(test_name, user_login, user_password) as non_admin_session: # to ensure that the created user has only the assigned # permissions, check that hosts menu tab does not exist with pytest.raises(NavigationTriesExceeded): diff --git a/tests/foreman/ui/test_repository.py b/tests/foreman/ui/test_repository.py index 08d44cc052..f5382f1ad0 100644 --- a/tests/foreman/ui/test_repository.py +++ b/tests/foreman/ui/test_repository.py @@ -14,8 +14,6 @@ from datetime import datetime, timedelta from random import randint, shuffle -from airgun.session import Session -from nailgun import entities from navmazing import NavigationTriesExceeded import pytest @@ -41,19 +39,19 @@ @pytest.fixture(scope='module') -def module_org(): - return entities.Organization().create() +def module_org(module_target_sat): + return module_target_sat.api.Organization().create() @pytest.fixture(scope='module') -def module_prod(module_org): - return entities.Product(organization=module_org).create() +def module_prod(module_org, module_target_sat): + return module_target_sat.api.Product(organization=module_org).create() @pytest.mark.tier2 @pytest.mark.upgrade @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') -def test_positive_create_in_different_orgs(session, module_org): +def test_positive_create_in_different_orgs(session, module_org, module_target_sat): """Create repository in two different orgs with same name :id: 019c2242-8802-4bae-82c5-accf8f793dbc @@ -62,9 +60,9 @@ def test_positive_create_in_different_orgs(session, module_org): organizations """ repo_name = gen_string('alpha') - org2 = entities.Organization().create() - prod1 = entities.Product(organization=module_org).create() - prod2 = entities.Product(organization=org2).create() + org2 = module_target_sat.api.Organization().create() + prod1 = module_target_sat.api.Product(organization=module_org).create() + prod2 = module_target_sat.api.Product(organization=org2).create() with session: for org, prod in [[module_org, prod1], [org2, prod2]]: session.organization.select(org_name=org.name) @@ -107,9 +105,9 @@ def test_positive_create_as_non_admin_user(module_org, test_name, target_sat): 'sync_products', ], } - role = entities.Role().create() + role = target_sat.api.Role().create() target_sat.api_factory.create_role_permissions(role, user_permissions) - entities.User( + target_sat.api.User( login=user_login, password=user_password, role=[role], @@ -117,8 +115,8 @@ def test_positive_create_as_non_admin_user(module_org, test_name, target_sat): default_organization=module_org, organization=[module_org], ).create() - product = entities.Product(organization=module_org).create() - with Session(test_name, user=user_login, password=user_password) as session: + product = target_sat.api.Product(organization=module_org).create() + with target_sat.ui_session(test_name, user=user_login, password=user_password) as session: # ensure that the created user is not a global admin user # check administer->organizations page with pytest.raises(NavigationTriesExceeded): @@ -137,7 +135,7 @@ def test_positive_create_as_non_admin_user(module_org, test_name, target_sat): @pytest.mark.tier2 @pytest.mark.upgrade @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') -def test_positive_create_yum_repo_same_url_different_orgs(session, module_prod): +def test_positive_create_yum_repo_same_url_different_orgs(session, module_prod, module_target_sat): """Create two repos with the same URL in two different organizations. :id: f4cb00ed-6faf-4c79-9f66-76cd333299cb @@ -145,12 +143,16 @@ def test_positive_create_yum_repo_same_url_different_orgs(session, module_prod): :expectedresults: Repositories are created and have equal number of packages. """ # Create first repository - repo = entities.Repository(product=module_prod, url=settings.repos.yum_0.url).create() + repo = module_target_sat.api.Repository( + product=module_prod, url=settings.repos.yum_0.url + ).create() repo.sync() # Create second repository - org = entities.Organization().create() - product = entities.Product(organization=org).create() - new_repo = entities.Repository(product=product, url=settings.repos.yum_0.url).create() + org = module_target_sat.api.Organization().create() + product = module_target_sat.api.Product(organization=org).create() + new_repo = module_target_sat.api.Repository( + product=product, url=settings.repos.yum_0.url + ).create() new_repo.sync() with session: # Check packages number in first repository @@ -194,9 +196,9 @@ def test_positive_create_as_non_admin_user_with_cv_published(module_org, test_na 'sync_products', ], } - role = entities.Role().create() + role = target_sat.api.Role().create() target_sat.api_factory.create_role_permissions(role, user_permissions) - entities.User( + target_sat.api.User( login=user_login, password=user_password, role=[role], @@ -204,14 +206,14 @@ def test_positive_create_as_non_admin_user_with_cv_published(module_org, test_na default_organization=module_org, organization=[module_org], ).create() - prod = entities.Product(organization=module_org).create() - repo = entities.Repository(product=prod, url=settings.repos.yum_2.url).create() + prod = target_sat.api.Product(organization=module_org).create() + repo = target_sat.api.Repository(product=prod, url=settings.repos.yum_2.url).create() repo.sync() - content_view = entities.ContentView(organization=module_org).create() + content_view = target_sat.api.ContentView(organization=module_org).create() content_view.repository = [repo] content_view = content_view.update(['repository']) content_view.publish() - with Session(test_name, user_login, user_password) as session: + with target_sat.ui_session(test_name, user_login, user_password) as session: # ensure that the created user is not a global admin user # check administer->users page pswd = gen_string('alphanumeric') @@ -243,7 +245,7 @@ def test_positive_create_as_non_admin_user_with_cv_published(module_org, test_na @pytest.mark.upgrade @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') @pytest.mark.usefixtures('allow_repo_discovery') -def test_positive_discover_repo_via_existing_product(session, module_org): +def test_positive_discover_repo_via_existing_product(session, module_org, module_target_sat): """Create repository via repo-discovery under existing product :id: 9181950c-a756-456f-a46a-059e7a2add3c @@ -251,7 +253,7 @@ def test_positive_discover_repo_via_existing_product(session, module_org): :expectedresults: Repository is discovered and created """ repo_name = 'fakerepo01' - product = entities.Product(organization=module_org).create() + product = module_target_sat.api.Product(organization=module_org).create() with session: session.organization.select(org_name=module_org.name) session.product.discover_repo( @@ -297,7 +299,9 @@ def test_positive_discover_repo_via_new_product(session, module_org): @pytest.mark.upgrade @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') @pytest.mark.usefixtures('allow_repo_discovery') -def test_positive_discover_module_stream_repo_via_existing_product(session, module_org): +def test_positive_discover_module_stream_repo_via_existing_product( + session, module_org, module_target_sat +): """Create repository with module streams via repo-discovery under an existing product. :id: e7b9e2c4-7ecd-4cde-8f74-961fbac8919c @@ -315,7 +319,7 @@ def test_positive_discover_module_stream_repo_via_existing_product(session, modu """ repo_name = gen_string('alpha') repo_label = gen_string('alpha') - product = entities.Product(organization=module_org).create() + product = module_target_sat.api.Product(organization=module_org).create() with session: session.organization.select(org_name=module_org.name) session.product.discover_repo( @@ -336,15 +340,15 @@ def test_positive_discover_module_stream_repo_via_existing_product(session, modu @pytest.mark.tier2 @pytest.mark.upgrade @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') -def test_positive_sync_custom_repo_yum(session, module_org): +def test_positive_sync_custom_repo_yum(session, module_org, module_target_sat): """Create Custom yum repos and sync it via the repos page. :id: afa218f4-e97a-4240-a82a-e69538d837a1 :expectedresults: Sync procedure for specific yum repository is successful """ - product = entities.Product(organization=module_org).create() - repo = entities.Repository(url=settings.repos.yum_1.url, product=product).create() + product = module_target_sat.api.Product(organization=module_org).create() + repo = module_target_sat.api.Repository(url=settings.repos.yum_1.url, product=product).create() with session: result = session.repository.synchronize(product.name, repo.name) assert result['result'] == 'success' @@ -357,7 +361,7 @@ def test_positive_sync_custom_repo_yum(session, module_org): @pytest.mark.tier2 @pytest.mark.upgrade -def test_positive_sync_custom_repo_docker(session, module_org): +def test_positive_sync_custom_repo_docker(session, module_org, module_target_sat): """Create Custom docker repos and sync it via the repos page. :id: 942e0b4f-3524-4f00-812d-bdad306f81de @@ -365,8 +369,8 @@ def test_positive_sync_custom_repo_docker(session, module_org): :expectedresults: Sync procedure for specific docker repository is successful """ - product = entities.Product(organization=module_org).create() - repo = entities.Repository( + product = module_target_sat.api.Product(organization=module_org).create() + repo = module_target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=product, content_type=REPO_TYPE['docker'] ).create() with session: @@ -376,7 +380,7 @@ def test_positive_sync_custom_repo_docker(session, module_org): @pytest.mark.tier2 @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') -def test_positive_resync_custom_repo_after_invalid_update(session, module_org): +def test_positive_resync_custom_repo_after_invalid_update(session, module_org, module_target_sat): """Create Custom yum repo and sync it via the repos page. Then try to change repo url to invalid one and re-sync that repository @@ -389,8 +393,8 @@ def test_positive_resync_custom_repo_after_invalid_update(session, module_org): :BZ: 1487173, 1262313 """ - product = entities.Product(organization=module_org).create() - repo = entities.Repository(url=settings.repos.yum_1.url, product=product).create() + product = module_target_sat.api.Product(organization=module_org).create() + repo = module_target_sat.api.Repository(url=settings.repos.yum_1.url, product=product).create() with session: result = session.repository.synchronize(product.name, repo.name) assert result['result'] == 'success' @@ -408,7 +412,7 @@ def test_positive_resync_custom_repo_after_invalid_update(session, module_org): @pytest.mark.tier2 @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') -def test_positive_resynchronize_rpm_repo(session, module_prod): +def test_positive_resynchronize_rpm_repo(session, module_prod, module_target_sat): """Check that repository content is resynced after packages were removed from repository @@ -418,7 +422,7 @@ def test_positive_resynchronize_rpm_repo(session, module_prod): :BZ: 1318004 """ - repo = entities.Repository( + repo = module_target_sat.api.Repository( url=settings.repos.yum_1.url, content_type=REPO_TYPE['yum'], product=module_prod ).create() with session: @@ -442,7 +446,7 @@ def test_positive_resynchronize_rpm_repo(session, module_prod): @pytest.mark.tier2 @pytest.mark.upgrade @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') -def test_positive_end_to_end_custom_yum_crud(session, module_org, module_prod): +def test_positive_end_to_end_custom_yum_crud(session, module_org, module_prod, module_target_sat): """Perform end to end testing for custom yum repository :id: 8baf11c9-019e-4625-a549-ec4cd9312f75 @@ -455,11 +459,11 @@ def test_positive_end_to_end_custom_yum_crud(session, module_org, module_prod): checksum_type = 'sha256' new_repo_name = gen_string('alphanumeric') new_checksum_type = 'sha1' - gpg_key = entities.GPGKey( + gpg_key = module_target_sat.api.GPGKey( content=DataFile.VALID_GPG_KEY_FILE.read_bytes(), organization=module_org, ).create() - new_gpg_key = entities.GPGKey( + new_gpg_key = module_target_sat.api.GPGKey( content=DataFile.VALID_GPG_KEY_BETA_FILE.read_bytes(), organization=module_org, ).create() @@ -758,7 +762,7 @@ def test_positive_reposet_disable_after_manifest_deleted( :BZ: 1344391 """ org = function_entitlement_manifest_org - sub = entities.Subscription(organization=org) + sub = target_sat.api.Subscription(organization=org) sat_tools_repo = target_sat.cli_factory.SatelliteToolsRepository(distro='rhel7', cdn=True) repository_name = sat_tools_repo.data['repository'] repository_name_orphaned = f'{repository_name} (Orphaned)' @@ -798,7 +802,7 @@ def test_positive_reposet_disable_after_manifest_deleted( @pytest.mark.tier2 -def test_positive_delete_random_docker_repo(session, module_org): +def test_positive_delete_random_docker_repo(session, module_org, module_target_sat): """Create Docker-type repositories on multiple products and delete a random repository from a random product. @@ -808,9 +812,12 @@ def test_positive_delete_random_docker_repo(session, module_org): without altering the other products. """ entities_list = [] - products = [entities.Product(organization=module_org).create() for _ in range(randint(2, 5))] + products = [ + module_target_sat.api.Product(organization=module_org).create() + for _ in range(randint(2, 5)) + ] for product in products: - repo = entities.Repository( + repo = module_target_sat.api.Repository( url=CONTAINER_REGISTRY_HUB, product=product, content_type=REPO_TYPE['docker'] ).create() entities_list.append((product.name, repo.name)) @@ -1178,7 +1185,7 @@ def test_positive_select_org_in_any_context(): @pytest.mark.tier2 @pytest.mark.upgrade @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') -def test_positive_sync_repo_and_verify_checksum(session, module_org): +def test_positive_sync_repo_and_verify_checksum(session, module_org, module_target_sat): """Tests that Verify Content Checksum succeeds when executing from the products page :id: 577be1f8-7510-49d2-8b33-600db60bd960 @@ -1194,7 +1201,7 @@ def test_positive_sync_repo_and_verify_checksum(session, module_org): :expectedresults: Verify Content Checksum task succeeds """ repo_name = gen_string('alpha') - product = entities.Product(organization=module_org).create() + product = module_target_sat.api.Product(organization=module_org).create() with session: session.repository.create( product.name, @@ -1210,7 +1217,7 @@ def test_positive_sync_repo_and_verify_checksum(session, module_org): @pytest.mark.tier2 -def test_positive_sync_sha_repo(session, module_org): +def test_positive_sync_sha_repo(session, module_org, module_target_sat): """Sync 'sha' repo successfully :id: 6172035f-96c4-41e4-a79b-acfaa78ad734 @@ -1222,7 +1229,7 @@ def test_positive_sync_sha_repo(session, module_org): :SubComponent: Candlepin """ repo_name = gen_string('alpha') - product = entities.Product(organization=module_org).create() + product = module_target_sat.api.Product(organization=module_org).create() with session: session.repository.create( product.name, @@ -1237,7 +1244,7 @@ def test_positive_sync_sha_repo(session, module_org): @pytest.mark.tier2 -def test_positive_sync_third_party_repo(session, module_org): +def test_positive_sync_third_party_repo(session, module_org, module_target_sat): """Sync third part repo successfully :id: 655161e0-aa90-4c7c-9a0d-cb5b9f56eac3 @@ -1249,7 +1256,7 @@ def test_positive_sync_third_party_repo(session, module_org): :SubComponent: Pulp """ repo_name = gen_string('alpha') - product = entities.Product(organization=module_org).create() + product = module_target_sat.api.Product(organization=module_org).create() with session: session.repository.create( product.name, diff --git a/tests/foreman/ui/test_role.py b/tests/foreman/ui/test_role.py index dd7c9c9ddf..652bdcbd4f 100644 --- a/tests/foreman/ui/test_role.py +++ b/tests/foreman/ui/test_role.py @@ -13,8 +13,6 @@ """ import random -from airgun.session import Session -from nailgun import entities from navmazing import NavigationTriesExceeded import pytest @@ -25,7 +23,7 @@ @pytest.mark.e2e @pytest.mark.tier2 @pytest.mark.upgrade -def test_positive_end_to_end(session, module_org, module_location): +def test_positive_end_to_end(session, module_org, module_location, module_target_sat): """Perform end to end testing for role component :id: 3284016a-e2df-4a0e-aa24-c95ab132eec1 @@ -45,8 +43,8 @@ def test_positive_end_to_end(session, module_org, module_location): cloned_role_name = gen_string('alpha') new_role_name = gen_string('alpha') new_role_description = gen_string('alpha') - new_org = entities.Organization().create() - new_loc = entities.Location(organization=[new_org]).create() + new_org = module_target_sat.api.Organization().create() + new_loc = module_target_sat.api.Location(organization=[new_org]).create() with session: session.role.create( { @@ -156,7 +154,9 @@ def test_positive_delete_cloned_builtin(session): @pytest.mark.tier2 -def test_positive_create_filter_without_override(session, module_org, module_location, test_name): +def test_positive_create_filter_without_override( + session, module_org, module_location, test_name, module_target_sat +): """Create filter in role w/o overriding it :id: a7f76f6e-6c13-4b34-b38c-19501b65786f @@ -178,7 +178,7 @@ def test_positive_create_filter_without_override(session, module_org, module_loc role_name = gen_string('alpha') username = gen_string('alpha') password = gen_string('alpha') - subnet = entities.Subnet() + subnet = module_target_sat.api.Subnet() subnet.create_missing() subnet_name = subnet.name with session: @@ -222,7 +222,7 @@ def test_positive_create_filter_without_override(session, module_org, module_loc 'locations.resources.assigned': [module_location.name], } ) - with Session(test_name, user=username, password=password) as session: + with module_target_sat.ui_session(test_name, user=username, password=password) as session: session.subnet.create( { 'subnet.name': subnet_name, @@ -239,7 +239,9 @@ def test_positive_create_filter_without_override(session, module_org, module_loc @pytest.mark.tier2 @pytest.mark.upgrade -def test_positive_create_non_overridable_filter(session, module_org, module_location, test_name): +def test_positive_create_non_overridable_filter( + session, module_org, module_location, test_name, module_target_sat +): """Create non overridden filter in role :id: 5ee281cf-28fa-439d-888d-b1f9aacc6d57 @@ -262,9 +264,9 @@ def test_positive_create_non_overridable_filter(session, module_org, module_loca username = gen_string('alpha') password = gen_string('alpha') new_name = gen_string('alpha') - user_org = entities.Organization().create() - user_loc = entities.Location().create() - arch = entities.Architecture().create() + user_org = module_target_sat.api.Organization().create() + user_loc = module_target_sat.api.Location().create() + arch = module_target_sat.api.Architecture().create() with session: session.role.create( { @@ -293,7 +295,7 @@ def test_positive_create_non_overridable_filter(session, module_org, module_loca 'locations.resources.assigned': [user_loc.name], } ) - with Session(test_name, user=username, password=password) as session: + with module_target_sat.ui_session(test_name, user=username, password=password) as session: session.architecture.update(arch.name, {'name': new_name}) assert session.architecture.search(new_name)[0]['Name'] == new_name with pytest.raises(NavigationTriesExceeded): @@ -302,7 +304,9 @@ def test_positive_create_non_overridable_filter(session, module_org, module_loca @pytest.mark.tier2 @pytest.mark.upgrade -def test_positive_create_overridable_filter(session, module_org, module_location, test_name): +def test_positive_create_overridable_filter( + session, module_org, module_location, test_name, module_target_sat +): """Create overridden filter in role :id: 325e7e3e-60fc-4182-9585-0449d9660e8d @@ -327,9 +331,9 @@ def test_positive_create_overridable_filter(session, module_org, module_location role_name = gen_string('alpha') username = gen_string('alpha') password = gen_string('alpha') - role_org = entities.Organization().create() - role_loc = entities.Location().create() - subnet = entities.Subnet() + role_org = module_target_sat.api.Organization().create() + role_loc = module_target_sat.api.Location().create() + subnet = module_target_sat.api.Subnet() subnet.create_missing() subnet_name = subnet.name new_subnet_name = gen_string('alpha') @@ -378,7 +382,7 @@ def test_positive_create_overridable_filter(session, module_org, module_location 'locations.resources.assigned': [role_loc.name, module_location.name], } ) - with Session(test_name, user=username, password=password) as session: + with module_target_sat.ui_session(test_name, user=username, password=password) as session: session.organization.select(org_name=module_org.name) session.location.select(loc_name=module_location.name) session.subnet.create( @@ -485,7 +489,7 @@ def test_positive_create_with_sc_parameter_permission(session_puppet_enabled_sat @pytest.mark.tier2 -def test_positive_create_filter_admin_user_with_locs(test_name): +def test_positive_create_filter_admin_user_with_locs(test_name, module_target_sat): """Attempt to create a role filter by admin user, who has 6+ locations assigned. :id: 688ecb7d-1d49-494c-97cc-0d5e715f3bb1 @@ -501,10 +505,10 @@ def test_positive_create_filter_admin_user_with_locs(test_name): role_name = gen_string('alpha') resource_type = 'Architecture' permissions = ['view_architectures', 'edit_architectures'] - org = entities.Organization().create() - locations = [entities.Location(organization=[org]).create() for _ in range(6)] + org = module_target_sat.api.Organization().create() + locations = [module_target_sat.api.Location(organization=[org]).create() for _ in range(6)] password = gen_string('alphanumeric') - user = entities.User( + user = module_target_sat.api.User( admin=True, organization=[org], location=locations, @@ -512,7 +516,7 @@ def test_positive_create_filter_admin_user_with_locs(test_name): default_location=locations[0], password=password, ).create() - with Session(test_name, user=user.login, password=password) as session: + with module_target_sat.ui_session(test_name, user=user.login, password=password) as session: session.role.create({'name': role_name}) assert session.role.search(role_name)[0]['Name'] == role_name session.filter.create( @@ -523,7 +527,7 @@ def test_positive_create_filter_admin_user_with_locs(test_name): @pytest.mark.tier2 -def test_positive_create_filter_admin_user_with_orgs(test_name): +def test_positive_create_filter_admin_user_with_orgs(test_name, module_target_sat): """Attempt to create a role filter by admin user, who has 10 organizations assigned. :id: 04208e17-34b5-46b1-84dd-b8a973521d30 @@ -540,9 +544,9 @@ def test_positive_create_filter_admin_user_with_orgs(test_name): resource_type = 'Architecture' permissions = ['view_architectures', 'edit_architectures'] password = gen_string('alphanumeric') - organizations = [entities.Organization().create() for _ in range(10)] - loc = entities.Location(organization=[organizations[0]]).create() - user = entities.User( + organizations = [module_target_sat.api.Organization().create() for _ in range(10)] + loc = module_target_sat.api.Location(organization=[organizations[0]]).create() + user = module_target_sat.api.User( admin=True, organization=organizations, location=[loc], @@ -550,7 +554,7 @@ def test_positive_create_filter_admin_user_with_orgs(test_name): default_location=loc, password=password, ).create() - with Session(test_name, user=user.login, password=password) as session: + with module_target_sat.ui_session(test_name, user=user.login, password=password) as session: session.role.create({'name': role_name}) assert session.role.search(role_name)[0]['Name'] == role_name session.filter.create( diff --git a/tests/foreman/ui/test_settings.py b/tests/foreman/ui/test_settings.py index 87682a55db..c3c233bf97 100644 --- a/tests/foreman/ui/test_settings.py +++ b/tests/foreman/ui/test_settings.py @@ -13,9 +13,7 @@ """ import math -from airgun.session import Session from fauxfactory import gen_url -from nailgun import entities import pytest from robottelo.config import settings @@ -28,14 +26,14 @@ def invalid_settings_values(): return [' ', '-1', 'text', '0'] -def add_content_views_to_composite(composite_cv, org, repo): +def add_content_views_to_composite(composite_cv, org, repo, module_target_sat): """Add necessary number of content views to the composite one :param composite_cv: Composite content view object :param org: Organisation of satellite :param repo: repository need to added in content view """ - content_view = entities.ContentView(organization=org).create() + content_view = module_target_sat.api.ContentView(organization=org).create() content_view.repository = [repo] content_view.update(['repository']) content_view.publish() @@ -47,7 +45,9 @@ def add_content_views_to_composite(composite_cv, org, repo): @pytest.mark.run_in_one_thread @pytest.mark.tier3 @pytest.mark.parametrize('setting_update', ['restrict_composite_view'], indirect=True) -def test_positive_update_restrict_composite_view(session, setting_update, repo_setup): +def test_positive_update_restrict_composite_view( + session, setting_update, repo_setup, module_target_sat +): """Update settings parameter restrict_composite_view to Yes/True and ensure a composite content view may not be published or promoted, unless the component content view versions that it includes exist in the target environment. @@ -61,9 +61,11 @@ def test_positive_update_restrict_composite_view(session, setting_update, repo_s :CaseImportance: Critical """ property_name = setting_update.name - composite_cv = entities.ContentView(composite=True, organization=repo_setup['org']).create() + composite_cv = module_target_sat.api.ContentView( + composite=True, organization=repo_setup['org'] + ).create() content_view = add_content_views_to_composite( - composite_cv, repo_setup['org'], repo_setup['repo'] + composite_cv, repo_setup['org'], repo_setup['repo'], module_target_sat ) composite_cv.publish() with session: @@ -252,9 +254,9 @@ def test_negative_settings_access_to_non_admin(module_target_sat): """ login = gen_string('alpha') password = gen_string('alpha') - entities.User(admin=False, login=login, password=password).create() + module_target_sat.api.User(admin=False, login=login, password=password).create() try: - with Session(user=login, password=password) as session: + with module_target_sat.ui_session(user=login, password=password) as session: result = session.settings.permission_denied() assert ( result == 'Permission denied You are not authorized to perform this action. ' @@ -367,7 +369,7 @@ def test_positive_update_email_delivery_method_sendmail(session, target_sat): "send_welcome_email": "", } mail_config_default_param = { - content: entities.Setting().search(query={'search': f'name={content}'})[0] + content: target_sat.api.Setting().search(query={'search': f'name={content}'})[0] for content in mail_config_default_param } mail_config_new_params = { diff --git a/tests/foreman/ui/test_subscription.py b/tests/foreman/ui/test_subscription.py index f98a2ccde4..9981e371cd 100644 --- a/tests/foreman/ui/test_subscription.py +++ b/tests/foreman/ui/test_subscription.py @@ -14,9 +14,7 @@ from tempfile import mkstemp import time -from airgun.session import Session from fauxfactory import gen_string -from nailgun import entities import pytest from robottelo.config import settings @@ -44,18 +42,18 @@ def golden_ticket_host_setup(function_entitlement_manifest_org, module_target_sa reposet=REPOSET['rhst7'], releasever=None, ) - rh_repo = entities.Repository(id=rh_repo_id).read() + rh_repo = module_target_sat.api.Repository(id=rh_repo_id).read() rh_repo.sync() - custom_product = entities.Product(organization=org).create() - custom_repo = entities.Repository( + custom_product = module_target_sat.api.Product(organization=org).create() + custom_repo = module_target_sat.api.Repository( name=gen_string('alphanumeric').upper(), product=custom_product ).create() custom_repo.sync() - ak = entities.ActivationKey( + ak = module_target_sat.api.ActivationKey( content_view=org.default_content_view, max_hosts=100, organization=org, - environment=entities.LifecycleEnvironment(id=org.library.id), + environment=module_target_sat.api.LifecycleEnvironment(id=org.library.id), auto_attach=True, ).create() return org, ak @@ -93,7 +91,7 @@ def test_positive_end_to_end(session, target_sat): 'Note: Deleting a subscription manifest is STRONGLY discouraged.', 'This action should only be taken for debugging purposes.', ] - org = entities.Organization().create() + org = target_sat.api.Organization().create() _, temporary_local_manifest_path = mkstemp(prefix='manifest-', suffix='.zip') with clone() as manifest: with open(temporary_local_manifest_path, 'wb') as file_handler: @@ -147,8 +145,8 @@ def test_positive_access_with_non_admin_user_without_manifest(test_name, target_ :CaseImportance: Critical """ - org = entities.Organization().create() - role = entities.Role(organization=[org]).create() + org = target_sat.api.Organization().create() + role = target_sat.api.Role(organization=[org]).create() target_sat.api_factory.create_role_permissions( role, { @@ -162,14 +160,14 @@ def test_positive_access_with_non_admin_user_without_manifest(test_name, target_ }, ) user_password = gen_string('alphanumeric') - user = entities.User( + user = target_sat.api.User( admin=False, role=[role], password=user_password, organization=[org], default_organization=org, ).create() - with Session(test_name, user=user.login, password=user_password) as session: + with target_sat.ui_session(test_name, user=user.login, password=user_password) as session: assert not session.subscription.has_manifest @@ -193,20 +191,20 @@ def test_positive_access_with_non_admin_user_with_manifest( :CaseImportance: Critical """ org = function_entitlement_manifest_org - role = entities.Role(organization=[org]).create() + role = target_sat.api.Role(organization=[org]).create() target_sat.api_factory.create_role_permissions( role, {'Katello::Subscription': ['view_subscriptions'], 'Organization': ['view_organizations']}, ) user_password = gen_string('alphanumeric') - user = entities.User( + user = target_sat.api.User( admin=False, role=[role], password=user_password, organization=[org], default_organization=org, ).create() - with Session(test_name, user=user.login, password=user_password) as session: + with target_sat.ui_session(test_name, user=user.login, password=user_password) as session: assert ( session.subscription.search(f'name = "{DEFAULT_SUBSCRIPTION_NAME}"')[0]['Name'] == DEFAULT_SUBSCRIPTION_NAME @@ -230,23 +228,23 @@ def test_positive_access_manifest_as_another_admin_user( :CaseImportance: High """ - org = entities.Organization().create() + org = target_sat.api.Organization().create() user1_password = gen_string('alphanumeric') - user1 = entities.User( + user1 = target_sat.api.User( admin=True, password=user1_password, organization=[org], default_organization=org ).create() user2_password = gen_string('alphanumeric') - user2 = entities.User( + user2 = target_sat.api.User( admin=True, password=user2_password, organization=[org], default_organization=org ).create() # use the first admin to upload a manifest - with Session(test_name, user=user1.login, password=user1_password) as session: + with target_sat.ui_session(test_name, user=user1.login, password=user1_password) as session: target_sat.upload_manifest(org.id, function_entitlement_manifest.content) assert session.subscription.has_manifest # store subscriptions that have "Red Hat" in the name for later rh_subs = session.subscription.search("Red Hat") # try to view and delete the manifest with another admin - with Session(test_name, user=user2.login, password=user2_password) as session: + with target_sat.ui_session(test_name, user=user2.login, password=user2_password) as session: assert session.subscription.has_manifest assert rh_subs == session.subscription.search("Red Hat") session.subscription.delete_manifest( @@ -290,7 +288,7 @@ def test_positive_view_vdc_subscription_products( :parametrized: yes """ org = function_entitlement_manifest_org - lce = entities.LifecycleEnvironment(organization=org).create() + lce = target_sat.api.LifecycleEnvironment(organization=org).create() repos_collection = target_sat.cli_factory.RepositoryCollection( distro='rhel7', repositories=[target_sat.cli_factory.RHELAnsibleEngineRepository(cdn=True)], @@ -348,7 +346,7 @@ def test_positive_view_vdc_guest_subscription_products( :parametrized: yes """ org = function_entitlement_manifest_org - lce = entities.LifecycleEnvironment(organization=org).create() + lce = target_sat.api.LifecycleEnvironment(organization=org).create() provisioning_server = settings.libvirt.libvirt_hostname rh_product_repository = target_sat.cli_factory.RHELAnsibleEngineRepository(cdn=True) product_name = rh_product_repository.data['product'] @@ -511,13 +509,15 @@ def test_positive_candlepin_events_processed_by_STOMP( :CaseImportance: High """ org = function_entitlement_manifest_org - repo = entities.Repository(product=entities.Product(organization=org).create()).create() + repo = target_sat.api.Repository( + product=target_sat.api.Product(organization=org).create() + ).create() repo.sync() - ak = entities.ActivationKey( + ak = target_sat.api.ActivationKey( content_view=org.default_content_view, max_hosts=100, organization=org, - environment=entities.LifecycleEnvironment(id=org.library.id), + environment=target_sat.api.LifecycleEnvironment(id=org.library.id), ).create() rhel7_contenthost.install_katello_ca(target_sat) rhel7_contenthost.register_contenthost(org.name, ak.name) @@ -533,7 +533,7 @@ def test_positive_candlepin_events_processed_by_STOMP( rhel7_contenthost.hostname, widget_names='details' )['details']['subscription_status'] assert 'Fully entitled' in updated_sub_status - response = entities.Ping().search_json()['services']['candlepin_events'] + response = target_sat.api.Ping().search_json()['services']['candlepin_events'] assert response['status'] == 'ok' assert '0 Failed' in response['message'] diff --git a/tests/foreman/ui/test_user.py b/tests/foreman/ui/test_user.py index 21147e88ad..a69b58250b 100644 --- a/tests/foreman/ui/test_user.py +++ b/tests/foreman/ui/test_user.py @@ -13,7 +13,6 @@ """ import random -from airgun.session import Session from fauxfactory import gen_email, gen_string import pytest @@ -83,7 +82,7 @@ def test_positive_end_to_end(session, target_sat, test_name, module_org, module_ assert session.user.search(new_name)[0]['Username'] == new_name assert not session.user.search(name) # Login into application using new user - with Session(test_name, new_name, password) as newsession: + with target_sat.ui_session(test_name, new_name, password) as newsession: newsession.organization.select(module_org.name) newsession.location.select(module_location.name) newsession.activationkey.create({'name': ak_name}) @@ -91,7 +90,7 @@ def test_positive_end_to_end(session, target_sat, test_name, module_org, module_ current_user = newsession.activationkey.read(ak_name, 'current_user')['current_user'] assert current_user == f'{firstname} {lastname}' # Delete user - with Session('deletehostsession') as deletehostsession: + with target_sat.ui_session('deletehostsession') as deletehostsession: deletehostsession.user.delete(new_name) assert not deletehostsession.user.search(new_name) @@ -300,7 +299,7 @@ def test_positive_create_product_with_limited_user_permission( password=password, mail='test@test.com', ).create() - with Session(test_name, username, password) as newsession: + with target_sat.ui_session(test_name, username, password) as newsession: newsession.product.create( {'name': product_name, 'label': product_label, 'description': product_description} ) diff --git a/tests/foreman/virtwho/conftest.py b/tests/foreman/virtwho/conftest.py index 133fa0026a..9b09a66c0f 100644 --- a/tests/foreman/virtwho/conftest.py +++ b/tests/foreman/virtwho/conftest.py @@ -1,4 +1,3 @@ -from airgun.session import Session from fauxfactory import gen_string import pytest from requests.exceptions import HTTPError @@ -37,7 +36,7 @@ def module_user(request, module_target_sat, default_org, default_location): @pytest.fixture -def session(test_name, module_user): +def session(test_name, module_user, module_target_sat): """Session fixture which automatically initializes (but does not start!) airgun UI session and correctly passes current test name to it. Uses shared module user credentials to log in. @@ -50,7 +49,7 @@ def test_foo(session): # your ui test steps here session.architecture.create({'name': 'bar'}) """ - return Session(test_name, module_user.login, module_user.password) + return module_target_sat.ui_session(test_name, module_user.login, module_user.password) @pytest.fixture(scope='module') @@ -84,7 +83,7 @@ def module_user_sca(request, module_target_sat, module_org, module_location): @pytest.fixture -def session_sca(test_name, module_user_sca): +def session_sca(test_name, module_user_sca, module_target_sat): """Session fixture which automatically initializes (but does not start!) airgun UI session and correctly passes current test name to it. Uses shared module user credentials to log in. @@ -97,4 +96,4 @@ def test_foo(session): # your ui test steps here session.architecture.create({'name': 'bar'}) """ - return Session(test_name, module_user_sca.login, module_user_sca.password) + return module_target_sat.ui_session(test_name, module_user_sca.login, module_user_sca.password) diff --git a/tests/foreman/virtwho/ui/test_esx.py b/tests/foreman/virtwho/ui/test_esx.py index 5baba61e97..b81536ab21 100644 --- a/tests/foreman/virtwho/ui/test_esx.py +++ b/tests/foreman/virtwho/ui/test_esx.py @@ -13,7 +13,6 @@ """ from datetime import datetime -from airgun.session import Session from fauxfactory import gen_string import pytest @@ -369,7 +368,7 @@ def test_positive_delete_configure(self, default_org, org_session, form_data_ui) @pytest.mark.tier2 def test_positive_virtwho_reporter_role( - self, default_org, org_session, test_name, form_data_ui + self, default_org, org_session, test_name, form_data_ui, target_sat ): """Verify the virt-who reporter role can TRULY work. @@ -418,13 +417,15 @@ def test_positive_virtwho_reporter_role( assert user['roles']['resources']['assigned'] == ['Virt-who Reporter'] restart_virtwho_service() assert get_virtwho_status() == 'running' - with Session(test_name, username, password) as newsession: + with target_sat.ui_session(test_name, username, password) as newsession: assert not newsession.virtwho_configure.check_create_permission()['can_view'] org_session.user.delete(username) assert not org_session.user.search(username) @pytest.mark.tier2 - def test_positive_virtwho_viewer_role(self, default_org, org_session, test_name, form_data_ui): + def test_positive_virtwho_viewer_role( + self, default_org, org_session, test_name, form_data_ui, target_sat + ): """Verify the virt-who viewer role can TRULY work. :id: bf3be2e4-3853-41cc-9b3e-c8677f0b8c5f @@ -469,7 +470,7 @@ def test_positive_virtwho_viewer_role(self, default_org, org_session, test_name, add_configure_option('rhsm_password', password, config_file) restart_virtwho_service() assert get_virtwho_status() == 'logerror' - with Session(test_name, username, password) as newsession: + with target_sat.ui_session(test_name, username, password) as newsession: create_permission = newsession.virtwho_configure.check_create_permission() update_permission = newsession.virtwho_configure.check_update_permission( config_name @@ -484,7 +485,9 @@ def test_positive_virtwho_viewer_role(self, default_org, org_session, test_name, assert not org_session.user.search(username) @pytest.mark.tier2 - def test_positive_virtwho_manager_role(self, default_org, org_session, test_name, form_data_ui): + def test_positive_virtwho_manager_role( + self, default_org, org_session, test_name, form_data_ui, target_sat + ): """Verify the virt-who manager role can TRULY work. :id: a72023fb-7b23-4582-9adc-c5227dc7859c @@ -520,7 +523,7 @@ def test_positive_virtwho_manager_role(self, default_org, org_session, test_name org_session.user.update(username, {'roles.resources.assigned': ['Virt-who Manager']}) user = org_session.user.read(username) assert user['roles']['resources']['assigned'] == ['Virt-who Manager'] - with Session(test_name, username, password) as newsession: + with target_sat.ui_session(test_name, username, password) as newsession: # create_virt_who_config new_virt_who_name = gen_string('alpha') form_data_ui['name'] = new_virt_who_name From 6828a2ac5ef273539f6667ad39227f13126e49c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 15:35:37 +0530 Subject: [PATCH 68/93] Bump pascalgn/automerge-action from 0.15.6 to 0.16.0 (#13666) Bumps [pascalgn/automerge-action](https://github.com/pascalgn/automerge-action) from 0.15.6 to 0.16.0. - [Release notes](https://github.com/pascalgn/automerge-action/releases) - [Commits](https://github.com/pascalgn/automerge-action/compare/v0.15.6...v0.16.0) --- updated-dependencies: - dependency-name: pascalgn/automerge-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/auto_cherry_pick_merge.yaml | 2 +- .github/workflows/dependency_merge.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto_cherry_pick_merge.yaml b/.github/workflows/auto_cherry_pick_merge.yaml index 0f0e9e33b3..01896dd9d5 100644 --- a/.github/workflows/auto_cherry_pick_merge.yaml +++ b/.github/workflows/auto_cherry_pick_merge.yaml @@ -67,7 +67,7 @@ jobs: - id: automerge name: Auto merge of cherry-picked PRs. - uses: "pascalgn/automerge-action@v0.15.6" + uses: "pascalgn/automerge-action@v0.16.0" env: GITHUB_TOKEN: "${{ secrets.CHERRYPICK_PAT }}" MERGE_LABELS: "AutoMerge_Cherry_Picked, Auto_Cherry_Picked" diff --git a/.github/workflows/dependency_merge.yml b/.github/workflows/dependency_merge.yml index 90aeb7a9bc..ebac6d10c8 100644 --- a/.github/workflows/dependency_merge.yml +++ b/.github/workflows/dependency_merge.yml @@ -61,7 +61,7 @@ jobs: - id: automerge name: Auto merge of dependabot PRs. - uses: "pascalgn/automerge-action@v0.15.6" + uses: "pascalgn/automerge-action@v0.16.0" env: GITHUB_TOKEN: "${{ secrets.CHERRYPICK_PAT }}" MERGE_LABELS: "dependencies" From 9585a3dc99d18d682794e1dadb5cad98ef8c6238 Mon Sep 17 00:00:00 2001 From: Adarsh dubey Date: Tue, 9 Jan 2024 17:26:04 +0530 Subject: [PATCH 69/93] Removing stubbed marker (#13668) --- tests/foreman/api/test_discoveryrule.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/foreman/api/test_discoveryrule.py b/tests/foreman/api/test_discoveryrule.py index 3f6ff72e55..f5dffd5be1 100644 --- a/tests/foreman/api/test_discoveryrule.py +++ b/tests/foreman/api/test_discoveryrule.py @@ -111,7 +111,6 @@ def test_negative_create_with_invalid_host_limit_and_priority(module_target_sat) module_target_sat.api.DiscoveryRule(priority=gen_string('alpha')).create() -@pytest.mark.stubbed @pytest.mark.tier3 def test_positive_update_and_provision_with_rule_priority( module_target_sat, module_discovery_hostgroup, discovery_location, discovery_org From a40cdebbf12f256aae211aaef123902e5f2078fd Mon Sep 17 00:00:00 2001 From: Jake Callahan Date: Tue, 9 Jan 2024 09:47:26 -0500 Subject: [PATCH 70/93] Add Ruff rule group B (flake8-bugbear) (#13491) This change includes the rule addition and mostly manual changes to existing code in order to bring it in line with the new rules and avoid as many ignores as is reasonable. I added a number of {{from err}} statements to the end of exceptions that currently include the error message. The error message being included in the raised string can be removed later, but keeping for consistency for now. In cases where I raised from None, the raised exception is clear enough that the additional context of the parent exception isn't helpful. cli/test\_ping.py has a zip that should probably be strict. --- pyproject.toml | 1 + robottelo/cli/base.py | 10 +-- robottelo/cli/hammer.py | 2 +- robottelo/host_helpers/api_factory.py | 10 +-- robottelo/host_helpers/capsule_mixins.py | 4 +- robottelo/host_helpers/cli_factory.py | 70 ++++++++++++------- robottelo/host_helpers/repository_mixins.py | 2 +- robottelo/host_helpers/satellite_mixins.py | 16 ++--- robottelo/host_helpers/ui_factory.py | 4 +- robottelo/hosts.py | 23 ++++-- robottelo/utils/decorators/func_locker.py | 4 +- .../utils/decorators/func_shared/shared.py | 3 +- robottelo/utils/ohsnap.py | 4 +- robottelo/utils/virtwho.py | 24 +++---- tests/foreman/api/test_acs.py | 2 +- tests/foreman/api/test_ansible.py | 8 ++- tests/foreman/api/test_discoveredhost.py | 32 +++++---- tests/foreman/api/test_host.py | 2 +- tests/foreman/api/test_media.py | 4 +- tests/foreman/api/test_notifications.py | 4 +- tests/foreman/api/test_organization.py | 4 +- tests/foreman/api/test_partitiontable.py | 4 +- tests/foreman/api/test_provisioning.py | 4 +- tests/foreman/api/test_repository.py | 38 ++++++---- tests/foreman/api/test_role.py | 2 +- tests/foreman/api/test_webhook.py | 4 +- tests/foreman/cli/test_errata.py | 4 +- tests/foreman/cli/test_host.py | 4 +- tests/foreman/cli/test_model.py | 4 +- tests/foreman/cli/test_partitiontable.py | 1 + tests/foreman/cli/test_ping.py | 2 +- tests/foreman/cli/test_remoteexecution.py | 8 +-- tests/foreman/cli/test_report.py | 2 +- tests/foreman/cli/test_repository.py | 2 +- tests/foreman/cli/test_role.py | 4 +- .../destructive/test_capsulecontent.py | 2 +- .../destructive/test_discoveredhost.py | 26 +++---- .../destructive/test_ldap_authentication.py | 2 +- .../destructive/test_remoteexecution.py | 4 +- tests/foreman/installer/test_installer.py | 7 +- tests/foreman/longrun/test_oscap.py | 8 +-- tests/foreman/maintain/test_advanced.py | 4 +- tests/foreman/maintain/test_health.py | 4 +- .../foreman/ui/test_computeresource_vmware.py | 8 +-- tests/foreman/ui/test_contenthost.py | 10 +-- tests/foreman/ui/test_dashboard.py | 2 +- tests/foreman/ui/test_errata.py | 4 +- tests/foreman/ui/test_host.py | 2 +- tests/foreman/ui/test_hostcollection.py | 7 +- tests/foreman/ui/test_sync.py | 2 +- tests/robottelo/test_func_shared.py | 2 +- tests/robottelo/test_report.py | 10 +-- 52 files changed, 240 insertions(+), 180 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7988aa2a58..61982c48c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,7 @@ target-version = "py311" fixable = ["ALL"] select = [ + "B", # bugbear # "C90", # mccabe "E", # pycodestyle "F", # flake8 diff --git a/robottelo/cli/base.py b/robottelo/cli/base.py index 2d3d797469..2d3e6dbf85 100644 --- a/robottelo/cli/base.py +++ b/robottelo/cli/base.py @@ -169,15 +169,9 @@ def _get_username_password(cls, username=None, password=None): """ if username is None: - try: - username = getattr(cls, 'foreman_admin_username') - except AttributeError: - username = settings.server.admin_username + username = getattr(cls, 'foreman_admin_username', settings.server.admin_username) if password is None: - try: - password = getattr(cls, 'foreman_admin_password') - except AttributeError: - password = settings.server.admin_password + password = getattr(cls, 'foreman_admin_password', settings.server.admin_password) return (username, password) diff --git a/robottelo/cli/hammer.py b/robottelo/cli/hammer.py index f6ddb11b4f..661042050e 100644 --- a/robottelo/cli/hammer.py +++ b/robottelo/cli/hammer.py @@ -42,7 +42,7 @@ def parse_csv(output): # Generate the key names, spaces will be converted to dashes "-" keys = [_normalize(header) for header in next(reader)] # For each entry, create a dict mapping each key with each value - return [dict(zip(keys, values)) for values in reader if len(values) > 0] + return [dict(zip(keys, values, strict=True)) for values in reader if len(values) > 0] def parse_help(output): diff --git a/robottelo/host_helpers/api_factory.py b/robottelo/host_helpers/api_factory.py index 92f40652d3..0fff257935 100644 --- a/robottelo/host_helpers/api_factory.py +++ b/robottelo/host_helpers/api_factory.py @@ -468,14 +468,14 @@ def create_role_permissions( if entity_permission.name != name: raise self._satellite.api.APIResponseError( 'the returned permission is different from the' - ' requested one "{} != {}"'.format(entity_permission.name, name) + f' requested one "{entity_permission.name} != {name}"' ) permissions_entities.append(entity_permission) else: if not permissions_name: raise ValueError( - 'resource type "{}" empty. You must select at' - ' least one permission'.format(resource_type) + f'resource type "{resource_type}" empty. You must select at' + ' least one permission' ) resource_type_permissions_entities = self._satellite.api.Permission().search( @@ -575,8 +575,8 @@ def satellite_setting(self, key_val: str): setting = self._satellite.api.Setting().search( query={'search': f'name={name.strip()}'} )[0] - except IndexError: - raise KeyError(f'The setting {name} in not available in satellite.') + except IndexError as err: + raise KeyError(f'The setting {name} in not available in satellite.') from err old_value = setting.value setting.value = value.strip() setting.update({'value'}) diff --git a/robottelo/host_helpers/capsule_mixins.py b/robottelo/host_helpers/capsule_mixins.py index 0a4c88ddf6..f726b921ef 100644 --- a/robottelo/host_helpers/capsule_mixins.py +++ b/robottelo/host_helpers/capsule_mixins.py @@ -61,10 +61,12 @@ def wait_for_tasks( raise AssertionError(f"No task was found using query '{search_query}'") return tasks - def wait_for_sync(self, timeout=600, start_time=datetime.utcnow()): + def wait_for_sync(self, timeout=600, start_time=None): """Wait for capsule sync to finish and assert the sync task succeeded""" # Assert that a task to sync lifecycle environment to the capsule # is started (or finished already) + if start_time is None: + start_time = datetime.utcnow() logger.info(f"Waiting for capsule {self.hostname} sync to finish ...") sync_status = self.nailgun_capsule.content_get_sync() logger.info(f"Active tasks {sync_status['active_sync_tasks']}") diff --git a/robottelo/host_helpers/cli_factory.py b/robottelo/host_helpers/cli_factory.py index 7ff8eb086e..ba82a80e7f 100644 --- a/robottelo/host_helpers/cli_factory.py +++ b/robottelo/host_helpers/cli_factory.py @@ -4,7 +4,7 @@ example: my_satellite.cli_factory.make_org() """ import datetime -from functools import lru_cache, partial +from functools import partial import inspect import os from os import chmod @@ -14,6 +14,7 @@ from time import sleep from box import Box +from cachetools import cachedmethod from fauxfactory import ( gen_alpha, gen_alphanumeric, @@ -59,9 +60,9 @@ def create_object(cli_object, options, values=None, credentials=None): 'Failed to create {} with data:\n{}\n{}'.format( cli_object.__name__, pprint.pformat(options, indent=2), err.msg ) - ) + ) from err # Sometimes we get a list with a dictionary and not a dictionary. - if type(result) is list and len(result) > 0: + if isinstance(result, list) and len(result) > 0: result = result[0] return Box(result) @@ -294,7 +295,7 @@ def _evaluate_functions(self, iterable): if not key.startswith('_') } - @lru_cache + @cachedmethod def _find_entity_class(self, entity_name): entity_name = entity_name.replace('_', '').lower() for name, class_obj in self._satellite.cli.__dict__.items(): @@ -394,8 +395,8 @@ def make_product_wait(self, options=None, wait_for=5): product = self._satellite.cli.Product.info( {'name': options.get('name'), 'organization-id': options.get('organization-id')} ) - except CLIReturnCodeError: - raise err + except CLIReturnCodeError as nested_err: + raise nested_err from err if not product: raise err return product @@ -503,7 +504,7 @@ def make_proxy(self, options=None): args['url'] = url return create_object(self._satellite.cli.Proxy, args, options) except CapsuleTunnelError as err: - raise CLIFactoryError(f'Failed to create ssh tunnel: {err}') + raise CLIFactoryError(f'Failed to create ssh tunnel: {err}') from None args['url'] = options['url'] return create_object(self._satellite.cli.Proxy, args, options) @@ -569,7 +570,7 @@ def activationkey_add_subscription_to_repo(self, options=None): except CLIReturnCodeError as err: raise CLIFactoryError( f'Failed to add subscription to activation key\n{err.msg}' - ) + ) from err def setup_org_for_a_custom_repo(self, options=None): """Sets up Org for the given custom repo by: @@ -608,7 +609,7 @@ def setup_org_for_a_custom_repo(self, options=None): try: self._satellite.cli.Repository.synchronize({'id': custom_repo['id']}) except CLIReturnCodeError as err: - raise CLIFactoryError(f'Failed to synchronize repository\n{err.msg}') + raise CLIFactoryError(f'Failed to synchronize repository\n{err.msg}') from err # Create CV if needed and associate repo with it if options.get('content-view-id') is None: cv_id = self.make_content_view({'organization-id': org_id})['id'] @@ -619,12 +620,14 @@ def setup_org_for_a_custom_repo(self, options=None): {'id': cv_id, 'organization-id': org_id, 'repository-id': custom_repo['id']} ) except CLIReturnCodeError as err: - raise CLIFactoryError(f'Failed to add repository to content view\n{err.msg}') + raise CLIFactoryError(f'Failed to add repository to content view\n{err.msg}') from err # Publish a new version of CV try: self._satellite.cli.ContentView.publish({'id': cv_id}) except CLIReturnCodeError as err: - raise CLIFactoryError(f'Failed to publish new version of content view\n{err.msg}') + raise CLIFactoryError( + f'Failed to publish new version of content view\n{err.msg}' + ) from err # Get the version id cv_info = self._satellite.cli.ContentView.info({'id': cv_id}) assert len(cv_info['versions']) > 0 @@ -642,7 +645,9 @@ def setup_org_for_a_custom_repo(self, options=None): } ) except CLIReturnCodeError as err: - raise CLIFactoryError(f'Failed to promote version to next environment\n{err.msg}') + raise CLIFactoryError( + f'Failed to promote version to next environment\n{err.msg}' + ) from err # Create activation key if needed and associate content view with it if options.get('activationkey-id') is None: activationkey_id = self.make_activation_key( @@ -661,7 +666,9 @@ def setup_org_for_a_custom_repo(self, options=None): {'content-view-id': cv_id, 'id': activationkey_id, 'organization-id': org_id} ) except CLIReturnCodeError as err: - raise CLIFactoryError(f'Failed to associate activation-key with CV\n{err.msg}') + raise CLIFactoryError( + f'Failed to associate activation-key with CV\n{err.msg}' + ) from err # Add custom_product subscription to activation-key, if SCA mode is disabled if self._satellite.is_sca_mode_enabled(org_id) is False: @@ -720,10 +727,13 @@ def _setup_org_for_a_rh_repo(self, options=None): # If manifest does not exist, clone and upload it if len(self._satellite.cli.Subscription.exists({'organization-id': org_id})) == 0: with clone() as manifest: - try: - self._satellite.upload_manifest(org_id, manifest.content) - except CLIReturnCodeError as err: - raise CLIFactoryError(f'Failed to upload manifest\n{err.msg}') + self._satellite.put(manifest.path, manifest.name) + try: + self._satellite.cli.Subscription.upload( + {'file': manifest.name, 'organization-id': org_id} + ) + except CLIReturnCodeError as err: + raise CLIFactoryError(f'Failed to upload manifest\n{err.msg}') from err # Enable repo from Repository Set try: self._satellite.cli.RepositorySet.enable( @@ -736,7 +746,7 @@ def _setup_org_for_a_rh_repo(self, options=None): } ) except CLIReturnCodeError as err: - raise CLIFactoryError(f'Failed to enable repository set\n{err.msg}') + raise CLIFactoryError(f'Failed to enable repository set\n{err.msg}') from err # Fetch repository info try: rhel_repo = self._satellite.cli.Repository.info( @@ -747,7 +757,7 @@ def _setup_org_for_a_rh_repo(self, options=None): } ) except CLIReturnCodeError as err: - raise CLIFactoryError(f'Failed to fetch repository info\n{err.msg}') + raise CLIFactoryError(f'Failed to fetch repository info\n{err.msg}') from err # Synchronize the RH repository try: self._satellite.cli.Repository.synchronize( @@ -758,7 +768,7 @@ def _setup_org_for_a_rh_repo(self, options=None): } ) except CLIReturnCodeError as err: - raise CLIFactoryError(f'Failed to synchronize repository\n{err.msg}') + raise CLIFactoryError(f'Failed to synchronize repository\n{err.msg}') from err # Create CV if needed and associate repo with it if options.get('content-view-id') is None: cv_id = self.make_content_view({'organization-id': org_id})['id'] @@ -769,24 +779,28 @@ def _setup_org_for_a_rh_repo(self, options=None): {'id': cv_id, 'organization-id': org_id, 'repository-id': rhel_repo['id']} ) except CLIReturnCodeError as err: - raise CLIFactoryError(f'Failed to add repository to content view\n{err.msg}') + raise CLIFactoryError(f'Failed to add repository to content view\n{err.msg}') from err # Publish a new version of CV try: self._satellite.cli.ContentView.publish({'id': cv_id}) except CLIReturnCodeError as err: - raise CLIFactoryError(f'Failed to publish new version of content view\n{err.msg}') + raise CLIFactoryError( + f'Failed to publish new version of content view\n{err.msg}' + ) from err # Get the version id try: cvv = self._satellite.cli.ContentView.info({'id': cv_id})['versions'][-1] except CLIReturnCodeError as err: - raise CLIFactoryError(f'Failed to fetch content view info\n{err.msg}') + raise CLIFactoryError(f'Failed to fetch content view info\n{err.msg}') from err # Promote version1 to next env try: self._satellite.cli.ContentView.version_promote( {'id': cvv['id'], 'organization-id': org_id, 'to-lifecycle-environment-id': env_id} ) except CLIReturnCodeError as err: - raise CLIFactoryError(f'Failed to promote version to next environment\n{err.msg}') + raise CLIFactoryError( + f'Failed to promote version to next environment\n{err.msg}' + ) from err # Create activation key if needed and associate content view with it if options.get('activationkey-id') is None: activationkey_id = self.make_activation_key( @@ -805,7 +819,9 @@ def _setup_org_for_a_rh_repo(self, options=None): {'id': activationkey_id, 'organization-id': org_id, 'content-view-id': cv_id} ) except CLIReturnCodeError as err: - raise CLIFactoryError(f'Failed to associate activation-key with CV\n{err.msg}') + raise CLIFactoryError( + f'Failed to associate activation-key with CV\n{err.msg}' + ) from err # Add default subscription to activation-key, if SCA mode is disabled if self._satellite.is_sca_mode_enabled(org_id) is False: @@ -876,7 +892,7 @@ def setup_org_for_a_rh_repo( } ) except CLIReturnCodeError as err: - raise CLIFactoryError(f'Failed to upload manifest\n{err.msg}') + raise CLIFactoryError(f'Failed to upload manifest\n{err.msg}') from err # Add default subscription to activation-key, if SCA mode is disabled if self._satellite.is_sca_mode_enabled(result['organization-id']) is False: @@ -1086,7 +1102,7 @@ def setup_cdn_and_custom_repos_content( try: self._satellite.upload_manifest(org_id, interface='CLI') except CLIReturnCodeError as err: - raise CLIFactoryError(f'Failed to upload manifest\n{err.msg}') + raise CLIFactoryError(f'Failed to upload manifest\n{err.msg}') from err custom_product, repos_info = self.setup_cdn_and_custom_repositories( org_id=org_id, repos=repos, download_policy=download_policy diff --git a/robottelo/host_helpers/repository_mixins.py b/robottelo/host_helpers/repository_mixins.py index 968b0ffea4..aeb06a0c97 100644 --- a/robottelo/host_helpers/repository_mixins.py +++ b/robottelo/host_helpers/repository_mixins.py @@ -826,7 +826,7 @@ def setup_virtual_machine( patch_os_release_distro = self.os_repo.distro rh_repo_ids = [] if enable_rh_repos: - rh_repo_ids = [getattr(repo, 'rh_repository_id') for repo in self.rh_repos] + rh_repo_ids = [repo.rh_repository_id for repo in self.rh_repos] repo_labels = [] if enable_custom_repos: repo_labels = [ diff --git a/robottelo/host_helpers/satellite_mixins.py b/robottelo/host_helpers/satellite_mixins.py index 751e9607ff..312ec7e49f 100644 --- a/robottelo/host_helpers/satellite_mixins.py +++ b/robottelo/host_helpers/satellite_mixins.py @@ -1,10 +1,10 @@ import contextlib -from functools import cache import io import os import random import re +from cachetools import cachedmethod import requests from robottelo.cli.proxy import CapsuleTunnelError @@ -188,7 +188,7 @@ def publish_content_view(self, org, repo_list): :returns: A dictionary containing the details of the published content view. """ - repo = repo_list if type(repo_list) is list else [repo_list] + repo = repo_list if isinstance(repo_list, list) else [repo_list] content_view = self.api.ContentView(organization=org, repository=repo).create() content_view.publish() content_view = content_view.read() @@ -235,9 +235,9 @@ def available_capsule_port(self): :rtype: int """ port_pool_range = settings.fake_capsules.port_range - if type(port_pool_range) is str: + if isinstance(port_pool_range, list): port_pool_range = tuple(port_pool_range.split('-')) - if type(port_pool_range) is tuple and len(port_pool_range) == 2: + if isinstance(port_pool_range, tuple) and len(port_pool_range) == 2: port_pool = range(int(port_pool_range[0]), int(port_pool_range[1])) else: raise TypeError( @@ -263,14 +263,14 @@ def available_capsule_port(self): except ValueError: raise CapsuleTunnelError( f'Failed parsing the port numbers from stdout: {ss_cmd.stdout.splitlines()[:-1]}' - ) + ) from None try: # take the list of available ports and return randomly selected one return random.choice([port for port in port_pool if port not in used_ports]) except IndexError: raise CapsuleTunnelError( 'Failed to create ssh tunnel: No more ports available for mapping' - ) + ) from None @contextlib.contextmanager def default_url_on_new_port(self, oldport, newport): @@ -308,7 +308,7 @@ def validate_pulp_filepath( self, org, dir_path, - file_names=['*.json', '*.tar.gz'], + file_names=('*.json', '*.tar.gz'), ): """Checks the existence of certain files in a pulp dir""" extension_query = ' -o '.join([f'-name "{file}"' for file in file_names]) @@ -358,6 +358,6 @@ def api_factory(self): self._api_factory = APIFactory(self) return self._api_factory - @cache + @cachedmethod def ui_factory(self, session): return UIFactory(self, session=session) diff --git a/robottelo/host_helpers/ui_factory.py b/robottelo/host_helpers/ui_factory.py index cb85436051..df156ad6d6 100644 --- a/robottelo/host_helpers/ui_factory.py +++ b/robottelo/host_helpers/ui_factory.py @@ -18,12 +18,14 @@ def __init__(self, satellite, session=None): def create_fake_host( self, host, - interface_id=gen_string('alpha'), + interface_id=None, global_parameters=None, host_parameters=None, extra_values=None, new_host_details=False, ): + if interface_id is None: + interface_id = gen_string('alpha') if extra_values is None: extra_values = {} os_name = f'{host.operatingsystem.name} {host.operatingsystem.major}' diff --git a/robottelo/hosts.py b/robottelo/hosts.py index 439b5012a9..ed313eaeed 100644 --- a/robottelo/hosts.py +++ b/robottelo/hosts.py @@ -17,6 +17,7 @@ from box import Box from broker import Broker from broker.hosts import Host +from cachetools import cachedmethod from dynaconf.vendor.box.exceptions import BoxKeyError from fauxfactory import gen_alpha, gen_string from manifester import Manifester @@ -414,11 +415,11 @@ def power_control(self, state=VmState.RUNNING, ensure=True): try: vm_operation = POWER_OPERATIONS.get(state) workflow_name = settings.broker.host_workflows.power_control - except (AttributeError, KeyError): + except (AttributeError, KeyError) as err: raise NotImplementedError( 'No workflow in broker.host_workflows for power control, ' 'or VM operation not supported' - ) + ) from err assert ( # TODO read the kwarg name from settings too? Broker() @@ -525,10 +526,12 @@ def subscription_manager_status(self): def subscription_manager_list(self): return self.execute('subscription-manager list') - def subscription_manager_get_pool(self, sub_list=[]): + def subscription_manager_get_pool(self, sub_list=None): """ Return pool ids for the corresponding subscriptions in the list """ + if sub_list is None: + sub_list = [] pool_ids = [] for sub in sub_list: result = self.execute( @@ -540,10 +543,12 @@ def subscription_manager_get_pool(self, sub_list=[]): pool_ids.append(result) return pool_ids - def subscription_manager_attach_pool(self, pool_list=[]): + def subscription_manager_attach_pool(self, pool_list=None): """ Attach pool ids to the host and return the result """ + if pool_list is None: + pool_list = [] result = [] for pool in pool_list: result.append(self.execute(f'subscription-manager attach --pool={pool}')) @@ -621,6 +626,7 @@ def install_katello_ca(self, satellite): warnings.warn( message='The install_katello_ca method is deprecated, use the register method instead.', category=DeprecationWarning, + stacklevel=2, ) self._satellite = satellite self.execute( @@ -673,6 +679,7 @@ def install_capsule_katello_ca(self, capsule=None): 'use the register method instead.' ), category=DeprecationWarning, + stacklevel=2, ) url = urlunsplit(('http', capsule, 'pub/', '', '')) ca_url = urljoin(url, 'katello-ca-consumer-latest.noarch.rpm') @@ -1444,8 +1451,10 @@ def install_tracer(self): raise ContentHostError('There was an error installing katello-host-tools-tracer') self.execute('katello-tracer-upload') - def register_to_cdn(self, pool_ids=[settings.subscription.rhn_poolid]): + def register_to_cdn(self, pool_ids=None): """Subscribe satellite to CDN""" + if pool_ids is None: + pool_ids = [settings.subscription.rhn_poolid] self.remove_katello_ca() cmd_result = self.register_contenthost( org=None, @@ -2274,7 +2283,7 @@ def get_rhsso_client_id(self): break return client_id - @lru_cache + @cachedmethod def get_rhsso_user_details(self, username): """Getter method to receive the user id""" result = self.execute( @@ -2283,7 +2292,7 @@ def get_rhsso_user_details(self, username): result_json = json.loads(result.stdout) return result_json[0] - @lru_cache + @cachedmethod def get_rhsso_groups_details(self, group_name): """Getter method to receive the group id""" result = self.execute(f"{KEY_CLOAK_CLI} get groups -r {settings.rhsso.realm}") diff --git a/robottelo/utils/decorators/func_locker.py b/robottelo/utils/decorators/func_locker.py index 2d575d8f56..4d82c3add2 100644 --- a/robottelo/utils/decorators/func_locker.py +++ b/robottelo/utils/decorators/func_locker.py @@ -227,8 +227,8 @@ def lock_function( def main_wrapper(func): - setattr(func, '__class_name__', class_name) - setattr(func, '__function_locked__', True) + func.__class_name__ = class_name + func.__function_locked__ = True @functools.wraps(func) def function_wrapper(*args, **kwargs): diff --git a/robottelo/utils/decorators/func_shared/shared.py b/robottelo/utils/decorators/func_shared/shared.py index 62e529b8d8..072ebc3fb4 100644 --- a/robottelo/utils/decorators/func_shared/shared.py +++ b/robottelo/utils/decorators/func_shared/shared.py @@ -392,8 +392,7 @@ def __call__(self): # if was not able to restore the original exception raise this one raise SharedFunctionException( - 'Error generated by process: {} Exception: {}' - ' error: {}'.format(pid, error_class_name, error) + f'Error generated by process: {pid} Exception: {error_class_name} error: {error}' ) if not call_function and self._inject: diff --git a/robottelo/utils/ohsnap.py b/robottelo/utils/ohsnap.py index 7449476611..89eb6a97e2 100644 --- a/robottelo/utils/ohsnap.py +++ b/robottelo/utils/ohsnap.py @@ -90,7 +90,9 @@ def dogfood_repository( try: repository = next(r for r in res.json() if r['label'] == repo) except StopIteration: - raise RepositoryDataNotFound(f'Repository "{repo}" is not provided by the given product') + raise RepositoryDataNotFound( + f'Repository "{repo}" is not provided by the given product' + ) from None repository['baseurl'] = repository['baseurl'].replace('$basearch', arch) # If repo check is enabled, check that the repository actually exists on the remote server dogfood_req = requests.get(repository['baseurl']) diff --git a/robottelo/utils/virtwho.py b/robottelo/utils/virtwho.py index 8c7a6c4865..aaae57d7c9 100644 --- a/robottelo/utils/virtwho.py +++ b/robottelo/utils/virtwho.py @@ -301,9 +301,9 @@ def get_hypervisor_ahv_mapping(hypervisor_type): # Always check the last json section to get the host_uuid for item in mapping: if 'entities' in item: - for item in item['entities']: - if 'host_uuid' in item: - system_uuid = item['host_uuid'] + for _item in item['entities']: + if 'host_uuid' in _item: + system_uuid = _item['host_uuid'] break message = f"Host UUID {system_uuid} found for VM: {guest_uuid}" for line in logs.split('\n'): @@ -384,8 +384,8 @@ def deploy_configure_by_command_check(command): virtwho_cleanup() try: ret, stdout = runcmd(command) - except Exception: - raise VirtWhoError(f"Failed to deploy configure by {command}") + except Exception as err: + raise VirtWhoError(f"Failed to deploy configure by {command}") from err else: if ret != 0 or 'Finished successfully' not in stdout: raise VirtWhoError(f"Failed to deploy configure by {command}") @@ -410,7 +410,7 @@ def update_configure_option(option, value, config_file): :param value: set the option to the value :param config_file: path of virt-who config file """ - cmd = 'sed -i "s|^{0}.*|{0}={1}|g" {2}'.format(option, value, config_file) + cmd = f'sed -i "s|^{option}.*|{option}={value}|g" {config_file}' ret, output = runcmd(cmd) if ret != 0: raise VirtWhoError(f"Failed to set option {option} value to {value}") @@ -422,7 +422,7 @@ def delete_configure_option(option, config_file): :param option: the option you want to delete :param config_file: path of virt-who config file """ - cmd = 'sed -i "/^{0}/d" {1}; sed -i "/^#{0}/d" {1}'.format(option, config_file) + cmd = f'sed -i "/^{option}/d" {config_file}; sed -i "/^#{option}/d" {config_file}' ret, output = runcmd(cmd) if ret != 0: raise VirtWhoError(f"Failed to delete option {option}") @@ -437,11 +437,11 @@ def add_configure_option(option, value, config_file): """ try: get_configure_option(option, config_file) - except Exception: + except Exception as err: cmd = f'echo -e "\n{option}={value}" >> {config_file}' - ret, output = runcmd(cmd) + ret, _ = runcmd(cmd) if ret != 0: - raise VirtWhoError(f"Failed to add option {option}={value}") + raise VirtWhoError(f"Failed to add option {option}={value}") from err else: raise VirtWhoError(f"option {option} is already exist in {config_file}") @@ -456,9 +456,9 @@ def hypervisor_json_create(hypervisors, guests): :param guests: how many guests will be created """ hypervisors_list = [] - for i in range(hypervisors): + for _ in range(hypervisors): guest_list = [] - for c in range(guests): + for _ in range(guests): guest_list.append( { "guestId": str(uuid.uuid4()), diff --git a/tests/foreman/api/test_acs.py b/tests/foreman/api/test_acs.py index 8294f36366..7821db07fc 100644 --- a/tests/foreman/api/test_acs.py +++ b/tests/foreman/api/test_acs.py @@ -123,7 +123,7 @@ def test_positive_run_bulk_actions(module_target_sat, module_yum_repo): 2. Only the proper ACSes are deleted on bulk destroy. """ acs_ids = [] - for i in range(3): + for _ in range(3): acs = module_target_sat.api.AlternateContentSource( name=gen_string('alpha'), alternate_content_source_type='simplified', diff --git a/tests/foreman/api/test_ansible.py b/tests/foreman/api/test_ansible.py index eca139145d..730e469b0e 100644 --- a/tests/foreman/api/test_ansible.py +++ b/tests/foreman/api/test_ansible.py @@ -240,10 +240,14 @@ def test_add_and_remove_ansible_role_hostgroup(target_sat): for role in ROLE_NAMES ] target_sat.api.HostGroup(id=hg.id).assign_ansible_roles(data={'ansible_role_ids': ROLES[:2]}) - for r1, r2 in zip(target_sat.api.HostGroup(id=hg.id).list_ansible_roles(), ROLE_NAMES[:2]): + for r1, r2 in zip( + target_sat.api.HostGroup(id=hg.id).list_ansible_roles(), ROLE_NAMES[:2], strict=True + ): assert r1['name'] == r2 target_sat.api.HostGroup(id=hg.id).add_ansible_role(data={'ansible_role_id': ROLES[2]}) - for r1, r2 in zip(target_sat.api.HostGroup(id=hg.id).list_ansible_roles(), ROLE_NAMES): + for r1, r2 in zip( + target_sat.api.HostGroup(id=hg.id).list_ansible_roles(), ROLE_NAMES, strict=True + ): assert r1['name'] == r2 for role in ROLES: diff --git a/tests/foreman/api/test_discoveredhost.py b/tests/foreman/api/test_discoveredhost.py index 5ecc02e1e5..df8444c951 100644 --- a/tests/foreman/api/test_discoveredhost.py +++ b/tests/foreman/api/test_discoveredhost.py @@ -67,9 +67,9 @@ def _assert_discovered_host(host, channel=None, user_config=None): ]: try: dhcp_pxe = _wait_for_log(channel, pattern[0], timeout=10) - except TimedOutError: + except TimedOutError as err: # raise assertion error - raise AssertionError(f'Timed out waiting for {pattern[1]} from VM') + raise AssertionError(f'Timed out waiting for {pattern[1]} from VM') from err groups = re.search('DHCPACK on (\\d.+) to', dhcp_pxe.out) assert len(groups.groups()) == 1, 'Unable to parse bootloader ip address' pxe_ip = groups.groups()[0] @@ -82,9 +82,9 @@ def _assert_discovered_host(host, channel=None, user_config=None): ]: try: _wait_for_log(channel, pattern[0], timeout=20) - except TimedOutError: + except TimedOutError as err: # raise assertion error - raise AssertionError(f'Timed out waiting for VM (tftp) to fetch {pattern[1]}') + raise AssertionError(f'Timed out waiting for VM (tftp) to fetch {pattern[1]}') from err # assert that server receives DHCP discover from FDI for pattern in [ ( @@ -95,9 +95,9 @@ def _assert_discovered_host(host, channel=None, user_config=None): ]: try: dhcp_fdi = _wait_for_log(channel, pattern[0], timeout=30) - except TimedOutError: + except TimedOutError as err: # raise assertion error - raise AssertionError(f'Timed out waiting for {pattern[1]} from VM') + raise AssertionError(f'Timed out waiting for {pattern[1]} from VM') from err groups = re.search('DHCPACK on (\\d.+) to', dhcp_fdi.out) assert len(groups.groups()) == 1, 'Unable to parse FDI ip address' fdi_ip = groups.groups()[0] @@ -109,17 +109,17 @@ def _assert_discovered_host(host, channel=None, user_config=None): f'"/api/v2/discovered_hosts/facts" for {fdi_ip}', timeout=60, ) - except TimedOutError: + except TimedOutError as err: # raise assertion error - raise AssertionError('Timed out waiting for /facts POST request') + raise AssertionError('Timed out waiting for /facts POST request') from err groups = re.search('\\[I\\|app\\|([a-z0-9]+)\\]', facts_fdi.out) assert len(groups.groups()) == 1, 'Unable to parse POST request UUID' req_id = groups.groups()[0] try: _wait_for_log(channel, f'\\[I\\|app\\|{req_id}\\] Completed 201 Created') - except TimedOutError: + except TimedOutError as err: # raise assertion error - raise AssertionError('Timed out waiting for "/facts" 201 response') + raise AssertionError('Timed out waiting for "/facts" 201 response') from err default_config = entity_mixins.DEFAULT_SERVER_CONFIG try: wait_for( @@ -133,8 +133,10 @@ def _assert_discovered_host(host, channel=None, user_config=None): delay=2, logger=logger, ) - except TimedOutError: - raise AssertionError('Timed out waiting for discovered_host to appear on satellite') + except TimedOutError as err: + raise AssertionError( + 'Timed out waiting for discovered_host to appear on satellite' + ) from err discovered_host = host.api.DiscoveredHost(user_config or default_config).search( query={'search': f'name={host.guest_name}'} ) @@ -148,8 +150,8 @@ def assert_discovered_host_provisioned(channel, ksrepo): try: log = _wait_for_log(channel, pattern, timeout=300, delay=10) assert pattern in log - except TimedOutError: - raise AssertionError(f'Timed out waiting for {pattern} from VM') + except TimedOutError as err: + raise AssertionError(f'Timed out waiting for {pattern} from VM') from err @pytest.fixture @@ -429,7 +431,7 @@ def test_positive_reboot_all_pxe_hosts( host.power_control(ensure=False) mac = host._broker_args['provisioning_nic_mac_addr'] wait_for( - lambda: sat.api.DiscoveredHost().search(query={'mac': mac}) != [], + lambda: sat.api.DiscoveredHost().search(query={'mac': mac}) != [], # noqa: B023 timeout=240, delay=20, ) diff --git a/tests/foreman/api/test_host.py b/tests/foreman/api/test_host.py index 28dcda9517..94730d5692 100644 --- a/tests/foreman/api/test_host.py +++ b/tests/foreman/api/test_host.py @@ -955,7 +955,7 @@ def test_positive_read_content_source_id( 'lifecycle_environment_id': module_lce.id, }, ).create() - content_facet_attributes = getattr(host, 'content_facet_attributes') + content_facet_attributes = host.content_facet_attributes assert content_facet_attributes is not None content_source_id = content_facet_attributes.get('content_source_id') assert content_source_id is not None diff --git a/tests/foreman/api/test_media.py b/tests/foreman/api/test_media.py index b29339448c..79c5cb7f20 100644 --- a/tests/foreman/api/test_media.py +++ b/tests/foreman/api/test_media.py @@ -36,7 +36,9 @@ def class_media(self, module_org, class_target_sat): @pytest.mark.upgrade @pytest.mark.parametrize( ('name', 'new_name'), - **parametrized(list(zip(valid_data_list().values(), valid_data_list().values()))) + **parametrized( + list(zip(valid_data_list().values(), valid_data_list().values(), strict=True)) + ) ) def test_positive_crud_with_name(self, module_org, name, new_name, module_target_sat): """Create, update, delete media with valid name only diff --git a/tests/foreman/api/test_notifications.py b/tests/foreman/api/test_notifications.py index c2f1582f7d..6ab89e9f4f 100644 --- a/tests/foreman/api/test_notifications.py +++ b/tests/foreman/api/test_notifications.py @@ -134,11 +134,11 @@ def wait_for_mail(sat_obj, mailbox_file, contains_string, timeout=300, delay=5): timeout=timeout, delay=delay, ) - except TimedOutError: + except TimedOutError as err: raise AssertionError( f'No e-mail with text "{contains_string}" has arrived to mailbox {mailbox_file} ' f'after {timeout} seconds.' - ) + ) from err return True diff --git a/tests/foreman/api/test_organization.py b/tests/foreman/api/test_organization.py index 4ec6a3e850..89988935f9 100644 --- a/tests/foreman/api/test_organization.py +++ b/tests/foreman/api/test_organization.py @@ -225,7 +225,7 @@ def test_positive_update_name(self, module_org, name): :parametrized: yes """ - setattr(module_org, 'name', name) + module_org.name = name module_org = module_org.update(['name']) assert module_org.name == name @@ -242,7 +242,7 @@ def test_positive_update_description(self, module_org, desc): :parametrized: yes """ - setattr(module_org, 'description', desc) + module_org.description = desc module_org = module_org.update(['description']) assert module_org.description == desc diff --git a/tests/foreman/api/test_partitiontable.py b/tests/foreman/api/test_partitiontable.py index 2a9012e1a6..9b8e2a29d2 100644 --- a/tests/foreman/api/test_partitiontable.py +++ b/tests/foreman/api/test_partitiontable.py @@ -61,6 +61,7 @@ def test_positive_create_with_one_character_name(self, target_sat, name): zip( generate_strings_list(length=gen_integer(4, 30)), generate_strings_list(length=gen_integer(4, 30)), + strict=True, ) ) ), @@ -90,7 +91,8 @@ def test_positive_crud_with_name(self, target_sat, name, new_name): @pytest.mark.tier1 @pytest.mark.parametrize( - ('layout', 'new_layout'), **parametrized(list(zip(valid_data_list(), valid_data_list()))) + ('layout', 'new_layout'), + **parametrized(list(zip(valid_data_list(), valid_data_list(), strict=True))), ) def test_positive_create_update_with_layout(self, target_sat, layout, new_layout): """Create new and update partition tables using different inputs as a diff --git a/tests/foreman/api/test_provisioning.py b/tests/foreman/api/test_provisioning.py index 481dd84f1f..47dcc8d54a 100644 --- a/tests/foreman/api/test_provisioning.py +++ b/tests/foreman/api/test_provisioning.py @@ -55,8 +55,8 @@ def assert_host_logs(channel, pattern): try: log = _wait_for_log(channel, pattern, timeout=300, delay=10) assert pattern in log - except TimedOutError: - raise AssertionError(f'Timed out waiting for {pattern} from VM') + except TimedOutError as err: + raise AssertionError(f'Timed out waiting for {pattern} from VM') from err @pytest.mark.e2e diff --git a/tests/foreman/api/test_repository.py b/tests/foreman/api/test_repository.py index dd7ce7bb3a..9b908dbada 100644 --- a/tests/foreman/api/test_repository.py +++ b/tests/foreman/api/test_repository.py @@ -2540,6 +2540,17 @@ def test_positive_create_with_long_token( container_repo = container_repos[0] except IndexError: pytest.skip('No registries with "long_pass" set to true') + + to_clean = [] + + @request.addfinalizer + def clean_repos(): + for repo in to_clean: + try: + repo.delete(synchronous=False) + except Exception: + logger.exception(f'Exception cleaning up docker repo:\n{repo}') + for docker_repo_name in container_repo.repos_to_sync: repo_options = dict( content_type='docker', @@ -2557,13 +2568,7 @@ def test_positive_create_with_long_token( pytest.skip('The "long_pass" registry does not meet length requirement') repo = module_target_sat.api.Repository(**repo_options).create() - - @request.addfinalizer - def clean_repo(): - try: - repo.delete(synchronous=False) - except Exception: - logger.exception('Exception cleaning up docker repo:') + to_clean.append(repo) repo = repo.read() for field in 'name', 'docker_upstream_name', 'content_type', 'upstream_username': @@ -2590,6 +2595,17 @@ def test_positive_tag_whitelist( :expectedresults: multiple products and repos are created """ container_repo = getattr(settings.container_repo.registries, repo_key) + + to_clean = [] + + @request.addfinalizer + def clean_repos(): + for repo in to_clean: + try: + repo.delete(synchronous=False) + except Exception: + logger.exception(f'Exception cleaning up docker repo:\n{repo}') + for docker_repo_name in container_repo.repos_to_sync: repo_options = dict( content_type='docker', @@ -2604,13 +2620,7 @@ def test_positive_tag_whitelist( repo_options['product'] = module_product repo = module_target_sat.api.Repository(**repo_options).create() - - @request.addfinalizer - def clean_repo(): - try: - repo.delete(synchronous=False) - except Exception: - logger.exception('Exception cleaning up docker repo:') + to_clean.append(repo) for field in 'name', 'docker_upstream_name', 'content_type', 'upstream_username': assert getattr(repo, field) == repo_options[field] diff --git a/tests/foreman/api/test_role.py b/tests/foreman/api/test_role.py index 2499d48559..fe6807734e 100644 --- a/tests/foreman/api/test_role.py +++ b/tests/foreman/api/test_role.py @@ -32,7 +32,7 @@ class TestRole: @pytest.mark.upgrade @pytest.mark.parametrize( ('name', 'new_name'), - **parametrized(list(zip(generate_strings_list(), generate_strings_list()))), + **parametrized(list(zip(generate_strings_list(), generate_strings_list(), strict=True))), ) def test_positive_crud(self, name, new_name, target_sat): """Create, update and delete role with name ``name_generator()``. diff --git a/tests/foreman/api/test_webhook.py b/tests/foreman/api/test_webhook.py index dbe0e57523..b6cb3036b5 100644 --- a/tests/foreman/api/test_webhook.py +++ b/tests/foreman/api/test_webhook.py @@ -56,8 +56,8 @@ def assert_event_triggered(channel, event): try: log = _wait_for_log(channel, pattern) assert pattern in log - except TimedOutError: - raise AssertionError(f'Timed out waiting for {pattern} from VM') + except TimedOutError as err: + raise AssertionError(f'Timed out waiting for {pattern} from VM') from err class TestWebhook: diff --git a/tests/foreman/cli/test_errata.py b/tests/foreman/cli/test_errata.py index d1975547de..b08e2882dd 100644 --- a/tests/foreman/cli/test_errata.py +++ b/tests/foreman/cli/test_errata.py @@ -108,7 +108,7 @@ def products_with_repos(orgs, module_target_sat): """Create and return a list of products. For each product, create and sync a single repo.""" products = [] # Create one product for each org, and a second product for the last org. - for org, params in zip(orgs + orgs[-1:], REPOS_WITH_ERRATA): + for org, params in zip(orgs + orgs[-1:], REPOS_WITH_ERRATA, strict=True): product = module_target_sat.api.Product(organization=org).create() # Replace the organization entity returned by create(), which contains only the id, # with the one we already have. @@ -334,7 +334,7 @@ def check_errata(errata_ids, by_org=False): :param errata_ids: a list containing a list of errata ids for each repo :type errata_ids: list[list] """ - for ids, repo_with_errata in zip(errata_ids, REPOS_WITH_ERRATA): + for ids, repo_with_errata in zip(errata_ids, REPOS_WITH_ERRATA, strict=True): assert len(ids) == repo_with_errata['org_errata_count' if by_org else 'errata_count'] assert repo_with_errata['errata_id'] in ids diff --git a/tests/foreman/cli/test_host.py b/tests/foreman/cli/test_host.py index a3a59102d6..026168b8f6 100644 --- a/tests/foreman/cli/test_host.py +++ b/tests/foreman/cli/test_host.py @@ -1719,11 +1719,11 @@ def test_positive_erratum_applicability( timeout=300, delay=5, ) - except TimedOutError: + except TimedOutError as err: raise TimedOutError( f"Timed out waiting for erratum \"{setup_custom_repo['security_errata']}\"" " to disappear from the list" - ) + ) from err @pytest.mark.cli_katello_host_tools diff --git a/tests/foreman/cli/test_model.py b/tests/foreman/cli/test_model.py index d06e392b6b..8fc51be9f6 100644 --- a/tests/foreman/cli/test_model.py +++ b/tests/foreman/cli/test_model.py @@ -35,7 +35,9 @@ def class_model(self, target_sat): @pytest.mark.upgrade @pytest.mark.parametrize( ('name', 'new_name'), - **parametrized(list(zip(valid_data_list().values(), valid_data_list().values()))) + **parametrized( + list(zip(valid_data_list().values(), valid_data_list().values(), strict=True)) + ) ) def test_positive_crud_with_name(self, name, new_name, module_target_sat): """Successfully creates, updates and deletes a Model. diff --git a/tests/foreman/cli/test_partitiontable.py b/tests/foreman/cli/test_partitiontable.py index 352602eef8..35e52cbbe6 100644 --- a/tests/foreman/cli/test_partitiontable.py +++ b/tests/foreman/cli/test_partitiontable.py @@ -50,6 +50,7 @@ def test_positive_create_with_one_character_name(self, name, target_sat): zip( generate_strings_list(length=randint(4, 30)), generate_strings_list(length=randint(4, 30)), + strict=True, ) ) ) diff --git a/tests/foreman/cli/test_ping.py b/tests/foreman/cli/test_ping.py index 69727dd3d0..0a28814323 100644 --- a/tests/foreman/cli/test_ping.py +++ b/tests/foreman/cli/test_ping.py @@ -47,7 +47,7 @@ def test_positive_ping(target_sat, switch_user): # iterate over the lines grouping every 3 lines # example [1, 2, 3, 4, 5, 6] will return [(1, 2, 3), (4, 5, 6)] # only the status line is relevant for this test - for _, status, _ in zip(*[iter(result.stdout)] * 3): + for _, status, _ in zip(*[iter(result.stdout)] * 3, strict=False): # should this be strict? status_count += 1 if status.split(':')[1].strip().lower() == 'ok': diff --git a/tests/foreman/cli/test_remoteexecution.py b/tests/foreman/cli/test_remoteexecution.py index def7f8688e..45c2183e9d 100644 --- a/tests/foreman/cli/test_remoteexecution.py +++ b/tests/foreman/cli/test_remoteexecution.py @@ -75,7 +75,7 @@ def assert_job_invocation_result( result = sat.cli.JobInvocation.info({'id': invocation_command_id}) try: assert result[expected_result] == '1' - except AssertionError: + except AssertionError as err: raise AssertionError( 'host output: {}'.format( ' '.join( @@ -84,7 +84,7 @@ def assert_job_invocation_result( ) ) ) - ) + ) from err def assert_job_invocation_status(sat, invocation_command_id, client_hostname, status): @@ -93,7 +93,7 @@ def assert_job_invocation_status(sat, invocation_command_id, client_hostname, st result = sat.cli.JobInvocation.info({'id': invocation_command_id}) try: assert result['status'] == status - except AssertionError: + except AssertionError as err: raise AssertionError( 'host output: {}'.format( ' '.join( @@ -102,7 +102,7 @@ def assert_job_invocation_status(sat, invocation_command_id, client_hostname, st ) ) ) - ) + ) from err class TestRemoteExecution: diff --git a/tests/foreman/cli/test_report.py b/tests/foreman/cli/test_report.py index 7ef9e7fc9e..b46c3881a1 100644 --- a/tests/foreman/cli/test_report.py +++ b/tests/foreman/cli/test_report.py @@ -79,7 +79,7 @@ def test_positive_install_configure_host( :BZ: 2126891, 2026239 """ puppet_infra_host = [session_puppet_enabled_sat, session_puppet_enabled_capsule] - for client, puppet_proxy in zip(content_hosts, puppet_infra_host): + for client, puppet_proxy in zip(content_hosts, puppet_infra_host, strict=True): client.configure_puppet(proxy_hostname=puppet_proxy.hostname) report = session_puppet_enabled_sat.cli.ConfigReport.list( {'search': f'host~{client.hostname},origin=Puppet'} diff --git a/tests/foreman/cli/test_repository.py b/tests/foreman/cli/test_repository.py index 184536c02c..b43da6e4e8 100644 --- a/tests/foreman/cli/test_repository.py +++ b/tests/foreman/cli/test_repository.py @@ -265,7 +265,7 @@ def test_positive_create_with_auth_yum_repo(self, repo_options, repo): for key in 'url', 'content-type': assert repo.get(key) == repo_options[key] repo = entities.Repository(id=repo['id']).read() - assert getattr(repo, 'upstream_username') == repo_options['upstream-username'] + assert repo.upstream_username == repo_options['upstream-username'] @pytest.mark.tier1 @pytest.mark.upgrade diff --git a/tests/foreman/cli/test_role.py b/tests/foreman/cli/test_role.py index 90f12c6ce4..5eb4e8569f 100644 --- a/tests/foreman/cli/test_role.py +++ b/tests/foreman/cli/test_role.py @@ -30,7 +30,9 @@ class TestRole: @pytest.mark.parametrize( ('name', 'new_name'), **parametrized( - list(zip(generate_strings_list(length=10), generate_strings_list(length=10))) + list( + zip(generate_strings_list(length=10), generate_strings_list(length=10), strict=True) + ) ), ) def test_positive_crud_with_name(self, name, new_name, module_target_sat): diff --git a/tests/foreman/destructive/test_capsulecontent.py b/tests/foreman/destructive/test_capsulecontent.py index e746b2cc8d..12f3455c08 100644 --- a/tests/foreman/destructive/test_capsulecontent.py +++ b/tests/foreman/destructive/test_capsulecontent.py @@ -65,7 +65,7 @@ def test_positive_sync_without_deadlock( cv = target_sat.publish_content_view(function_entitlement_manifest_org, repo) - for i in range(4): + for _ in range(4): copy_id = target_sat.api.ContentView(id=cv.id).copy(data={'name': gen_alpha()})['id'] copy_cv = target_sat.api.ContentView(id=copy_id).read() copy_cv.publish() diff --git a/tests/foreman/destructive/test_discoveredhost.py b/tests/foreman/destructive/test_discoveredhost.py index 79645a1eb7..bcf73a14ed 100644 --- a/tests/foreman/destructive/test_discoveredhost.py +++ b/tests/foreman/destructive/test_discoveredhost.py @@ -65,9 +65,9 @@ def _assert_discovered_host(host, channel=None, user_config=None, sat=None): ]: try: dhcp_pxe = _wait_for_log(channel, pattern[0], timeout=10) - except TimedOutError: + except TimedOutError as err: # raise assertion error - raise AssertionError(f'Timed out waiting for {pattern[1]} from VM') + raise AssertionError(f'Timed out waiting for {pattern[1]} from VM') from err groups = re.search('DHCPACK on (\\d.+) to', dhcp_pxe.out) assert len(groups.groups()) == 1, 'Unable to parse bootloader ip address' @@ -82,9 +82,9 @@ def _assert_discovered_host(host, channel=None, user_config=None, sat=None): ]: try: _wait_for_log(channel, pattern[0], timeout=20) - except TimedOutError: + except TimedOutError as err: # raise assertion error - raise AssertionError(f'Timed out waiting for VM (tftp) to fetch {pattern[1]}') + raise AssertionError(f'Timed out waiting for VM (tftp) to fetch {pattern[1]}') from err # assert that server receives DHCP discover from FDI for pattern in [ @@ -96,9 +96,9 @@ def _assert_discovered_host(host, channel=None, user_config=None, sat=None): ]: try: dhcp_fdi = _wait_for_log(channel, pattern[0], timeout=30) - except TimedOutError: + except TimedOutError as err: # raise assertion error - raise AssertionError(f'Timed out waiting for {pattern[1]} from VM') + raise AssertionError(f'Timed out waiting for {pattern[1]} from VM') from err groups = re.search('DHCPACK on (\\d.+) to', dhcp_fdi.out) assert len(groups.groups()) == 1, 'Unable to parse FDI ip address' fdi_ip = groups.groups()[0] @@ -111,18 +111,18 @@ def _assert_discovered_host(host, channel=None, user_config=None, sat=None): f'"/api/v2/discovered_hosts/facts" for {fdi_ip}', timeout=60, ) - except TimedOutError: + except TimedOutError as err: # raise assertion error - raise AssertionError('Timed out waiting for /facts POST request') + raise AssertionError('Timed out waiting for /facts POST request') from err groups = re.search('\\[I\\|app\\|([a-z0-9]+)\\]', facts_fdi.out) assert len(groups.groups()) == 1, 'Unable to parse POST request UUID' req_id = groups.groups()[0] try: _wait_for_log(channel, f'\\[I\\|app\\|{req_id}\\] Completed 201 Created') - except TimedOutError: + except TimedOutError as err: # raise assertion error - raise AssertionError('Timed out waiting for "/facts" 201 response') + raise AssertionError('Timed out waiting for "/facts" 201 response') from err default_config = entity_mixins.DEFAULT_SERVER_CONFIG @@ -138,8 +138,10 @@ def _assert_discovered_host(host, channel=None, user_config=None, sat=None): delay=2, logger=logger, ) - except TimedOutError: - raise AssertionError('Timed out waiting for discovered_host to appear on satellite') + except TimedOutError as err: + raise AssertionError( + 'Timed out waiting for discovered_host to appear on satellite' + ) from err discovered_host = sat.api.DiscoveredHost(user_config or default_config).search( query={'search': f'name={host.guest_name}'} ) diff --git a/tests/foreman/destructive/test_ldap_authentication.py b/tests/foreman/destructive/test_ldap_authentication.py index 89f312fb99..ecedf803e0 100644 --- a/tests/foreman/destructive/test_ldap_authentication.py +++ b/tests/foreman/destructive/test_ldap_authentication.py @@ -540,7 +540,7 @@ def test_user_permissions_rhsso_user_multiple_group( group_names = ['sat_users', 'sat_admins'] arguments = [{'roles': katello_role.name}, {'admin': 1}] external_auth_source = module_target_sat.cli.ExternalAuthSource.info({'name': "External"}) - for group_name, argument in zip(group_names, arguments): + for group_name, argument in zip(group_names, arguments, strict=True): # adding/creating rhsso groups default_sso_host.create_group(group_name=group_name) default_sso_host.update_rhsso_user(username, group_name=group_name) diff --git a/tests/foreman/destructive/test_remoteexecution.py b/tests/foreman/destructive/test_remoteexecution.py index ce19cc6bb6..c9c6bdb8b2 100644 --- a/tests/foreman/destructive/test_remoteexecution.py +++ b/tests/foreman/destructive/test_remoteexecution.py @@ -126,14 +126,14 @@ def test_positive_use_alternate_directory( result = target_sat.cli.JobInvocation.info({'id': invocation_command['id']}) try: assert result['success'] == '1' - except AssertionError: + except AssertionError as err: output = ' '.join( target_sat.cli.JobInvocation.get_output( {'id': invocation_command['id'], 'host': client.hostname} ) ) result = f'host output: {output}' - raise AssertionError(result) + raise AssertionError(result) from err task = target_sat.cli.Task.list_tasks({'search': command})[0] search = target_sat.cli.Task.list_tasks({'search': f'id={task["id"]}'}) diff --git a/tests/foreman/installer/test_installer.py b/tests/foreman/installer/test_installer.py index f1e0033193..4dc4680905 100644 --- a/tests/foreman/installer/test_installer.py +++ b/tests/foreman/installer/test_installer.py @@ -1354,9 +1354,10 @@ def install_satellite(satellite, installer_args, enable_fapolicyd=False): snap=settings.server.version.snap, ) if enable_fapolicyd: - satellite.execute( - 'dnf -y install fapolicyd && systemctl enable --now fapolicyd' - ).status == 0 + assert ( + satellite.execute('dnf -y install fapolicyd && systemctl enable --now fapolicyd').status + == 0 + ) satellite.execute('dnf -y module enable satellite:el8 && dnf -y install satellite') if enable_fapolicyd: assert satellite.execute('rpm -q foreman-fapolicyd').status == 0 diff --git a/tests/foreman/longrun/test_oscap.py b/tests/foreman/longrun/test_oscap.py index be5d38f389..fa3654f8a4 100644 --- a/tests/foreman/longrun/test_oscap.py +++ b/tests/foreman/longrun/test_oscap.py @@ -210,12 +210,12 @@ def test_positive_oscap_run_via_ansible( try: result = target_sat.cli.JobInvocation.info({'id': job_id})['success'] assert result == '1' - except AssertionError: + except AssertionError as err: output = ' '.join( target_sat.cli.JobInvocation.get_output({'id': job_id, 'host': vm.hostname}) ) result = f'host output: {output}' - raise AssertionError(result) + raise AssertionError(result) from err result = vm.run('cat /etc/foreman_scap_client/config.yaml | grep profile') assert result.status == 0 # Runs the actual oscap scan on the vm/clients and @@ -315,12 +315,12 @@ def test_positive_oscap_run_via_ansible_bz_1814988( try: result = target_sat.cli.JobInvocation.info({'id': job_id})['success'] assert result == '1' - except AssertionError: + except AssertionError as err: output = ' '.join( target_sat.cli.JobInvocation.get_output({'id': job_id, 'host': vm.hostname}) ) result = f'host output: {output}' - raise AssertionError(result) + raise AssertionError(result) from err result = vm.run('cat /etc/foreman_scap_client/config.yaml | grep profile') assert result.status == 0 # Runs the actual oscap scan on the vm/clients and diff --git a/tests/foreman/maintain/test_advanced.py b/tests/foreman/maintain/test_advanced.py index b264cb339c..2771994d56 100644 --- a/tests/foreman/maintain/test_advanced.py +++ b/tests/foreman/maintain/test_advanced.py @@ -22,8 +22,10 @@ def get_satellite_capsule_repos( - x_y_release=sat_x_y_release, product='satellite', os_major_ver=get_sat_rhel_version().major + x_y_release=sat_x_y_release, product='satellite', os_major_ver=None ): + if os_major_ver is None: + os_major_ver = get_sat_rhel_version().major if product == 'capsule': product = 'satellite-capsule' repos = [ diff --git a/tests/foreman/maintain/test_health.py b/tests/foreman/maintain/test_health.py index 4313c37205..e927d85b5a 100644 --- a/tests/foreman/maintain/test_health.py +++ b/tests/foreman/maintain/test_health.py @@ -209,7 +209,7 @@ def test_negative_health_check_upstream_repository(sat_maintain, request): assert result.status == 0 assert 'System has upstream foreman_repo,puppet_repo repositories enabled' in result.stdout assert 'FAIL' in result.stdout - for name in upstream_url.keys(): + for name in upstream_url: result = sat_maintain.execute(f'cat /etc/yum.repos.d/{name}.repo') if name == 'fedorapeople_repo': assert 'enabled=1' in result.stdout @@ -218,7 +218,7 @@ def test_negative_health_check_upstream_repository(sat_maintain, request): @request.addfinalizer def _finalize(): - for name, url in upstream_url.items(): + for name in upstream_url: sat_maintain.execute(f'rm -fr /etc/yum.repos.d/{name}.repo') sat_maintain.execute('dnf clean all') diff --git a/tests/foreman/ui/test_computeresource_vmware.py b/tests/foreman/ui/test_computeresource_vmware.py index f8a7ac9776..e85a406e14 100644 --- a/tests/foreman/ui/test_computeresource_vmware.py +++ b/tests/foreman/ui/test_computeresource_vmware.py @@ -282,8 +282,8 @@ def test_positive_resource_vm_power_management(session): timeout=30, delay=2, ) - except TimedOutError: - raise AssertionError('Timed out waiting for VM to toggle power state') + except TimedOutError as err: + raise AssertionError('Timed out waiting for VM to toggle power state') from err @pytest.mark.tier2 @@ -554,8 +554,8 @@ def test_positive_virt_card(session, target_sat, module_location, module_org): timeout=30, delay=2, ) - except TimedOutError: - raise AssertionError('Timed out waiting for VM to toggle power state') + except TimedOutError as err: + raise AssertionError('Timed out waiting for VM to toggle power state') from err virt_card = session.host_new.get_virtualization(host_name)['details'] assert virt_card['datacenter'] == settings.vmware.datacenter diff --git a/tests/foreman/ui/test_contenthost.py b/tests/foreman/ui/test_contenthost.py index ec2c6de469..ffbe571c5b 100644 --- a/tests/foreman/ui/test_contenthost.py +++ b/tests/foreman/ui/test_contenthost.py @@ -1505,7 +1505,7 @@ def test_syspurpose_attributes_empty(session, default_location, vm_module_stream ] syspurpose_status = details['system_purpose_status'] assert syspurpose_status.lower() == 'not specified' - for spname, spdata in DEFAULT_SYSPURPOSE_ATTRIBUTES.items(): + for spname in DEFAULT_SYSPURPOSE_ATTRIBUTES: assert details[spname] == '' @@ -1541,7 +1541,7 @@ def test_set_syspurpose_attributes_cli(session, default_location, vm_module_stre with session: session.location.select(default_location.name) # Set sypurpose attributes - for spname, spdata in DEFAULT_SYSPURPOSE_ATTRIBUTES.items(): + for spdata in DEFAULT_SYSPURPOSE_ATTRIBUTES.values(): run_remote_command_on_content_host( f'syspurpose set-{spdata[0]} "{spdata[1]}"', vm_module_streams ) @@ -1584,11 +1584,11 @@ def test_unset_syspurpose_attributes_cli(session, default_location, vm_module_st :CaseImportance: High """ # Set sypurpose attributes... - for spname, spdata in DEFAULT_SYSPURPOSE_ATTRIBUTES.items(): + for spdata in DEFAULT_SYSPURPOSE_ATTRIBUTES.values(): run_remote_command_on_content_host( f'syspurpose set-{spdata[0]} "{spdata[1]}"', vm_module_streams ) - for spname, spdata in DEFAULT_SYSPURPOSE_ATTRIBUTES.items(): + for spdata in DEFAULT_SYSPURPOSE_ATTRIBUTES.values(): # ...and unset them. run_remote_command_on_content_host(f'syspurpose unset-{spdata[0]}', vm_module_streams) @@ -1597,7 +1597,7 @@ def test_unset_syspurpose_attributes_cli(session, default_location, vm_module_st details = session.contenthost.read(vm_module_streams.hostname, widget_names='details')[ 'details' ] - for spname, spdata in DEFAULT_SYSPURPOSE_ATTRIBUTES.items(): + for spname in DEFAULT_SYSPURPOSE_ATTRIBUTES: assert details[spname] == '' diff --git a/tests/foreman/ui/test_dashboard.py b/tests/foreman/ui/test_dashboard.py index 0dc1bb0fcc..b55891475e 100644 --- a/tests/foreman/ui/test_dashboard.py +++ b/tests/foreman/ui/test_dashboard.py @@ -77,7 +77,7 @@ def test_positive_host_configuration_status(session, target_sat): else: assert dashboard_values['status_list'][criteria] == 0 - for criteria, search in zip(criteria_list, search_strings_list): + for criteria, search in zip(criteria_list, search_strings_list, strict=True): if criteria == 'Hosts with no reports': session.dashboard.action({'HostConfigurationStatus': {'status_list': criteria}}) values = session.host.read_all() diff --git a/tests/foreman/ui/test_errata.py b/tests/foreman/ui/test_errata.py index 7e0a300b32..d7773533a8 100644 --- a/tests/foreman/ui/test_errata.py +++ b/tests/foreman/ui/test_errata.py @@ -147,7 +147,7 @@ def registered_contenthost( module_cv, module_target_sat, request, - repos=[CUSTOM_REPO_URL], + repos=None, ): """RHEL ContentHost registered in satellite, Using SCA and global registration. @@ -155,6 +155,8 @@ def registered_contenthost( :param repos: list of upstream URLs for custom repositories, default to CUSTOM_REPO_URL """ + if not repos: + repos = [CUSTOM_REPO_URL] activation_key = module_target_sat.api.ActivationKey( organization=module_org, environment=module_lce, diff --git a/tests/foreman/ui/test_host.py b/tests/foreman/ui/test_host.py index 6cbb3a47ff..65dfb73d68 100644 --- a/tests/foreman/ui/test_host.py +++ b/tests/foreman/ui/test_host.py @@ -785,7 +785,7 @@ def test_positive_search_by_parameter_with_different_values( for host in hosts: assert session.host.search(host.name)[0]['Name'] == host.name # Check that search by parameter returns only one host in the list - for param_value, host in zip(param_values, hosts): + for param_value, host in zip(param_values, hosts, strict=True): values = session.host.search(f'params.{param_name} = {param_value}') assert len(values) == 1 assert values[0]['Name'] == host.name diff --git a/tests/foreman/ui/test_hostcollection.py b/tests/foreman/ui/test_hostcollection.py index a480db5385..546e70faae 100644 --- a/tests/foreman/ui/test_hostcollection.py +++ b/tests/foreman/ui/test_hostcollection.py @@ -673,9 +673,10 @@ def test_negative_hosts_limit( session.hostcollection.associate_host(hc_name, hosts[0].name) with pytest.raises(AssertionError) as context: session.hostcollection.associate_host(hc_name, hosts[1].name) - assert "cannot have more than 1 host(s) associated with host collection '{}'".format( - hc_name - ) in str(context.value) + assert ( + f"cannot have more than 1 host(s) associated with host collection '{hc_name}'" + in str(context.value) + ) @pytest.mark.tier3 diff --git a/tests/foreman/ui/test_sync.py b/tests/foreman/ui/test_sync.py index b7fdc4eb57..c5ea76e0fa 100644 --- a/tests/foreman/ui/test_sync.py +++ b/tests/foreman/ui/test_sync.py @@ -73,7 +73,7 @@ def test_positive_sync_rh_repos(session, target_sat, module_entitlement_manifest distros = ['rhel6', 'rhel7'] repo_collections = [ target_sat.cli_factory.RepositoryCollection(distro=distro, repositories=[repo]) - for distro, repo in zip(distros, repos) + for distro, repo in zip(distros, repos, strict=True) ] for repo_collection in repo_collections: repo_collection.setup(module_entitlement_manifest_org.id, synchronize=False) diff --git a/tests/robottelo/test_func_shared.py b/tests/robottelo/test_func_shared.py index 7cc635e1aa..4e70550a08 100644 --- a/tests/robottelo/test_func_shared.py +++ b/tests/robottelo/test_func_shared.py @@ -538,7 +538,7 @@ def test_function_kw_scope(self): """ prefixes = [f'pre_{i}' for i in range(10)] suffixes = [f'suf_{i}' for i in range(10)] - for prefix, suffix in zip(prefixes, suffixes): + for prefix, suffix in zip(prefixes, suffixes, strict=True): counter_value = gen_integer(min_value=2, max_value=10000) inc_string = basic_shared_counter_string( prefix=prefix, suffix=suffix, counter=counter_value diff --git a/tests/robottelo/test_report.py b/tests/robottelo/test_report.py index e5f2090b21..acdc41c6ad 100644 --- a/tests/robottelo/test_report.py +++ b/tests/robottelo/test_report.py @@ -44,11 +44,13 @@ def test_junit_timestamps(exec_test, property_level): prop = [prop] try: assert 'start_time' in [p['@name'] for p in prop] - except KeyError as e: - raise AssertionError(f'Missing property node: "start_time": {e}') + except KeyError as err: + raise AssertionError(f'Missing property node: "start_time": {err}') from err try: for p in prop: if p['@name'] == 'start_time': datetime.datetime.strptime(p['@value'], XUNIT_TIME_FORMAT) - except ValueError as e: - raise AssertionError(f'Unable to parse datetime for "start_time" property node: {e}') + except ValueError as err: + raise AssertionError( + f'Unable to parse datetime for "start_time" property node: {err}' + ) from err From 19f59625d710700b6c6489b6b11b6c3285aee873 Mon Sep 17 00:00:00 2001 From: yanpliu Date: Wed, 10 Jan 2024 01:05:40 -0500 Subject: [PATCH 71/93] virtwho config hammer deploy option name organization-title and location-id support (#13632) * virtwho config hammer option name organization-title and location-id support * use fstring and optimize duplicated code * remove print * Update pytest_fixtures/component/virtwho_config.py Co-authored-by: Shubham Ganar <67952129+shubhamsg199@users.noreply.github.com> * Update pytest_fixtures/component/virtwho_config.py Co-authored-by: Shubham Ganar <67952129+shubhamsg199@users.noreply.github.com> * Update pytest_fixtures/component/virtwho_config.py Co-authored-by: Shubham Ganar <67952129+shubhamsg199@users.noreply.github.com> * Update pytest_fixtures/component/virtwho_config.py Co-authored-by: Shubham Ganar <67952129+shubhamsg199@users.noreply.github.com> --------- Co-authored-by: Shubham Ganar <67952129+shubhamsg199@users.noreply.github.com> --- pytest_fixtures/component/virtwho_config.py | 21 +++++++++++++++------ robottelo/utils/virtwho.py | 14 ++++++++++++++ tests/foreman/virtwho/cli/test_esx_sca.py | 8 ++++++-- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/pytest_fixtures/component/virtwho_config.py b/pytest_fixtures/component/virtwho_config.py index fc7a262e80..b897023213 100644 --- a/pytest_fixtures/component/virtwho_config.py +++ b/pytest_fixtures/component/virtwho_config.py @@ -6,6 +6,7 @@ deploy_configure_by_command, deploy_configure_by_script, get_configure_command, + get_configure_command_option, get_guest_info, ) @@ -271,21 +272,29 @@ def deploy_type_cli( form_data_cli, virtwho_config_cli, target_sat, + default_location, ): deploy_type = request.param.lower() assert virtwho_config_cli['status'] == 'No Report Yet' - if "id" in deploy_type: - command = get_configure_command(virtwho_config_cli['id'], org_module.name) - hypervisor_name, guest_name = deploy_configure_by_command( - command, form_data_cli['hypervisor-type'], debug=True, org=org_module.label - ) - elif "script" in deploy_type: + if 'script' in deploy_type: script = target_sat.cli.VirtWhoConfig.fetch( {'id': virtwho_config_cli['id']}, output_format='base' ) hypervisor_name, guest_name = deploy_configure_by_script( script, form_data_cli['hypervisor-type'], debug=True, org=org_module.label ) + elif deploy_type == 'organization-title': + virtwho_config_cli['organization-title'] = org_module.title + elif deploy_type == 'location-id': + virtwho_config_cli['location-id'] = default_location.id + if deploy_type in ['id', 'name', 'organization-title', 'location-id']: + if 'id' in deploy_type: + command = get_configure_command(virtwho_config_cli['id'], org_module.name) + else: + command = get_configure_command_option(deploy_type, virtwho_config_cli, org_module.name) + hypervisor_name, guest_name = deploy_configure_by_command( + command, form_data_cli['hypervisor-type'], debug=True, org=org_module.label + ) return hypervisor_name, guest_name diff --git a/robottelo/utils/virtwho.py b/robottelo/utils/virtwho.py index aaae57d7c9..2f176d5534 100644 --- a/robottelo/utils/virtwho.py +++ b/robottelo/utils/virtwho.py @@ -526,3 +526,17 @@ def create_http_proxy(org, name=None, url=None, http_type='https'): organization=[org.id], ).create() return http_proxy.url, http_proxy.name, http_proxy.id + + +def get_configure_command_option(deploy_type, args, org=DEFAULT_ORG): + """Return the deploy command line based on option. + :param str option: the unique id of the configure file you have created. + :param str org: the satellite organization name. + """ + username, password = Base._get_username_password() + if deploy_type == 'location-id': + return f"hammer -u {username} -p {password} virt-who-config deploy --id {args['id']} --location-id '{args['location-id']}' " + elif deploy_type == 'organization-title': + return f"hammer -u {username} -p {password} virt-who-config deploy --id {args['id']} --organization-title '{args['organization-title']}' " + elif deploy_type == 'name': + return f"hammer -u {username} -p {password} virt-who-config deploy --name {args['name']} --organization '{org}' " diff --git a/tests/foreman/virtwho/cli/test_esx_sca.py b/tests/foreman/virtwho/cli/test_esx_sca.py index b09cabef91..7c5a4f5bc2 100644 --- a/tests/foreman/virtwho/cli/test_esx_sca.py +++ b/tests/foreman/virtwho/cli/test_esx_sca.py @@ -32,8 +32,12 @@ class TestVirtWhoConfigforEsx: @pytest.mark.tier2 @pytest.mark.upgrade - @pytest.mark.parametrize('deploy_type_cli', ['id', 'script'], indirect=True) - def test_positive_deploy_configure_by_id_script( + @pytest.mark.parametrize( + 'deploy_type_cli', + ['id', 'script', 'name', 'location-id', 'organization-title'], + indirect=True, + ) + def test_positive_deploy_configure_by_id_script_name_locationid_organizationtitle( self, module_sca_manifest_org, target_sat, virtwho_config_cli, deploy_type_cli ): """Verify "hammer virt-who-config deploy & fetch" From 8e29889af7e9aed206dd3cc6cd9a06496bd89e10 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Jan 2024 13:12:18 +0530 Subject: [PATCH 72/93] Bump kentaro-m/auto-assign-action from 1.2.5 to 1.2.6 (#13698) Bumps [kentaro-m/auto-assign-action](https://github.com/kentaro-m/auto-assign-action) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/kentaro-m/auto-assign-action/releases) - [Commits](https://github.com/kentaro-m/auto-assign-action/compare/v1.2.5...v1.2.6) --- updated-dependencies: - dependency-name: kentaro-m/auto-assign-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/auto_assignment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto_assignment.yaml b/.github/workflows/auto_assignment.yaml index 72c62c984a..5b914ed642 100644 --- a/.github/workflows/auto_assignment.yaml +++ b/.github/workflows/auto_assignment.yaml @@ -15,6 +15,6 @@ jobs: if: "!contains(github.event.pull_request.labels.*.name, 'Auto_Cherry_Picked')" runs-on: ubuntu-latest steps: - - uses: kentaro-m/auto-assign-action@v1.2.5 + - uses: kentaro-m/auto-assign-action@v1.2.6 with: configuration-path: ".github/auto_assign.yml" From 6d75a026be2e234c88f39328408e716a2d91f51c Mon Sep 17 00:00:00 2001 From: Gaurav Talreja Date: Wed, 10 Jan 2024 15:30:41 +0530 Subject: [PATCH 73/93] Fix domain read in discovery auto provision test (#13708) Signed-off-by: Gaurav Talreja --- tests/foreman/ui/test_discoveredhost.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/foreman/ui/test_discoveredhost.py b/tests/foreman/ui/test_discoveredhost.py index fc3915f0fa..ee437cfe89 100644 --- a/tests/foreman/ui/test_discoveredhost.py +++ b/tests/foreman/ui/test_discoveredhost.py @@ -189,7 +189,7 @@ def test_positive_auto_provision_host_with_rule( discovered_host.build = True discovered_host_name = discovered_host.name - domain_name = provisioning_hostgroup.domain.name + domain_name = provisioning_hostgroup.domain.read().name host_name = f'{discovered_host_name}.{domain_name}' discovery_rule = sat.api.DiscoveryRule( From 8f7fe941d1f474328d6862692b20f9ed5d2f1b14 Mon Sep 17 00:00:00 2001 From: Jacob Callahan Date: Wed, 10 Jan 2024 10:23:38 -0500 Subject: [PATCH 74/93] Removing changes associated with Bugbear rule B019 This PR reverts the change from lru_cache to cachedmethod. The primary goal of the original change was to avoid memory leaks, due to lru_cache holding instances of a class alive longer than they should be. However, for our test framework, the workaround to avoid these memory leaks really aren't worth it. I also added an lru_cache to cli_factory.__getattr__, improving its recurring lookup time substantially. Finally, I corrected a type check that was erroneously converted in the initial pass. --- pyproject.toml | 1 + robottelo/host_helpers/cli_factory.py | 6 +++--- robottelo/host_helpers/satellite_mixins.py | 6 +++--- robottelo/hosts.py | 5 ++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 61982c48c0..4f5c8af613 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,6 +32,7 @@ select = [ ] ignore = [ + "B019", # lru_cache can lead to memory leaks - acceptable tradeoff "E501", # line too long - handled by black "PT004", # pytest underscrore prefix for non-return fixtures "PT005", # pytest no underscrore prefix for return fixtures diff --git a/robottelo/host_helpers/cli_factory.py b/robottelo/host_helpers/cli_factory.py index ba82a80e7f..efb5a8fb4b 100644 --- a/robottelo/host_helpers/cli_factory.py +++ b/robottelo/host_helpers/cli_factory.py @@ -4,7 +4,7 @@ example: my_satellite.cli_factory.make_org() """ import datetime -from functools import partial +from functools import lru_cache, partial import inspect import os from os import chmod @@ -14,7 +14,6 @@ from time import sleep from box import Box -from cachetools import cachedmethod from fauxfactory import ( gen_alpha, gen_alphanumeric, @@ -250,6 +249,7 @@ def __init__(self, satellite): self._satellite = satellite self.__dict__.update(initiate_repo_helpers(self._satellite)) + @lru_cache def __getattr__(self, name): """We intercept the usual attribute behavior on this class to emulate make_entity methods The keys in the dictionary above correspond to potential make_ methods @@ -295,7 +295,7 @@ def _evaluate_functions(self, iterable): if not key.startswith('_') } - @cachedmethod + @lru_cache def _find_entity_class(self, entity_name): entity_name = entity_name.replace('_', '').lower() for name, class_obj in self._satellite.cli.__dict__.items(): diff --git a/robottelo/host_helpers/satellite_mixins.py b/robottelo/host_helpers/satellite_mixins.py index 312ec7e49f..4b56326f8c 100644 --- a/robottelo/host_helpers/satellite_mixins.py +++ b/robottelo/host_helpers/satellite_mixins.py @@ -1,10 +1,10 @@ import contextlib +from functools import lru_cache import io import os import random import re -from cachetools import cachedmethod import requests from robottelo.cli.proxy import CapsuleTunnelError @@ -235,7 +235,7 @@ def available_capsule_port(self): :rtype: int """ port_pool_range = settings.fake_capsules.port_range - if isinstance(port_pool_range, list): + if isinstance(port_pool_range, str): port_pool_range = tuple(port_pool_range.split('-')) if isinstance(port_pool_range, tuple) and len(port_pool_range) == 2: port_pool = range(int(port_pool_range[0]), int(port_pool_range[1])) @@ -358,6 +358,6 @@ def api_factory(self): self._api_factory = APIFactory(self) return self._api_factory - @cachedmethod + @lru_cache def ui_factory(self, session): return UIFactory(self, session=session) diff --git a/robottelo/hosts.py b/robottelo/hosts.py index ed313eaeed..8e48f963fe 100644 --- a/robottelo/hosts.py +++ b/robottelo/hosts.py @@ -17,7 +17,6 @@ from box import Box from broker import Broker from broker.hosts import Host -from cachetools import cachedmethod from dynaconf.vendor.box.exceptions import BoxKeyError from fauxfactory import gen_alpha, gen_string from manifester import Manifester @@ -2283,7 +2282,7 @@ def get_rhsso_client_id(self): break return client_id - @cachedmethod + @lru_cache def get_rhsso_user_details(self, username): """Getter method to receive the user id""" result = self.execute( @@ -2292,7 +2291,7 @@ def get_rhsso_user_details(self, username): result_json = json.loads(result.stdout) return result_json[0] - @cachedmethod + @lru_cache def get_rhsso_groups_details(self, group_name): """Getter method to receive the group id""" result = self.execute(f"{KEY_CLOAK_CLI} get groups -r {settings.rhsso.realm}") From de84bd3e1d30074534ac42c7e66718ec73e19929 Mon Sep 17 00:00:00 2001 From: Omkar Khatavkar Date: Thu, 11 Jan 2024 02:23:57 +0530 Subject: [PATCH 75/93] fixing the incorrect recording video url (#13714) fixing the recording video url --- robottelo/hosts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/robottelo/hosts.py b/robottelo/hosts.py index 8e48f963fe..f20b2ce495 100644 --- a/robottelo/hosts.py +++ b/robottelo/hosts.py @@ -1857,7 +1857,7 @@ def get_caller(): raise finally: video_url = settings.ui.grid_url.replace( - ':4444', f'/videos/{ui_session.ui_session_id}.mp4' + ':4444', f'/videos/{ui_session.ui_session_id}/video.mp4' ) if self.record_property is not None and settings.ui.record_video: self.record_property('video_url', video_url) From a547eecb2261eaf0ac0f23ba1c2a618252035356 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Jan 2024 22:19:11 -0500 Subject: [PATCH 76/93] Bump pascalgn/automerge-action from 0.16.0 to 0.16.2 (#13724) --- .github/workflows/auto_cherry_pick_merge.yaml | 2 +- .github/workflows/dependency_merge.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto_cherry_pick_merge.yaml b/.github/workflows/auto_cherry_pick_merge.yaml index 01896dd9d5..e0cb8e4817 100644 --- a/.github/workflows/auto_cherry_pick_merge.yaml +++ b/.github/workflows/auto_cherry_pick_merge.yaml @@ -67,7 +67,7 @@ jobs: - id: automerge name: Auto merge of cherry-picked PRs. - uses: "pascalgn/automerge-action@v0.16.0" + uses: "pascalgn/automerge-action@v0.16.2" env: GITHUB_TOKEN: "${{ secrets.CHERRYPICK_PAT }}" MERGE_LABELS: "AutoMerge_Cherry_Picked, Auto_Cherry_Picked" diff --git a/.github/workflows/dependency_merge.yml b/.github/workflows/dependency_merge.yml index ebac6d10c8..e2735e5a77 100644 --- a/.github/workflows/dependency_merge.yml +++ b/.github/workflows/dependency_merge.yml @@ -61,7 +61,7 @@ jobs: - id: automerge name: Auto merge of dependabot PRs. - uses: "pascalgn/automerge-action@v0.16.0" + uses: "pascalgn/automerge-action@v0.16.2" env: GITHUB_TOKEN: "${{ secrets.CHERRYPICK_PAT }}" MERGE_LABELS: "dependencies" From 73e1475eefe95ca6c8b53cf0271ffdaddb538783 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Jan 2024 23:00:12 -0500 Subject: [PATCH 77/93] Bump jinja2 from 3.1.2 to 3.1.3 (#13729) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a6b074d03c..650862b07c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ cryptography==41.0.7 deepdiff==6.7.1 dynaconf[vault]==3.2.4 fauxfactory==3.1.0 -jinja2==3.1.2 +jinja2==3.1.3 manifester==0.0.14 navmazing==1.2.2 productmd==1.38 From 39be0d7f962dc5bb55946a5034d239709e799592 Mon Sep 17 00:00:00 2001 From: jyejare Date: Thu, 11 Jan 2024 15:57:49 +0530 Subject: [PATCH 78/93] Non tabular output denied for CSV conversion --- robottelo/cli/hammer.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/robottelo/cli/hammer.py b/robottelo/cli/hammer.py index 661042050e..cf14cd2f0d 100644 --- a/robottelo/cli/hammer.py +++ b/robottelo/cli/hammer.py @@ -34,10 +34,23 @@ def _normalize_obj(obj): return obj +def is_csv(output): + """Verifies if the output string is eligible for converting into CSV""" + sniffer = csv.Sniffer() + try: + sniffer.sniff(output) + return True + except csv.Error: + return False + + def parse_csv(output): """Parse CSV output from Hammer CLI and convert it to python dictionary.""" # ignore warning about puppet and ostree deprecation output.replace('Puppet and OSTree will no longer be supported in Katello 3.16\n', '') + # Validate if the output is eligible for CSV conversions else return as it is + if not is_csv(output): + return output reader = csv.reader(output.splitlines()) # Generate the key names, spaces will be converted to dashes "-" keys = [_normalize(header) for header in next(reader)] From 9d5e84ceec5debdabaadc2244e060782c31bba01 Mon Sep 17 00:00:00 2001 From: Adarsh dubey Date: Thu, 11 Jan 2024 19:50:02 +0530 Subject: [PATCH 79/93] Increasing the timeout for mac collection (#13741) --- tests/foreman/api/test_discoveredhost.py | 8 ++++---- tests/foreman/cli/test_discoveredhost.py | 4 ++-- tests/foreman/ui/test_discoveredhost.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/foreman/api/test_discoveredhost.py b/tests/foreman/api/test_discoveredhost.py index df8444c951..1bf31452ae 100644 --- a/tests/foreman/api/test_discoveredhost.py +++ b/tests/foreman/api/test_discoveredhost.py @@ -201,7 +201,7 @@ def test_positive_provision_pxe_host( mac = provisioning_host._broker_args['provisioning_nic_mac_addr'] wait_for( lambda: sat.api.DiscoveredHost().search(query={'mac': mac}) != [], - timeout=600, + timeout=1500, delay=40, ) discovered_host = sat.api.DiscoveredHost().search(query={'mac': mac})[0] @@ -251,7 +251,7 @@ def test_positive_provision_pxe_less_host( mac = pxeless_discovery_host._broker_args['provisioning_nic_mac_addr'] wait_for( lambda: sat.api.DiscoveredHost().search(query={'mac': mac}) != [], - timeout=600, + timeout=1500, delay=40, ) discovered_host = sat.api.DiscoveredHost().search(query={'mac': mac})[0] @@ -386,7 +386,7 @@ def test_positive_reboot_pxe_host( mac = provisioning_host._broker_args['provisioning_nic_mac_addr'] wait_for( lambda: sat.api.DiscoveredHost().search(query={'mac': mac}) != [], - timeout=240, + timeout=1500, delay=20, ) @@ -432,7 +432,7 @@ def test_positive_reboot_all_pxe_hosts( mac = host._broker_args['provisioning_nic_mac_addr'] wait_for( lambda: sat.api.DiscoveredHost().search(query={'mac': mac}) != [], # noqa: B023 - timeout=240, + timeout=1500, delay=20, ) discovered_host = sat.api.DiscoveredHost().search(query={'mac': mac})[0] diff --git a/tests/foreman/cli/test_discoveredhost.py b/tests/foreman/cli/test_discoveredhost.py index 6da0330db1..5fbeca4ef4 100644 --- a/tests/foreman/cli/test_discoveredhost.py +++ b/tests/foreman/cli/test_discoveredhost.py @@ -52,7 +52,7 @@ def test_rhel_pxe_discovery_provisioning( wait_for( lambda: sat.api.DiscoveredHost().search(query={'mac': mac}) != [], - timeout=600, + timeout=1500, delay=40, ) discovered_host = sat.api.DiscoveredHost().search(query={'mac': mac})[0] @@ -115,7 +115,7 @@ def test_rhel_pxeless_discovery_provisioning( wait_for( lambda: sat.api.DiscoveredHost().search(query={'mac': mac}) != [], - timeout=600, + timeout=1500, delay=40, ) discovered_host = sat.api.DiscoveredHost().search(query={'mac': mac})[0] diff --git a/tests/foreman/ui/test_discoveredhost.py b/tests/foreman/ui/test_discoveredhost.py index ee437cfe89..292ad94f7a 100644 --- a/tests/foreman/ui/test_discoveredhost.py +++ b/tests/foreman/ui/test_discoveredhost.py @@ -81,7 +81,7 @@ def test_positive_provision_pxe_host( mac = provisioning_host._broker_args['provisioning_nic_mac_addr'] wait_for( lambda: sat.api.DiscoveredHost().search(query={'mac': mac}) != [], - timeout=240, + timeout=1500, delay=20, ) discovered_host = sat.api.DiscoveredHost().search(query={'mac': mac})[0] @@ -179,7 +179,7 @@ def test_positive_auto_provision_host_with_rule( mac = pxeless_discovery_host._broker_args['provisioning_nic_mac_addr'] wait_for( lambda: sat.api.DiscoveredHost().search(query={'mac': mac}) != [], - timeout=240, + timeout=1500, delay=20, ) discovered_host = sat.api.DiscoveredHost().search(query={'mac': mac})[0] From 81cdd6b164d7dbe68264a929af30005ecdd8611d Mon Sep 17 00:00:00 2001 From: Vladimir Sedmik Date: Thu, 11 Jan 2024 11:22:40 +0100 Subject: [PATCH 80/93] Fixes in cli_factory - remove @lru_cache from CLIFactory.__getattr__ - flip output format of cli.Repository.synchronize to from 'csv' to 'base' (output is not in csv format here) --- robottelo/cli/repository.py | 2 +- robottelo/host_helpers/cli_factory.py | 1 - tests/foreman/cli/test_capsulecontent.py | 16 ++++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/robottelo/cli/repository.py b/robottelo/cli/repository.py index 85296f25e5..94fa8baa18 100644 --- a/robottelo/cli/repository.py +++ b/robottelo/cli/repository.py @@ -60,7 +60,7 @@ def synchronize(cls, options, return_raw_response=None, timeout=3600000): cls.command_sub = 'synchronize' return cls.execute( cls._construct_command(options), - output_format='csv', + output_format='base', ignore_stderr=True, return_raw_response=return_raw_response, timeout=timeout, diff --git a/robottelo/host_helpers/cli_factory.py b/robottelo/host_helpers/cli_factory.py index efb5a8fb4b..fdfd29152a 100644 --- a/robottelo/host_helpers/cli_factory.py +++ b/robottelo/host_helpers/cli_factory.py @@ -249,7 +249,6 @@ def __init__(self, satellite): self._satellite = satellite self.__dict__.update(initiate_repo_helpers(self._satellite)) - @lru_cache def __getattr__(self, name): """We intercept the usual attribute behavior on this class to emulate make_entity methods The keys in the dictionary above correspond to potential make_ methods diff --git a/tests/foreman/cli/test_capsulecontent.py b/tests/foreman/cli/test_capsulecontent.py index b55b845719..63e2096b6e 100644 --- a/tests/foreman/cli/test_capsulecontent.py +++ b/tests/foreman/cli/test_capsulecontent.py @@ -201,3 +201,19 @@ def test_positive_update_counts(target_sat, module_capsule_configured): search_rate=5, max_tries=5, ) + + +@pytest.mark.parametrize( + 'repos_collection', + [ + { + 'distro': 'rhel8', + 'YumRepository': {'url': settings.repos.module_stream_1.url}, + 'FileRepository': {'url': CUSTOM_FILE_REPO}, + } + ], + indirect=True, +) +def test_dummie(repos_collection, function_org, function_lce): + repos_collection.setup_content(function_org.id, function_lce.id, upload_manifest=False) + pass From 99df502cac9635160eaa713e7f7abe8344b73d2f Mon Sep 17 00:00:00 2001 From: Vladimir Sedmik Date: Thu, 11 Jan 2024 15:35:07 +0100 Subject: [PATCH 81/93] Remmove the test_dummie --- tests/foreman/cli/test_capsulecontent.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/tests/foreman/cli/test_capsulecontent.py b/tests/foreman/cli/test_capsulecontent.py index 63e2096b6e..b55b845719 100644 --- a/tests/foreman/cli/test_capsulecontent.py +++ b/tests/foreman/cli/test_capsulecontent.py @@ -201,19 +201,3 @@ def test_positive_update_counts(target_sat, module_capsule_configured): search_rate=5, max_tries=5, ) - - -@pytest.mark.parametrize( - 'repos_collection', - [ - { - 'distro': 'rhel8', - 'YumRepository': {'url': settings.repos.module_stream_1.url}, - 'FileRepository': {'url': CUSTOM_FILE_REPO}, - } - ], - indirect=True, -) -def test_dummie(repos_collection, function_org, function_lce): - repos_collection.setup_content(function_org.id, function_lce.id, upload_manifest=False) - pass From d984b2b8438e0b4bb8ccadba2cce77f8d85c6b8c Mon Sep 17 00:00:00 2001 From: Radek Mynar Date: Mon, 18 Dec 2023 16:26:40 +0100 Subject: [PATCH 82/93] refactor and simplify ping test after cache status was added --- tests/foreman/cli/test_ping.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/tests/foreman/cli/test_ping.py b/tests/foreman/cli/test_ping.py index 0a28814323..1036b3c5fd 100644 --- a/tests/foreman/cli/test_ping.py +++ b/tests/foreman/cli/test_ping.py @@ -37,21 +37,13 @@ def test_positive_ping(target_sat, switch_user): """ result = target_sat.execute(f"su - {'postgres' if switch_user else 'root'} -c 'hammer ping'") assert result.stderr[1].decode() == '' - assert result.status == 0 - status_count = 0 - ok_count = 0 - # Exclude message from stdout for services candlepin_events and katello_events - result.stdout = [line for line in result.stdout.splitlines() if 'message' not in line] + # Filter lines containing status + statuses = [line for line in result.stdout.splitlines() if 'status:' in line.lower()] - # iterate over the lines grouping every 3 lines - # example [1, 2, 3, 4, 5, 6] will return [(1, 2, 3), (4, 5, 6)] - # only the status line is relevant for this test - for _, status, _ in zip(*[iter(result.stdout)] * 3, strict=False): # should this be strict? - status_count += 1 - - if status.split(':')[1].strip().lower() == 'ok': - ok_count += 1 + # Get count of total status lines and lines containing OK + status_count = len(statuses) + ok_count = len([status for status in statuses if status.split(':')[1].strip().lower() == 'ok']) if status_count == ok_count: assert result.status == 0, 'Return code should be 0 if all services are ok' From 7e9fcc81dab139184893b09cd00a9048f7f48894 Mon Sep 17 00:00:00 2001 From: Shubham Ganar <67952129+shubhamsg199@users.noreply.github.com> Date: Thu, 11 Jan 2024 21:03:03 +0530 Subject: [PATCH 83/93] Add missing on_premises_provisioning marker for capsule provisioning test (#13760) Add on premise marker for capsule provisioning test --- tests/foreman/api/test_provisioning.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/foreman/api/test_provisioning.py b/tests/foreman/api/test_provisioning.py index 47dcc8d54a..100a9964f9 100644 --- a/tests/foreman/api/test_provisioning.py +++ b/tests/foreman/api/test_provisioning.py @@ -587,6 +587,7 @@ def test_rhel_pxe_provisioning_fips_enabled( @pytest.mark.e2e @pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True) +@pytest.mark.on_premises_provisioning @pytest.mark.rhel_ver_match('[^6]') def test_capsule_pxe_provisioning( request, From 40c6b469aad1fd9fa1d9c016f33bc2097d8f6dfb Mon Sep 17 00:00:00 2001 From: Griffin Sullivan Date: Thu, 21 Dec 2023 13:52:53 -0500 Subject: [PATCH 84/93] Add CU scenario for puma worker count --- tests/foreman/destructive/test_installer.py | 39 +++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tests/foreman/destructive/test_installer.py b/tests/foreman/destructive/test_installer.py index da213102b8..c130e0fcd2 100644 --- a/tests/foreman/destructive/test_installer.py +++ b/tests/foreman/destructive/test_installer.py @@ -11,6 +11,8 @@ :CaseImportance: Critical """ +import random + from fauxfactory import gen_domain, gen_string import pytest @@ -140,3 +142,40 @@ def test_positive_installer_certs_regenerate(target_sat): ) assert result.status == 0 assert 'FAIL' not in target_sat.cli.Base.ping() + + +def test_positive_installer_puma_worker_count(target_sat): + """Installer should set the puma worker count and thread max without having to manually + restart the foreman service. + + :id: d0e7d958-dd3e-4962-bf5a-8d7ec36f3485 + + :steps: + 1. Check how many puma workers there are + 2. Select a new worker count that is less than the default + 2. Change answer's file to have new count for puma workers + 3. Run satellite-installer --foreman-foreman-service-puma-workers new_count --foreman-foreman-service-puma-threads-max new_count + + :expectedresults: aux should show there are only new_count puma workers after installer runs + + :BZ: 2025760 + + :customerscenario: true + """ + count = int(target_sat.execute('pgrep --full "puma: cluster worker" | wc -l').stdout) + worker_count = str(random.randint(1, count - 1)) + result = target_sat.install( + InstallerCommand( + foreman_foreman_service_puma_workers=worker_count, + foreman_foreman_service_puma_threads_max=worker_count, + ) + ) + assert result.status == 0 + result = target_sat.execute(f'grep "foreman_service_puma_workers" {SATELLITE_ANSWER_FILE}') + assert worker_count in result.stdout + result = target_sat.execute('ps aux | grep -v grep | grep -e USER -e puma') + for i in range(count): + if i < int(worker_count): + assert f'cluster worker {i}' in result.stdout + else: + assert f'cluster worker {i}' not in result.stdout From ad6b99ffb7d87bcd41ff86d256df900568644d86 Mon Sep 17 00:00:00 2001 From: dosas Date: Fri, 12 Jan 2024 14:22:49 +0100 Subject: [PATCH 85/93] Cleanup video recording (#13713) * Only call related functionallity when record_video is set to true * Add settings options to config template Co-authored-by: dosas --- conf/ui.yaml.template | 4 +++- pytest_plugins/video_cleanup.py | 17 +++++++++-------- robottelo/hosts.py | 6 +++--- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/conf/ui.yaml.template b/conf/ui.yaml.template index 750f715f7e..2817b81120 100644 --- a/conf/ui.yaml.template +++ b/conf/ui.yaml.template @@ -24,13 +24,15 @@ UI: WEBDRIVER: chrome # Binary location for selected wedriver (not needed if using saucelabs) WEBDRIVER_BINARY: /usr/bin/chromedriver - + RECORD_VIDEO: false + GRID_URL: http://infra-grid.example.com:4444 # Web_Kaifuku Settings (checkout https://github.com/RonnyPfannschmidt/webdriver_kaifuku) WEBKAIFUKU: webdriver: chrome/remote webdriver_options: command_executor: http://localhost:4444/wd/hub desired_capabilities: + se:recordVideo: '@jinja {{ this.ui.record_video }}' browserName: chrome chromeOptions: args: diff --git a/pytest_plugins/video_cleanup.py b/pytest_plugins/video_cleanup.py index 35c6fb5fb1..0eaeb57028 100644 --- a/pytest_plugins/video_cleanup.py +++ b/pytest_plugins/video_cleanup.py @@ -17,15 +17,16 @@ def _clean_video(session_id, test): - logger.info(f"cleaning up video files for session: {session_id} and test: {test}") + if settings.ui.record_video: + logger.info(f"cleaning up video files for session: {session_id} and test: {test}") - if settings.ui.grid_url and session_id: - grid = urlparse(url=settings.ui.grid_url) - infra_grid = Host(hostname=grid.hostname) - infra_grid.execute(command=f'rm -rf /var/www/html/videos/{session_id}') - logger.info(f"video cleanup for session {session_id} is complete") - else: - logger.warning("missing grid_url or session_id. unable to clean video files.") + if settings.ui.grid_url and session_id: + grid = urlparse(url=settings.ui.grid_url) + infra_grid = Host(hostname=grid.hostname) + infra_grid.execute(command=f'rm -rf /var/www/html/videos/{session_id}') + logger.info(f"video cleanup for session {session_id} is complete") + else: + logger.warning("missing grid_url or session_id. unable to clean video files.") def pytest_addoption(parser): diff --git a/robottelo/hosts.py b/robottelo/hosts.py index f20b2ce495..580c64fb3e 100644 --- a/robottelo/hosts.py +++ b/robottelo/hosts.py @@ -1856,10 +1856,10 @@ def get_caller(): except Exception: raise finally: - video_url = settings.ui.grid_url.replace( - ':4444', f'/videos/{ui_session.ui_session_id}/video.mp4' - ) if self.record_property is not None and settings.ui.record_video: + video_url = settings.ui.grid_url.replace( + ':4444', f'/videos/{ui_session.ui_session_id}/video.mp4' + ) self.record_property('video_url', video_url) self.record_property('session_id', ui_session.ui_session_id) From 2512f9722485aefc06194f0a27a45a2e74f2e016 Mon Sep 17 00:00:00 2001 From: yanpliu Date: Fri, 12 Jan 2024 11:03:02 -0500 Subject: [PATCH 86/93] http proxy create location option support (#13768) --- robottelo/utils/virtwho.py | 3 ++- tests/foreman/virtwho/api/test_esx.py | 8 +++++--- tests/foreman/virtwho/api/test_esx_sca.py | 8 +++++--- tests/foreman/virtwho/cli/test_esx.py | 8 +++++--- tests/foreman/virtwho/cli/test_esx_sca.py | 11 ++++++++--- tests/foreman/virtwho/ui/test_esx.py | 18 +++++++++++++----- 6 files changed, 38 insertions(+), 18 deletions(-) diff --git a/robottelo/utils/virtwho.py b/robottelo/utils/virtwho.py index 2f176d5534..5e0f3a4657 100644 --- a/robottelo/utils/virtwho.py +++ b/robottelo/utils/virtwho.py @@ -506,7 +506,7 @@ def virtwho_package_locked(): assert "Packages are locked" in result[1] -def create_http_proxy(org, name=None, url=None, http_type='https'): +def create_http_proxy(org, location, name=None, url=None, http_type='https'): """ Creat a new http-proxy with attributes. :param name: Name of the proxy @@ -524,6 +524,7 @@ def create_http_proxy(org, name=None, url=None, http_type='https'): name=http_proxy_name, url=http_proxy_url, organization=[org.id], + location=[location.id], ).create() return http_proxy.url, http_proxy.name, http_proxy.id diff --git a/tests/foreman/virtwho/api/test_esx.py b/tests/foreman/virtwho/api/test_esx.py index cdea45e72b..bb6046188a 100644 --- a/tests/foreman/virtwho/api/test_esx.py +++ b/tests/foreman/virtwho/api/test_esx.py @@ -210,7 +210,7 @@ def test_positive_filter_option( @pytest.mark.tier2 def test_positive_proxy_option( - self, default_org, form_data_api, virtwho_config_api, target_sat + self, default_org, default_location, form_data_api, virtwho_config_api, target_sat ): """Verify http_proxy option by "PUT @@ -232,7 +232,7 @@ def test_positive_proxy_option( assert get_configure_option('no_proxy', ETC_VIRTWHO_CONFIG) == '*' # Check HTTTP Proxy and No_PROXY option http_proxy_url, http_proxy_name, http_proxy_id = create_http_proxy( - http_type='http', org=default_org + http_type='http', org=default_org, location=default_location ) no_proxy = 'test.satellite.com' virtwho_config_api.http_proxy_id = http_proxy_id @@ -245,7 +245,9 @@ def test_positive_proxy_option( assert get_configure_option('http_proxy', ETC_VIRTWHO_CONFIG) == http_proxy_url assert get_configure_option('no_proxy', ETC_VIRTWHO_CONFIG) == no_proxy # Check HTTTPs Proxy option - https_proxy_url, https_proxy_name, https_proxy_id = create_http_proxy(org=default_org) + https_proxy_url, https_proxy_name, https_proxy_id = create_http_proxy( + org=default_org, location=default_location + ) virtwho_config_api.http_proxy_id = https_proxy_id virtwho_config_api.update(['http_proxy_id']) deploy_configure_by_command( diff --git a/tests/foreman/virtwho/api/test_esx_sca.py b/tests/foreman/virtwho/api/test_esx_sca.py index 290e67242f..2d43f59637 100644 --- a/tests/foreman/virtwho/api/test_esx_sca.py +++ b/tests/foreman/virtwho/api/test_esx_sca.py @@ -227,7 +227,9 @@ def test_positive_filter_option( assert result.exclude_host_parents == regex @pytest.mark.tier2 - def test_positive_proxy_option(self, module_sca_manifest_org, form_data_api, target_sat): + def test_positive_proxy_option( + self, module_sca_manifest_org, default_location, form_data_api, target_sat + ): """Verify http_proxy option by "PUT /foreman_virt_who_configure/api/v2/configs/:id"" @@ -251,7 +253,7 @@ def test_positive_proxy_option(self, module_sca_manifest_org, form_data_api, tar assert get_configure_option('no_proxy', ETC_VIRTWHO_CONFIG) == '*' # Check HTTTP Proxy and No_PROXY option http_proxy_url, http_proxy_name, http_proxy_id = create_http_proxy( - http_type='http', org=module_sca_manifest_org + http_type='http', org=module_sca_manifest_org, location=default_location ) no_proxy = 'test.satellite.com' virtwho_config.http_proxy_id = http_proxy_id @@ -269,7 +271,7 @@ def test_positive_proxy_option(self, module_sca_manifest_org, form_data_api, tar assert result.no_proxy == no_proxy # Check HTTTPs Proxy option https_proxy_url, https_proxy_name, https_proxy_id = create_http_proxy( - org=module_sca_manifest_org + org=module_sca_manifest_org, location=default_location ) virtwho_config.http_proxy_id = https_proxy_id virtwho_config.update(['http_proxy_id']) diff --git a/tests/foreman/virtwho/cli/test_esx.py b/tests/foreman/virtwho/cli/test_esx.py index c661d31cd6..c18ffb3ab3 100644 --- a/tests/foreman/virtwho/cli/test_esx.py +++ b/tests/foreman/virtwho/cli/test_esx.py @@ -214,7 +214,7 @@ def test_positive_filter_option( @pytest.mark.tier2 def test_positive_proxy_option( - self, default_org, form_data_cli, virtwho_config_cli, target_sat + self, default_org, default_location, form_data_cli, virtwho_config_cli, target_sat ): """Verify http_proxy option by hammer virt-who-config update" @@ -227,7 +227,9 @@ def test_positive_proxy_option( :BZ: 1902199 """ # Check the https proxy option, update it via http proxy name - https_proxy_url, https_proxy_name, https_proxy_id = create_http_proxy(org=default_org) + https_proxy_url, https_proxy_name, https_proxy_id = create_http_proxy( + org=default_org, location=default_location + ) no_proxy = 'test.satellite.com' target_sat.cli.VirtWhoConfig.update( {'id': virtwho_config_cli['id'], 'http-proxy': https_proxy_name, 'no-proxy': no_proxy} @@ -244,7 +246,7 @@ def test_positive_proxy_option( # Check the http proxy option, update it via http proxy id http_proxy_url, http_proxy_name, http_proxy_id = create_http_proxy( - http_type='http', org=default_org + http_type='http', org=default_org, location=default_location ) target_sat.cli.VirtWhoConfig.update( {'id': virtwho_config_cli['id'], 'http-proxy-id': http_proxy_id} diff --git a/tests/foreman/virtwho/cli/test_esx_sca.py b/tests/foreman/virtwho/cli/test_esx_sca.py index 7c5a4f5bc2..6b15b6803f 100644 --- a/tests/foreman/virtwho/cli/test_esx_sca.py +++ b/tests/foreman/virtwho/cli/test_esx_sca.py @@ -250,7 +250,12 @@ def test_positive_filter_option( @pytest.mark.tier2 def test_positive_proxy_option( - self, module_sca_manifest_org, form_data_cli, virtwho_config_cli, target_sat + self, + module_sca_manifest_org, + default_location, + form_data_cli, + virtwho_config_cli, + target_sat, ): """Verify http_proxy option by hammer virt-who-config update" @@ -266,7 +271,7 @@ def test_positive_proxy_option( """ # Check the https proxy option, update it via http proxy name https_proxy_url, https_proxy_name, https_proxy_id = create_http_proxy( - org=module_sca_manifest_org + org=module_sca_manifest_org, location=default_location ) no_proxy = 'test.satellite.com' target_sat.cli.VirtWhoConfig.update( @@ -284,7 +289,7 @@ def test_positive_proxy_option( # Check the http proxy option, update it via http proxy id http_proxy_url, http_proxy_name, http_proxy_id = create_http_proxy( - http_type='http', org=module_sca_manifest_org + http_type='http', org=module_sca_manifest_org, location=default_location ) target_sat.cli.VirtWhoConfig.update( {'id': virtwho_config_cli['id'], 'http-proxy-id': http_proxy_id} diff --git a/tests/foreman/virtwho/ui/test_esx.py b/tests/foreman/virtwho/ui/test_esx.py index b81536ab21..efd46e6deb 100644 --- a/tests/foreman/virtwho/ui/test_esx.py +++ b/tests/foreman/virtwho/ui/test_esx.py @@ -215,7 +215,9 @@ def test_positive_filtering_option( assert regex == get_configure_option('exclude_host_parents', config_file) @pytest.mark.tier2 - def test_positive_proxy_option(self, default_org, virtwho_config_ui, org_session, form_data_ui): + def test_positive_proxy_option( + self, default_org, default_location, virtwho_config_ui, org_session, form_data_ui + ): """Verify 'HTTP Proxy' and 'Ignore Proxy' options. :id: 6659d577-0135-4bf0-81af-14b930011536 @@ -225,9 +227,11 @@ def test_positive_proxy_option(self, default_org, virtwho_config_ui, org_session :CaseImportance: Medium """ - https_proxy, https_proxy_name, https_proxy_id = create_http_proxy(org=default_org) + https_proxy, https_proxy_name, https_proxy_id = create_http_proxy( + org=default_org, location=default_location + ) http_proxy, http_proxy_name, http_proxy_id = create_http_proxy( - http_type='http', org=default_org + http_type='http', org=default_org, location=default_location ) name = form_data_ui['name'] config_id = get_configure_id(name) @@ -547,7 +551,9 @@ def test_positive_virtwho_manager_role( assert not org_session.user.search(username) @pytest.mark.tier2 - def test_positive_overview_label_name(self, default_org, form_data_ui, org_session): + def test_positive_overview_label_name( + self, default_org, default_location, form_data_ui, org_session + ): """Verify the label name on virt-who config Overview Page. :id: 21df8175-bb41-422e-a263-8677bc3a9565 @@ -561,7 +567,9 @@ def test_positive_overview_label_name(self, default_org, form_data_ui, org_sessi name = gen_string('alpha') form_data_ui['name'] = name hypervisor_type = form_data_ui['hypervisor_type'] - http_proxy_url, proxy_name, proxy_id = create_http_proxy(org=default_org) + http_proxy_url, proxy_name, proxy_id = create_http_proxy( + org=default_org, location=default_location + ) form_data_ui['proxy'] = http_proxy_url form_data_ui['no_proxy'] = 'test.satellite.com' regex = '.*redhat.com' From e621e6fe6b2827f3b082cc0782a0fb1b25de685a Mon Sep 17 00:00:00 2001 From: Shubham Ganar <67952129+shubhamsg199@users.noreply.github.com> Date: Mon, 15 Jan 2024 16:08:56 +0530 Subject: [PATCH 87/93] Add module_sync_kickstart_content to fixture_markers.py (#13772) --- .../component/provisioning_template.py | 2 +- pytest_plugins/fixture_markers.py | 1 + tests/foreman/api/test_provisioningtemplate.py | 16 ++++++++-------- tests/foreman/cli/test_bootdisk.py | 2 +- tests/foreman/destructive/test_infoblox.py | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pytest_fixtures/component/provisioning_template.py b/pytest_fixtures/component/provisioning_template.py index cb4ea6d84d..97439a8a07 100644 --- a/pytest_fixtures/component/provisioning_template.py +++ b/pytest_fixtures/component/provisioning_template.py @@ -62,7 +62,7 @@ def module_sync_kickstart_content( """ repo_names = [] tasks = [] - rhel_ver = request.param + rhel_ver = request.param['rhel_version'] if int(rhel_ver) <= 7: repo_names.append(f'rhel{rhel_ver}') else: diff --git a/pytest_plugins/fixture_markers.py b/pytest_plugins/fixture_markers.py index 41e12b85ba..951be635ac 100644 --- a/pytest_plugins/fixture_markers.py +++ b/pytest_plugins/fixture_markers.py @@ -8,6 +8,7 @@ 'content_hosts', 'module_provisioning_rhel_content', 'capsule_provisioning_rhel_content', + 'module_sync_kickstart_content', 'rex_contenthost', ] diff --git a/tests/foreman/api/test_provisioningtemplate.py b/tests/foreman/api/test_provisioningtemplate.py index 33f794cb98..b0128fca0a 100644 --- a/tests/foreman/api/test_provisioningtemplate.py +++ b/tests/foreman/api/test_provisioningtemplate.py @@ -240,7 +240,7 @@ def test_positive_build_pxe_default(self, tftpboot, module_target_sat): in rendered ) - @pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True) + @pytest.mark.rhel_ver_match('[^6]') def test_positive_provision_template_check_net_interface( self, module_sync_kickstart_content, @@ -286,7 +286,7 @@ def test_positive_provision_template_check_net_interface( assert 'ifcfg-$sanitized_real' in provision_template @pytest.mark.e2e - @pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True) + @pytest.mark.rhel_ver_match('[^6]') def test_positive_template_check_ipxe( self, module_sync_kickstart_content, @@ -334,7 +334,7 @@ def test_positive_template_check_ipxe( ks_param = 'ks=' if module_sync_kickstart_content.rhel_ver <= 8 else 'inst.ks=' assert ipxe_template.count(ks_param) == 1 - @pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True) + @pytest.mark.rhel_ver_match('[^6]') def test_positive_template_check_vlan_parameter( self, module_sync_kickstart_content, @@ -401,9 +401,9 @@ def test_positive_template_check_vlan_parameter( ipxe_template = host.read_template(data={'template_kind': 'iPXE'})['template'] assert f'vlan={identifier}.{tag}:{identifier}' in ipxe_template - @pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True) @pytest.mark.parametrize('pxe_loader', ['uefi'], indirect=True) @pytest.mark.parametrize('boot_mode', ['Static', 'DHCP']) + @pytest.mark.rhel_ver_match('[^6]') def test_positive_template_subnet_with_boot_mode( self, module_sync_kickstart_content, @@ -495,7 +495,7 @@ def test_positive_template_use_graphical_installer( assert 'graphical' in render assert 'skipx' not in render - @pytest.mark.parametrize('module_sync_kickstart_content', [8], indirect=True) + @pytest.mark.rhel_ver_match('[8]') def test_positive_template_check_aap_snippet( self, module_sync_kickstart_content, @@ -552,7 +552,7 @@ def test_positive_template_check_aap_snippet( assert f'"host_config_key":"{config_key}"' in render assert '{"package_install": "zsh"}' in render - @pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True) + @pytest.mark.rhel_ver_match('[^6]') def test_positive_template_check_rex_snippet( self, module_sync_kickstart_content, @@ -631,7 +631,7 @@ def test_positive_template_check_rex_snippet( ) assert ssh_key in rex_snippet - @pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True) + @pytest.mark.rhel_ver_match('[^6]') def test_positive_template_check_rex_pull_mode_snippet( self, module_sync_kickstart_content, @@ -692,7 +692,7 @@ def test_positive_template_check_rex_pull_mode_snippet( assert 'yggdrasil status' in rex_snippet assert 'Remote execution pull provider successfully configured!' in rex_snippet - @pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True) + @pytest.mark.rhel_ver_match('[^6]') def test_positive_template_check_fips_enabled( self, module_sync_kickstart_content, diff --git a/tests/foreman/cli/test_bootdisk.py b/tests/foreman/cli/test_bootdisk.py index e6515e1af9..4775c3bbde 100644 --- a/tests/foreman/cli/test_bootdisk.py +++ b/tests/foreman/cli/test_bootdisk.py @@ -18,7 +18,7 @@ from robottelo.constants import HTTPS_MEDIUM_URL -@pytest.mark.parametrize('module_sync_kickstart_content', [7, 8, 9], indirect=True) +@pytest.mark.rhel_ver_match('[^6]') def test_positive_bootdisk_download_https( module_location, module_sync_kickstart_content, diff --git a/tests/foreman/destructive/test_infoblox.py b/tests/foreman/destructive/test_infoblox.py index 52e26830b1..cb3aad76c7 100644 --- a/tests/foreman/destructive/test_infoblox.py +++ b/tests/foreman/destructive/test_infoblox.py @@ -112,7 +112,7 @@ def test_plugin_installation(target_sat, command_args, command_opts, rpm_command @pytest.mark.e2e -@pytest.mark.parametrize('module_sync_kickstart_content', [8], indirect=True) +@pytest.mark.rhel_ver_match('[8]') def test_infoblox_end_to_end( request, module_sync_kickstart_content, From 8f1c8daccc1b233eb66d2020da2c46ebb9cd23fb Mon Sep 17 00:00:00 2001 From: Adarsh dubey Date: Mon, 15 Jan 2024 16:14:04 +0530 Subject: [PATCH 88/93] Adding fix for discoveryrule UI (#13754) --- tests/foreman/ui/test_discoveryrule.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/foreman/ui/test_discoveryrule.py b/tests/foreman/ui/test_discoveryrule.py index 0ca5af8712..83ab23cbcc 100644 --- a/tests/foreman/ui/test_discoveryrule.py +++ b/tests/foreman/ui/test_discoveryrule.py @@ -210,6 +210,8 @@ def test_positive_list_host_based_on_rule_search_query( target_sat.api_factory.create_discovered_host(options={'physicalprocessorcount': cpu_count + 1}) provisioned_host_name = f'{host.domain.read().name}' with session: + session.organization.select(org_name=module_org.name) + session.location.select(loc_name=module_location.name) values = session.discoveryrule.read_all() assert discovery_rule.name in [rule['Name'] for rule in values] values = session.discoveryrule.read_discovered_hosts(discovery_rule.name) @@ -218,8 +220,8 @@ def test_positive_list_host_based_on_rule_search_query( assert values['table'][0]['IP Address'] == ip_address assert values['table'][0]['CPUs'] == str(cpu_count) # auto provision the discovered host - session.discoveredhosts.apply_action('Auto Provision', [discovered_host['name']]) - assert not session.discoveredhosts.search('name = "{}"'.format(discovered_host['name'])) + result = target_sat.api.DiscoveredHost(id=discovered_host['id']).auto_provision() + assert f'provisioned with rule {discovery_rule.name}' in result['message'] values = session.discoveryrule.read_associated_hosts(discovery_rule.name) host_name = values['table'][0]['Name'] assert values['searchbox'] == f'discovery_rule = "{discovery_rule.name}"' From 0bbae87ebef0ac961ea3e1e009d63acdf5375b89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hellebrandt?= Date: Mon, 15 Jan 2024 12:13:11 +0100 Subject: [PATCH 89/93] Component Evaluation - add RHEL 8 and 9 host versions (#13602) * Component Evaluation - add RHEL 8 and 9 host versions * Simplify rhel version choice --- tests/foreman/ui/test_host.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/foreman/ui/test_host.py b/tests/foreman/ui/test_host.py index 65dfb73d68..df68fc8966 100644 --- a/tests/foreman/ui/test_host.py +++ b/tests/foreman/ui/test_host.py @@ -1480,8 +1480,9 @@ def test_global_registration_upgrade_subscription_manager( @pytest.mark.tier3 @pytest.mark.usefixtures('enable_capsule_for_registration') +@pytest.mark.rhel_ver_match('[^6].*') def test_global_re_registration_host_with_force_ignore_error_options( - session, module_activation_key, default_os, default_smart_proxy, rhel7_contenthost + session, module_activation_key, default_os, default_smart_proxy, rhel_contenthost ): """If the ignore_error and force checkbox is checked then registered host can get re-registered without any error. @@ -1499,7 +1500,7 @@ def test_global_re_registration_host_with_force_ignore_error_options( :parametrized: yes """ - client = rhel7_contenthost + client = rhel_contenthost with session: cmd = session.host.get_register_command( { @@ -1511,11 +1512,13 @@ def test_global_re_registration_host_with_force_ignore_error_options( 'advanced.ignore_error': True, } ) - client.execute(cmd) + result = client.execute(cmd) + assert result.status == 0 result = client.execute('subscription-manager identity') assert result.status == 0 # rerun the register command - client.execute(cmd) + result = client.execute(cmd) + assert result.status == 0 result = client.execute('subscription-manager identity') assert result.status == 0 From 4b8caa442ff58b6225865a4f51d2ed0166762c7c Mon Sep 17 00:00:00 2001 From: Cole Higgins Date: Wed, 6 Dec 2023 15:45:13 -0500 Subject: [PATCH 90/93] Adding test for invalid release version --- tests/foreman/cli/test_activationkey.py | 64 ++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/tests/foreman/cli/test_activationkey.py b/tests/foreman/cli/test_activationkey.py index 7a0d5f57dd..484a75b5bc 100644 --- a/tests/foreman/cli/test_activationkey.py +++ b/tests/foreman/cli/test_activationkey.py @@ -20,7 +20,7 @@ from robottelo.cli.defaults import Defaults from robottelo.config import settings -from robottelo.constants import PRDS, REPOS, REPOSET +from robottelo.constants import DEFAULT_ARCHITECTURE, PRDS, REPOS, REPOSET from robottelo.exceptions import CLIFactoryError, CLIReturnCodeError from robottelo.hosts import ContentHost from robottelo.utils.datafactory import ( @@ -1686,3 +1686,65 @@ def test_positive_ak_with_custom_product_on_rhel6(module_org, rhel6_contenthost, rhel6_contenthost.install_katello_ca(target_sat) result = rhel6_contenthost.register_contenthost(module_org.label, activation_key=ak.name) assert 'The system has been registered with ID' in result.stdout + + +@pytest.mark.tier3 +def test_positive_invalid_release_version(module_entitlement_manifest_org, module_target_sat): + """Check invalid release versions when updating or creating an activation key + + :id: 2efe452f-132c-4831-abfb-62305832ac66 + + :customerscenario: true + + :Steps: + 1. Attempt to create an activation key with an invalid release version + 2. Attempt to update an activation key with an invalid release version + 3. Successfully update an activation key with a release version + + :expectedresults: Invalid release versions should fail and valid release version should succeed + + :BZ: 1895976 + """ + + name = gen_string('alpha') + gen_string('alpha') + activation_key = module_target_sat.cli_factory.make_activation_key( + {'organization-id': module_entitlement_manifest_org.id, 'name': name} + ) + rh_repo_id = module_target_sat.api_factory.enable_rhrepo_and_fetchid( + basearch=DEFAULT_ARCHITECTURE, + org_id=module_entitlement_manifest_org.id, + product=REPOS['kickstart']['rhel8_aps']['product'], + repo=REPOS['kickstart']['rhel8_aps']['name'], + reposet=REPOS['kickstart']['rhel8_aps']['reposet'], + releasever=REPOS['kickstart']['rhel8_aps']['version'], + ) + rh_repo = module_target_sat.api.Repository(id=rh_repo_id).read() + rh_repo.sync() + with pytest.raises(CLIFactoryError) as error: + module_target_sat.cli_factory.make_activation_key( + { + 'organization-id': module_entitlement_manifest_org.id, + 'name': name, + 'release-version': "ThisShouldNotWork", + } + ) + assert 'Invalid release version: [ThisShouldNotWork]' in error.value.args[0] + + with pytest.raises(CLIReturnCodeError) as error: + module_target_sat.cli.ActivationKey.update( + { + 'name': activation_key['name'], + 'organization-id': module_entitlement_manifest_org.id, + 'release-version': "ThisShouldAlsoNotWork", + } + ) + assert 'Invalid release version: [ThisShouldAlsoNotWork]' in error.value.args[0] + update_ak = module_target_sat.cli.ActivationKey.update( + { + 'name': activation_key['name'], + 'organization-id': module_entitlement_manifest_org.id, + 'release-version': REPOS['kickstart']['rhel8_aps']['version'], + } + ) + assert update_ak[0]['message'] == 'Activation key updated.' From bfd9946febdb49ddce593a86adea214ccc9cc064 Mon Sep 17 00:00:00 2001 From: Cole Higgins Date: Mon, 11 Dec 2023 10:44:14 -0500 Subject: [PATCH 91/93] Addressing comments --- tests/foreman/cli/test_activationkey.py | 27 ++++++++++++------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/tests/foreman/cli/test_activationkey.py b/tests/foreman/cli/test_activationkey.py index 484a75b5bc..d9da85f262 100644 --- a/tests/foreman/cli/test_activationkey.py +++ b/tests/foreman/cli/test_activationkey.py @@ -19,6 +19,7 @@ import pytest from robottelo.cli.defaults import Defaults +from robottelo.cli.repository import Repository from robottelo.config import settings from robottelo.constants import DEFAULT_ARCHITECTURE, PRDS, REPOS, REPOSET from robottelo.exceptions import CLIFactoryError, CLIReturnCodeError @@ -1689,7 +1690,7 @@ def test_positive_ak_with_custom_product_on_rhel6(module_org, rhel6_contenthost, @pytest.mark.tier3 -def test_positive_invalid_release_version(module_entitlement_manifest_org, module_target_sat): +def test_positive_invalid_release_version(module_sca_manifest_org, module_target_sat): """Check invalid release versions when updating or creating an activation key :id: 2efe452f-132c-4831-abfb-62305832ac66 @@ -1697,9 +1698,9 @@ def test_positive_invalid_release_version(module_entitlement_manifest_org, modul :customerscenario: true :Steps: - 1. Attempt to create an activation key with an invalid release version - 2. Attempt to update an activation key with an invalid release version - 3. Successfully update an activation key with a release version + 1. Attempt to create an activation key with a invalid release version + 2. Attempt to update an activation key with a invalid release version + 3. Successfully update an activation key with a valid release version :expectedresults: Invalid release versions should fail and valid release version should succeed @@ -1707,26 +1708,24 @@ def test_positive_invalid_release_version(module_entitlement_manifest_org, modul """ name = gen_string('alpha') - gen_string('alpha') activation_key = module_target_sat.cli_factory.make_activation_key( - {'organization-id': module_entitlement_manifest_org.id, 'name': name} + {'organization-id': module_sca_manifest_org.id, 'name': name} ) rh_repo_id = module_target_sat.api_factory.enable_rhrepo_and_fetchid( basearch=DEFAULT_ARCHITECTURE, - org_id=module_entitlement_manifest_org.id, + org_id=module_sca_manifest_org.id, product=REPOS['kickstart']['rhel8_aps']['product'], repo=REPOS['kickstart']['rhel8_aps']['name'], reposet=REPOS['kickstart']['rhel8_aps']['reposet'], releasever=REPOS['kickstart']['rhel8_aps']['version'], ) - rh_repo = module_target_sat.api.Repository(id=rh_repo_id).read() - rh_repo.sync() + Repository.synchronize({'id': rh_repo_id}) with pytest.raises(CLIFactoryError) as error: module_target_sat.cli_factory.make_activation_key( { - 'organization-id': module_entitlement_manifest_org.id, + 'organization-id': module_sca_manifest_org.id, 'name': name, - 'release-version': "ThisShouldNotWork", + 'release-version': 'ThisShouldNotWork', } ) assert 'Invalid release version: [ThisShouldNotWork]' in error.value.args[0] @@ -1735,15 +1734,15 @@ def test_positive_invalid_release_version(module_entitlement_manifest_org, modul module_target_sat.cli.ActivationKey.update( { 'name': activation_key['name'], - 'organization-id': module_entitlement_manifest_org.id, - 'release-version': "ThisShouldAlsoNotWork", + 'organization-id': module_sca_manifest_org.id, + 'release-version': 'ThisShouldAlsoNotWork', } ) assert 'Invalid release version: [ThisShouldAlsoNotWork]' in error.value.args[0] update_ak = module_target_sat.cli.ActivationKey.update( { 'name': activation_key['name'], - 'organization-id': module_entitlement_manifest_org.id, + 'organization-id': module_sca_manifest_org.id, 'release-version': REPOS['kickstart']['rhel8_aps']['version'], } ) From 3e4147cf389af8e703e40719e2441f32c5d2c401 Mon Sep 17 00:00:00 2001 From: Cole Higgins Date: Fri, 15 Dec 2023 14:01:53 -0500 Subject: [PATCH 92/93] Addressing comments --- tests/foreman/cli/test_activationkey.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/foreman/cli/test_activationkey.py b/tests/foreman/cli/test_activationkey.py index d9da85f262..0c03c80bb8 100644 --- a/tests/foreman/cli/test_activationkey.py +++ b/tests/foreman/cli/test_activationkey.py @@ -1719,7 +1719,7 @@ def test_positive_invalid_release_version(module_sca_manifest_org, module_target reposet=REPOS['kickstart']['rhel8_aps']['reposet'], releasever=REPOS['kickstart']['rhel8_aps']['version'], ) - Repository.synchronize({'id': rh_repo_id}) + module_target_sat.cli.Repository.synchronize({'id': rh_repo_id}) with pytest.raises(CLIFactoryError) as error: module_target_sat.cli_factory.make_activation_key( { From 5d277a6e12e1c9825cddd6361767a30b18b34c94 Mon Sep 17 00:00:00 2001 From: Cole Higgins Date: Fri, 15 Dec 2023 14:05:08 -0500 Subject: [PATCH 93/93] removing import --- tests/foreman/cli/test_activationkey.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/foreman/cli/test_activationkey.py b/tests/foreman/cli/test_activationkey.py index 0c03c80bb8..68c43807fa 100644 --- a/tests/foreman/cli/test_activationkey.py +++ b/tests/foreman/cli/test_activationkey.py @@ -19,7 +19,6 @@ import pytest from robottelo.cli.defaults import Defaults -from robottelo.cli.repository import Repository from robottelo.config import settings from robottelo.constants import DEFAULT_ARCHITECTURE, PRDS, REPOS, REPOSET from robottelo.exceptions import CLIFactoryError, CLIReturnCodeError