[LTP] [PATCH v5 3/6] Refactor mqns_03 using new LTP API

Petr Vorel pvorel@suse.cz
Fri Mar 3 10:25:26 CET 2023


Hi Andrea,

...
> +++ b/runtest/containers
> @@ -22,7 +22,8 @@ mqns_02 mqns_02
>  mqns_02_clone mqns_02 -m clone
>  mqns_02_unshare mqns_02 -m unshare
>  mqns_03 mqns_03
> -mqns_03_clone mqns_03 -clone
> +mqns_03_clone mqns_03 -m clone
> +mqns_03_unshare mqns_03 -m unshare
Interesting, it was not run with unshare. +1 for adding it.

>  mqns_04 mqns_04
>  mqns_04_clone mqns_04 -clone

> diff --git a/testcases/kernel/containers/mqns/mqns_03.c b/testcases/kernel/containers/mqns/mqns_03.c
...
> +/*\
> + * [Description]
> + *
> + * Test mqueuefs from an isolated/forked process namespace.
Again, I'd mention supported modes here.
> + *
> + * [Algorithm]
> + *
> + * - create /MQ1
> + * - mount mqueue inside the temporary folder
> + * - check for /MQ1 existance
> + * - create /MQ2 inside the temporary folder
> + * - umount
> + * - mount mqueue inside the temporary folder
> + * - check /MQ1 existance
> + * - check /MQ2 existance
> + * - umount
> + */
>  #define _GNU_SOURCE
I wonder why _GNU_SOURCE was used here and in mqns_04.c. I don't see anything
in man mq_open(3), both tests are working without it.

...
> +static void cleanup(void)
> +{
mqns_04.c checks here:
	if (!devdir)
		return;

Although it's unlikely that SAFE_ASPRINTF(&devdir, "%s/mqueue", tmpdir); in
setup() would fail, I'd add it also here.

Kind regards,
Petr


More information about the ltp mailing list