[LTP] [PATCH v4 1/6] syscalls/quotactl08: Test quoatctl01 but quota info hidden in filesystem

Cyril Hrubis chrubis@suse.cz
Fri Jan 7 15:09:10 CET 2022


Hi!
> +static void verify_quota(unsigned int n)
> +{
> +	struct tcase *tc = &tcases[n];
> +
> +	res_dq.dqb_bsoftlimit = 0;
> +	res_qf.dqi_igrace = 0;
> +	fmt_buf = 0;
> +	res_ndq.dqb_id = -1;
> +
> +	tst_res(TINFO, "Test #%d: %s", n, tc->tname);
> +	if ((tc->cmd == QCMD(Q_GETNEXTQUOTA, USRQUOTA) ||
> +		tc->cmd == QCMD(Q_GETNEXTQUOTA, GRPQUOTA)) &&
> +		getnextquota_nsup) {
> +		tst_res(TCONF, "current system doesn't support this cmd");
                                                                ^
								Can we
								print
								tc->des
								here?
> +		return;
> +	}
> +	TEST(do_quotactl(fd, tc->cmd, tst_device->dev, *tc->id, tc->addr));
> +	if (TST_RET == -1) {
> +		tst_res(TFAIL | TTERRNO, "quotactl failed to %s", tc->des);
> +		return;
> +	}

And this can be TST_EXP_PASS_SILENT() followed by if (!TST_PASS) return;

The difference is that the TST_EXP* macros are more comprehensive if
there is a bug in kernel that makes quotaclt() return a possitive number
on success this test would still succeed while the macro will fail it.


Other than these two minor issues:

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list