From: Jiri Jaburek <jjaburek@redhat.com>
To: Jan Stancek <jstancek@redhat.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] syslog: rsyslog doesn't create empty log files
Date: Thu, 05 Jun 2014 13:30:50 +0200 [thread overview]
Message-ID: <539054EA.2050004@redhat.com> (raw)
In-Reply-To: <1249145583.18329328.1401964511429.JavaMail.zimbra@redhat.com>
On 06/05/2014 12:35 PM, Jan Stancek wrote:
> Hi Jiri,
>
> I was thinking about removing that check, and checking file existence
> only after test generates some log entry. That would make things simpler
> and we would still know if there is logfile after syslogtst ran:
I was considering that as well, but I went with retaining the old
behavior for other possible implementations of generic syslog (if there
are still any).
>
>
> diff --git a/testcases/kernel/syscalls/syslog/syslog01 b/testcases/kernel/syscalls/syslog/syslog01
> index b7bcd9e..2f3aea0 100755
> --- a/testcases/kernel/syscalls/syslog/syslog01
> +++ b/testcases/kernel/syscalls/syslog/syslog01
> @@ -66,12 +66,6 @@ syslog_case1()
>
> restart_syslog_daemon
>
> - # check if $MAILLOG script exists
> - if [ "$CONFIG_FILE" != "/etc/syslog-ng/syslog-ng.conf" -a ! -e $MAILLOG ]; then
> - tst_resm TBROK "$MAILLOG no such log file"
> - cleanup 1
> - fi
> -
> # Grepping pattern has to be changed whenever the executable name
> # changes, ex: syslogtst executable.
> # This check is neccessary for syslog-ng because $MAILLOG is
> @@ -87,6 +81,11 @@ syslog_case1()
>
> sleep 2
>
> + if [ ! -e $MAILLOG ]; then
> + tst_resm TBROK "$MAILLOG no such log file"
> + cleanup 1
> + fi
> +
> newvalue1=`grep -c "syslogtst: mail info test" $MAILLOG`
> if [ "x$(( $newvalue1 - $oldvalue1 ))" != "x1" ]; then
> status_flag=1
> diff --git a/testcases/kernel/syscalls/syslog/syslog02 b/testcases/kernel/syscalls/syslog/syslog02
> index a416344..7a55a84 100755
> --- a/testcases/kernel/syscalls/syslog/syslog02
> +++ b/testcases/kernel/syscalls/syslog/syslog02
> @@ -65,15 +65,6 @@ syslog_case2()
>
> restart_syslog_daemon
>
> - # Grepping pattern is as follows:
> - # syslogtst: mail $level test.
> - # check if $MAILLOG script exists
> - if [ "$CONFIG_FILE" != "/etc/syslog-ng/syslog-ng.conf" -a ! -e $MAILLOG ]; then
> - tst_resm TBROK "$MAILLOG no such log file"
> - cleanup 1
> - fi
> -
> -
> # Grepping pattern has to be changed whenever the executable name
> # changes, ex: syslogtst executable.
> # This check is neccessary for syslog-ng because $MAILLOG is
> diff --git a/testcases/kernel/syscalls/syslog/syslog09 b/testcases/kernel/syscalls/syslog/syslog09
> index de06fb1..9cfafa8 100755
> --- a/testcases/kernel/syscalls/syslog/syslog09
> +++ b/testcases/kernel/syscalls/syslog/syslog09
> @@ -56,15 +56,14 @@ syslog_case9()
>
> restart_syslog_daemon
>
> - # check if /var/log/messages script exists
> - if [ "$CONFIG_FILE" != "/etc/syslog-ng/syslog-ng.conf" -a ! -e /var/log/messages ]; then
> - tst_resm TBROK "/var/log/messages no such log file"
> - cleanup 1
> + if [ -e /var/log/messages ]; then
> + allow1=`grep -c "syslogtst: error level is logged" /var/log/messages`
> + donot_allow1=`grep -c "syslogtst: warning level not to be logged" /var/log/messages`
> + else
> + allow1=0
> + donot_allow1=0
> fi
>
> - allow1=`grep -c "syslogtst: error level is logged" /var/log/messages`
> - donot_allow1=`grep -c "syslogtst: warning level not to be logged" /var/log/messages`
> -
> if ! syslogtst 9 2>/dev/null; then
> cleanup 1
> fi
>
> What do you think?
Looks good to me.
Jiri
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2014-06-05 11:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-28 10:15 [LTP] [PATCH] syslog: rsyslog doesn't create empty log files Jiri Jaburek
2014-06-05 10:35 ` Jan Stancek
2014-06-05 11:30 ` Jiri Jaburek [this message]
2014-06-05 14:37 ` [LTP] [PATCH v2] " Jiri Jaburek
2014-06-13 11:35 ` Jan Stancek
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=539054EA.2050004@redhat.com \
--to=jjaburek@redhat.com \
--cc=jstancek@redhat.com \
--cc=ltp-list@lists.sourceforge.net \
/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