* [LTP] [PATCH] lib/tst_test.c: Take account of tst_brk(TCONF)/tst_brk(TFAIL) in summary output
@ 2020-05-18 5:43 Xiao Yang
2020-05-19 14:34 ` Cyril Hrubis
0 siblings, 1 reply; 6+ messages in thread
From: Xiao Yang @ 2020-05-18 5:43 UTC (permalink / raw)
To: ltp
Current summary output doesn't take account of tst_brk(TCONF/TFAIL),
for example:
-----------------------------------------------------
[root@RHEL8U2GA_Intel64 pidfd_send_signal]# ./pidfd_send_signal01
tst_test.c:1246: INFO: Timeout per run is 0h 05m 00s
../../../../include/lapi/pidfd_send_signal.h:16: CONF: syscall(424) __NR_pidfd_send_signal not supported
Summary:
passed 0
failed 0
skipped 0
warnings 0
-----------------------------------------------------
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
lib/tst_test.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/tst_test.c b/lib/tst_test.c
index 0e58060e0..b28521a67 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -316,6 +316,7 @@ void tst_vbrk_(const char *file, const int lineno, int ttype,
const char *fmt, va_list va)
{
print_result(file, lineno, ttype, fmt, va);
+ update_results(TTYPE_RESULT(ttype));
/*
* The getpid implementation in some C library versions may cause cloned
--
2.21.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [LTP] [PATCH] lib/tst_test.c: Take account of tst_brk(TCONF)/tst_brk(TFAIL) in summary output
2020-05-18 5:43 [LTP] [PATCH] lib/tst_test.c: Take account of tst_brk(TCONF)/tst_brk(TFAIL) in summary output Xiao Yang
@ 2020-05-19 14:34 ` Cyril Hrubis
2020-05-20 2:02 ` Xiao Yang
0 siblings, 1 reply; 6+ messages in thread
From: Cyril Hrubis @ 2020-05-19 14:34 UTC (permalink / raw)
To: ltp
Hi!
> lib/tst_test.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/tst_test.c b/lib/tst_test.c
> index 0e58060e0..b28521a67 100644
> --- a/lib/tst_test.c
> +++ b/lib/tst_test.c
> @@ -316,6 +316,7 @@ void tst_vbrk_(const char *file, const int lineno, int ttype,
> const char *fmt, va_list va)
> {
> print_result(file, lineno, ttype, fmt, va);
> + update_results(TTYPE_RESULT(ttype));
>
> /*
> * The getpid implementation in some C library versions may cause cloned
Good catch, but I guess that we should also remove the update_result()
call from the run_tcases_per_fs() after this.
And it also makes sense to call the function as a first thing in the
tst_res_/tst_brk_ function, which simplifies the code flow.
So I guess that we want something like this (not tested):
diff --git a/lib/tst_test.c b/lib/tst_test.c
index 0e58060e0..9d0ef672d 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -278,8 +278,6 @@ void tst_vres_(const char *file, const int lineno, int ttype,
const char *fmt, va_list va)
{
print_result(file, lineno, ttype, fmt, va);
-
- update_results(TTYPE_RESULT(ttype));
}
void tst_vbrk_(const char *file, const int lineno, int ttype,
@@ -297,7 +295,6 @@ static void tst_cvres(const char *file, const int lineno, int ttype,
}
print_result(file, lineno, ttype, fmt, va);
- update_results(TTYPE_RESULT(ttype));
}
static void do_test_cleanup(void)
@@ -337,6 +334,8 @@ void tst_res_(const char *file, const int lineno, int ttype,
{
va_list va;
+ update_results(TTYPE_RESULT(ttype));
+
va_start(va, fmt);
tst_vres_(file, lineno, ttype, fmt, va);
va_end(va);
@@ -347,6 +346,8 @@ void tst_brk_(const char *file, const int lineno, int ttype,
{
va_list va;
+ update_results(TTYPE_RESULT(ttype));
+
va_start(va, fmt);
tst_brk_handler(file, lineno, ttype, fmt, va);
va_end(va);
@@ -1316,10 +1317,8 @@ static int run_tcases_per_fs(void)
mntpoint_mounted = 0;
}
- if (ret == TCONF) {
- update_results(ret);
+ if (ret == TCONF)
continue;
- }
if (ret == 0)
continue;
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [LTP] [PATCH] lib/tst_test.c: Take account of tst_brk(TCONF)/tst_brk(TFAIL) in summary output
2020-05-19 14:34 ` Cyril Hrubis
@ 2020-05-20 2:02 ` Xiao Yang
2020-05-22 1:40 ` [LTP] [PATCH v2] lib/tst_test.c: Take account of tst_brk(TCONF/TFAIL) " Xiao Yang
0 siblings, 1 reply; 6+ messages in thread
From: Xiao Yang @ 2020-05-20 2:02 UTC (permalink / raw)
To: ltp
On 2020/5/19 22:34, Cyril Hrubis wrote:
> Hi!
>> lib/tst_test.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/lib/tst_test.c b/lib/tst_test.c
>> index 0e58060e0..b28521a67 100644
>> --- a/lib/tst_test.c
>> +++ b/lib/tst_test.c
>> @@ -316,6 +316,7 @@ void tst_vbrk_(const char *file, const int lineno, int ttype,
>> const char *fmt, va_list va)
>> {
>> print_result(file, lineno, ttype, fmt, va);
>> + update_results(TTYPE_RESULT(ttype));
>>
>> /*
>> * The getpid implementation in some C library versions may cause cloned
>
> Good catch, but I guess that we should also remove the update_result()
> call from the run_tcases_per_fs() after this.
Hi Cyril,
Agreed. I missed redundant update_result() in run_tcases_per_fs() after
this change.
>
> And it also makes sense to call the function as a first thing in the
> tst_res_/tst_brk_ function, which simplifies the code flow.
It is actually simpler but it changes the original logic of tst_cvres()
called by tst_brk(TBROK) in cleanup().
Before change, tst_cvres() changes TBROK to TWARN and then saves TWARN
into summary output:
----------------------------------
e.g. Add some debug code in preadv01:
[root@Fedora-30 preadv]# ./preadv01
tst_buffers.c:55: INFO: Test is using guarded buffers
tst_test.c:1244: INFO: Timeout per run is 0h 05m 00s
preadv01.c:80: PASS: Preadv(2) read 64 bytes successfully with content
'a' expectedly
preadv01.c:80: PASS: Preadv(2) read 64 bytes successfully with content
'a' expectedly
preadv01.c:80: PASS: Preadv(2) read 32 bytes successfully with content
'b' expectedly
preadv01.c:99: WARN: test
Summary:
passed 3
failed 0
skipped 0
warnings 1
----------------------------------
After change, tst_cvres() changes TBROK to TWARN but doesn't save TWARN
into summary output:
----------------------------------
e.g. Add some debug code in preadv01:
[root@Fedora-30 preadv]# ./preadv01
tst_buffers.c:55: INFO: Test is using guarded buffers
tst_test.c:1245: INFO: Timeout per run is 0h 05m 00s
preadv01.c:80: PASS: Preadv(2) read 64 bytes successfully with content
'a' expectedly
preadv01.c:80: PASS: Preadv(2) read 64 bytes successfully with content
'a' expectedly
preadv01.c:80: PASS: Preadv(2) read 32 bytes successfully with content
'b' expectedly
preadv01.c:99: WARN: test
Summary:
passed 3
failed 0
skipped 0
warnings 0
----------------------------------
I perfer to add a update_results() in tst_vbrk_(), do you think so?
Best Regards,
Xiao Yang
>
> So I guess that we want something like this (not tested):
>
> diff --git a/lib/tst_test.c b/lib/tst_test.c
> index 0e58060e0..9d0ef672d 100644
> --- a/lib/tst_test.c
> +++ b/lib/tst_test.c
> @@ -278,8 +278,6 @@ void tst_vres_(const char *file, const int lineno, int ttype,
> const char *fmt, va_list va)
> {
> print_result(file, lineno, ttype, fmt, va);
> -
> - update_results(TTYPE_RESULT(ttype));
> }
>
> void tst_vbrk_(const char *file, const int lineno, int ttype,
> @@ -297,7 +295,6 @@ static void tst_cvres(const char *file, const int lineno, int ttype,
> }
>
> print_result(file, lineno, ttype, fmt, va);
> - update_results(TTYPE_RESULT(ttype));
> }
>
> static void do_test_cleanup(void)
> @@ -337,6 +334,8 @@ void tst_res_(const char *file, const int lineno, int ttype,
> {
> va_list va;
>
> + update_results(TTYPE_RESULT(ttype));
> +
> va_start(va, fmt);
> tst_vres_(file, lineno, ttype, fmt, va);
> va_end(va);
> @@ -347,6 +346,8 @@ void tst_brk_(const char *file, const int lineno, int ttype,
> {
> va_list va;
>
> + update_results(TTYPE_RESULT(ttype));
> +
> va_start(va, fmt);
> tst_brk_handler(file, lineno, ttype, fmt, va);
> va_end(va);
> @@ -1316,10 +1317,8 @@ static int run_tcases_per_fs(void)
> mntpoint_mounted = 0;
> }
>
> - if (ret == TCONF) {
> - update_results(ret);
> + if (ret == TCONF)
> continue;
> - }
>
> if (ret == 0)
> continue;
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [LTP] [PATCH v2] lib/tst_test.c: Take account of tst_brk(TCONF/TFAIL) in summary output
2020-05-20 2:02 ` Xiao Yang
@ 2020-05-22 1:40 ` Xiao Yang
2020-05-26 13:43 ` Xiao Yang
0 siblings, 1 reply; 6+ messages in thread
From: Xiao Yang @ 2020-05-22 1:40 UTC (permalink / raw)
To: ltp
Current summary output doesn't take account of tst_brk(TCONF/TFAIL),
for example:
-----------------------------------------------------
[root@Fedora-30 pidfd_send_signal]# ./pidfd_send_signal01
tst_test.c:1246: INFO: Timeout per run is 0h 05m 00s
../../../../include/lapi/pidfd_send_signal.h:16: CONF: syscall(424) __NR_pidfd_send_signal not supported
Summary:
passed 0
failed 0
skipped 0
warnings 0
----------------------------------------------------
1) Add update_result() in tst_vbrk_() to fix the issue.
2) Remove redundant update_result() in run_tcases_per_fs() after the fix.
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
lib/tst_test.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/tst_test.c b/lib/tst_test.c
index 0e58060e0..e93c88ba5 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -316,6 +316,7 @@ void tst_vbrk_(const char *file, const int lineno, int ttype,
const char *fmt, va_list va)
{
print_result(file, lineno, ttype, fmt, va);
+ update_results(TTYPE_RESULT(ttype));
/*
* The getpid implementation in some C library versions may cause cloned
@@ -1316,10 +1317,8 @@ static int run_tcases_per_fs(void)
mntpoint_mounted = 0;
}
- if (ret == TCONF) {
- update_results(ret);
+ if (ret == TCONF)
continue;
- }
if (ret == 0)
continue;
--
2.21.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [LTP] [PATCH v2] lib/tst_test.c: Take account of tst_brk(TCONF/TFAIL) in summary output
2020-05-22 1:40 ` [LTP] [PATCH v2] lib/tst_test.c: Take account of tst_brk(TCONF/TFAIL) " Xiao Yang
@ 2020-05-26 13:43 ` Xiao Yang
2020-05-27 7:08 ` Xiao Yang
0 siblings, 1 reply; 6+ messages in thread
From: Xiao Yang @ 2020-05-26 13:43 UTC (permalink / raw)
To: ltp
Hi,
I want to push it tomorrow if nobody has any objection.
Thanks,
Xiao Yang
On 2020/5/22 9:40, Xiao Yang wrote:
> Current summary output doesn't take account of tst_brk(TCONF/TFAIL),
> for example:
> -----------------------------------------------------
> [root@Fedora-30 pidfd_send_signal]# ./pidfd_send_signal01
> tst_test.c:1246: INFO: Timeout per run is 0h 05m 00s
> ../../../../include/lapi/pidfd_send_signal.h:16: CONF: syscall(424) __NR_pidfd_send_signal not supported
>
> Summary:
> passed 0
> failed 0
> skipped 0
> warnings 0
> ----------------------------------------------------
>
> 1) Add update_result() in tst_vbrk_() to fix the issue.
> 2) Remove redundant update_result() in run_tcases_per_fs() after the fix.
>
> Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
> ---
> lib/tst_test.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/lib/tst_test.c b/lib/tst_test.c
> index 0e58060e0..e93c88ba5 100644
> --- a/lib/tst_test.c
> +++ b/lib/tst_test.c
> @@ -316,6 +316,7 @@ void tst_vbrk_(const char *file, const int lineno, int ttype,
> const char *fmt, va_list va)
> {
> print_result(file, lineno, ttype, fmt, va);
> + update_results(TTYPE_RESULT(ttype));
>
> /*
> * The getpid implementation in some C library versions may cause cloned
> @@ -1316,10 +1317,8 @@ static int run_tcases_per_fs(void)
> mntpoint_mounted = 0;
> }
>
> - if (ret == TCONF) {
> - update_results(ret);
> + if (ret == TCONF)
> continue;
> - }
>
> if (ret == 0)
> continue;
^ permalink raw reply [flat|nested] 6+ messages in thread
* [LTP] [PATCH v2] lib/tst_test.c: Take account of tst_brk(TCONF/TFAIL) in summary output
2020-05-26 13:43 ` Xiao Yang
@ 2020-05-27 7:08 ` Xiao Yang
0 siblings, 0 replies; 6+ messages in thread
From: Xiao Yang @ 2020-05-27 7:08 UTC (permalink / raw)
To: ltp
Hi,
Pushed.
Best Regards,
Xiao Yang
On 2020/5/26 21:43, Xiao Yang wrote:
> Hi,
>
> I want to push it tomorrow if nobody has any objection.
>
> Thanks,
> Xiao Yang
> On 2020/5/22 9:40, Xiao Yang wrote:
>> Current summary output doesn't take account of tst_brk(TCONF/TFAIL),
>> for example:
>> -----------------------------------------------------
>> [root@Fedora-30 pidfd_send_signal]# ./pidfd_send_signal01
>> tst_test.c:1246: INFO: Timeout per run is 0h 05m 00s
>> ../../../../include/lapi/pidfd_send_signal.h:16: CONF: syscall(424) __NR_pidfd_send_signal not supported
>>
>> Summary:
>> passed 0
>> failed 0
>> skipped 0
>> warnings 0
>> ----------------------------------------------------
>>
>> 1) Add update_result() in tst_vbrk_() to fix the issue.
>> 2) Remove redundant update_result() in run_tcases_per_fs() after the fix.
>>
>> Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
>> ---
>> lib/tst_test.c | 5 ++---
>> 1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/lib/tst_test.c b/lib/tst_test.c
>> index 0e58060e0..e93c88ba5 100644
>> --- a/lib/tst_test.c
>> +++ b/lib/tst_test.c
>> @@ -316,6 +316,7 @@ void tst_vbrk_(const char *file, const int lineno, int ttype,
>> const char *fmt, va_list va)
>> {
>> print_result(file, lineno, ttype, fmt, va);
>> + update_results(TTYPE_RESULT(ttype));
>>
>> /*
>> * The getpid implementation in some C library versions may cause cloned
>> @@ -1316,10 +1317,8 @@ static int run_tcases_per_fs(void)
>> mntpoint_mounted = 0;
>> }
>>
>> - if (ret == TCONF) {
>> - update_results(ret);
>> + if (ret == TCONF)
>> continue;
>> - }
>>
>> if (ret == 0)
>> continue;
>
> .
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-05-27 7:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-18 5:43 [LTP] [PATCH] lib/tst_test.c: Take account of tst_brk(TCONF)/tst_brk(TFAIL) in summary output Xiao Yang
2020-05-19 14:34 ` Cyril Hrubis
2020-05-20 2:02 ` Xiao Yang
2020-05-22 1:40 ` [LTP] [PATCH v2] lib/tst_test.c: Take account of tst_brk(TCONF/TFAIL) " Xiao Yang
2020-05-26 13:43 ` Xiao Yang
2020-05-27 7:08 ` Xiao Yang
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.