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

[CV Eval] CV Version Test #14949

Merged
merged 12 commits into from
Jun 3, 2024
58 changes: 58 additions & 0 deletions tests/foreman/ui/test_contentview.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
from fauxfactory import gen_string
import pytest

from robottelo.constants import DEFAULT_ARCHITECTURE, REPOS


@pytest.mark.tier2
def test_positive_create_cv(session, target_sat):
Expand All @@ -36,6 +38,62 @@ def test_positive_create_cv(session, target_sat):
assert session.contentview_new.search(cv)[0]['Name'] == cv


@pytest.mark.tier2
def test_version_table_read(session, function_sca_manifest_org, target_sat):
"""Able to read CV version package details, which includes the Epoch tab

:id: fe2a87c7-f148-40f2-b11a-c209a4807016

:steps:
1. Enable and Sync RHEL8 Base OS Repo
2. Add repo to a CV
3. Publish the CV
4. Navigate to the published Version's page
5. Filter packages to only an arbitrary package

:expectedresults: The package is present, has the appropriate name, and has the epoch tab present

:CaseImportance: Critical

:BZ: 1911545

:customerscenario: true
"""
target_sat.cli.RepositorySet.enable(
{
'basearch': DEFAULT_ARCHITECTURE,
'name': REPOS['rhel8_bos']['reposet'],
'organization-id': function_sca_manifest_org.id,
'product': REPOS['rhel8_bos']['product'],
'releasever': REPOS['rhel8_bos']['releasever'],
}
)
rhel8_bos_info = target_sat.cli.RepositorySet.info(
{
'name': REPOS['rhel8_bos']['reposet'],
'organization-id': function_sca_manifest_org.id,
'product': REPOS['rhel8_bos']['product'],
}
)
rh_repo_id = rhel8_bos_info['enabled-repositories'][0]['id']
rh_repo = target_sat.api.Repository(id=rh_repo_id).read()
rh_repo.sync()
sambible marked this conversation as resolved.
Show resolved Hide resolved
cv = target_sat.api.ContentView(organization=function_sca_manifest_org).create()
cv = target_sat.api.ContentView(id=cv.id, repository=[rh_repo]).update(["repository"])
cv.publish()
with target_sat.ui_session() as session:
package_name = 'aajohan'
session.organization.select(org_name=function_sca_manifest_org.name)
response = session.contentview_new.read_version_table(
cv.name, 'Version 1.0', 'rpmPackages', search_param=package_name
)
assert package_name in response[0]['Name']
assert response[0]['Epoch']
assert response[0]['Name'] == 'aajohan-comfortaa-fonts-3.001-2.el8.noarch'
Copy link
Contributor

Choose a reason for hiding this comment

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

This test will fail on RHEL9 Satellite.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we avoid the hardcoding of version?

assert response[0]['Version'] == '3.001'
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

assert response[0]['Release'] == '2.el8'
sambible marked this conversation as resolved.
Show resolved Hide resolved


@pytest.mark.tier2
def test_no_blank_page_on_language_switch(session, target_sat, module_org):
"""Able to view the new CV UI when the language is set to something other
Expand Down