All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] syslog: Add TPASS log
@ 2022-02-22  1:19 Ma Feng via ltp
  2022-04-05 10:42 ` Petr Vorel
  0 siblings, 1 reply; 4+ messages in thread
From: Ma Feng via ltp @ 2022-02-22  1:19 UTC (permalink / raw)
  To: ltp

Add TPASS log to facilitate the analysis of cases.

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
 	else
 		status_flag=1
 	fi
diff --git a/testcases/kernel/syscalls/syslog/syslog03 b/testcases/kernel/syscalls/syslog/syslog03
index 31b7fd66d..8e8b887eb 100755
--- a/testcases/kernel/syscalls/syslog/syslog03
+++ b/testcases/kernel/syscalls/syslog/syslog03
@@ -75,7 +75,10 @@ syslog_case3()
 
 	newvalue4=`grep -c "SYSLOG_CASE3" /var/log/messages`
 	if [ "x$(( $newvalue4 - $oldvalue4 ))" != x1 ]; then
+        tst_resm TFAIL "dameon info test: ident string is not prepended to the message"
 		status_flag=1
+        else
+                tst_resm TPASS "dameon info test: ident string is prepended to the message"
 	fi
 }
 
diff --git a/testcases/kernel/syscalls/syslog/syslog04 b/testcases/kernel/syscalls/syslog/syslog04
index d1739d32a..a551ea003 100755
--- a/testcases/kernel/syscalls/syslog/syslog04
+++ b/testcases/kernel/syscalls/syslog/syslog04
@@ -71,7 +71,10 @@ syslog_case4()
 
 	found=`grep -c "\[$log_pid\]: syslogtst: user info test." /var/log/messages`
 	if [ $found -ne 1 ]; then
-		status_flag=1
+		tst_resm TFAIL "user info test: pid is not logged with /var/log/messages"
+                status_flag=1
+        else
+                tst_resm TPASS "user info test: pid is logged with /var/log/messages"
 	fi
 }
 
diff --git a/testcases/kernel/syscalls/syslog/syslog05 b/testcases/kernel/syscalls/syslog/syslog05
index 40dd1fa1a..2350765a7 100755
--- a/testcases/kernel/syscalls/syslog/syslog05
+++ b/testcases/kernel/syscalls/syslog/syslog05
@@ -80,7 +80,10 @@ syslog_case5()
 	newvalue=`grep -c "syslogtst: info to console test." /var/log/messages`
 
 	if [ "x$(( $newvalue - $oldvalue ))" != "x1" ]; then
-		status_flag=1
+		tst_resm TFAIL "info to console test: syslog is not written to the console"
+                status_flag=1
+        else
+                tst_resm TPASS "info to console test: syslog is written to the console"
 	fi
 }
 
diff --git a/testcases/kernel/syscalls/syslog/syslog06 b/testcases/kernel/syscalls/syslog/syslog06
index 7050fd264..bcdda4737 100755
--- a/testcases/kernel/syscalls/syslog/syslog06
+++ b/testcases/kernel/syscalls/syslog/syslog06
@@ -59,7 +59,10 @@ syslog_case6()
 	restart_syslog_daemon
 
 	if ! syslogtst 6 2>/dev/null; then
-		status_flag=1
+		tst_resm TFAIL "openlog fd test: open has returned unexpected fd"
+                status_flag=1
+        else
+                tst_resm TPASS "openlog fd test: open has returned expected fd"
 	fi
 }
 
diff --git a/testcases/kernel/syscalls/syslog/syslog07 b/testcases/kernel/syscalls/syslog/syslog07
index a24c3e207..cc5f9cdf8 100755
--- a/testcases/kernel/syscalls/syslog/syslog07
+++ b/testcases/kernel/syscalls/syslog/syslog07
@@ -119,7 +119,10 @@ syslog_case7()
 	if [ $emerg -ne 1 -o $alert -ne 1 -o $crit -ne 1 -o $err -ne 1 -o \
 	     $warning -ne 1 -o $notice -ne 1 -o $info -ne 1 -o \
 	     $info -ne 1 ]; then
-		status_flag=1
+		tst_resm TFAIL "syslogtst: not all level logs logged"
+                status_flag=1
+        else
+                tst_resm TPASS "syslogtst: all level logs logged"
 	fi
 }
 
diff --git a/testcases/kernel/syscalls/syslog/syslog09 b/testcases/kernel/syscalls/syslog/syslog09
index 9cfafa840..2a67faaa4 100755
--- a/testcases/kernel/syscalls/syslog/syslog09
+++ b/testcases/kernel/syscalls/syslog/syslog09
@@ -83,12 +83,16 @@ syslog_case9()
 		tst_resm TFAIL "Expected message was not logged...."
 		status_flag=1
 		return
+        else
+                tst_resm TPASS "Expected message was logged..."
 	fi
 
 	diff2=$(( $donot_allow2 - $donot_allow1 ))
 	if [ $diff2 -ne 0 ]; then
 		tst_resm TFAIL "Unexpected message was logged..."
 		status_flag=1
+        else
+                tst_resm TPASS "Unexpected message was not logged..."
 	fi
 }
 
diff --git a/testcases/kernel/syscalls/syslog/syslog10 b/testcases/kernel/syscalls/syslog/syslog10
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
 
 	diff2=$(( $donot_allow2 - $donot_allow1 ))
 	if [ $diff2 -ne 0 ]; then
 		tst_resm TFAIL "Unexpected message was logged..."
 		status_flag=1
+        else
+                tst_resm TPASS "Unexpected message was not logged..."
 	fi
 
 }
-- 
2.22.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH] syslog: Add TPASS log
  2022-02-22  1:19 [LTP] [PATCH] syslog: Add TPASS log Ma Feng via ltp
@ 2022-04-05 10:42 ` Petr Vorel
  2022-04-06 12:56   ` Jan Stancek
  0 siblings, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2022-04-05 10:42 UTC (permalink / raw)
  To: Ma Feng; +Cc: ltp

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).

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH] syslog: Add TPASS log
  2022-04-05 10:42 ` Petr Vorel
@ 2022-04-06 12:56   ` Jan Stancek
  2022-04-06 15:38     ` Petr Vorel
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Stancek @ 2022-04-06 12:56 UTC (permalink / raw)
  To: Petr Vorel; +Cc: LTP List

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
>


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH] syslog: Add TPASS log
  2022-04-06 12:56   ` Jan Stancek
@ 2022-04-06 15:38     ` Petr Vorel
  0 siblings, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2022-04-06 15:38 UTC (permalink / raw)
  To: Jan Stancek; +Cc: LTP List

Hi Jan,

> 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.

Thanks for confirmation. I'd keep syslog11.c and syslog12.c, which test syslog
(syscall - __NR_syslog; IMHO there is no test for (g)libc/POSIX syslog())
and delete all shell tests.

Kind regards,
Petr

> > Kind regards,
> > Petr

> > --
> > Mailing list info: https://lists.linux.it/listinfo/ltp



-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-06 15:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-22  1:19 [LTP] [PATCH] syslog: Add TPASS log Ma Feng via ltp
2022-04-05 10:42 ` Petr Vorel
2022-04-06 12:56   ` Jan Stancek
2022-04-06 15:38     ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.