public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH V7 14/19] syscalls/select6: Add support for time64 tests
Date: Mon, 27 Jul 2020 11:40:30 +0200	[thread overview]
Message-ID: <20200727094030.GB7863@yuki.lan> (raw)
In-Reply-To: <883a188e83c201b23074bf0ac974b41d89d818c7.1593152309.git.viresh.kumar@linaro.org>

Hi!
> This adds support for time64 tests to the existing select6() syscall
> tests.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  testcases/kernel/syscalls/select/select_var.h | 25 ++++++++++++++++---
>  1 file changed, 22 insertions(+), 3 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/select/select_var.h b/testcases/kernel/syscalls/select/select_var.h
> index b19a1d1bf085..2c7604807cf6 100644
> --- a/testcases/kernel/syscalls/select/select_var.h
> +++ b/testcases/kernel/syscalls/select/select_var.h
> @@ -6,6 +6,7 @@
>  #define SELECT_VAR__
>  
>  #include "lapi/syscalls.h"
> +#include "tst_timer.h"
>  
>  struct compat_sel_arg_struct {
>  	long _n;
> @@ -38,7 +39,7 @@ static int do_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *except
>  	}
>  	case 2: {
>  		int ret;
> -		struct timespec ts = {
> +		struct __kernel_old_timespec ts = {
>  			.tv_sec = timeout->tv_sec,
>  			.tv_nsec = timeout->tv_usec * 1000,
>  		};

I'm a bit lost here, should we actually pass the __kernel_old_timespec
to all the tst_syscall() fuctions here?

I guess that the only function that would take the argument as struct
timeval is the select() glibc function, or do I miss something?

Also this change should be ideally done in a separate patch from the
second half that adds the __NR_pselect6_time64.

> @@ -47,7 +48,22 @@ static int do_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *except
>  		timeout->tv_usec = ts.tv_nsec / 1000;
>  		return ret;
>  	}
> -	case 3:
> +	case 3: {
> +		int ret = 0;
> +#if (__NR_clock_settime64 != __LTP__NR_INVALID_SYSCALL)
            ^
	    __NR_pselect6_time64 ?

> +		struct __kernel_timespec ts = {
> +			.tv_sec = timeout->tv_sec,
> +			.tv_nsec = timeout->tv_usec * 1000,
> +		};
> +		ret = tst_syscall(__NR_pselect6_time64, nfds, readfds, writefds, exceptfds, &ts, NULL);
> +		timeout->tv_sec = ts.tv_sec;
> +		timeout->tv_usec = ts.tv_nsec / 1000;
> +#else
> +		tst_brk(TCONF, "__NR_pselect6 time64 variant not supported");
> +#endif
> +		return ret;
> +	}
> +	case 4:
>  #ifdef __NR__newselect
>  		return tst_syscall(__NR__newselect, nfds, readfds, writefds, exceptfds, timeout);
>  #else
> @@ -72,11 +88,14 @@ static void select_info(void)
>  		tst_res(TINFO, "Testing SYS_pselect6 syscall");
>  	break;
>  	case 3:
> +		tst_res(TINFO, "Testing SYS_pselect6 time64 syscall");
> +	break;
> +	case 4:
>  		tst_res(TINFO, "Testing SYS__newselect syscall");
>  	break;
>  	}
>  }
>  
> -#define TEST_VARIANTS 4
> +#define TEST_VARIANTS 5

Also lastly but not least we should clean up the rest of the select
tests and add support for the different variants there as well.

Looking at them these are just copy&paste of the same test with a
different fds, we can easily merge them into a single test.

