[LTP] [PATCH] syslog: Add TPASS log

Jan Stancek jstancek@redhat.com
Wed Apr 6 14:56:01 CEST 2022


On Tue, Apr 5, 2022 at 12:42 PM Petr Vorel <pvorel@suse.cz> wrote:
>
> Hi Ma, Li, Cyril,
>
> > Add TPASS log to facilitate the analysis of cases.
> nit: in some tests you added both TPASS/TFAIL.
>
> > Signed-off-by: Ma Feng <mafeng.ma@huawei.com>
> > ---
> >  testcases/kernel/syscalls/syslog/syslog01 | 7 +++++--
> >  testcases/kernel/syscalls/syslog/syslog03 | 3 +++
> >  testcases/kernel/syscalls/syslog/syslog04 | 5 ++++-
> >  testcases/kernel/syscalls/syslog/syslog05 | 5 ++++-
> >  testcases/kernel/syscalls/syslog/syslog06 | 5 ++++-
> >  testcases/kernel/syscalls/syslog/syslog07 | 5 ++++-
> >  testcases/kernel/syscalls/syslog/syslog09 | 4 ++++
> >  testcases/kernel/syscalls/syslog/syslog10 | 6 +++++-
> >  8 files changed, 33 insertions(+), 7 deletions(-)
>
> > diff --git a/testcases/kernel/syscalls/syslog/syslog01 b/testcases/kernel/syscalls/syslog/syslog01
> > index 2f3aea0bb..f99c44914 100755
> > --- a/testcases/kernel/syscalls/syslog/syslog01
> > +++ b/testcases/kernel/syscalls/syslog/syslog01
> > @@ -88,8 +88,11 @@ syslog_case1()
>
> >               newvalue1=`grep -c "syslogtst: mail info test" $MAILLOG`
> >               if [ "x$(( $newvalue1 - $oldvalue1 ))" != "x1" ]; then
> > -                     status_flag=1
> > -             fi
> > +                        tst_resm TFAIL "mail info test: messages are not logged to $MAILLOG"
> > +                        status_flag=1
> > +                else
> > +                        tst_resm TPASS "mail info test: messages are logged to $MAILLOG"
> > +                fi
>
> I'm going to merge this fix, thus I'll fix wrong indentation myself before merge
> (it's in more tests). But please next time pay attention to the whitespace.
>
> ...
>
> > index 573ab755e..97f7c54cc 100755
> > --- a/testcases/kernel/syscalls/syslog/syslog10
> > +++ b/testcases/kernel/syscalls/syslog/syslog10
> > @@ -85,12 +85,16 @@ syslog_case10()
> >               tst_resm TFAIL "Expected message was not logged...."
> >               status_flag=1
> >               return
> > -     fi
> > +        else
> > +                tst_resm TPASS "Expected message was logged..."
> > +        fi
>
> Here I'm going to remove useless '...' in newly added TPASS and the original
> TFAIL (and in other tests).
>
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
>
> @Cyril, Li: do we want to still keep syslog0[1-9] and syslog10 which tests syslogd?
> I suppose so, but I'm asking because they are not using even legacy shell API
> (test.sh) and use several other legacy libraries (syslog-lib.sh, cmdlib.sh, daemonlib.sh).

I wouldn't miss these tests, they always had sporadic failures that
were related to
configuration (rsyslog config, journald rate-limiting, etc.) and lot
of sleep to restart
daemon dozens of times. One sanity test calling syslog() would probably do.

We already cover kernel functionality with kmsg01 and on recent distros
syslog() (or write to /dev/log) is write to /run/systemd/journal/dev-log anyway.

>
> Kind regards,
> Petr
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
>



More information about the ltp mailing list