-
Notifications
You must be signed in to change notification settings - Fork 115
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] Applied Errata report with invalid errata #15378
Changes from all commits
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 | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -455,6 +455,82 @@ def test_positive_applied_errata( | |||||||||
assert res[0]['issued'] | ||||||||||
|
||||||||||
|
||||||||||
@pytest.mark.tier2 | ||||||||||
@pytest.mark.rhel_ver_match('[^6]') | ||||||||||
@pytest.mark.no_containers | ||||||||||
def test_positive_applied_errata_report_with_invalid_errata( | ||||||||||
function_org, function_location, function_lce, rhel_contenthost, target_sat | ||||||||||
): | ||||||||||
"""Generate an Applied Errata report after an invalid errata has been applied | ||||||||||
|
||||||||||
:id: cf64f193-870d-4053-ae4b-28148424b2e2 | ||||||||||
|
||||||||||
:setup: A Host with some invalid applied errata. | ||||||||||
|
||||||||||
:steps: | ||||||||||
|
||||||||||
1. Apply invalid errata | ||||||||||
2. Generate an Applied Errata report | ||||||||||
|
||||||||||
:expectedresults: A report is generated without failures | ||||||||||
|
||||||||||
:BZ: 2176368 | ||||||||||
|
||||||||||
:customerscenario: true | ||||||||||
""" | ||||||||||
activation_key = target_sat.api.ActivationKey( | ||||||||||
environment=function_lce, organization=function_org | ||||||||||
).create() | ||||||||||
cv = target_sat.api.ContentView(organization=function_org).create() | ||||||||||
Comment on lines
+481
to
+484
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
We could probably use 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. Had some issues with lce using that fixture, Test was failing, Lets just keep it how it is 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. I have also found that fixture fails to setup as expected |
||||||||||
target_sat.cli_factory.setup_org_for_a_custom_repo( | ||||||||||
{ | ||||||||||
'url': settings.repos.yum_6.url, | ||||||||||
'organization-id': function_org.id, | ||||||||||
'content-view-id': cv.id, | ||||||||||
'lifecycle-environment-id': function_lce.id, | ||||||||||
'activationkey-id': activation_key.id, | ||||||||||
} | ||||||||||
) | ||||||||||
result = rhel_contenthost.register( | ||||||||||
function_org, function_location, activation_key.name, target_sat | ||||||||||
) | ||||||||||
assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout | ||||||||||
assert rhel_contenthost.subscribed | ||||||||||
rhel_contenthost.execute(r'subscription-manager repos --enable \*') | ||||||||||
assert rhel_contenthost.execute(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}').status == 0 | ||||||||||
assert rhel_contenthost.execute(f'rpm -q {FAKE_1_CUSTOM_PACKAGE}').status == 0 | ||||||||||
task_id = target_sat.api.JobInvocation().run( | ||||||||||
data={ | ||||||||||
'feature': 'katello_errata_install', | ||||||||||
'inputs': {'errata': 'invalid-errata'}, | ||||||||||
'targeting_type': 'static_query', | ||||||||||
'search_query': f'name = {rhel_contenthost.hostname}', | ||||||||||
'organization_id': function_org.id, | ||||||||||
}, | ||||||||||
)['id'] | ||||||||||
target_sat.wait_for_tasks( | ||||||||||
search_query=(f'label = Actions::RemoteExecution::RunHostsJob and id = {task_id}'), | ||||||||||
search_rate=15, | ||||||||||
max_tries=10, | ||||||||||
) | ||||||||||
rt = ( | ||||||||||
target_sat.api.ReportTemplate() | ||||||||||
.search(query={'search': 'name="Host - Applied Errata"'})[0] | ||||||||||
.read() | ||||||||||
) | ||||||||||
rt.generate( | ||||||||||
data={ | ||||||||||
'organization_id': function_org.id, | ||||||||||
'report_format': 'json', | ||||||||||
'input_values': { | ||||||||||
'Filter Errata Type': 'all', | ||||||||||
'Include Last Reboot': 'no', | ||||||||||
'Status': 'all', | ||||||||||
}, | ||||||||||
} | ||||||||||
) | ||||||||||
|
||||||||||
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. Do you think any other assertion can be implementated after generating errata report? 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. We talked about this in chat, There are not any good ways to make an assertion here. All we need to test is that this report is generated. A failing tests is a good enough indicator here |
||||||||||
|
||||||||||
@pytest.mark.tier2 | ||||||||||
@pytest.mark.rhel_ver_match('[^6]') | ||||||||||
@pytest.mark.no_containers | ||||||||||
|
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.