-
Notifications
You must be signed in to change notification settings - Fork 116
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -269,6 +269,23 @@ def oracle_host(request, version): | |||||
yield host | ||||||
|
||||||
|
||||||
@pytest.fixture | ||||||
def bootc_host(request): | ||||||
"""Fixture to check out boot-c hosts""" | ||||||
with Broker( | ||||||
**host_conf(request), | ||||||
workflow='deploy-bootc', | ||||||
host_class=ContentHost, | ||||||
) as host: | ||||||
assert ( | ||||||
host[0] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
PRT fails with
Did you plan to get multiple hosts (like with |
||||||
.execute(f"echo '{constants.DUMMY_BOOTC_FACTS}' > /etc/rhsm/facts/bootc.facts") | ||||||
.status | ||||||
== 0 | ||||||
) | ||||||
yield host | ||||||
|
||||||
|
||||||
@pytest.fixture(scope='module', params=[{'rhel_version': 8, 'no_containers': True}]) | ||||||
def external_puppet_server(request): | ||||||
deploy_args = host_conf(request) | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,14 +17,15 @@ | |
""" | ||
|
||
import http | ||
import json | ||
|
||
from fauxfactory import gen_choice, gen_integer, gen_ipaddr, gen_mac, gen_string | ||
from nailgun import client | ||
import pytest | ||
from requests.exceptions import HTTPError | ||
|
||
from robottelo.config import get_credentials | ||
from robottelo.constants import DEFAULT_CV, ENVIRONMENT | ||
from robottelo.constants import DEFAULT_CV, DUMMY_BOOTC_FACTS, ENVIRONMENT | ||
from robottelo.utils import datafactory | ||
|
||
|
||
|
@@ -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): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add the jira-id of the feature. |
||
"""Register a bootc host and validate API information | ||
:id: b94ab231-0dd8-4e47-a96b-972c5ee55f4d | ||
:expectedresults: Upon registering a Bootc host, the API returns correct information across multiple endpoints | ||
:CaseComponent:Hosts-Content | ||
sambible marked this conversation as resolved.
Show resolved
Hide resolved
|
||
:CaseImportance: Critical | ||
""" | ||
bootc_dummy_info = json.loads(DUMMY_BOOTC_FACTS) | ||
assert ( | ||
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] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar question here ( |
||
assert ( | ||
bootc_host.content_facet_attributes['bootc_booted_image'] | ||
== bootc_dummy_info['bootc.booted.image'] | ||
) | ||
assert ( | ||
bootc_host.content_facet_attributes['bootc_booted_digest'] | ||
== bootc_dummy_info['bootc.booted.digest'] | ||
) | ||
assert ( | ||
bootc_host.content_facet_attributes['bootc_rollback_image'] | ||
== bootc_dummy_info['bootc.rollback.image'] | ||
) | ||
assert ( | ||
bootc_host.content_facet_attributes['bootc_rollback_digest'] | ||
== bootc_dummy_info['bootc.rollback.digest'] | ||
) | ||
# Testing bootc info from hosts/bootc_images | ||
bootc_image_info = target_sat.api.Host().get_bootc_images() | ||
assert bootc_image_info[0]['bootc_booted_image'] == bootc_dummy_info['bootc.booted.image'] | ||
assert ( | ||
bootc_image_info[0]['bootc_booted_image']['digests'][0]['bootc_booted_digest'] | ||
== bootc_dummy_info['bootc.booted.digest'] | ||
) | ||
assert bootc_image_info[0]['bootc_booted_image']['digests'][0]['host_count'] > 0 | ||
|
||
|
||
@pytest.mark.tier2 | ||
@pytest.mark.stubbed | ||
def test_positive_add_future_subscription(): | ||
|
There was a problem hiding this comment.
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?