From: Qian Yingjin Date: Tue, 9 Jun 2020 15:00:07 +0000 (+0800) Subject: LU-13628 tests: replace btime with crtime for statx test X-Git-Tag: 2.13.55~128 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=350cd07b27f94e02203274913d89b659bda06f86 LU-13628 tests: replace btime with crtime for statx test Tests sanityn/106a failed due to wrongly using 'btime' to filter the debugfs output for file creation time, which should be 'crtime'. This patch also replaces '-c %q' with '-c %p' in sanityn/106c to get the statx 'stx_attributes_mask': Mask to show what's supported in 'stx_attributes'. Test-Parameters: trivial clientdistro=el8 Test-Parameters: trivial clientdistro=ubuntu1804 Signed-off-by: Qian Yingjin Change-Id: Ia8273e02d4ebe7f1e9e5d6973e691c82e0524fb2 Reviewed-on: https://review.whamcloud.com/38880 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Wei Liu --- diff --git a/lustre/tests/sanityn.sh b/lustre/tests/sanityn.sh index 242797c..642926e 100755 --- a/lustre/tests/sanityn.sh +++ b/lustre/tests/sanityn.sh @@ -18,8 +18,8 @@ init_test_env $@ init_logging ALWAYS_EXCEPT="$SANITYN_EXCEPT " -# bug number for skipped test: LU-7105 LU-13628 -ALWAYS_EXCEPT+=" 28 106" +# bug number for skipped test: LU-7105 +ALWAYS_EXCEPT+=" 28 " # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT! # skip tests for PPC until they are fixed @@ -5132,7 +5132,8 @@ test_106a() { dd if=/dev/zero of=$DIR/$tfile bs=1k count=1 conv=notrunc btime=$($STATX -c %W $DIR/$tfile) output=$(do_facet mds1 "$DEBUGFS -c -R 'stat ROOT/$tfile' $mdtdev") - ((mdt_btime=$(awk -F ':' /btime/'{ print $2 }' <<< "$output"))) + echo $output + ((mdt_btime=$(awk -F ':' /crtime/'{ print $2 }' <<< "$output"))) [[ $btime == $mdt_btime ]] || error "$DIR/$tfile btime ($btime:$mdt_btime) diff" @@ -5202,7 +5203,7 @@ test_106c() { touch $DIR/$tfile # Mask supported in stx_attributes by Lustre is # STATX_ATTR_IMMUTABLE(0x10) | STATX_ATTR_APPEND(0x20) : (0x30). - mask=$($STATX -c %q $DIR/$tfile) + mask=$($STATX -c %p $DIR/$tfile) [[ $mask == "30" ]] || error "supported stx_attributes: got '$mask', expected '30'" chattr +i $DIR/$tfile || error "chattr +i $DIR/$tfile failed" diff --git a/lustre/tests/statx.c b/lustre/tests/statx.c index aa7429b..eff64f8 100644 --- a/lustre/tests/statx.c +++ b/lustre/tests/statx.c @@ -232,7 +232,7 @@ void usage(char *prog) "\t%%n file name\n" "\t%%N quoted file name with dereference if symbolic link\n" "\t%%o optimal I/O transfer size hint\n" - "\t%%q Mask to show what's supported in stx_attributes\n" + "\t%%p Mask to show what's supported in stx_attributes\n" "\t%%r Flags conveying information about the file: " "stx_attributes\n" "\t%%s total size, in bytes\n"