Skip to content

Commit

Permalink
Mark UI tests as end-to-end for Rocket Team Components
Browse files Browse the repository at this point in the history
  • Loading branch information
shweta83 committed Apr 22, 2024
1 parent bcb33fc commit 6fb17ba
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 49 deletions.
1 change: 1 addition & 0 deletions tests/foreman/ui/test_computeprofiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
22 changes: 11 additions & 11 deletions tests/foreman/ui/test_computeresource.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
)


Expand Down
7 changes: 2 additions & 5 deletions tests/foreman/ui/test_computeresource_azurerm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions tests/foreman/ui/test_computeresource_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
53 changes: 26 additions & 27 deletions tests/foreman/ui/test_computeresource_gce.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 2 additions & 4 deletions tests/foreman/ui/test_computeresource_libvirt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions tests/foreman/ui/test_config_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 2 additions & 0 deletions tests/foreman/ui/test_discoveryrule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions tests/foreman/ui/test_operatingsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/foreman/ui/test_puppetclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions tests/foreman/ui/test_puppetenvironment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions tests/foreman/ui/test_smartclassparameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/foreman/ui/test_subnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 6fb17ba

Please sign in to comment.