Skip to content

Commit

Permalink
mend
Browse files Browse the repository at this point in the history
  • Loading branch information
adarshdubey-star committed Dec 19, 2023
1 parent 83faca6 commit ad1fa4c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
6 changes: 3 additions & 3 deletions pytest_fixtures/core/xdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
15 changes: 6 additions & 9 deletions tests/foreman/ui/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ad1fa4c

Please sign in to comment.