Skip to content

Commit

Permalink
host name & value updated with subnet
Browse files Browse the repository at this point in the history
  • Loading branch information
amolpati30 committed Feb 28, 2024
1 parent 7aa0e86 commit b67c14f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/foreman/api/test_subnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,8 @@ def test_negative_update_parameter(new_name, target_sat):
sub_param.update(['name'])


@pytest.mark.stubbed
@pytest.mark.tier2
def test_positive_update_subnet_parameter_host_impact():
def test_positive_update_subnet_parameter_host_impact(target_sat,):
"""Update in parameter name and value from subnet component updates
the parameter in host inheriting that subnet
Expand All @@ -359,6 +358,18 @@ def test_positive_update_subnet_parameter_host_impact():
:BZ: 1470014
"""
parameter = [{'name': gen_string('alpha'), 'value': gen_string('alpha')}]
org = target_sat.api.Organization().create()
loc = target_sat.api.Location(organization=[org]).create()
org_subnet = target_sat.api.Subnet(
location=[loc], organization=[org], subnet_parameters_attributes=parameter
).create()
host = target_sat.api.Host(location=loc, organization=org, subnet=org_subnet).create()
parameter_new_value = [{'name': gen_string('alpha'), 'value': gen_string('alpha')}]
org_subnet.subnet_parameters_attributes = parameter_new_value
org_subnet.update(['subnet_parameters_attributes'])
assert host.subnet.read().subnet_parameters_attributes[0]['name'] == parameter_new_value[0]['name']
assert host.subnet.read().subnet_parameters_attributes[0]['value'] == parameter_new_value[0]['value']


@pytest.mark.tier1
Expand Down

0 comments on commit b67c14f

Please sign in to comment.