Fix TBROK usage in timer tests
PATCH 1/1 Fix TBROK usage in timer tests
timer_delete01, timer_settime01 and timer_settime02 incorrectly use tst_res(TBROK, ...). Change it to tst_res(TFAIL, ...)
Also check errno for ENOTSUP and use tst_res(TCONF, ...) when the tested functionality is not supported by kernel, including in timer_create01.
Signed-off-by Martin Doucha <[email protected]>
--- .../kernel/syscalls/timer_create/timer_create01.c | 3 +-- .../kernel/syscalls/timer_delete/timer_delete01.c | 8 ++++---- .../kernel/syscalls/timer_settime/timer_settime01.c | 10 +++++----- .../kernel/syscalls/timer_settime/timer_settime02.c | 8 ++++---- 4 files changed, 14 insertions(+), 15 deletions(-)
testcases/kernel/syscalls/timer_create/timer_create01.c +1 -2
@@ -82,8 +82,7 @@ static void run(unsigned int n)if (TST_RET !=0 ) {if (possibly_unsupported (clock) && (TST_ERR ==EINVAL ||TST_ERR ==ENOTSUP )) { -tst_res (TPASS |TTERRNO , -"%s unsupported, failed as expected" , +tst_res (TCONF |TTERRNO ,"%s unsupported" ,get_clock_str (clock)); }else { tst_res(TFAIL | TTERRNO,
testcases/kernel/syscalls/timer_delete/timer_delete01.c +4 -4
@@ -37,12 +37,12 @@ static void run(void)TEST (tst_syscall (__NR_timer_create, clock,NULL , &timer_id));if (TST_RET !=0 ) { -if (possibly_unsupported (clock) &&TST_ERR ==EINVAL ) { -tst_res (TPASS |TTERRNO , -"%s unsupported, failed as expected" , +if (possibly_unsupported (clock) && + (TST_ERR ==EINVAL ||TST_ERR ==ENOTSUP )) { +tst_res (TCONF |TTERRNO ,"%s unsupported" ,get_clock_str (clock)); }else { -tst_res (TBROK |TTERRNO , +tst_res (TFAIL |TTERRNO ,"Aborting test - timer_create(%s) failed" ,get_clock_str (clock)); }
testcases/kernel/syscalls/timer_settime/timer_settime01.c +5 -5
@@ -60,12 +60,12 @@ static void run(unsigned int n)TEST (tst_syscall (__NR_timer_create, clock,NULL , &timer));if (TST_RET !=0 ) { -if (possibly_unsupported (clock) &&TST_ERR ==EINVAL ) { -tst_res (TPASS |TTERRNO , -"%s unsupported, failed as expected" , +if (possibly_unsupported (clock) && + (TST_ERR ==EINVAL ||TST_ERR ==ENOTSUP )) { +tst_res (TCONF |TTERRNO ,"%s unsupported" ,get_clock_str (clock)); }else { -tst_res (TBROK |TTERRNO , +tst_res (TFAIL |TTERRNO ,"timer_create(%s) failed" ,get_clock_str (clock)); }
@@ -80,7 +80,7 @@ static void run(unsigned int n)if (tc->flag &TIMER_ABSTIME ) {if (clock_gettime (clock, &timenow) <0 ) { -tst_res (TBROK , +tst_res (TFAIL ,"clock_gettime(%s) failed - skipping the test" ,get_clock_str (clock));continue ;
testcases/kernel/syscalls/timer_settime/timer_settime02.c +4 -4
@@ -73,12 +73,12 @@ static void run(unsigned int n)/* Init temporary timer */ TEST (tst_syscall (__NR_timer_create, clock,NULL , &timer));if (TST_RET !=0 ) { -if (possibly_unsupported (clock) &&TST_ERR ==EINVAL ) { -tst_res (TPASS |TTERRNO , -"%s unsupported, failed as expected" , +if (possibly_unsupported (clock) && + (TST_ERR ==EINVAL ||TST_ERR ==ENOTSUP )) { +tst_res (TCONF |TTERRNO ,"%s unsupported" ,get_clock_str (clock)); }else { -tst_res (TBROK |TTERRNO , +tst_res (TFAIL |TTERRNO ,"timer_create(%s) failed" ,get_clock_str (clock)); }
Signature · 1 line
2.24.0
PATCH 1/1 Fix TBROK usage in timer tests
PATCH 1/1 Fix TBROK usage in timer tests
In reply to Martin DouchaHi!
Applied, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]