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 Mar 7, 2024
1 parent cc8227d commit dfd337c
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions tests/foreman/api/test_subnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,10 @@ 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 @@ -354,11 +355,26 @@ def test_positive_update_subnet_parameter_host_impact():
1. The inherited subnet parameter in host should have
updated name and value
2. The inherited subnet parameter in host enc should have
updated name and value
: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 dfd337c

Please sign in to comment.