From ad1fa4ce7bf4e698f595ec8aa6e35cb3bfec16e1 Mon Sep 17 00:00:00 2001 From: Adarsh Dubey Date: Fri, 15 Dec 2023 21:29:12 +0530 Subject: [PATCH] mend --- pytest_fixtures/core/xdist.py | 6 +++--- tests/foreman/ui/test_registration.py | 15 ++++++--------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/pytest_fixtures/core/xdist.py b/pytest_fixtures/core/xdist.py index ac8f52ab663..4d02fe026d0 100644 --- a/pytest_fixtures/core/xdist.py +++ b/pytest_fixtures/core/xdist.py @@ -30,9 +30,9 @@ def align_to_satellite(request, worker_id, satellite_factory): worker_pos = int(worker_id.replace('gw', '')) # attempt to add potential satellites from the broker inventory file - # if settings.server.inventory_filter: - # hosts = Satellite.get_hosts_from_inventory(filter=settings.server.inventory_filter) - # settings.server.hostnames += [host.hostname for host in hosts] + if settings.server.inventory_filter: + hosts = Satellite.get_hosts_from_inventory(filter=settings.server.inventory_filter) + settings.server.hostnames += [host.hostname for host in hosts] # attempt to align a worker to a satellite if settings.server.xdist_behavior == 'run-on-one' and settings.server.hostnames: diff --git a/tests/foreman/ui/test_registration.py b/tests/foreman/ui/test_registration.py index 09c069a7313..24804b50971 100644 --- a/tests/foreman/ui/test_registration.py +++ b/tests/foreman/ui/test_registration.py @@ -20,42 +20,39 @@ def test_positive_verify_default_values_for_global_registration( - session, module_target_sat, default_org, default_location, - default_os, ): """Check for all the Default values pre-populated in the global registration template :id: 34122bf3-ae23-47ca-ba3d-da0653d8fd33 - :expectedresults: Some of the fields in the form should be populated - e.g. organization, location,remote-execution, insights setup. + :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 + 1. Check for the default values in the global registration template """ - ak = module_target_sat.cli_factory.make_activation_key( + module_target_sat.cli_factory.make_activation_key( {'organization-id': default_org.id, 'name': gen_string('alpha')} ) - with session: + with module_target_sat.ui_session() as session: session.organization.select(org_name=default_org.name) session.location.select(loc_name=default_location.name) cmd = session.host.get_register_command( - {'general.activation_keys': ak.name, 'general.operating_system': default_os.title}, full_read=True, ) assert cmd['general']['organization'] == 'Default Organization' assert cmd['general']['location'] == 'Default Location' + assert cmd['general']['capsule'] == 'Nothing to select.' 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['general']['capsule'] == 'Nothing to select.' assert cmd['advanced']['update_packages'] is False assert cmd['advanced']['ignore_error'] is False assert cmd['advanced']['force'] is False