summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2012-05-31 18:21:20 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-05-31 18:39:59 +0200
commit00ce927aa99e40cd8a917963f7c7d7ea6785f118 (patch)
tree3e1ad89e2a2c3fd5247f3e29f06684bad79bbc6c /tests
parent6861810b736ec0d76358eb5f107ad15e1f5c8273 (diff)
downloadrsyslog-00ce927aa99e40cd8a917963f7c7d7ea6785f118.tar.gz
rsyslog-00ce927aa99e40cd8a917963f7c7d7ea6785f118.tar.xz
rsyslog-00ce927aa99e40cd8a917963f7c7d7ea6785f118.zip
Skip tests that require root if euid != 0
This will mark them as SKIPPED instead of FAILED, making it at least in theory possible to get 0 FAILED tests even when running as an unprivileged user.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/imuxsock_ccmiddle_root.sh3
-rwxr-xr-xtests/imuxsock_logger_root.sh3
-rwxr-xr-xtests/imuxsock_traillf_root.sh3
-rwxr-xr-xtests/sndrcv_udp.sh3
4 files changed, 12 insertions, 0 deletions
diff --git a/tests/imuxsock_ccmiddle_root.sh b/tests/imuxsock_ccmiddle_root.sh
index b487611a..7f255bd0 100755
--- a/tests/imuxsock_ccmiddle_root.sh
+++ b/tests/imuxsock_ccmiddle_root.sh
@@ -2,6 +2,9 @@
# carry out this test
echo \[imuxsock_ccmiddle_root.sh\]: test trailing LF handling in imuxsock
echo This test must be run as root with no other active syslogd
+if [ "$EUID" -ne 0 ]; then
+ exit 77 # Not root, skip this test
+fi
source $srcdir/diag.sh init
source $srcdir/diag.sh startup imuxsock_ccmiddle_root.conf
# send a message with trailing LF
diff --git a/tests/imuxsock_logger_root.sh b/tests/imuxsock_logger_root.sh
index 377999f7..0902d797 100755
--- a/tests/imuxsock_logger_root.sh
+++ b/tests/imuxsock_logger_root.sh
@@ -2,6 +2,9 @@
# carry out this test.
echo \[imuxsock_logger_root.sh\]: test trailing LF handling in imuxsock
echo This test must be run as root with no other active syslogd
+if [ "$EUID" -ne 0 ]; then
+ exit 77 # Not root, skip this test
+fi
source $srcdir/diag.sh init
source $srcdir/diag.sh startup imuxsock_logger_root.conf
# send a message with trailing LF
diff --git a/tests/imuxsock_traillf_root.sh b/tests/imuxsock_traillf_root.sh
index 1b821ee7..0141a626 100755
--- a/tests/imuxsock_traillf_root.sh
+++ b/tests/imuxsock_traillf_root.sh
@@ -2,6 +2,9 @@
# carry out this test
echo \[imuxsock_traillf_root.sh\]: test trailing LF handling in imuxsock
echo This test must be run as root with no other active syslogd
+if [ "$EUID" -ne 0 ]; then
+ exit 77 # Not root, skip this test
+fi
source $srcdir/diag.sh init
source $srcdir/diag.sh startup imuxsock_traillf_root.conf
# send a message with trailing LF
diff --git a/tests/sndrcv_udp.sh b/tests/sndrcv_udp.sh
index 274a414a..df37782c 100755
--- a/tests/sndrcv_udp.sh
+++ b/tests/sndrcv_udp.sh
@@ -7,4 +7,7 @@
# This file is part of the rsyslog project, released under GPLv3
echo ===============================================================================
echo \[sndrcv_udp.sh\]: testing sending and receiving via udp
+if [ "$EUID" -ne 0 ]; then
+ exit 77 # Not root, skip this test
+fi
source $srcdir/sndrcv_drvr.sh sndrcv_udp 50