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 9, 2024
1 parent ce6777c commit 9e8b42a
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 77 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
62 changes: 29 additions & 33 deletions tests/foreman/ui/test_computeresource_azurerm.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ def module_azure_cp_attrs(module_azurerm_cr, module_azurerm_custom_finishimg, sa

@pytest.fixture(scope='module')
def module_azure_hg(
sat_azure,
module_azurerm_cr,
module_azure_cp_attrs,
sat_azure_default_architecture,
sat_azure_default_os,
sat_azure_org,
sat_azure_loc,
sat_azure_domain,
sat_azure,
module_azurerm_cr,
module_azure_cp_attrs,
sat_azure_default_architecture,
sat_azure_default_os,
sat_azure_org,
sat_azure_loc,
sat_azure_domain,
):
"""Create hostgroup"""

Expand All @@ -73,18 +73,17 @@ 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,
module_azure_hg,
sat_azure,
azurermclient,
module_azurerm_custom_finishimg,
sat_azure_domain,
sat_azure_org,
sat_azure_loc,
module_azure_hg,
):
"""Provision Host with hostgroup and Compute-profile using
finish template on AzureRm compute resource
Expand Down Expand Up @@ -120,8 +119,8 @@ def test_positive_end_to_end_azurerm_ft_host_provision(
host_info = session.host.get_details(fqdn)
assert 'Installed' in host_info['properties']['properties_table']['Build']
assert (
host_info['properties']['properties_table']['Host group']
== module_azure_hg.name
host_info['properties']['properties_table']['Host group']
== module_azure_hg.name
)

# AzureRm Cloud assertion
Expand Down Expand Up @@ -156,16 +155,13 @@ def test_positive_end_to_end_azurerm_ft_host_provision(
'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,
sat_azure,
azurermclient,
module_azurerm_cloudimg,
sat_azure_domain,
sat_azure_org,
sat_azure_loc,
module_azure_hg,
):
"""Provision a Host with hostgroup and Compute-profile using
cloud-init image on AzureRm compute resource
Expand All @@ -189,7 +185,7 @@ def test_positive_azurerm_host_provision_ud(
# Provision Host
try:
with sat_azure.skip_yum_update_during_provisioning(
template='Kickstart default user data'
template='Kickstart default user data'
):
session.host.create(
{
Expand All @@ -202,11 +198,11 @@ def test_positive_azurerm_host_provision_ud(

host_info = session.host.get_details(fqdn)
assert (
'Pending installation' in host_info['properties']['properties_table']['Build']
'Pending installation' in host_info['properties']['properties_table']['Build']
)
assert (
host_info['properties']['properties_table']['Host group']
== module_azure_hg.name
host_info['properties']['properties_table']['Host group']
== module_azure_hg.name
)

# AzureRm Cloud assertion
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

0 comments on commit 9e8b42a

Please sign in to comment.