[LTP] [PATCH] syslog: Add TPASS log

Petr Vorel pvorel@suse.cz
Tue Apr 5 12:42:44 CEST 2022


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


More information about the ltp mailing list