Whamcloud - gitweb
LU-16491 lfs: test getdirstripe YAML 08/50208/3
authorTimothy Day <timday@amazon.com>
Sun, 5 Mar 2023 04:37:46 +0000 (04:37 +0000)
committerOleg Drokin <green@whamcloud.com>
Tue, 21 Mar 2023 23:16:32 +0000 (23:16 +0000)
Add a test to ensure that getdirstripe
is outputting valid YAML for layouts.

Fix the verbose flag for getdirstripe
by changing the verbose enum used. The
verbose flag is used in the test.

Add some parenthesis to improve readability.

Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: Ic862a039ab01b004f212bd168d9e28de4fee15c4
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50208
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity.sh
lustre/utils/lfs.c
lustre/utils/liblustreapi.c

index 5316c1e..100fa25 100755 (executable)
@@ -6418,6 +6418,17 @@ test_56b() {
 }
 run_test 56b "check $LFS getdirstripe"
 
+test_56bb() {
+       verify_yaml_available || skip_env "YAML verification not installed"
+       local output_file=$DIR/$tfile.out
+
+       $LFS getdirstripe -v -D -y $DIR 1> $output_file
+
+       cat $output_file
+       cat $output_file | verify_yaml || error "layout is not valid YAML"
+}
+run_test 56bb "check $LFS getdirstripe layout is YAML"
+
 test_56c() {
        remote_ost_nodsh && skip "remote OST with nodsh"
 
index aabcce8..dbfbfbb 100644 (file)
@@ -6479,6 +6479,7 @@ static int lfs_getdirstripe(int argc, char **argv)
                        param.fp_recursive = 1;
                        break;
                case 'v':
+                       param.fp_verbose |= VERBOSE_DEFAULT;
                        param.fp_verbose |= VERBOSE_DETAIL;
                        break;
                case 'X':
index f239eca..c3831d7 100644 (file)
@@ -3111,7 +3111,7 @@ void lmv_dump_user_lmm(struct lmv_user_md *lum, char *pool_name,
 
        separator = "\n";
 
-       if (verbose & VERBOSE_OBJID && lum->lum_magic != LMV_USER_MAGIC) {
+       if ((verbose & VERBOSE_OBJID) && lum->lum_magic != LMV_USER_MAGIC) {
                llapi_printf(LLAPI_MSG_NORMAL, "%s", separator);
                if (lum->lum_stripe_count > 0)
                        llapi_printf(LLAPI_MSG_NORMAL,