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] fix typo in test_host #15018

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
18 changes: 9 additions & 9 deletions tests/foreman/cli/test_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,13 +360,13 @@ def test_positive_crud_interface_by_id(target_sat, default_location, default_org

mac = gen_mac(multicast=False)
host = target_sat.cli_factory.make_fake_host({'domain-id': domain.id})
number_of_interfaces = len(target_sat.cliHostInterface.list({'host-id': host['id']}))
number_of_interfaces = len(target_sat.cli.HostInterface.list({'host-id': host['id']}))

target_sat.cliHostInterface.create(
target_sat.cli.HostInterface.create(
{'host-id': host['id'], 'domain-id': domain.id, 'mac': mac, 'type': 'interface'}
)
host = target_sat.cli.Host.info({'id': host['id']})
host_interface = target_sat.cliHostInterface.info(
host_interface = target_sat.cli.HostInterface.info(
{
'host-id': host['id'],
'id': [ni for ni in host['network-interfaces'] if ni['mac-address'] == mac][0]['id'],
Expand All @@ -375,22 +375,22 @@ def test_positive_crud_interface_by_id(target_sat, default_location, default_org
assert host_interface['domain'] == domain.name
assert host_interface['mac-address'] == mac
assert (
len(target_sat.cliHostInterface.list({'host-id': host['id']})) == number_of_interfaces + 1
len(target_sat.cli.HostInterface.list({'host-id': host['id']})) == number_of_interfaces + 1
)

new_domain = target_sat.api.Domain(
location=[default_location], organization=[default_org]
).create()
new_mac = gen_mac(multicast=False)
target_sat.cliHostInterface.update(
target_sat.cli.HostInterface.update(
{
'host-id': host['id'],
'id': host_interface['id'],
'domain-id': new_domain.id,
'mac': new_mac,
}
)
host_interface = target_sat.cliHostInterface.info(
host_interface = target_sat.cli.HostInterface.info(
{
'host-id': host['id'],
'id': [ni for ni in host['network-interfaces'] if ni['mac-address'] == mac][0]['id'],
Expand All @@ -399,10 +399,10 @@ def test_positive_crud_interface_by_id(target_sat, default_location, default_org
assert host_interface['domain'] == new_domain.name
assert host_interface['mac-address'] == new_mac

target_sat.cliHostInterface.delete({'host-id': host['id'], 'id': host_interface['id']})
assert len(target_sat.cliHostInterface.list({'host-id': host['id']})) == number_of_interfaces
target_sat.cli.HostInterface.delete({'host-id': host['id'], 'id': host_interface['id']})
assert len(target_sat.cli.HostInterface.list({'host-id': host['id']})) == number_of_interfaces
with pytest.raises(CLIReturnCodeError):
target_sat.cliHostInterface.info({'host-id': host['id'], 'id': host_interface['id']})
target_sat.cli.HostInterface.info({'host-id': host['id'], 'id': host_interface['id']})


@pytest.mark.cli_host_create
Expand Down
Loading