public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Petr Lautrbach <lautrbach@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/selinux] pr775-checkpolicy-revdeps: Test rpm transaction for stderr output
Date: Fri, 11 Sep 2026 13:22:08 GMT [thread overview]
Message-ID: <178913292813.1.17837514039607271115.tests-selinux-deaf7662f4ec@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : tests/selinux
Branch : pr775-checkpolicy-revdeps
Commit : deaf7662f4ec2c2dde737da139b055a5bcad6f10
Author : Petr Lautrbach <lautrbach@redhat.com>
Date : 2024-10-18T14:48:15+00:00
Stats : +72/-0 in 2 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/deaf7662f4ec2c2dde737da139b055a5bcad6f10?branch=pr775-checkpolicy-revdeps
Log:
Test rpm transaction for stderr output
Commands stderr output should be hidden unless it's fatal error
Verifies: https://issues.redhat.com/browse/RHEL-59192
---
diff --git a/selinux-policy/rpm-suppress-stderr/main.fmf b/selinux-policy/rpm-suppress-stderr/main.fmf
new file mode 100644
index 0000000..9ea92b7
--- /dev/null
+++ b/selinux-policy/rpm-suppress-stderr/main.fmf
@@ -0,0 +1,17 @@
+summary: Does rpm install generate any output on stderr?
+component:
+ - selinux-policy
+require:
+ - fuse
+ - fuse-overlayfs
+ - dnf
+test: ./test.sh
+framework: beakerlib
+duration: 10m
+enabled: true
+link:
+ - https://issues.redhat.com/browse/RHEL-59192
+adjust:
+ - enabled: false
+ when: distro == rhel-4, rhel-5, rhel-6, rhel-7, rhel-8
+ continue: false
diff --git a/selinux-policy/rpm-suppress-stderr/test.sh b/selinux-policy/rpm-suppress-stderr/test.sh
new file mode 100755
index 0000000..f7432da
--- /dev/null
+++ b/selinux-policy/rpm-suppress-stderr/test.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+. /usr/share/beakerlib/beakerlib.sh || exit 1
+
+INSTALL_OPTION=""
+DOWNLOAD_OPTION=""
+if dnf --help | grep -q use-host-config ; then
+ INSTALL_OPTION="${INSTALL_OPTION} --use-host-config"
+fi
+if rlIsCentOS 9 ; then
+ INSTALL_OPTION="${INSTALL_OPTION} --releasever 9"
+elif rlIsFedora ; then
+ RELEASEVER=`grep VERSION_ID /etc/os-release | cut -d = -f 2`
+ INSTALL_OPTION="${INSTALL_OPTION} --releasever ${RELEASEVER}"
+fi
+DOWNLOAD_OPTION=${INSTALL_OPTION}
+# dnf sometimes fails to detect the release version on CentOS 9
+if dnf install --help | grep -q skip-broken ; then
+ INSTALL_OPTION="${INSTALL_OPTION} --skip-broken"
+fi
+if dnf install --help | grep -q skip-unavailable ; then
+ INSTALL_OPTION="${INSTALL_OPTION} --skip-unavailable"
+fi
+
+rlJournalStart
+ rlPhaseStartSetup
+ rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
+ rlRun "pushd $tmp"
+ rlRun "set -o pipefail"
+ rlAssertRpm fuse
+ rlAssertRpm fuse-overlayfs
+ rlPhaseEnd
+
+ rlPhaseStartTest
+ rlRun "mkdir $tmp/lower $tmp/upper $tmp/work $tmp/merged"
+ rlRun "dnf -y install --installroot=$tmp/lower diffutils libfdisk libselinux-utils libutempter policycoreutils util-linux rpm ${INSTALL_OPTION}"
+ rlRun "mkdir download"
+ rlRun "cd download"
+ rlRun "dnf download --installroot=$tmp/lower rpm-plugin-selinux selinux-policy selinux-policy-targeted ${DOWNLOAD_OPTION}"
+ rlRun "mv -v *rpm $tmp/lower"
+ rlRun "cd .."
+ rlRun "fuse-overlayfs -o lowerdir=$tmp/lower/ -o upperdir=$tmp/upper/ -o workdir=$tmp/work/ $tmp/merged/"
+ RPMS=$(ls $tmp/merged/ | grep .rpm | xargs)
+ rlRun "chroot $tmp/merged/ /usr/bin/rpm -i $RPMS 2> error.log"
+ rlAssert0 "error.log should be empty" "test -s error.log"
+ rlRun "cat error.log"
+ rlRun "fusermount -u $tmp/merged/"
+ rlPhaseEnd
+
+ rlPhaseStartCleanup
+ rlRun "popd"
+ rlRun "rm -r $tmp" 0 "Remove tmp directory"
+ rlPhaseEnd
+rlJournalEnd
reply other threads:[~2026-09-11 13:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178913292813.1.17837514039607271115.tests-selinux-deaf7662f4ec@fedoraproject.org \
--to=lautrbach@redhat.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox