Skip to content

Commit

Permalink
Test for creating a host with lce specified
Browse files Browse the repository at this point in the history
  • Loading branch information
ColeHiggins2 committed Mar 8, 2024
1 parent 5dab06b commit 41dbf1f
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/foreman/cli/test_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -2694,3 +2694,34 @@ def test_positive_create_and_update_with_content_source(
target_sat.cli.Capsule.content_synchronize({'name': module_capsule_configured.hostname})
assert rhel_contenthost.execute(f'dnf -y install {package}').status == 0
assert rhel_contenthost.execute(f'rpm -q {package}').status == 0


@pytest.mark.cli_host_create
@pytest.mark.tier2
def test_positive_create_host_with_lifecycle_environment_name(
module_lce, module_org, module_promoted_cv, module_target_sat
):
"""Attempt to create a host with lifecycle-environment name specified
:id: 7445ad21-538f-4357-8bd1-9676d2478633
:BZ: 2106256
:expectedresults: Host is created with no errors
:CaseImportance: Medium
"""
found_host = False
new_host = module_target_sat.cli_factory.make_fake_host(
{
'content-view-id': module_promoted_cv.id,
'lifecycle-environment': module_lce.name,
'organization-id': module_org.id,
}
)
hosts = module_target_sat.cli.Host.list({'organization-id': module_org.id})
for i in hosts:
if new_host.name in i.values():
found_host = True
break
assert found_host is True, 'Assertion failed: host not found'

0 comments on commit 41dbf1f

Please sign in to comment.