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

[Customer Case] Test for creating a host with lce specified #14321

Merged
merged 4 commits into from
May 8, 2024
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
33 changes: 33 additions & 0 deletions tests/foreman/cli/test_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -2699,3 +2699,36 @@ 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

Griffin-Sullivan marked this conversation as resolved.
Show resolved Hide resolved
:customerscenario: true

: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})
found_host = any(new_host.name in i.values() for i in hosts)
assert found_host, 'Assertion failed: host not found'
Comment on lines +2733 to +2734
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking

Suggested change
found_host = any(new_host.name in i.values() for i in hosts)
assert found_host, 'Assertion failed: host not found'
assert any(new_host.name in i.values() for i in hosts), 'Assertion failed: host not found'

Loading