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

Errata with swidtags setup and modular update #14494

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

damoore044
Copy link
Contributor

@damoore044 damoore044 commented Mar 22, 2024

Problem Statement

Setup for contenthost of api::test_errata_installation_with_swidtags uses some outdated repositories and makes use of deprecated method repo_collection.setup_virtual_machine(). Has failed in most recent automation runs for 6.15, 6.14.3

Solution

Setup host with global registration to published CV and AK, with synced repos containing prereqs and module stream with swidtag attached, promoted CVV with all content. Also using SCA-only org fixture

Related Issues

  • Failing contenthost setup or prereq install commands in recent 6.15 and 6.14 CI.
  • these fixes have been included in an open CP for API::Errata-Management , which is not merged due to this failing test. This is now merged into 6.14.z ([6.14.z] CP of API-Errata modifications #13832)
    ^ We should CP to 6.14.z still, because review comments have brought enhancements to these fixes.

PRT case

trigger: test-robottelo
pytest: tests/foreman/api/test_errata.py::test_errata_installation_with_swidtags

@damoore044 damoore044 added CherryPick PR needs CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master 6.15.z Introduced in or relating directly to Satellite 6.15 labels Mar 22, 2024
@damoore044 damoore044 requested a review from a team as a code owner March 22, 2024 11:30
@damoore044 damoore044 requested a review from a team March 22, 2024 11:30
@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_errata.py::test_errata_installation_with_swidtags

@damoore044 damoore044 changed the title Errata with swidtags setup Errata with swidtags setup and modular update Mar 22, 2024
@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6167
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/api/test_errata.py::test_errata_installation_with_swidtags --external-logging
Test Result : ================== 1 passed, 2 warnings in 1893.11s (0:31:33) ==================

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Mar 22, 2024
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.

Few questions pending.

tests/foreman/api/test_errata.py Outdated Show resolved Hide resolved
tests/foreman/api/test_errata.py Outdated Show resolved Hide resolved
tests/foreman/api/test_errata.py Outdated Show resolved Hide resolved
tests/foreman/api/test_errata.py Outdated Show resolved Hide resolved
@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Mar 25, 2024
@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_errata.py::test_errata_installation_with_swidtags

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6183
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/api/test_errata.py::test_errata_installation_with_swidtags --external-logging
Test Result : ================== 1 passed, 1 warning in 1370.78s (0:22:50) ===================

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Mar 25, 2024
@damoore044 damoore044 added the 6.14.z Introduced in or relating directly to Satellite 6.14 label Mar 25, 2024
@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_errata.py::test_errata_installation_with_swidtags

@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Mar 25, 2024
@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6188
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/api/test_errata.py::test_errata_installation_with_swidtags --external-logging
Test Result : ================== 1 passed, 1 warning in 1374.40s (0:22:54) ===================

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Mar 25, 2024
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.

Non-blocking

tests/foreman/api/test_errata.py Outdated Show resolved Hide resolved
@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Mar 27, 2024
@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_errata.py::test_errata_installation_with_swidtags

@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Apr 3, 2024
@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_errata.py::test_errata_installation_with_swidtags

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6297
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/api/test_errata.py::test_errata_installation_with_swidtags --external-logging
Test Result : ================== 1 passed, 4 warnings in 1422.95s (0:23:42) ==================

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Apr 3, 2024
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.

Request to update doc string for the function fetch_cv_by_name_and_cvv.

return target_sat.api.LifecycleEnvironment(organization=module_sca_manifest_org).create()


def fetch_cv_by_name_and_cvv(sat, org, name=DEFAULT_CV, ver=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

Which test is calling this function?
Also could you please add :param: section which explain meaning of each parameter?

Suggested change
def fetch_cv_by_name_and_cvv(sat, org, name=DEFAULT_CV, ver=None):
def fetch_cv_by_name_and_cvv(sat, org, name=DEFAULT_CV, ver=None):
""" Doc string
:param: <type> sat:
:param: <type> org:
:param: <type> name:
:param: <type> ver:
"""

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Planned for next PR of a few enhancements, but is unneeded for now.
Will remove from here, and put up w/ requested changes once fully implemented

@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Apr 3, 2024
_set_prerequisites_for_swid_repos(rhel8_contenthost)
_run_remote_command_on_content_host(
f'dnf -y module install {module_name}:0:{version}', rhel8_contenthost
_repos = {
Copy link
Member

Choose a reason for hiding this comment

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

there's no need to use a leading underscore within a test

Suggested change
_repos = {
repos = {

'swid_tags': settings.repos.swid_tag.url, # module stream pkgs and errata
}
# associate repos with sat, org, lce, cv, and sync
for _r_ in _repos:
Copy link
Member

Choose a reason for hiding this comment

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

same comment about leading underscores, but this also has a tailing underscore.

Suggested change
for _r_ in _repos:
for r in repos:

Comment on lines 1355 to 1357
_run_remote_command_on_content_host('mv *swid*.repo /etc/yum.repos.d', vm)
_run_remote_command_on_content_host(r'subscription-manager repos --enable \*', vm)
_run_remote_command_on_content_host('yum install -y swid-tools', vm)
_run_remote_command_on_content_host('yum install -y dnf-plugin-swidtags', vm)
Copy link
Member

Choose a reason for hiding this comment

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

not within the scope of this PR (and not blocking), but this function needs to go away.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed, can get this done for the next errata maintenance pr

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.

LGTM, plus-one to get rid of _s (pending)

@damoore044
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_errata.py::test_errata_installation_with_swidtags

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6301
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/api/test_errata.py::test_errata_installation_with_swidtags --external-logging
Test Result : ================== 1 passed, 4 warnings in 1403.49s (0:23:23) ==================

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Apr 3, 2024
Comment on lines 1448 to 1455
_ak = target_sat.api.ActivationKey(
organization=org,
environment=lce,
content_view=cv,
).create()
# register host with ak, succeeds
result = rhel_contenthost.register(
activation_keys=_ak.name,
Copy link
Member

Choose a reason for hiding this comment

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

Very close! Just one more that I see.

Suggested change
_ak = target_sat.api.ActivationKey(
organization=org,
environment=lce,
content_view=cv,
).create()
# register host with ak, succeeds
result = rhel_contenthost.register(
activation_keys=_ak.name,
ak = target_sat.api.ActivationKey(
organization=org,
environment=lce,
content_view=cv,
).create()
# register host with ak, succeeds
result = rhel_contenthost.register(
activation_keys=ak.name,

@damoore044 damoore044 requested a review from JacobCallahan April 3, 2024 22:36
@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Apr 3, 2024
@JacobCallahan JacobCallahan merged commit 9fc762a into SatelliteQE:master Apr 3, 2024
8 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 3, 2024
Repair setup for package w/ swidtag, install and modular update

(cherry picked from commit 9fc762a)
shweta83 pushed a commit to shweta83/robottelo that referenced this pull request Apr 10, 2024
Repair setup for package w/ swidtag, install and modular update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing CherryPick PR needs CherryPick to previous branches 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