[CRIU] [PATCH 9/9] tty: test -- Add /dev/tty testing into pty00

Pavel Emelyanov xemul at parallels.com
Mon Mar 9 06:37:14 PDT 2015


On 03/06/2015 01:39 PM, Cyrill Gorcunov wrote:
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  test/zdtm/live/static/pty00.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/test/zdtm/live/static/pty00.c b/test/zdtm/live/static/pty00.c
> index b8553223abd8..02c06fdf9660 100644
> --- a/test/zdtm/live/static/pty00.c
> +++ b/test/zdtm/live/static/pty00.c
> @@ -21,7 +21,7 @@ static void signal_handler_sighup(int signum)
>  
>  int main(int argc, char ** argv)
>  {
> -	int fdm, fds, ret;
> +	int fdm, fds, ret, tty;
>  	char *slavename;
>  	char buf[10];
>  	const char teststr[] = "hello\n";
> @@ -56,6 +56,12 @@ int main(int argc, char ** argv)
>  		return 1;
>  	}
>  
> +	tty = open("/dev/tty", O_RDWR);
> +	if (tty < 0) {
> +		err("open(%s) failed", "/dev/tty");
> +		return 1;
> +	}
> +
>  	/* Try to reproduce a deadlock */
>  	if (dup2(fdm, 101) != 101) {
>  		err("dup( , 101) failed");
> 

Usually zdtm test consists of two steps -- prepare smth and check that
this smth is still there and works properly. I see only the first step
in this patch :) How about the 2nd one?

Thanks,
Pavel



More information about the CRIU mailing list