Skip to content

t/g/u/test_xen_guest_agent.py: Use yum on older distros or dnf if available - #582

Closed
rzr wants to merge 1 commit into
masterfrom
pcoval/review/master
Closed

t/g/u/test_xen_guest_agent.py: Use yum on older distros or dnf if available#582
rzr wants to merge 1 commit into
masterfrom
pcoval/review/master

Conversation

@rzr

@rzr rzr commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

On modern systems that uses dnf, there is a compatibility yum wrapper, some refactoring can be considered to support more package managers.

Observed issue was:

tests/guest_tools/unix/test_xen_guest_agent.py::TestXenGuestAgent::test_agent_running_after_reboot[...]
lib.commands.SSHCommandFailed: SSH command (dnf install -y xen-guest-agent) failed with return code 127: bash: dnf: command not found

@rzr
rzr requested review from a team as code owners June 11, 2026 12:32
@rzr
rzr force-pushed the pcoval/review/master branch from b71fee5 to 090a760 Compare June 11, 2026 12:32
@rzr
rzr force-pushed the pcoval/review/master branch from 090a760 to 43945e8 Compare June 11, 2026 12:34
@stormi

stormi commented Jun 11, 2026

Copy link
Copy Markdown
Member

I'm not sure what "from older distros" means here.

@rzr

rzr commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

I'm not sure what "from older distros" means here.

Pre dnf ones :)

@stormi

stormi commented Jun 11, 2026

Copy link
Copy Markdown
Member

It's the "from" part which I don't match with the contents of the change.

@d3athjest3r

d3athjest3r commented Jun 11, 2026

Copy link
Copy Markdown
Contributor
# yum
-bash: yum: command not found

On an Alma 10 (my XCP-ng 8.99 test deployment). So, yum is not supported anymore on newer distros. I believe we need a check whether yum or dnf exists....

@rzr
rzr force-pushed the pcoval/review/master branch from 43945e8 to 7fa099d Compare June 11, 2026 13:02
@glehmann

Copy link
Copy Markdown
Member

I began to implement a proper yum/dnf implementation as part of the XCP-ng 9 PR #570
Do you want me to extract that part?

…ilable

On some modern systems that uses dnf, there is a compatibility yum wrapper.

dnf5-5.2.18.0-4.fc43.x86_64 contains /sbin/yum

But not available in all dnf systems

dnf-4.20.0-14.el10_0.alma.1.noarch only contains /usr/bin/dnf

So we have to support both.

Some refactoring can be considered to support more package managers.

Observed issue was:

    tests/guest_tools/unix/test_xen_guest_agent.py::TestXenGuestAgent::test_agent_running_after_reboot[...]
    lib.commands.SSHCommandFailed: SSH command (dnf install -y xen-guest-agent) failed with return code 127: bash: dnf: command not found

Related-to: https://github.com/xcp-ng/xcp-ng-tests/pull/434/changes#r3395851769
Signed-off-by: Philippe Coval <philippe.coval@vates.tech>
@rzr
rzr force-pushed the pcoval/review/master branch from 7fa099d to ba882b8 Compare June 11, 2026 13:29

@glehmann glehmann 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.

I'm preparing a version with the package manager detection in the VM

@rzr rzr changed the title t/g/u/test_xen_guest_agent.py: Use yum from older distros t/g/u/test_xen_guest_agent.py: Use yum on older distros or dnf if available Jun 12, 2026
@d3athjest3r
d3athjest3r self-requested a review June 16, 2026 13:58

@d3athjest3r d3athjest3r 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.

lgtm.

@glehmann

Copy link
Copy Markdown
Member

See also #591 that introduces the dnf detection, and also fix the same problem than this PR

@stormi

stormi commented Jun 22, 2026

Copy link
Copy Markdown
Member

This PR has 3 approvals. What's next? Does it compete with #591? If yes, did you decide how to solve it?

@glehmann

glehmann commented Jul 7, 2026

Copy link
Copy Markdown
Member

Closing as #591 is merged and handles the dnf/yum differences

@glehmann glehmann closed this Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants