Fix broken test on Ubuntu 24.04

This commit is contained in:
Pedro Algarvio 2024-05-15 19:42:46 +01:00
parent f72dd1477e
commit 7835f3acb1
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF

View file

@ -234,11 +234,10 @@ def test_which(grains, modules):
"""
test finding the package owning a file
"""
if grains["os_family"] in ["Debian", "RedHat"]:
file = "/bin/mknod"
else:
file = "/usr/local/bin/salt-call"
ret = modules.pkg.which(file)
binary = "/bin/ls"
if grains["os"] == "Ubuntu" and grains["osmajorrelease"] >= 24:
binary = "/usr/bin/ls"
ret = modules.pkg.which(binary)
assert len(ret) != 0