Broaden pattern match for jenkins-sudo-grep.sh

In Ubuntu Trusty the error logged by sudo now looks like the one
logged in CentOS, so broaden the pattern match to no longer be
distro-specific.

Change-Id: I00d06a91cfb0ff1c790eee660f6d5f5ea4d41da6
This commit is contained in:
Jeremy Stanley 2015-01-09 00:24:22 +00:00
parent dee78f6cab
commit 18d19d37cb

View File

@ -18,14 +18,13 @@
# Find out if jenkins has attempted to run any sudo commands by checking
# the auth.log or secure log files before and after a test run.
PATTERN="sudo.*jenkins.*:.*\(incorrect password attempts\|command not allowed\)"
case $( facter osfamily ) in
Debian)
PATTERN="sudo.*jenkins.*:.*incorrect password attempts"
OLDLOGFILE=/var/log/auth.log.1
LOGFILE=/var/log/auth.log
;;
RedHat)
PATTERN="sudo.*jenkins.*:.*command not allowed"
OLDLOGFILE=$( ls /var/log/secure-* | sort | tail -n1 )
LOGFILE=/var/log/secure
;;