Skip to content

Commit 7fa099d

Browse files
committed
t/g/u/test_xen_guest_agent.py: Use yum on older distros or dnf if available
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 Related-to: https://github.com/xcp-ng/xcp-ng-tests/pull/434/changes#r3395851769 Signed-off-by: Philippe Coval <philippe.coval@vates.tech>
1 parent 1143e0b commit 7fa099d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tests/guest_tools/unix/test_xen_guest_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def agent_install(self, running_vm: VM, xen_guest_agent_urls: dict[str, str]) ->
5353
rpm_repo = xen_guest_agent_urls['rpm_repo']
5454
vm.ssh(f"echo -e '[xen-guest-agent]\\nbaseurl={rpm_repo}main/\\ngpgcheck=0'"
5555
f" > /etc/yum.repos.d/xen-guest-agent.repo")
56-
vm.ssh('dnf install -y xen-guest-agent')
56+
vm.ssh('app=yum && which dnf && app=dnf ; $app install -y xen-guest-agent')
5757
elif pkg_mgr == PackageManagerEnum.APT_GET:
5858
# DEB packages are published to a stable APT repo in the GitLab
5959
# Generic Package Registry after each push to main.

0 commit comments

Comments
 (0)