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

[Customer Case] Adding test for syncing inventory with missing ip #16547

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ColeHiggins2
Copy link
Member

@ColeHiggins2 ColeHiggins2 commented Oct 1, 2024

Customer Case automation for SAT-24805. Sync inventory status with missing IP

@ColeHiggins2 ColeHiggins2 added CherryPick PR needs CherryPick to previous branches AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing Stream Introduced in or relating directly to Satellite Stream/Master 6.15.z Introduced in or relating directly to Satellite 6.15 6.16.z Introduced in or relating directly to Satellite 6.16 labels Oct 1, 2024
@ColeHiggins2 ColeHiggins2 self-assigned this Oct 1, 2024
@ColeHiggins2 ColeHiggins2 requested a review from a team as a code owner October 1, 2024 18:17
@ColeHiggins2 ColeHiggins2 marked this pull request as draft October 1, 2024 18:17
@ColeHiggins2 ColeHiggins2 changed the title Adding test for syncing inventory with missing ip [Customer Case] Adding test for syncing inventory with missing ip Oct 1, 2024
@ColeHiggins2 ColeHiggins2 marked this pull request as ready for review October 3, 2024 18:48
@ColeHiggins2
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/cli/test_rhcloud_inventory.py -k 'test_positive_sync_inventory_status_missing_host_ip'

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 8863
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/cli/test_rhcloud_inventory.py -k test_positive_sync_inventory_status_missing_host_ip --external-logging
Test Result : ======== 6 passed, 22 deselected, 2468 warnings in 10319.90s (2:51:59) =========

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Oct 3, 2024
Comment on lines +252 to +257
for task in task_output:
if task.input.get("organization_ids") is None:
continue
if str(task.input.get("organization_ids")[0]) == str(org.id):
host_status = task.output
break
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we narrow the task search instead of this looping through orgs? Something like

query={'search': f'{inventory_sync_task} and started_at >= "{timestamp}" and organization_id={org.id}}

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried that. But could not get it to work... even on the UI itself

Comment on lines +258 to +259
assert host_status['host_statuses']['sync'] == 2
assert host_status['host_statuses']['disconnect'] == 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Some context on these 2 and 0 values might be helpful in the future for anyone who looks here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Pulled from the rhcloud_registered_hosts fixture. Two hosts are spun up and registered with insights. In our case, the first one has a missing IP. Both however should be registered and synced to rh cloud without failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.15.z Introduced in or relating directly to Satellite 6.15 6.16.z Introduced in or relating directly to Satellite 6.16 AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing CherryPick PR needs CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR Stream Introduced in or relating directly to Satellite Stream/Master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants