From 7835f3acb1179bbe00e8af28a7f3af67fa30afab Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 15 May 2024 19:42:46 +0100 Subject: [PATCH] Fix broken test on Ubuntu 24.04 --- tests/pytests/functional/modules/test_pkg.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/pytests/functional/modules/test_pkg.py b/tests/pytests/functional/modules/test_pkg.py index d26675265a25..35bca1a03d21 100644 --- a/tests/pytests/functional/modules/test_pkg.py +++ b/tests/pytests/functional/modules/test_pkg.py @@ -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