[CRIU] Re: [PATCH v2] zdtm: POSIX timers migration test

Vladimir Davydov VDavydov at parallels.com
Thu Oct 11 07:52:58 EDT 2012


On Oct 11, 2012, at 3:44 PM, Kinsbursky Stanislav wrote:

> From: Stanislav Kinsbursky <skinsbursky at openvz.org>
> 
> This test set up two posix timers with different clocks: REALTIME and
> MONOTONIC.
> Both send signals.
> Signals are disabled before suspend. This makes overrun counters increasing.
> After restore tests enables signals, and make sure, that:
> 1) signal handler for both timers was called with proper arguments
> 2) time displacement for both timers is not greater than specified (10% by
> default).
> 
> Signed-off-by: Stanislav Kinsbursky <skinsbursky at openvz.org>
> ---
> test/zdtm/live/static/Makefile       |    2 
> test/zdtm/live/static/posix_timers.c |  216 ++++++++++++++++++++++++++++++++++
> 2 files changed, 218 insertions(+), 0 deletions(-)
> create mode 100644 test/zdtm/live/static/posix_timers.c
> <diff-zdtm-static-posix-timers-test.patch>

> +static void generic_handler(struct posix_timers_info *info,
> +			    struct posix_timers_info *real, int sig)
> +{
> +	if (info != real) {
> +		real->handler_status |= WRONG_SI_PTR;
> +		return;
> +	}
> +
> +	if (sig != info->sig)
> +		info->handler_status |= WRONG_SIGNAL;
> +
> +	info->overrun += timer_getoverrun(info->timerid);
> +	if (info->overrun == -1)
> +		info->handler_status |= FAIL_OVERRUN;

overrun = timer_getoverrun(info->timerid);
if (overrun == -1)
    info->handler_status |= FAIL_OVERRUN;
else
    info->overrun += overrun;

> +	info->handler_cnt++;
> +}
> +



More information about the CRIU mailing list