Skip to content

Modifications in CLI and UI Libvirt CR to resolve key error - #20176

Merged
Gauravtalreja1 merged 1 commit into
SatelliteQE:masterfrom
nacoool:CR_Libvirt
Feb 9, 2026
Merged

Modifications in CLI and UI Libvirt CR to resolve key error#20176
Gauravtalreja1 merged 1 commit into
SatelliteQE:masterfrom
nacoool:CR_Libvirt

Conversation

@nacoool

@nacoool nacoool commented Nov 4, 2025

Copy link
Copy Markdown
Contributor

Problem Statement

The test test_positive_provision_end_to_end is failing intermittently with a KeyError during execution of the lambda function used in the wait_for call. This happens when the status or build-status keys are temporarily unavailable in the Satellite API response, causing the test to break before the timeout is reached.

Solution

Updated the lambda function inside the wait_for call to safely handle missing keys and potential transient exceptions by using .get() methods and handle_exception=True.
This ensures the polling logic continues gracefully until the host build is complete, thereby preventing continue flow of code even after the timeout happens.

Restarting DHCP as dhcpd service does not recover from (Network is down) state on its own.
Removing UEFI and secure-boot for RHEL 7 because RHEL 7 is not supported with UEFI on VMware and libvirt hypervisors. mentioned in SAT-41340 for CLI testcase.

Adding BIOS back as it is working while Restarting of DHCPD

Added Restart of DHCPD for booting of RHEL 8 host on libvirt.

Related Issues

@nacoool
nacoool requested a review from a team as a code owner November 4, 2025 06:13

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@nacoool

nacoool commented Nov 4, 2025

Copy link
Copy Markdown
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/cli/test_computeresource_libvirt.py -k "test_positive_provision_end_to_end"

@nacoool nacoool added CLI Issues and PRs involving the CLI TestFailure Issues and PRs related to a test failing in automation Easy Fix :) Easiest Fix to review and quick merge request. CherryPick PR needs CherryPick to previous branches AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing 6.16.z 6.17.z 6.18.z Introduced in or relating directly to Satellite 6.18 labels Nov 4, 2025
@amolpati30

Copy link
Copy Markdown
Contributor

trigger: test-robottelo
pytest: tests/foreman/cli/test_computeresource_libvirt.py -k "test_positive_provision_end_to_end"
provisioning: true

@shubhamsg199

Copy link
Copy Markdown
Contributor

trigger: test-robottelo
pytest: tests/foreman/ --component ComputeResources-libvirt
provisioning: true

@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 13426
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ --component ComputeResources-libvirt --external-logging --include-onprem-provisioning
Test Result : == 69 passed, 5739 deselected, 241 warnings, 10 errors in 3352.86s (0:55:52) ===

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Nov 6, 2025
@Gauravtalreja1

Copy link
Copy Markdown
Member

trigger: test-robottelo
pytest: tests/foreman/ --component ComputeResources-libvirt
provisioning: true

@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 13433
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ --component ComputeResources-libvirt --external-logging --include-onprem-provisioning
Test Result : == 3 failed, 76 passed, 5739 deselected, 881 warnings in 15210.97s (4:13:30) ===

@stejskalleos

Copy link
Copy Markdown
Contributor

Tests are failing, @amolpati30 any updates?

@nacoool

nacoool commented Nov 17, 2025

Copy link
Copy Markdown
Contributor Author

@stejskalleos The test case which is rectified is tests/foreman/cli/test_computeresource_libvirt.py::test_positive_provision_end_to_end
which is failing intermittently during execution of the lambda function used in the wait_for call.
It returns a boolean:

  • True → when build-status is not "Pending installation" or key missing
  • False → when it is "Pending installation"

Thus

We have updated the lambda function inside the wait_for call to safely handle missing keys so.
It returns a boolean:

  • True → when build-status is not "Pending installation"
  • False → when it is "Pending installation" or key missing.

In the previous PRT result, Build Number: 13433
The testcase is correctly waiting for status, and is giving timeout error.

@nacoool

nacoool commented Nov 17, 2025

Copy link
Copy Markdown
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/cli/test_computeresource_libvirt.py -k "test_positive_provision_end_to_end"
provisioning: true

@nacoool nacoool changed the title Modifications in Libvirt CR to resolve key error Modifications in CLI Libvirt CR to resolve key error Nov 17, 2025
@nacoool nacoool added PRT-Passed Indicates that latest PRT run is passed for the PR and removed PRT-Failed Indicates that latest PRT run is failed for the PR labels Nov 18, 2025
@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Nov 19, 2025
@nacoool

nacoool commented Nov 26, 2025

Copy link
Copy Markdown
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ --component ComputeResources-libvirt
provisioning: true

@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 13592
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ --component ComputeResources-libvirt --external-logging --include-onprem-provisioning
Test Result : = 3 failed, 76 passed, 5737 deselected, 858 warnings, 1 error in 18868.18s (5:14:28) =

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Nov 26, 2025
@nacoool nacoool added the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 5, 2026
Comment thread tests/foreman/conftest.py Outdated
@nacoool
nacoool requested a review from a team as a code owner February 5, 2026 08:57
@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 5, 2026
@nacoool

nacoool commented Feb 5, 2026

Copy link
Copy Markdown
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ --component ComputeResources-libvirt
provisioning: true

Comment thread tests/foreman/cli/test_computeresource_libvirt.py Outdated
Comment thread tests/foreman/ui/test_computeresource_libvirt.py Outdated
@nacoool

nacoool commented Feb 5, 2026

Copy link
Copy Markdown
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ --component ComputeResources-libvirt
provisioning: true

@evgeni evgeni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the diff looks good to me

@Gauravtalreja1 wdyt?

@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 14185
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ --component ComputeResources-libvirt --external-logging --include-onprem-provisioning
Test Result : = 4 failed, 86 passed, 5754 deselected, 1615 warnings, 10 errors in 16712.14s (4:38:32) =

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Feb 5, 2026
@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 14188
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ --component ComputeResources-libvirt --external-logging --include-onprem-provisioning
Test Result : = 4 failed, 92 passed, 4 skipped, 5754 deselected, 1583 warnings in 21414.66s (5:56:54) =

@nacoool

nacoool commented Feb 6, 2026

Copy link
Copy Markdown
Contributor Author

Required tests are passed.

@nacoool

nacoool commented Feb 8, 2026

Copy link
Copy Markdown
Contributor Author
trigger: test-robottelo
pytest: tests/foreman/ --component ComputeResources-libvirt
provisioning: true
airgun : 2304

@Satellite-QE

Copy link
Copy Markdown
Collaborator

PRT Result

Build Number: 14211
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ --component ComputeResources-libvirt --external-logging --include-onprem-provisioning
Test Result : = 4 failed, 92 passed, 4 skipped, 5755 deselected, 1602 warnings in 20698.77s (5:44:58) =

@nacoool

nacoool commented Feb 9, 2026

Copy link
Copy Markdown
Contributor Author

Required tests are passed.

@Gauravtalreja1 Gauravtalreja1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACK, Great job @nacoool 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.16.z 6.17.z 6.18.z Introduced in or relating directly to Satellite 6.18 AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing CherryPick PR needs CherryPick to previous branches CLI Issues and PRs involving the CLI PRT-Failed Indicates that latest PRT run is failed for the PR TestFailure Issues and PRs related to a test failing in automation UI Issues and PRs involving the UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants