[LTP] [PATCH v7 16/16] Add listmount04 test

Cyril Hrubis chrubis@suse.cz
Wed Oct 9 12:45:48 CEST 2024


Hi!
> +static struct tcase {
> +	int req_usage;
> +	uint32_t size;
> +	uint32_t spare;
> +	uint64_t mnt_id;
> +	uint64_t param;
> +	uint64_t *mnt_ids;
> +	size_t nr_mnt_ids;
> +	uint64_t flags;
> +	int exp_errno;
> +	char *msg;
> +} tcases[] = {
> +	{
> +		.req_usage = 0,
> +		.mnt_ids = mnt_ids,
> +		.nr_mnt_ids = MNT_SIZE,
> +		.flags = 0,
> +		.exp_errno = EFAULT,
> +		.msg = "request points to unaccessible memory",
> +	},
> +	{
> +		.req_usage = 1,
> +		.size = MNT_ID_REQ_SIZE_VER0,
> +		.spare = 0,
> +		.mnt_id = LSMT_ROOT,
> +		.param = 0,
> +		.mnt_ids = NULL,
> +		.nr_mnt_ids = MNT_SIZE,
> +		.flags = 0,
> +		.exp_errno = EFAULT,
> +		.msg = "mnt_ids points to unaccessible memory",
> +	},
> +	{
> +		.req_usage = 1,
> +		.size = MNT_ID_REQ_SIZE_VER0,
> +		.spare = 0,
> +		.mnt_id = LSMT_ROOT,
> +		.param = 0,
> +		.mnt_ids = mnt_ids,
> +		.nr_mnt_ids = MNT_SIZE,
> +		.flags = -1,
> +		.exp_errno = EINVAL,
> +		.msg = "invalid flags",
> +	},
> +	{
> +		.req_usage = 1,
> +		.size = 0,
> +		.spare = 0,
> +		.mnt_id = LSMT_ROOT,
> +		.param = 0,
> +		.mnt_ids = mnt_ids,
> +		.nr_mnt_ids = MNT_SIZE,
> +		.flags = 0,
> +		.exp_errno = EINVAL,
> +		.msg = "insufficient mnt_id_req.size",
> +	},
> +	{
> +		.req_usage = 1,
> +		.size = MNT_ID_REQ_SIZE_VER0,
> +		.spare = -1,
> +		.mnt_id = LSMT_ROOT,
> +		.param = 0,
> +		.mnt_ids = mnt_ids,
> +		.nr_mnt_ids = MNT_SIZE,
> +		.flags = 0,
> +		.exp_errno = EINVAL,
> +		.msg = "invalid mnt_id_req.spare",
> +	},
> +	{
> +		.req_usage = 1,
> +		.size = MNT_ID_REQ_SIZE_VER0,
> +		.spare = 0,
> +		.mnt_id = LSMT_ROOT,
> +		.param = STATMOUNT_PROPAGATE_FROM + 1,
> +		.mnt_ids = mnt_ids,
> +		.nr_mnt_ids = MNT_SIZE,
> +		.flags = 0,
> +		.exp_errno = EINVAL,
> +		.msg = "invalid mnt_id_req.param",
> +	},
> +	{
> +		.req_usage = 1,
> +		.size = MNT_ID_REQ_SIZE_VER0,
> +		.spare = 0,
> +		.mnt_id = 0,
> +		.param = 0,
> +		.mnt_ids = mnt_ids,
> +		.nr_mnt_ids = MNT_SIZE,
> +		.flags = 0,
> +		.exp_errno = EINVAL,
> +		.msg = "invalid mnt_id_req.mnt_id",
> +	},
> +	{
> +		.req_usage = 1,
> +		.size = MNT_ID_REQ_SIZE_VER0,
> +		.spare = 0,
> +		.mnt_id = LSMT_ROOT - 1,
> +		.param = 0,
> +		.mnt_ids = mnt_ids,
> +		.nr_mnt_ids = MNT_SIZE,
> +		.flags = 0,
> +		.exp_errno = ENOENT,
> +		.msg = "non-existant mnt_id",
> +	},
> +};

We can omit setting spare, params and flags to 0 here, to make it
shorter, otherwise:

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

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list