From: Timothy Day Date: Sun, 5 Mar 2023 04:37:46 +0000 (+0000) Subject: LU-16491 lfs: test getdirstripe YAML X-Git-Tag: 2.15.55~59 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=25a53cdc80a03df42aa884cf85dfc725876994f4;p=fs%2Flustre-release.git LU-16491 lfs: test getdirstripe YAML 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 Change-Id: Ic862a039ab01b004f212bd168d9e28de4fee15c4 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50208 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 5316c1e..100fa25 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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" diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index aabcce8..dbfbfbb 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -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': diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index f239eca..c3831d7 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -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,