[LTP] [PATCH v9 1/4] Refactor mqns_03 using new LTP API

Petr Vorel pvorel@suse.cz
Wed Sep 20 09:55:14 CEST 2023


Hi Andrea, Cyril,

> Hi!
> Since we are getting close to release I've fixed the remaining problems
> and pushed, thanks.

> What I fixed:

> - runtest entries were not updated
> - license did not match the original
> - there was no need for asprintf() for statically defined strings
> - the mq_freed was set but not used, so I've removed it
> - changed the SAFE_STAT() to access() so that we have clear TPASS/TFAIL
>   messages

I found that mqns_03.c and mqns_04.c fails on Debian in cleanup, when they try
to unmont DEVDIR:

static void cleanup(void)
{
	if (!access(MQUEUE1, F_OK))
		SAFE_MQ_UNLINK(MQNAME1);

	if (!access(MQUEUE2, F_OK))
		SAFE_MQ_UNLINK(MQNAME2);

	if (tst_is_mounted(DEVDIR))
		SAFE_UMOUNT(DEVDIR);
}

While on some distros (e.g. Tumbleweed) it's already unmounted in cleanup, thus
it just warns:
mqns_03.c:88: TINFO: Umounting /tmp/LTP_mqniOxGTg/ltp_mqueue
tst_device.c:442: TINFO: No device is mounted at ltp_mqueue

on Debian it's mounted and fail with EINVAL:
mqns_03.c:136: TINFO: Umounting /tmp/LTP_mqniOxGTg/ltp_mqueue
tst_device.c:402: TWARN: umount('ltp_mqueue') failed with EINVAL
mqns_03.c:136: TWARN: umount(ltp_mqueue) failed: EINVAL (22)

Any idea what can cause this?
(it's a regression)

Kind regards,
Petr


More information about the ltp mailing list