[LTP] [PATCH v3 1/2] tst_filesystems01.c: Add test for .filesystems

Petr Vorel pvorel@suse.cz
Tue Nov 11 13:06:00 CET 2025


Hi Wei,

...
> +static void do_test(void)
> +{
> +	long fs_type;
> +
> +	fs_type = tst_fs_type(MOUNT_POINT);
> +
> +	if (fs_type == TST_EXT234_MAGIC) {
> +		TST_EXP_PASS((check_inode_size(128)));
> +		TST_EXP_PASS((check_mkfs_size_opt(10240)));

very nit: I would personally add #define for 128 and 10240, but sure it's ok to
keep it hardcoded on 2 places.

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

> +	}
> +
> +	if (fs_type == TST_XFS_MAGIC)
> +		TST_EXP_PASS((check_mnt_data("usrquota")));
> +}
> +
> +static struct tst_test test = {
> +	.test_all = do_test,
> +	.needs_root = 1,
> +	.mntpoint = MOUNT_POINT,
> +	.mount_device = 1,
> +	.needs_cmds = (const char *[]) {
> +		"tune2fs",
> +		"dumpe2fs",
> +		NULL
> +	},
> +	.filesystems = (struct tst_fs []) {
> +		{
> +			.type = "ext3",
> +			.mkfs_opts = (const char *const []){"-I", "128", "-b", "1024", NULL},
> +			.mkfs_size_opt = "10240",
> +		},
> +		{
> +			.type = "xfs",
> +			.mnt_data = "usrquota",
> +		},
> +		{}
> +	},
> +
> +};


More information about the ltp mailing list