[CRIU] [PATCH] Tests sysv5 msg queues

Pavel Emelyanov xemul at parallels.com
Wed Nov 25 06:21:25 PST 2015


On 11/25/2015 05:10 PM, Pavel Ganyushin wrote:
> This is old missed test.

Does it pass of fail on criu head?

> Signed-off-by: Pavel Ganyushin <pganyushin at odin.com>
> ---
>  test/zdtm/live/static/Makefile |  1 +
>  test/zdtm/live/static/msgq00.c | 28 ++++++++++++++++++++++++++++
>  2 files changed, 29 insertions(+)
>  create mode 100644 test/zdtm/live/static/msgq00.c
> 
> diff --git a/test/zdtm/live/static/Makefile b/test/zdtm/live/static/Makefile
> index 66920ca..dbb6de2 100644
> --- a/test/zdtm/live/static/Makefile
> +++ b/test/zdtm/live/static/Makefile
> @@ -139,6 +139,7 @@ TST_NOFILE	=				\
>  		different_creds			\
>  		vsx				\
>  		bridge				\
> +		msgq00				\
>  #		jobctl00			\
>  
>  TST_FILE	=				\
> diff --git a/test/zdtm/live/static/msgq00.c b/test/zdtm/live/static/msgq00.c
> new file mode 100644
> index 0000000..23630dd
> --- /dev/null
> +++ b/test/zdtm/live/static/msgq00.c
> @@ -0,0 +1,28 @@
> +#include <stdlib.h>
> +#include <sys/msg.h>
> +
> +#include "zdtmtst.h"
> +
> +const char *test_doc	= "Block migration by holding a message queue";
> +const char *test_author	= "Pavel Emelianov <xemul at sw.ru>";
> +
> +int main(int argc, char ** argv)
> +{
> +	int msg;
> +
> +	test_init(argc, argv);
> +
> +	msg = msgget(IPC_PRIVATE, IPC_CREAT | 0644);
> +	if (msg < 0) {
> +		err("msgget failed: %m");
> +		exit(1);
> +	}
> +
> +	test_daemon();
> +	test_waitsig();
> +
> +	msgctl(msg, IPC_RMID, 0);

This is not a test. At least not a zdtm one. Zdtm test should check its state after 
waitsig() and fail in some conditions.

> +	pass();
> +	return 0;
> +}
> 



More information about the CRIU mailing list