[LTP] [PATCH 2/2] syscalls/quotactl: Skip tests if FS quota is not supported

Petr Vorel pvorel@suse.cz
Fri Mar 12 11:39:27 CET 2021


Hi Martin,

> --- a/testcases/kernel/syscalls/quotactl/quotactl04.c
...
> +static void do_mount(const char *source, const char *target,
> +	const char *filesystemtype, unsigned long mountflags,
> +	const void *data)
> +{
> +	TEST(mount(source, target, filesystemtype, mountflags, data));
> +
> +	if (TST_RET == -1 && TST_ERR == ESRCH)
> +		tst_brk(TCONF, "Kernel or device does not support FS quotas");
BTW I was also thinking about moving this also into safe_mount(), but
quotactl04.c is the only test which is using "-O quota" option, thus probably
useless.

Kind regards,
Petr

> +
> +	if (TST_RET == -1) {
> +		tst_brk(TBROK | TTERRNO, "mount(%s, %s, %s, %lu, %p) failed",
> +			source, target, filesystemtype, mountflags, data);
> +	}
> +
> +	if (TST_RET) {
> +		tst_brk(TBROK | TTERRNO, "mount(%s, %s, %s, %lu, %p) failed",
> +			source, target, filesystemtype, mountflags, data);
> +	}
> +
> +	mount_flag = 1;
> +}


More information about the ltp mailing list