Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.15.z] global registration with nested hostgroup #14204

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions tests/foreman/ui/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,17 +284,19 @@ def test_global_registration_form_populate(
1. create and sync repository
2. create the content view and activation-key
3. create the host-group with activation key, operating system, host-parameters
4. Open the global registration form and select the same host-group
5. check host registration form should be populated automatically based on the host-group
4. create a nested host-group to inherit values
5. open the global registration form and select the same host-group
6. check host registration form should be populated automatically based on the host-group

:BZ: 2056469, 1994654
:BZ: 2056469, 1994654, 1955421

:customerscenario: true
"""
hg_name = gen_string('alpha')
hg_nested_name = gen_string('alpha')
iface = gen_string('alpha')
group_params = {'name': 'host_packages', 'value': constants.FAKE_0_CUSTOM_PACKAGE}
target_sat.api.HostGroup(
parent_hg = target_sat.api.HostGroup(
name=hg_name,
organization=[module_org],
lifecycle_environment=module_lce,
Expand All @@ -303,24 +305,25 @@ def test_global_registration_form_populate(
content_view=module_promoted_cv,
group_parameters_attributes=[group_params],
).create()
target_sat.api.HostGroup(name=hg_nested_name, parent=parent_hg).create()
new_org = target_sat.api.Organization().create()
new_ak = target_sat.api.ActivationKey(organization=new_org).create()
with session:
session.hostgroup.update(
hg_name,
f'{hg_name}/{hg_nested_name}',
{
'activation_keys.activation_keys': module_ak_with_cv.name,
},
)
cmd = session.host.get_register_command(
{
'general.host_group': hg_name,
'general.host_group': f'{hg_name}/{hg_nested_name}',
'advanced.rex_interface': iface,
'general.insecure': True,
},
full_read=True,
)
assert hg_name in cmd['general']['host_group']
assert hg_nested_name in cmd['general']['host_group']
assert module_ak_with_cv.name in cmd['general']['activation_key_helper']
assert constants.FAKE_0_CUSTOM_PACKAGE in cmd['advanced']['install_packages_helper']

Expand Down
Loading