And the coverate in these tests is a bit lacking, we do not have a
single tests that would send a data over a pipe to a fd select is
watching and check that select was woken up by that. There is no such
test in the pselect/ directory either.

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2020-07-27  9:40 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26  6:22 [LTP] [PATCH V7 00/19] Syscalls: Add support for time64 variants Viresh Kumar
2020-06-26  6:22 ` [LTP] [PATCH V7 01/19] tst_timer: Add new definitions Viresh Kumar
2020-06-26  9:49   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 02/19] syscalls/timer_gettime: Add support for time64 tests Viresh Kumar
2020-06-26  9:49   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 03/19] syscalls/timer_settime: " Viresh Kumar
2020-06-29  9:39   ` Cyril Hrubis
2020-06-29 11:43     ` Viresh Kumar
2020-06-26  6:22 ` [LTP] [PATCH V7 04/19] syscalls/timerfd: " Viresh Kumar
2020-07-02 12:24   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 05/19] syscalls/sched_rr_get_interval: " Viresh Kumar
2020-07-02 13:06   ` Cyril Hrubis
2020-07-03  3:15     ` Viresh Kumar
2020-07-03  5:52       ` Yang Xu
2020-07-03  7:26         ` Viresh Kumar
2020-07-03  7:38   ` [LTP] [PATCH] syscalls/sched_rr_get_interval: Validate the timeslice Viresh Kumar
2020-07-03  7:43     ` Yang Xu
2020-07-03  7:51       ` Viresh Kumar
2020-07-03  8:00         ` Yang Xu
2020-07-03  8:18           ` Viresh Kumar
2020-07-03  9:01             ` Yang Xu
2020-07-03 14:08     ` Cyril Hrubis
2020-07-06  3:31     ` [LTP] [PATCH V2] " Viresh Kumar
2020-07-06  4:41       ` Yang Xu
2020-07-07  9:30       ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 06/19] syscalls/futex: Merge futex_wait_bitset tests Viresh Kumar
2020-07-03  9:15   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 07/19] syscalls/futex: Add support for time64 tests Viresh Kumar
2020-07-03 12:45   ` Cyril Hrubis
2020-07-06 10:40     ` Viresh Kumar
2020-07-06 11:36       ` Viresh Kumar
2020-07-06 11:40   ` [LTP] [PATCH V7.1 " Viresh Kumar
2020-07-23 19:44     ` Cyril Hrubis
2020-07-24  2:33       ` Viresh Kumar
2020-06-26  6:22 ` [LTP] [PATCH V7 08/19] syscalls/io_pgetevents: " Viresh Kumar
2020-07-03 14:59   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 09/19] syscalls/sigwaitinfo: Migrate to new test framework Viresh Kumar
2020-07-03 13:58   ` Cyril Hrubis
2020-07-06  2:39     ` Viresh Kumar
2020-07-07 15:16       ` Cyril Hrubis
2020-07-09 10:46         ` Viresh Kumar
2020-06-26  6:22 ` [LTP] [PATCH V7 10/19] syscalls/rt_sigtimedwait: Add support for time64 tests Viresh Kumar
2020-07-22 10:03   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 11/19] syscalls/mq_timed{send|receive}: " Viresh Kumar
2020-07-24 14:51   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 12/19] syscalls/recvmmsg: " Viresh Kumar
2020-07-24 15:13   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 13/19] syscalls/ppoll: " Viresh Kumar
2020-07-27  9:17   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 14/19] syscalls/select6: " Viresh Kumar
2020-07-27  9:40   ` Cyril Hrubis [this message]
2020-07-28  7:23     ` Viresh Kumar
2020-07-28  8:02       ` Arnd Bergmann
2020-06-26  6:22 ` [LTP] [PATCH V7 15/19] syscalls/semop: Migrate to new test framework Viresh Kumar
2020-07-27 13:46   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 16/19] syscalls/semtimedop: Add support for semtimedop and its time64 version Viresh Kumar
2020-06-26  6:22 ` [LTP] [PATCH V7 17/19] syscalls/utimensat: Migrate to new test framework Viresh Kumar
2020-07-27 15:35   ` Cyril Hrubis
2020-06-26  6:22 ` [LTP] [PATCH V7 18/19] syscalls/utimensat: Add support for time64 tests Viresh Kumar
2020-06-26  6:22 ` [LTP] [PATCH V7 19/19] syscalls: clock_settime: Add test around y2038 vulnerability Viresh Kumar
2020-07-28 12:11   ` Cyril Hrubis
2020-08-04 12:37     ` Viresh Kumar
2020-07-20 10:19 ` [LTP] [PATCH V7 00/19] Syscalls: Add support for time64 variants Viresh Kumar
2020-07-22 10:04   ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200727094030.GB7863@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox