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

Add Cli/API/UI tests for bootc #17634

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sambible
Copy link
Contributor

Problem Statement

Adds tests for CLI/UI/API for bootc, using dummy facts

Related Issues

Relies on: SatelliteQE/airgun#1745 and SatelliteQE/nailgun#1277

@sambible sambible added No-CherryPick PR doesnt need CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master labels Feb 19, 2025
@sambible sambible requested a review from a team February 19, 2025 14:02
@sambible sambible self-assigned this Feb 19, 2025
@sambible sambible requested review from a team as code owners February 19, 2025 14:02
@sambible
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py::test_bootc_booted_container_images tests/foreman/cli/test_host.py::test_positive_register_read_bootc tests/foreman/api/test_host.py::test_positive_bootc_api_actions --co
airgun: 1745
nailgun: 1277

@LadislavVasina1
Copy link
Contributor

trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py::test_bootc_booted_container_images tests/foreman/cli/test_host.py::test_positive_register_read_bootc tests/foreman/api/test_host.py::test_positive_bootc_api_actions
airgun: 1745
nailgun: 1277

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10262
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_host.py::test_bootc_booted_container_images tests/foreman/cli/test_host.py::test_positive_register_read_bootc tests/foreman/api/test_host.py::test_positive_bootc_api_actions --external-logging
Test Result : ================== 30 warnings, 3 errors in 542.21s (0:09:02) ==================

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Feb 20, 2025
Copy link
Contributor

@vijaysawant vijaysawant left a comment

Choose a reason for hiding this comment

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

Please confirm :CaseComponent: before merging. Rest of things looks good.

@pytest.fixture
def bootc_host(request):
"""Fixture to check out boot-c hosts"""
with Broker(
Copy link
Contributor

Choose a reason for hiding this comment

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

Won't we need ipv6 host?

@@ -1068,6 +1069,51 @@ def test_positive_read_enc_information(
assert host_enc_parameters[param['name']] == param['value']


@pytest.mark.e2e
def test_positive_bootc_api_actions(target_sat, bootc_host, function_ak_with_cv, function_org):
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add the jira-id of the feature.

@sambible
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py::test_bootc_booted_container_images tests/foreman/cli/test_host.py::test_positive_register_read_bootc tests/foreman/api/test_host.py::test_positive_bootc_api_actions
airgun: 1745
nailgun: 1277

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10292
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_host.py::test_bootc_booted_container_images tests/foreman/cli/test_host.py::test_positive_register_read_bootc tests/foreman/api/test_host.py::test_positive_bootc_api_actions --external-logging
Test Result : ================== 35 warnings, 3 errors in 730.98s (0:12:10) ==================

Copy link
Contributor

@vsedmik vsedmik left a comment

Choose a reason for hiding this comment

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

A hosts count question - one or more?

host_class=ContentHost,
) as host:
assert (
host[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
host[0]
host

PRT fails with

20:09:15  >               host[0]
20:09:15                  .execute(f"echo '{constants.DUMMY_BOOTC_FACTS}' > /etc/rhsm/facts/bootc.facts")
20:09:15                  .status
20:09:15                  == 0
20:09:15              )
20:09:15  E           TypeError: 'ContentHost' object is not subscriptable

Did you plan to get multiple hosts (like with _count parameter) from this broker run?
The docstring says so but the fixture name and code don't.

Comment on lines +1086 to +1090
bootc_host[0].register(function_org, None, function_ak_with_cv.name, target_sat).status == 0
)
assert bootc_host[0].subscribed
# Testing bootc info from content_facet_attributes
bootc_host = target_sat.api.Host().search(query={'search': f'name={bootc_host[0].hostname}'})[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar question here (bootc_host[0]) and lower in the other tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No-CherryPick PR doesnt need CherryPick to previous branches PRT-Failed Indicates that latest PRT run is failed for the PR Stream Introduced in or relating directly to Satellite Stream/Master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants