public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: kernel/...: fix --skip-broken detection for DNF5
@ 2026-09-11 13:21 Ondrej Mosnacek
  0 siblings, 0 replies; only message in thread
From: Ondrej Mosnacek @ 2026-09-11 13:21 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 9e9a717326ecb963dfe3c181a427a4e4f45fc879
            Author : Ondrej Mosnacek <omosnace@redhat.com>
            Date   : 2024-06-07T09:58:36+02:00
            Stats  : +9/-3 in 3 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/9e9a717326ecb963dfe3c181a427a4e4f45fc879?branch=pr775-checkpolicy-revdeps

            Log:
            kernel/...: fix --skip-broken detection for DNF5

The detection of this flag is broken with DNF5, because it now only
appears under `dnf install --help`. Also, DNF5 now implements the logic
we want (skipping packages that are not available, rather than "broken")
under a new --skip-unavailable flag.

Therefore, detect both using `dnf install --help` and also check for
--skip-unavailable first.

Without this fix the tests try to install each package one by one with
DNF5, which is suboptimal.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>

---
diff --git a/kernel/mount-options-memleak/runtest.sh b/kernel/mount-options-memleak/runtest.sh
index f7fc666..8d21797 100755
--- a/kernel/mount-options-memleak/runtest.sh
+++ b/kernel/mount-options-memleak/runtest.sh
@@ -16,7 +16,9 @@ fi
 function installDepsYum() {
     local yum="$1"; shift
 
-    if "$yum" --help | grep -q -- --skip-broken; then
+    if "$yum" install --help | grep -q -- --skip-unavailable; then
+        "$yum" install -y --skip-unavailable $*
+    elif "$yum" install --help | grep -q -- --skip-broken; then
         "$yum" install -y --skip-broken $*
     else
         for req in $*; do

diff --git a/kernel/selinux-testsuite/runtest.sh b/kernel/selinux-testsuite/runtest.sh
index 09f063a..40846f2 100755
--- a/kernel/selinux-testsuite/runtest.sh
+++ b/kernel/selinux-testsuite/runtest.sh
@@ -82,7 +82,9 @@ function kver_gt() { ! kver_le "$1"; }
 function installDepsYum() {
     local yum="$1"; shift
 
-    if "$yum" --help | grep -q -- --skip-broken; then
+    if "$yum" install --help | grep -q -- --skip-unavailable; then
+        "$yum" install -y --skip-unavailable $*
+    elif "$yum" install --help | grep -q -- --skip-broken; then
         "$yum" install -y --skip-broken $*
     else
         for req in $*; do

diff --git a/kernel/xfrm-refcount-underflow/runtest.sh b/kernel/xfrm-refcount-underflow/runtest.sh
index 895a1af..5822f60 100755
--- a/kernel/xfrm-refcount-underflow/runtest.sh
+++ b/kernel/xfrm-refcount-underflow/runtest.sh
@@ -10,7 +10,9 @@
 function installDepsYum() {
     local yum="$1"; shift
 
-    if "$yum" --help | grep -q -- --skip-broken; then
+    if "$yum" install --help | grep -q -- --skip-unavailable; then
+        "$yum" install -y --skip-unavailable $*
+    elif "$yum" install --help | grep -q -- --skip-broken; then
         "$yum" install -y --skip-broken $*
     else
         for req in $*; do

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-11 13:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-11 13:21 [tests/selinux] pr775-checkpolicy-revdeps: kernel/...: fix --skip-broken detection for DNF5 Ondrej Mosnacek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox