[LTP] [PATCH] tst_supported_fs: Implement checking paths against skiplist

Cyril Hrubis chrubis@suse.cz
Fri Sep 23 17:17:50 CEST 2022


Hi!
> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
> ---
> 
> Implement tst_supported_fs feature suggested by pvorel in his patch:
> tst_test.sh: Fix filesystem support detection
> 
> Although the tst_fs_type_name() functions could use some improvements,
> e.g. ext4 must be specified in skiplist as "ext2/ext3/ext4" to get properly
> skipped and vfat is missing from the list of known filesystems.
> 
>  testcases/lib/tst_supported_fs.c | 49 ++++++++++++++++++++++++++------
>  1 file changed, 41 insertions(+), 8 deletions(-)
> 
> diff --git a/testcases/lib/tst_supported_fs.c b/testcases/lib/tst_supported_fs.c
> index 70d4d38c7..5873d0ba1 100644
> --- a/testcases/lib/tst_supported_fs.c
> +++ b/testcases/lib/tst_supported_fs.c
> @@ -32,9 +32,13 @@ static void usage(void)
>  	fprintf(stderr, "tst_supported_fs -s skip_list fs_type\n");
>  	fprintf(stderr, "   if fs_type is in skip_list, return 1 otherwise return 0\n\n");
>  
> +	fprintf(stderr, "tst_supported_fs -s skip_list -d path\n");
> +	fprintf(stderr, "   if filesystem mounted on path is in skip_list, return 1 otherwise return 0\n\n");
> +
>  	fprintf(stderr, "fs_type - a specified filesystem type\n");
>  	fprintf(stderr, "skip_list - filesystems to skip, delimiter: '%c'\n",
>  			SKIP_DELIMITER);
> +	fprintf(stderr, "path - any valid file or directory\n");
>  }
>  
>  static char **parse_skiplist(char *fs)
> @@ -62,10 +66,11 @@ static char **parse_skiplist(char *fs)
>  int main(int argc, char *argv[])
>  {
>  	const char *const *filesystems;
> +	const char *fsname = NULL;
>  	int i, ret;
>  	char **skiplist = NULL;
>  
> -	while ((ret = getopt(argc, argv, "hs:"))) {
> +	while ((ret = getopt(argc, argv, "hs:d:"))) {
                                          ^
					  It's customary to sort these
					  in alphabetical order.

Other than that:

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

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list