[CRIU] Re: [PATCH] zdtm: Check full tcp buffers with custom sizes

Pavel Emelyanov xemul at parallels.com
Tue Oct 30 10:27:13 EDT 2012


On 10/30/2012 06:16 PM, Andrey Vagin wrote:
> * Increase sizes of tcp rcv and snd bufffers
> * Fill buffers
> * Dump/Restore
> * Check, that all data were restored
> 
> This test reproduces a problem from buf #2411
> 
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  test/zdtm/lib/test.c                  |  16 +++
>  test/zdtm/live/static/Makefile        |   1 +
>  test/zdtm/live/static/socket-tcpbuf.c | 227 ++++++++++++++++++++++++++++++++++
>  3 files changed, 244 insertions(+)
>  create mode 100644 test/zdtm/live/static/socket-tcpbuf.c
> 
> diff --git a/test/zdtm/lib/test.c b/test/zdtm/lib/test.c
> index 6ba6364..1c2cf41 100644
> --- a/test/zdtm/lib/test.c
> +++ b/test/zdtm/lib/test.c
> @@ -91,6 +91,22 @@ static void redir_stdfds()
>  
>  void test_ext_init(int argc, char **argv)
>  {
> +	struct sigaction sa = {
> +		.sa_handler	= sig_hand,
> +		.sa_flags	= SA_RESTART,
> +	};
> +	sigemptyset(&sa.sa_mask);
> +
> +	if (sigaction(SIGTERM, &sa, NULL)) {
> +		fprintf(stderr, "Can't set SIGTERM handler: %m\n");
> +		exit(1);
> +	}
> +
> +	if (sigaction(SIGCHLD, &sa, NULL)) {
> +		fprintf(stderr, "Can't set SIGCHLD handler: %m\n");
> +		exit(1);
> +	}
> +

What the heck is that?

>  	parseargs(argc, argv);
>  	if (test_log_init(outfile, ".external"))
>  		exit(1);


More information about the CRIU mailing list