From 6fb17ba03ce9048dd02a144f54337b8e466aba69 Mon Sep 17 00:00:00 2001 From: shwsingh Date: Tue, 9 Apr 2024 19:53:32 +0530 Subject: [PATCH] Mark UI tests as end-to-end for Rocket Team Components --- tests/foreman/ui/test_computeprofiles.py | 1 + tests/foreman/ui/test_computeresource.py | 22 ++++---- .../ui/test_computeresource_azurerm.py | 7 +-- tests/foreman/ui/test_computeresource_ec2.py | 5 +- tests/foreman/ui/test_computeresource_gce.py | 53 +++++++++---------- .../ui/test_computeresource_libvirt.py | 6 +-- tests/foreman/ui/test_config_group.py | 1 + tests/foreman/ui/test_discoveryrule.py | 2 + tests/foreman/ui/test_operatingsystem.py | 1 + tests/foreman/ui/test_puppetclass.py | 1 + tests/foreman/ui/test_puppetenvironment.py | 1 + tests/foreman/ui/test_smartclassparameter.py | 1 + tests/foreman/ui/test_subnet.py | 1 + 13 files changed, 53 insertions(+), 49 deletions(-) diff --git a/tests/foreman/ui/test_computeprofiles.py b/tests/foreman/ui/test_computeprofiles.py index 035e09a9938..cdf6842516f 100644 --- a/tests/foreman/ui/test_computeprofiles.py +++ b/tests/foreman/ui/test_computeprofiles.py @@ -15,6 +15,7 @@ import pytest +@pytest.mark.e2e @pytest.mark.tier2 @pytest.mark.upgrade def test_positive_end_to_end(session, module_location, module_org, module_target_sat): diff --git a/tests/foreman/ui/test_computeresource.py b/tests/foreman/ui/test_computeresource.py index abbc088aa47..67c02806606 100644 --- a/tests/foreman/ui/test_computeresource.py +++ b/tests/foreman/ui/test_computeresource.py @@ -47,7 +47,7 @@ def rhev_data(): @pytest.mark.tier2 -def test_positive_end_to_end(session, rhev_data, module_org, module_location, module_target_sat): +def test_positive_end_to_end(session, rhev_data, module_target_sat): """Perform end to end testing for compute resource RHEV. :id: 3c079675-e5d3-490e-9b7e-1c2950f9965d @@ -215,10 +215,10 @@ def test_positive_resource_vm_power_management(session, rhev_data): wait_for( lambda: ( - session.browser.refresh(), - session.computeresource.vm_status(name, rhev_data['vm_name']), - )[1] - is not status, + session.browser.refresh(), + session.computeresource.vm_status(name, rhev_data['vm_name']), + )[1] + is not status, timeout=180, delay=1, ) @@ -288,7 +288,6 @@ def test_positive_VM_import(session, module_org, module_location, rhev_data, mod name = gen_string('alpha') with session: - session.computeresource.create( { 'name': name, @@ -361,8 +360,9 @@ def test_positive_update_organization(session, rhev_data, module_location, modul assert new_organization.name in resource_values['organizations']['resources']['assigned'] +@pytest.mark.e2e @pytest.mark.tier2 -def test_positive_image_end_to_end(session, rhev_data, module_location, target_sat): +def test_positive_image_end_to_end(session, rhev_data, target_sat): """Perform end to end testing for compute resource RHV component image. :id: 62a5c52f-dd15-45e7-8200-c64bb335474f @@ -410,13 +410,13 @@ def test_positive_image_end_to_end(session, rhev_data, module_location, target_s session.computeresource.update_image(cr_name, image_name, dict(name=new_image_name)) assert session.computeresource.search_images(cr_name, image_name)[0] != image_name assert ( - session.computeresource.search_images(cr_name, new_image_name)[0]['Name'] - == new_image_name + session.computeresource.search_images(cr_name, new_image_name)[0]['Name'] + == new_image_name ) session.computeresource.delete_image(cr_name, new_image_name) assert ( - session.computeresource.search_images(cr_name, new_image_name)[0]['Name'] - != new_image_name + session.computeresource.search_images(cr_name, new_image_name)[0]['Name'] + != new_image_name ) diff --git a/tests/foreman/ui/test_computeresource_azurerm.py b/tests/foreman/ui/test_computeresource_azurerm.py index 36228513ffa..163319d4dd3 100644 --- a/tests/foreman/ui/test_computeresource_azurerm.py +++ b/tests/foreman/ui/test_computeresource_azurerm.py @@ -73,14 +73,13 @@ def module_azure_hg( ).create() +@pytest.mark.e2e @pytest.mark.tier4 @pytest.mark.parametrize('sat_azure', ['sat'], indirect=True) def test_positive_end_to_end_azurerm_ft_host_provision( - session, sat_azure, azurermclient, module_azurerm_custom_finishimg, - module_azurerm_cr, sat_azure_domain, sat_azure_org, sat_azure_loc, @@ -150,19 +149,17 @@ def test_positive_end_to_end_azurerm_ft_host_provision( raise error +@pytest.mark.e2e @pytest.mark.tier3 @pytest.mark.upgrade @pytest.mark.parametrize( 'sat_azure', ['sat', 'puppet_sat'], indirect=True, ids=['satellite', 'puppet_enabled'] ) def test_positive_azurerm_host_provision_ud( - session, sat_azure, azurermclient, module_azurerm_cloudimg, - module_azurerm_cr, sat_azure_domain, - sat_azure_default_os, sat_azure_org, sat_azure_loc, module_azure_hg, diff --git a/tests/foreman/ui/test_computeresource_ec2.py b/tests/foreman/ui/test_computeresource_ec2.py index 0d08685543c..b47f7d843f2 100644 --- a/tests/foreman/ui/test_computeresource_ec2.py +++ b/tests/foreman/ui/test_computeresource_ec2.py @@ -39,11 +39,12 @@ def module_ec2_settings(): ) +@pytest.mark.e2e @pytest.mark.tier2 @pytest.mark.skip_if_not_set('http_proxy') @pytest.mark.skip_if_open("BZ:2032530") def test_positive_default_end_to_end_with_custom_profile( - session, module_org, module_location, module_ec2_settings, module_target_sat + session, module_org, module_location, module_ec2_settings, module_target_sat ): """Create EC2 compute resource with default properties and apply it's basic functionality. @@ -135,7 +136,7 @@ def test_positive_default_end_to_end_with_custom_profile( new_cr_name, module_ec2_settings['region'], FOREMAN_PROVIDERS['ec2'] ) assert ( - cr_profile_values['provider_content']['managed_ip'] == module_ec2_settings['managed_ip'] + cr_profile_values['provider_content']['managed_ip'] == module_ec2_settings['managed_ip'] ) assert cr_profile_values['provider_content']['flavor'] == AWS_EC2_FLAVOR_T2_MICRO session.computeresource.delete(new_cr_name) diff --git a/tests/foreman/ui/test_computeresource_gce.py b/tests/foreman/ui/test_computeresource_gce.py index a25edb1da44..a45a598bd0c 100644 --- a/tests/foreman/ui/test_computeresource_gce.py +++ b/tests/foreman/ui/test_computeresource_gce.py @@ -28,11 +28,12 @@ ) +@pytest.mark.e2e @pytest.mark.tier2 @pytest.mark.upgrade @pytest.mark.skip_if_not_set('http_proxy', 'gce') def test_positive_default_end_to_end_with_custom_profile( - session, sat_gce_org, sat_gce_loc, gce_cert, sat_gce + sat_gce_org, sat_gce_loc, gce_cert, sat_gce ): """Create GCE compute resource with default properties and apply it's basic functionality. @@ -124,8 +125,8 @@ def test_positive_default_end_to_end_with_custom_profile( assert cr_profile_values['breadcrumb'] == f'Edit {COMPUTE_PROFILE_SMALL}' assert cr_profile_values['compute_profile'] == COMPUTE_PROFILE_SMALL assert ( - cr_profile_values['compute_resource'] - == f'{new_cr_name} ({settings.gce.zone}-{FOREMAN_PROVIDERS["google"]})' + cr_profile_values['compute_resource'] + == f'{new_cr_name} ({settings.gce.zone}-{FOREMAN_PROVIDERS["google"]})' ) assert cr_profile_values['provider_content']['machine_type'] == GCE_MACHINE_TYPE_DEFAULT assert cr_profile_values['provider_content']['network'] == GCE_NETWORK_DEFAULT @@ -139,21 +140,20 @@ def test_positive_default_end_to_end_with_custom_profile( assert not session.computeresource.search(new_cr_name) +@pytest.mark.e2e @pytest.mark.tier4 @pytest.mark.run_in_one_thread @pytest.mark.skip_if_not_set('gce') @pytest.mark.parametrize('sat_gce', ['sat', 'puppet_sat'], indirect=True) def test_positive_gce_provision_end_to_end( - session, - request, - sat_gce, - sat_gce_org, - sat_gce_loc, - sat_gce_default_os, - gce_domain, - gce_hostgroup_resource_image, - googleclient, - gce_setting_update, + request, + sat_gce, + sat_gce_org, + sat_gce_loc, + sat_gce_default_os, + gce_domain, + gce_hostgroup_resource_image, + googleclient, ): """Provision Host on GCE compute resource @@ -195,9 +195,9 @@ def _finalize(): ) wait_for( lambda: sat_gce.api.Host() - .search(query={'search': f'name={hostname}'})[0] - .build_status_label - != 'Pending installation', + .search(query={'search': f'name={hostname}'})[0] + .build_status_label + != 'Pending installation', timeout=600, delay=15, silent_failure=True, @@ -224,22 +224,21 @@ def _finalize(): assert gceapi_vm.is_stopping or gceapi_vm.is_stopped +@pytest.mark.e2e @pytest.mark.tier4 @pytest.mark.upgrade @pytest.mark.run_in_one_thread @pytest.mark.skip_if_not_set('gce') @pytest.mark.parametrize('sat_gce', ['sat', 'puppet_sat'], indirect=True) def test_positive_gce_cloudinit_provision_end_to_end( - session, - request, - sat_gce, - sat_gce_org, - sat_gce_loc, - sat_gce_default_os, - gce_domain, - gce_hostgroup_resource_image, - googleclient, - gce_setting_update, + request, + sat_gce, + sat_gce_org, + sat_gce_loc, + sat_gce_default_os, + gce_domain, + gce_hostgroup_resource_image, + googleclient, ): """Provision Host on GCE compute resource @@ -284,7 +283,7 @@ def _finalize(): host_info = session.host.get_details(hostname) assert session.host.search(hostname)[0]['Name'] == hostname assert ( - host_info['properties']['properties_table']['Build'] == 'Pending installation clear' + host_info['properties']['properties_table']['Build'] == 'Pending installation clear' ) # 1.2 GCE Backend Assertions gceapi_vm = googleclient.get_vm(gceapi_vmname) diff --git a/tests/foreman/ui/test_computeresource_libvirt.py b/tests/foreman/ui/test_computeresource_libvirt.py index 42477b8d46a..76e63a6e4fa 100644 --- a/tests/foreman/ui/test_computeresource_libvirt.py +++ b/tests/foreman/ui/test_computeresource_libvirt.py @@ -29,7 +29,6 @@ LIBVIRT_URL = LIBVIRT_RESOURCE_URL % settings.libvirt.libvirt_hostname - @pytest.mark.tier2 @pytest.mark.e2e def test_positive_end_to_end(session, module_target_sat, module_org, module_location): @@ -116,14 +115,13 @@ def test_positive_end_to_end(session, module_target_sat, module_org, module_loca session.computeresource.delete(new_cr_name) assert not session.computeresource.search(new_cr_name) - +@pytest.mark.e2e @pytest.mark.on_premises_provisioning @pytest.mark.tier4 @pytest.mark.rhel_ver_match('[^6]') @pytest.mark.parametrize('setting_update', ['destroy_vm_on_host_delete=True'], indirect=True) def test_positive_provision_end_to_end( request, - session, setting_update, module_sca_manifest_org, module_location, @@ -154,7 +152,7 @@ def test_positive_provision_end_to_end( location=[module_location], organization=[module_sca_manifest_org], ).create() - with session: + with sat.ui_session() as session: session.host.create( { 'host.name': hostname, diff --git a/tests/foreman/ui/test_config_group.py b/tests/foreman/ui/test_config_group.py index b38384d2977..9bf49ed1e1d 100644 --- a/tests/foreman/ui/test_config_group.py +++ b/tests/foreman/ui/test_config_group.py @@ -20,6 +20,7 @@ def module_puppet_class(session_puppet_enabled_sat): return session_puppet_enabled_sat.api.PuppetClass().create() +@pytest.mark.e2e @pytest.mark.tier2 @pytest.mark.upgrade def test_positive_end_to_end(session_puppet_enabled_sat, module_puppet_class): diff --git a/tests/foreman/ui/test_discoveryrule.py b/tests/foreman/ui/test_discoveryrule.py index 83ab23cbcc2..e49083d3300 100644 --- a/tests/foreman/ui/test_discoveryrule.py +++ b/tests/foreman/ui/test_discoveryrule.py @@ -62,6 +62,7 @@ def gen_int32(min_value=1): return gen_integer(min_value=min_value, max_value=max_value) +@pytest.mark.e2e @pytest.mark.tier2 def test_positive_crud_with_non_admin_user( module_location, manager_user, module_org, module_target_sat @@ -231,6 +232,7 @@ def test_positive_list_host_based_on_rule_search_query( assert values['properties']['properties_table']['IP Address'] == ip_address +@pytest.mark.e2e @pytest.mark.tier3 @pytest.mark.upgrade def test_positive_end_to_end(session, module_org, module_location, module_target_sat): diff --git a/tests/foreman/ui/test_operatingsystem.py b/tests/foreman/ui/test_operatingsystem.py index 1324b556230..d3b35faed0b 100644 --- a/tests/foreman/ui/test_operatingsystem.py +++ b/tests/foreman/ui/test_operatingsystem.py @@ -17,6 +17,7 @@ from robottelo.utils.datafactory import gen_string +@pytest.mark.e2e @pytest.mark.tier2 def test_positive_end_to_end(session, module_org, module_location, target_sat): """Create all possible entities that required for operating system and then diff --git a/tests/foreman/ui/test_puppetclass.py b/tests/foreman/ui/test_puppetclass.py index b44ad73e7a7..776d3e7845b 100644 --- a/tests/foreman/ui/test_puppetclass.py +++ b/tests/foreman/ui/test_puppetclass.py @@ -15,6 +15,7 @@ import pytest +@pytest.mark.e2e @pytest.mark.tier2 @pytest.mark.upgrade def test_positive_end_to_end(session_puppet_enabled_sat, module_puppet_org, module_puppet_loc): diff --git a/tests/foreman/ui/test_puppetenvironment.py b/tests/foreman/ui/test_puppetenvironment.py index 57502a51191..6a656b65ffb 100644 --- a/tests/foreman/ui/test_puppetenvironment.py +++ b/tests/foreman/ui/test_puppetenvironment.py @@ -17,6 +17,7 @@ from robottelo.utils.datafactory import gen_string +@pytest.mark.e2e @pytest.mark.upgrade @pytest.mark.tier2 def test_positive_end_to_end(session_puppet_enabled_sat, module_puppet_org, module_puppet_loc): diff --git a/tests/foreman/ui/test_smartclassparameter.py b/tests/foreman/ui/test_smartclassparameter.py index adc5169f2ae..081a2985d14 100644 --- a/tests/foreman/ui/test_smartclassparameter.py +++ b/tests/foreman/ui/test_smartclassparameter.py @@ -65,6 +65,7 @@ def module_domain(session_puppet_enabled_sat, module_host): return session_puppet_enabled_sat.api.Domain(id=module_host.domain.id).read() +@pytest.mark.e2e @pytest.mark.tier2 def test_positive_end_to_end(session_puppet_enabled_sat, module_puppet_classes, sc_params_list): """Perform end to end testing for smart class parameter component diff --git a/tests/foreman/ui/test_subnet.py b/tests/foreman/ui/test_subnet.py index 45886c3ec86..3994d8a7b45 100644 --- a/tests/foreman/ui/test_subnet.py +++ b/tests/foreman/ui/test_subnet.py @@ -26,6 +26,7 @@ def module_dom(module_target_sat, module_org, module_location): d.delete() +@pytest.mark.e2e @pytest.mark.tier2 @pytest.mark.upgrade def test_positive_end_to_end(session, module_target_sat, module_dom):