Whamcloud - gitweb
LU-13628 tests: replace btime with crtime for statx test 80/38880/5
authorQian Yingjin <qian@ddn.com>
Tue, 9 Jun 2020 15:00:07 +0000 (23:00 +0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 19 Jun 2020 16:50:14 +0000 (16:50 +0000)
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 <qian@ddn.com>
Change-Id: Ia8273e02d4ebe7f1e9e5d6973e691c82e0524fb2
Reviewed-on: https://review.whamcloud.com/38880
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Wei Liu <sarah@whamcloud.com>
lustre/tests/sanityn.sh
lustre/tests/statx.c

index 242797c..642926e 100755 (executable)
@@ -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"
index aa7429b..eff64f8 100644 (file)
@@ -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"