Whamcloud - gitweb
LU-13665 tests: skip sanity subtests for new features
[fs/lustre-release.git] / lustre / tests / sanity.sh
index 7ca9728..127a396 100755 (executable)
@@ -44,11 +44,6 @@ ALWAYS_EXCEPT+="               42a     42b     42c "
 # bug number:    LU-8411 LU-9054
 ALWAYS_EXCEPT+=" 407     312"
 
-if $SHARED_KEY; then
-       # bug number:    LU-9795 LU-9795 LU-9795 LU-9795
-       ALWAYS_EXCEPT+=" 17n     60a     133g    300f"
-fi
-
 selinux_status=$(getenforce)
 if [ "$selinux_status" != "Disabled" ]; then
        # bug number:
@@ -1450,6 +1445,23 @@ test_24F () {
 }
 run_test 24F "hash order vs readdir (LU-11330)"
 
+test_24G () {
+       [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs"
+
+       local ino1
+       local ino2
+
+       $LFS mkdir -i 0 $DIR/$tdir-0 || error "mkdir $tdir-0"
+       $LFS mkdir -i 1 $DIR/$tdir-1 || error "mkdir $tdir-1"
+       touch $DIR/$tdir-0/f1 || error "touch f1"
+       ln -s $DIR/$tdir-0/f1 $DIR/$tdir-0/s1 || error "ln s1"
+       ino1=$(stat -c%i $DIR/$tdir-0/s1)
+       mv $DIR/$tdir-0/s1 $DIR/$tdir-1 || error "mv s1"
+       ino2=$(stat -c%i $DIR/$tdir-1/s1)
+       [ $ino1 -ne $ino2 ] || error "s1 should be migrated"
+}
+run_test 24G "migrate symlink in rename"
+
 test_25a() {
        echo '== symlink sanity ============================================='
 
@@ -5970,6 +5982,8 @@ test_newerXY_base() {
                ref=$DIR/$tfile.newer.$x$y
                touch $ref || error "touch $ref failed"
        fi
+
+       echo "before = $ref"
        sleep 2
        setup_56 $dir $NUMFILES $NUMDIRS "-i0 -c1" "-i0 -c1"
        sleep 2
@@ -5984,28 +5998,28 @@ test_newerXY_base() {
                touch $negref || error "touch $negref failed"
        fi
 
+       echo "after = $negref"
        local cmd="$LFS find $dir -newer$x$y $ref"
        local nums=$(eval $cmd | wc -l)
        local expected=$(((NUMFILES + 2) * NUMDIRS + 1))
 
-       [ $nums -eq $expected ] ||
-               error "'$cmd' wrong: found $nums, expected $expected"
+       [ $nums -eq $expected ] || { ls -lauR --full-time $dir ;
+               error "'$cmd' wrong: found $nums newer, expected $expected"  ; }
 
        cmd="$LFS find $dir ! -newer$x$y $negref"
        nums=$(eval $cmd | wc -l)
-       [ $nums -eq $expected ] ||
-               error "'$cmd' wrong: found $nums, expected $expected"
+       [ $nums -eq $expected ] || { ls -lauR --full-time $dir ;
+               error "'$cmd' wrong: found $nums older, expected $expected"  ; }
 
        cmd="$LFS find $dir -newer$x$y $ref ! -newer$x$y $negref"
        nums=$(eval $cmd | wc -l)
-       [ $nums -eq $expected ] ||
-               error "'$cmd' wrong: found $nums, expected $expected"
+       [ $nums -eq $expected ] || { ls -lauR --full-time $dir ;
+               error "'$cmd' wrong: found $nums between, expected $expected"; }
 
        rm -rf $DIR/*
 }
 
 test_56oc() {
-       test_newerXY_base "b" "t"
        test_newerXY_base "a" "a"
        test_newerXY_base "a" "m"
        test_newerXY_base "a" "c"
@@ -6015,10 +6029,19 @@ test_56oc() {
        test_newerXY_base "c" "a"
        test_newerXY_base "c" "m"
        test_newerXY_base "c" "c"
-       test_newerXY_base "b" "b"
+
+       [[ -n "$sles_version" ]] &&
+               echo "skip timestamp tests on SLES, LU-13665" && return 0
+
        test_newerXY_base "a" "t"
        test_newerXY_base "m" "t"
        test_newerXY_base "c" "t"
+
+       [[ $MDS1_VERSION -lt $(version_code 2.13.54) ||
+          $CLIENT_VERSION -lt $(version_code 2.13.54) ]] &&
+               ! btime_supported && echo "btime unsupported" && return 0
+
+       test_newerXY_base "b" "b"
        test_newerXY_base "b" "t"
 }
 run_test 56oc "check lfs find -newerXY work"
@@ -15533,6 +15556,9 @@ test_165a() {
        local rc
        local count
 
+       (( $OST1_VERSION >= $(version_code 2.13.54) )) ||
+               skip "OFD access log unsupported"
+
        do_facet ost1 ofd_access_log_reader --debug=- --trace=- > "${trace}" &
        setup_165
        sleep 5
@@ -15566,10 +15592,14 @@ test_165b() {
        local size
        local flags
 
+       (( $OST1_VERSION >= $(version_code 2.13.54) )) ||
+               skip "OFD access log unsupported"
+
        setup_165
 
        lfs setstripe -c 1 -i 0 "${file}"
-       $MULTIOP "${file}" oO_CREAT:O_DIRECT:O_WRONLY:w1048576c || error "cannot create '${file}'"
+       $MULTIOP "${file}" oO_CREAT:O_DIRECT:O_WRONLY:w1048576c ||
+               error "cannot create '${file}'"
        do_facet ost1 ofd_access_log_reader --list
 
        do_facet ost1 ofd_access_log_reader --debug=- --trace=- > "${trace}" &
@@ -15608,7 +15638,8 @@ test_165b() {
        fi
 
        do_facet ost1 ofd_access_log_reader --debug=- --trace=- > "${trace}" &
-       $MULTIOP "${file}" oO_CREAT:O_DIRECT:O_RDONLY:r524288c || error "cannot read '${file}'"
+       $MULTIOP "${file}" oO_CREAT:O_DIRECT:O_RDONLY:r524288c ||
+               error "cannot read '${file}'"
        sleep 5
        do_facet ost1 killall -TERM ofd_access_log_reader
        wait
@@ -15642,6 +15673,10 @@ run_test 165b "ofd access log entries are produced and consumed"
 
 test_165c() {
        local file="${DIR}/${tdir}/${tfile}"
+
+       (( $OST1_VERSION >= $(version_code 2.13.54) )) ||
+               skip "OFD access log unsupported"
+
        test_mkdir "${DIR}/${tdir}"
 
        setup_165
@@ -15650,7 +15685,8 @@ test_165c() {
 
        # 4096 / 64 = 64. Create twice as many entries.
        for ((i = 0; i < 128; i++)); do
-               $MULTIOP "${file}-${i}" oO_CREAT:O_WRONLY:w512c || error "cannot create file"
+               $MULTIOP "${file}-${i}" oO_CREAT:O_WRONLY:w512c ||
+                       error "cannot create file"
        done
 
        sync
@@ -15660,7 +15696,8 @@ test_165c() {
 run_test 165c "full ofd access logs do not block IOs"
 
 oal_peek_entry_count() {
-       do_facet ost1 ofd_access_log_reader --list | awk '$1 == "_entry_count:" { print $2; }'
+       do_facet ost1 ofd_access_log_reader --list |
+               awk '$1 == "_entry_count:" { print $2; }'
 }
 
 oal_expect_entry_count() {
@@ -15681,37 +15718,49 @@ test_165d() {
        local file="${DIR}/${tdir}/${tfile}"
        local param="obdfilter.${FSNAME}-OST0000.access_log_mask"
        local entry_count
+
+       (( $OST1_VERSION >= $(version_code 2.13.54) )) ||
+               skip "OFD access log unsupported"
+
        test_mkdir "${DIR}/${tdir}"
 
        setup_165
        lfs setstripe -c 1 -i 0 "${file}"
 
        do_facet ost1 lctl set_param "${param}=rw"
-       $MULTIOP "${file}" oO_CREAT:O_DIRECT:O_WRONLY:w1048576c || error "cannot create '${file}'"
+       $MULTIOP "${file}" oO_CREAT:O_DIRECT:O_WRONLY:w1048576c ||
+               error "cannot create '${file}'"
        oal_expect_entry_count 1
 
-       $MULTIOP "${file}" oO_CREAT:O_DIRECT:O_RDONLY:r1048576c || error "cannot read '${file}'"
+       $MULTIOP "${file}" oO_CREAT:O_DIRECT:O_RDONLY:r1048576c ||
+               error "cannot read '${file}'"
        oal_expect_entry_count 2
 
        do_facet ost1 lctl set_param "${param}=r"
-       $MULTIOP "${file}" oO_CREAT:O_DIRECT:O_WRONLY:w1048576c || error "cannot create '${file}'"
+       $MULTIOP "${file}" oO_CREAT:O_DIRECT:O_WRONLY:w1048576c ||
+               error "cannot create '${file}'"
        oal_expect_entry_count 2
 
-       $MULTIOP "${file}" oO_CREAT:O_DIRECT:O_RDONLY:r1048576c || error "cannot read '${file}'"
+       $MULTIOP "${file}" oO_CREAT:O_DIRECT:O_RDONLY:r1048576c ||
+               error "cannot read '${file}'"
        oal_expect_entry_count 3
 
        do_facet ost1 lctl set_param "${param}=w"
-       $MULTIOP "${file}" oO_CREAT:O_DIRECT:O_WRONLY:w1048576c || error "cannot create '${file}'"
+       $MULTIOP "${file}" oO_CREAT:O_DIRECT:O_WRONLY:w1048576c ||
+               error "cannot create '${file}'"
        oal_expect_entry_count 4
 
-       $MULTIOP "${file}" oO_CREAT:O_DIRECT:O_RDONLY:r1048576c || error "cannot read '${file}'"
+       $MULTIOP "${file}" oO_CREAT:O_DIRECT:O_RDONLY:r1048576c ||
+               error "cannot read '${file}'"
        oal_expect_entry_count 4
 
        do_facet ost1 lctl set_param "${param}=0"
-       $MULTIOP "${file}" oO_CREAT:O_DIRECT:O_WRONLY:w1048576c || error "cannot create '${file}'"
+       $MULTIOP "${file}" oO_CREAT:O_DIRECT:O_WRONLY:w1048576c ||
+               error "cannot create '${file}'"
        oal_expect_entry_count 4
 
-       $MULTIOP "${file}" oO_CREAT:O_DIRECT:O_RDONLY:r1048576c || error "cannot read '${file}'"
+       $MULTIOP "${file}" oO_CREAT:O_DIRECT:O_RDONLY:r1048576c ||
+               error "cannot read '${file}'"
        oal_expect_entry_count 4
 }
 run_test 165d "ofd_access_log mask works"
@@ -15719,11 +15768,13 @@ run_test 165d "ofd_access_log mask works"
 test_169() {
        # do directio so as not to populate the page cache
        log "creating a 10 Mb file"
-       $MULTIOP $DIR/$tfile oO_CREAT:O_DIRECT:O_RDWR:w$((10*1048576))c || error "multiop failed while creating a file"
+       $MULTIOP $DIR/$tfile oO_CREAT:O_DIRECT:O_RDWR:w$((10*1048576))c ||
+               error "multiop failed while creating a file"
        log "starting reads"
        dd if=$DIR/$tfile of=/dev/null bs=4096 &
        log "truncating the file"
-       $MULTIOP $DIR/$tfile oO_TRUNC:c || error "multiop failed while truncating the file"
+       $MULTIOP $DIR/$tfile oO_TRUNC:c ||
+               error "multiop failed while truncating the file"
        log "killing dd"
        kill %+ || true # reads might have finished
        echo "wait until dd is finished"
@@ -23848,7 +23899,7 @@ test_802b() {
 }
 run_test 802b "be able to set MDTs to readonly"
 
-test_803() {
+test_803a() {
        [[ $MDSCOUNT -lt 2 ]] && skip_env "needs >= 2 MDTs"
        [ $MDS1_VERSION -lt $(version_code 2.10.54) ] &&
                skip "MDS needs to be newer than 2.10.54"
@@ -23896,7 +23947,39 @@ test_803() {
        [ $after_used -le $((before_used + 1)) ] ||
                error "after ($after_used) > before ($before_used) + 1"
 }
-run_test 803 "verify agent object for remote object"
+run_test 803a "verify agent object for remote object"
+
+test_803b() {
+       [[ $MDSCOUNT -lt 2 ]] && skip_env "needs >= 2 MDTs"
+       [ $MDS1_VERSION -lt $(version_code 2.13.56) ] &&
+               skip "MDS needs to be newer than 2.13.56"
+       [ $PARALLEL == "yes" ] && skip "skip parallel run"
+
+       for i in $(seq 0 $((MDSCOUNT - 1))); do
+               $LFS mkdir -i $i $DIR/$tdir.$i || error "mkdir $tdir.$i"
+       done
+
+       local before=0
+       local after=0
+
+       local tmp
+
+       stat $DIR/$tdir.* >/dev/null || error "stat $tdir.*"
+       for i in $(seq 0 $((MDSCOUNT - 1))); do
+               tmp=$(do_facet mds$i $LCTL get_param mdt.*-MDT000$i.md_stats |
+                       awk '/getattr/ { print $2 }')
+               before=$((before + tmp))
+       done
+       stat $DIR/$tdir.* >/dev/null || error "stat $tdir.*"
+       for i in $(seq 0 $((MDSCOUNT - 1))); do
+               tmp=$(do_facet mds$i $LCTL get_param mdt.*-MDT000$i.md_stats |
+                       awk '/getattr/ { print $2 }')
+               after=$((after + tmp))
+       done
+
+       [ $before -eq $after ] || error "getattr count $before != $after"
+}
+run_test 803b "remote object can getattr from cache"
 
 test_804() {
        [[ $MDSCOUNT -lt 2 ]] && skip_env "needs >= 2 MDTs"
@@ -24295,8 +24378,6 @@ run_test 810 "partial page writes on ZFS (LU-11663)"
 test_812a() {
        [ $OST1_VERSION -lt $(version_code 2.12.51) ] &&
                skip "OST < 2.12.51 doesn't support this fail_loc"
-       [ "$SHARED_KEY" = true ] &&
-               skip "OSC connections never go IDLE with Shared-Keys enabled"
 
        $LFS setstripe -c 1 -i 0 $DIR/$tfile
        # ensure ost1 is connected
@@ -24318,8 +24399,6 @@ run_test 812a "do not drop reqs generated when imp is going to idle (LU-11951)"
 test_812b() { # LU-12378
        [ $OST1_VERSION -lt $(version_code 2.12.51) ] &&
                skip "OST < 2.12.51 doesn't support this fail_loc"
-       [ "$SHARED_KEY" = true ] &&
-               skip "OSC connections never go IDLE with Shared-Keys enabled"
 
        $LFS setstripe -c 1 -i 0 $DIR/$tfile || error "setstripe failed"
        # ensure ost1 is connected
@@ -24527,9 +24606,6 @@ test_815()
 run_test 815 "zero byte tiny write doesn't hang (LU-12382)"
 
 test_816() {
-       [ "$SHARED_KEY" = true ] &&
-               skip "OSC connections never go IDLE with Shared-Keys enabled"
-
        $LFS setstripe -c 1 -i 0 $DIR/$tfile
        # ensure ost1 is connected
        stat $DIR/$tfile >/dev/null || error "can't stat"