[LTP] [PATCH] syscalls/quotactl02.c: Reconstruct and Convert to new API

Cyril Hrubis chrubis@suse.cz
Mon Oct 31 14:25:36 CET 2016


Hi!
> -} TC[] = {
> -	{Q_XQUOTAOFF, &qflag, check_qoff, NULL},
> -	{Q_XQUOTAON, &qflag, check_qon, NULL},
> -	{Q_XGETQUOTA, &dquota, check_getq, NULL},
> -	{Q_XSETQLIM, &dquota, check_setqlim, setup_setqlim},
> -	{Q_XGETQSTAT, &qstat, check_getqstat, NULL},
> +	void (*func_check)();
> +	char *des;
> +} tcases[] = {
> +	{QCMD(Q_XQUOTAOFF, USRQUOTA), &test_id, &qflag, NULL,
> +	"turn off xfs quota"},
> +	{QCMD(Q_XGETQSTAT, USRQUOTA), &test_id, &res_qstat, check_qoff,
> +	"get xfs quota off status"},
> +	{QCMD(Q_XQUOTAON, USRQUOTA), &test_id, &qflag, NULL,
> +	"turn on xfs quota"},
> +	{QCMD(Q_XGETQSTAT, USRQUOTA), &test_id, &res_qstat, check_qon,
> +	"get xfs quota on status"},
> +	{QCMD(Q_XSETQLIM, USRQUOTA), &test_id, &set_dquota, NULL,
> +	"set xfs disk quota limits"},
> +	{QCMD(Q_XGETQUOTA, USRQUOTA), &test_id, &res_dquota, check_getqlim,
> +	"get xfs disk quota limits"}
>  };

Looking at this part there is a problem that these testcases depends on
each other. I.e. that the test to check that quota is turned off needs
to be executed after we run the test to turn the quota off.

Now this will break horribly if we ever add default test options to
select the number of the test to execute. So what about addin the
quotactl() call to the check_{qoff,qon,getqlim} call and rather than
being a separate test add them as a check for the OFF/ON/SET calls?

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list