[CRIU] [PATCH 2/2] zdtm: Pre-check flock before daemonize in file_locks04 test

Andrew Vagin avagin at virtuozzo.com
Tue Jun 28 11:16:11 PDT 2016


On Tue, Jun 28, 2016 at 08:49:53PM +0300, Kirill Tkhai wrote:
> On some kernel (on travis.org, for example) either child
> or parent fdinfo do not contain flock information, on the
> configuration the test setups.
> 
> Pre-check if lock contains in child's fdinfo before the
> daemonization, and simply pass if not so.
> 
> Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
> ---
>  test/zdtm/static/file_locks04.c |   14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/test/zdtm/static/file_locks04.c b/test/zdtm/static/file_locks04.c
> index dfb7c53..6feb27b 100644
> --- a/test/zdtm/static/file_locks04.c
> +++ b/test/zdtm/static/file_locks04.c
> @@ -105,6 +105,20 @@ int main(int argc, char **argv)
>  		return -1;
>  	}
>  
> +	ret = check_file_locks(pid, fd, child_fd);
> +	if (ret < 0) {
> +		fail("Pre-check failed\n");
> +		goto out_kill;
> +	} else if (ret == 0) {
> +		test_msg("Old kernel?\n");
> +		test_daemon();
> +		test_waitsig();

you can add "'feature': 'fdinfo_lock'" to file_locks04.desc instead of
this code

> +		pass();
> +		goto out_kill;
> +	}
> +
> +	test_msg("Daemonize\n");
> +
>  	test_daemon();
>  	test_waitsig();
>  
> 


More information about the CRIU mailing list