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: Use `ausearch --input-logs`
Date: Fri, 11 Sep 2026 13:20:19 GMT [thread overview]
Message-ID: <178913281927.1.8433795595725362341.tests-selinux-8effe6fd87dc@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : tests/selinux
Branch : pr775-checkpolicy-revdeps
Commit : 8effe6fd87dcce4c7378a66b3813dc797907822c
Author : Petr Lautrbach <lautrbach@redhat.com>
Date : 2022-11-24T11:30:48+01:00
Stats : +29/-29 in 8 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/8effe6fd87dcce4c7378a66b3813dc797907822c?branch=pr775-checkpolicy-revdeps
Log:
Use `ausearch --input-logs`
CI systems don't necessary attach stdin to terminal and this option make
`ausearch` to use audit logs as input for searching.
---
diff --git a/policycoreutils/load_policy/runtest.sh b/policycoreutils/load_policy/runtest.sh
index a0402a9..c7809c3 100755
--- a/policycoreutils/load_policy/runtest.sh
+++ b/policycoreutils/load_policy/runtest.sh
@@ -63,13 +63,13 @@ rlJournalStart
rlRun "grep -i selinux /proc/mounts"
sleep 1
if rlIsRHEL ; then
- rlRun "ausearch -m MAC_POLICY_LOAD -i -ts ${START_DATE_TIME} | grep load_policy"
+ rlRun "ausearch -m MAC_POLICY_LOAD -i -ts ${START_DATE_TIME} --input-logs | grep load_policy"
fi
if rlIsRHEL 5 6 7 ; then
- rlRun "ausearch -m MAC_POLICY_LOAD -i -ts ${START_DATE_TIME} | grep 'policy loaded'"
+ rlRun "ausearch -m MAC_POLICY_LOAD -i -ts ${START_DATE_TIME} --input-logs | grep 'policy loaded'"
else
# we assume that audit message has a different format now (does not contain "policy loaded")
- rlRun "ausearch -m MAC_POLICY_LOAD -i -ts ${START_DATE_TIME} | grep 'type=MAC_POLICY_LOAD'"
+ rlRun "ausearch -m MAC_POLICY_LOAD -i -ts ${START_DATE_TIME} --input-logs | grep 'type=MAC_POLICY_LOAD'"
fi
rlRun "umount --lazy ${SELINUX_FS_MOUNT}" 0,32
if [ $? -eq 0 ] ; then
@@ -80,13 +80,13 @@ rlJournalStart
rlRun "grep -i selinux /proc/mounts"
sleep 1
if rlIsRHEL ; then
- rlRun "ausearch -m MAC_POLICY_LOAD -i -ts ${START_DATE_TIME} | grep load_policy"
+ rlRun "ausearch -m MAC_POLICY_LOAD -i -ts ${START_DATE_TIME} --input-logs | grep load_policy"
fi
if rlIsRHEL 5 6 7 ; then
- rlRun "ausearch -m MAC_POLICY_LOAD -i -ts ${START_DATE_TIME} | grep 'policy loaded'"
+ rlRun "ausearch -m MAC_POLICY_LOAD -i -ts ${START_DATE_TIME} --input-logs | grep 'policy loaded'"
else
# we assume that audit message has a different format now (does not contain "policy loaded")
- rlRun "ausearch -m MAC_POLICY_LOAD -i -ts ${START_DATE_TIME} | grep 'type=MAC_POLICY_LOAD'"
+ rlRun "ausearch -m MAC_POLICY_LOAD -i -ts ${START_DATE_TIME} --input-logs | grep 'type=MAC_POLICY_LOAD'"
fi
fi
rlRun "dmesg | grep -i selinux"
diff --git a/policycoreutils/semanage-port-add-delete-problems/runtest.sh b/policycoreutils/semanage-port-add-delete-problems/runtest.sh
index 2069299..435fc40 100755
--- a/policycoreutils/semanage-port-add-delete-problems/runtest.sh
+++ b/policycoreutils/semanage-port-add-delete-problems/runtest.sh
@@ -82,7 +82,7 @@ rlJournalStart
sleep 2
# Check for MAC_POLICY_LOAD
- rlRun "ausearch -m MAC_POLICY_LOAD -ts ${START_DATE_TIME}" 0
+ rlRun "ausearch -m MAC_POLICY_LOAD -ts ${START_DATE_TIME} --input-logs" 0
# deleting a port number from a type
START_DATE_TIME=`date "+%m/%d/%Y %T"`
@@ -91,7 +91,7 @@ rlJournalStart
sleep 2
# Check for MAC_POLICY_LOAD
- rlRun "ausearch -m MAC_POLICY_LOAD -ts ${START_DATE_TIME}" 0
+ rlRun "ausearch -m MAC_POLICY_LOAD -ts ${START_DATE_TIME} --input-logs" 0
rlPhaseEnd
fi
diff --git a/policycoreutils/setsebool/runtest.sh b/policycoreutils/setsebool/runtest.sh
index 36357f7..8678b1b 100755
--- a/policycoreutils/setsebool/runtest.sh
+++ b/policycoreutils/setsebool/runtest.sh
@@ -128,10 +128,10 @@ rlJournalStart
rlRun "setsebool ${BOOLEAN} off"
rlRun "setsebool ${BOOLEAN} on"
sleep 1
- rlRun "ausearch -m MAC_CONFIG_CHANGE -i -ts ${START_DATE_TIME} | grep \"type=MAC_CONFIG_CHANGE.*bool=${BOOLEAN} val=1 old_val=0\""
- rlRun "ausearch -m MAC_CONFIG_CHANGE -i -ts ${START_DATE_TIME} | grep \"type=MAC_CONFIG_CHANGE.*bool=${BOOLEAN} val=0 old_val=1\""
+ rlRun "ausearch -m MAC_CONFIG_CHANGE -i -ts ${START_DATE_TIME} --input-logs | grep \"type=MAC_CONFIG_CHANGE.*bool=${BOOLEAN} val=1 old_val=0\""
+ rlRun "ausearch -m MAC_CONFIG_CHANGE -i -ts ${START_DATE_TIME} --input-logs | grep \"type=MAC_CONFIG_CHANGE.*bool=${BOOLEAN} val=0 old_val=1\""
if rlIsRHEL ; then
- rlRun "ausearch -m MAC_CONFIG_CHANGE -i -ts ${START_DATE_TIME} | grep \"type=SYSCALL.*comm=setsebool\""
+ rlRun "ausearch -m MAC_CONFIG_CHANGE -i -ts ${START_DATE_TIME} --input-logs | grep \"type=SYSCALL.*comm=setsebool\""
fi
rlPhaseEnd
diff --git a/selinux-policy/anon_inode-and-similar/runtest.sh b/selinux-policy/anon_inode-and-similar/runtest.sh
index e09760a..35b18d6 100755
--- a/selinux-policy/anon_inode-and-similar/runtest.sh
+++ b/selinux-policy/anon_inode-and-similar/runtest.sh
@@ -55,7 +55,7 @@ rlJournalStart
tst_Time="$(date '+%T')"
rlRun "./reproducer"
sleep 3
- rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time" 1
+ rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time --input-logs" 1
rlSESearchRule "allow unconfined_t unconfined_t : anon_inode { write }"
rlRun "rm -f reproducer"
rlPhaseEnd
diff --git a/selinux-policy/ladvd/runtest.sh b/selinux-policy/ladvd/runtest.sh
index 211f280..ad3d458 100755
--- a/selinux-policy/ladvd/runtest.sh
+++ b/selinux-policy/ladvd/runtest.sh
@@ -52,7 +52,7 @@ rlJournalStart
rlPhaseStartTest "ladvd service selinux denials, bz#1834325"
rlServiceStart ladvd
sleep 2
- rlRun "ausearch -m AVC -c ladvd --raw > /tmp/avcfile" 1
+ rlRun "ausearch -m AVC -c ladvd --raw --input-logs > /tmp/avcfile" 1
if grep "tclass=process2" /tmp/avcfile; then
grep "tclass=process2" /tmp/avcfile > /tmp/avc_class_file
rlAssertNotGrep "denied { nnp_transition }" /tmp/avc_class_file
@@ -74,7 +74,7 @@ rlJournalStart
rlPhaseStartTest "ladvd selinux denials due to libpcap, bz#1855163"
rlServiceStart ladvd
sleep 2
- rlRun "ausearch -m AVC -c 'ladvd' --raw > /tmp/avcfile" 1
+ rlRun "ausearch -m AVC -c ladvd --raw --input-logs > /tmp/avcfile" 1
if grep "tclass=netlink_rdma_socket" /tmp/avcfile; then
grep "tclass=netlink_rdma_socket" /tmp/avcfile > /tmp/avc_class_file
rlAssertNotGrep "denied { create }" /tmp/avc_class_file
diff --git a/selinux-policy/rsyslog-and-similar/runtest.sh b/selinux-policy/rsyslog-and-similar/runtest.sh
index a3f33a9..edda98d 100755
--- a/selinux-policy/rsyslog-and-similar/runtest.sh
+++ b/selinux-policy/rsyslog-and-similar/runtest.sh
@@ -86,7 +86,7 @@ rlJournalStart
rlRun "update_rsys"
rlRun "systemctl restart rsyslog"
sleep 3
- rlRun "ausearch -m AVC --start $tst_Time" 1
+ rlRun "ausearch -m AVC --start $tst_Time --input-logs" 1
rlRun "cp -rv /etc/rsyslog.conf-orig /etc/rsyslog.conf"
rlRun "systemctl restart rsyslog"
rlPhaseEnd
@@ -104,7 +104,7 @@ rlJournalStart
rlRun "echo ' ' >> /etc/rsyslog.conf"
rlRun "systemctl restart rsyslog"
sleep 3
- rlRun "ausearch -m AVC --start $tst_Time" 1
+ rlRun "ausearch -m AVC --start $tst_Time --input-logs" 1
rlRun 'semanage fcontext -d -t public_content_rw_t "/my/custom(/.*)?"'
rlRun "semodule -r rsyslog_imfile_policy"
rlRun "cp -rv /etc/rsyslog.conf-orig /etc/rsyslog.conf"
diff --git a/selinux-policy/systemd-homed/runtest.sh b/selinux-policy/systemd-homed/runtest.sh
index 6a5d196..d95a340 100755
--- a/selinux-policy/systemd-homed/runtest.sh
+++ b/selinux-policy/systemd-homed/runtest.sh
@@ -129,8 +129,8 @@ rlJournalStart
rlPhaseStartTest "homectl create"
rlRun "create_u"
- rlRun "ausearch -m AVC -m USER_AVC -c systemd-homed -f mail" 1
- rlRun "ausearch -m AVC -m USER_AVC -c systemd-homewor" 1
+ rlRun "ausearch -m AVC -m USER_AVC -c systemd-homed -f mail --input-logs" 1
+ rlRun "ausearch -m AVC -m USER_AVC -c systemd-homewor --input-logs" 1
rlPhaseEnd
rlPhaseStartTest "homectl list"
@@ -138,7 +138,7 @@ rlJournalStart
tst_Time="$(date '+%T')"
rlRun "homectl list"
sleep 5
- rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time" 1
+ rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time --input-logs" 1
rlPhaseEnd
rlPhaseStartTest "homectl activate"
@@ -146,7 +146,7 @@ rlJournalStart
tst_Time="$(date '+%T')"
rlRun "activate_u"
sleep 5
- rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time" 1
+ rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time --input-logs" 1
rlPhaseEnd
rlPhaseStartTest "homectl inspect"
@@ -154,7 +154,7 @@ rlJournalStart
tst_Time="$(date '+%T')"
rlRun "homectl inspect test_u"
sleep 5
- rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time" 1
+ rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time --input-logs" 1
rlPhaseEnd
rlPhaseStartTest "homectl update"
@@ -162,7 +162,7 @@ rlJournalStart
tst_Time="$(date '+%T')"
rlRun "homectl update test_u --email-address=test_u@redhat.com"
sleep 5
- rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time" 1
+ rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time --input-logs" 1
rlPhaseEnd
rlPhaseStartTest "homectl lock"
@@ -170,7 +170,7 @@ rlJournalStart
tst_Time="$(date '+%T')"
rlRun "homectl lock test_u"
sleep 5
- rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time" 1
+ rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time --input-logs" 1
rlPhaseEnd
rlPhaseStartTest "homectl unlock"
@@ -178,7 +178,7 @@ rlJournalStart
tst_Time="$(date '+%T')"
rlRun "unlock_u"
sleep 5
- rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time" 1
+ rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time --input-logs" 1
rlPhaseEnd
rlPhaseStartTest "homectl passwd"
@@ -186,7 +186,7 @@ rlJournalStart
tst_Time="$(date '+%T')"
rlRun "passwd_u"
sleep 5
- rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time" 1
+ rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time --input-logs" 1
rlPhaseEnd
rlPhaseStartTest "homectl authenticate"
@@ -194,7 +194,7 @@ rlJournalStart
tst_Time="$(date '+%T')"
rlRun "auth_u"
sleep 5
- rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time" 1
+ rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time --input-logs" 1
rlPhaseEnd
rlPhaseStartTest "homectl deactivate and resize"
@@ -204,7 +204,7 @@ rlJournalStart
sleep 60
rlRun "resize_u"
sleep 5
- rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time" 1
+ rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time --input-logs" 1
rlPhaseEnd
rlPhaseStartTest "homectl remove"
@@ -212,7 +212,7 @@ rlJournalStart
tst_Time="$(date '+%T')"
rlRun "homectl remove test_u"
sleep 5
- rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time" 1
+ rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time --input-logs" 1
rlPhaseEnd
rlPhaseStartCleanup
diff --git a/selinux-policy/systemd-modules-load-and-similar/runtest.sh b/selinux-policy/systemd-modules-load-and-similar/runtest.sh
index 2e250b4..0e951c8 100755
--- a/selinux-policy/systemd-modules-load-and-similar/runtest.sh
+++ b/selinux-policy/systemd-modules-load-and-similar/runtest.sh
@@ -123,7 +123,7 @@ rlJournalStart
rlRun "systemctl start rdma-load-modules@rdma.service"
rlRun "systemctl status rdma-load-modules@rdma.service"
rlRun "lsmod | grep rdma"
- rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time" 1
+ rlRun "ausearch -m AVC -m USER_AVC --start $tst_Time --input-logs" 1
rlRun "systemctl stop rdma-load-modules@rdma.service"
if seinfo -c | grep -q lockdown ; then
rlSESearchRule "allow systemd_modules_load_t systemd_modules_load_t : lockdown { confidentiality } [ ]"
reply other threads:[~2026-09-11 13:20 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=178913281927.1.8433795595725362341.tests-selinux-8effe6fd87dc@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