X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fsanity.sh;h=c78862edbaed1d32858582377d9eeccfa99dc6af;hb=aa4269f5c2e3c834cdff63dc32d7a7183f32374a;hp=b8ca0801fb8abf30c9f166d45473fc8c2ec4322b;hpb=97a10cf9797bbed02fb131f6a205b6a0ceeb0525;p=fs%2Flustre-release.git diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index b8ca080..c78862e 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -45,8 +45,14 @@ ALWAYS_EXCEPT+=" 42a 42b 42c " ALWAYS_EXCEPT+=" 407 312 " if $SHARED_KEY; then - # bug number: LU-9795 LU-9795 LU-9795 LU-9795 - ALWAYS_EXCEPT+=" 17n 60a 133g 300f " + # bug number: LU-9795 LU-9795 LU-9795 LU-9795 LU-12781 + ALWAYS_EXCEPT+=" 17n 60a 133g 300f 272a" +fi + +selinux_status=$(getenforce) +if [ "$selinux_status" != "Disabled" ]; then + # bug number: LU-12895 LU-12469 LU-12469 + ALWAYS_EXCEPT+=" 185a 230b 230d" fi # skip the grant tests for ARM until they are fixed @@ -2468,11 +2474,11 @@ test_27D() { [ $MDS1_VERSION -lt $(version_code 2.9.55) ] || [ $CLIENT_VERSION -lt $(version_code 2.9.55) ] && skip27D+=" -s 30,31" - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && - skip27D+="-s 32" [[ ! $($LCTL get_param mdc.*.import) =~ connect_flags.*overstriping || $OSTCOUNT -ge $(($LOV_MAX_STRIPE_COUNT / 2)) ]] && skip27D+=" -s 32,33" + [[ $MDS_VERSION -lt $(version_code $SEL_VER) ]] && + skip27D+=" -s 34" llapi_layout_test -d$DIR/$tdir -p$POOL -o$OSTCOUNT $skip27D || error "llapi_layout_test failed" @@ -2612,6 +2618,8 @@ run_test 27H "Set specific OSTs stripe" test_27I() { [ $PARALLEL == "yes" ] && skip "skip parallel run" [[ $OSTCOUNT -lt 2 ]] && skip_env "needs >= 2 OSTs" + [[ $MDS1_VERSION -gt $(version_code 2.12.52) ]] || + skip "Need MDS version newer than 2.12.52" local pool=$TESTNAME local ostrange="1 1 1" @@ -5493,19 +5501,27 @@ test_56c() { skip_env "OST $ost_name is in $old_status status" do_facet ost1 $LCTL set_param -n obdfilter.$ost_name.degraded=1 + [[ $OST1_VERSION -ge $(version_code 2.12.55) ]] && do_facet ost1 \ + $LCTL set_param -n obdfilter.$ost_name.no_precreate=1 sleep_maxage local new_status=$(ost_dev_status $ost_idx) - [[ "$new_status" = "D" ]] || - error "OST $ost_name is in status of '$new_status', not 'D'" + [[ "$new_status" =~ "D" ]] || + error "$ost_name status is '$new_status', missing 'D'" + if [[ $OST1_VERSION -ge $(version_code 2.12.55) ]]; then + [[ "$new_status" =~ "N" ]] || + error "$ost_name status is '$new_status', missing 'N'" + fi do_facet ost1 $LCTL set_param -n obdfilter.$ost_name.degraded=0 + [[ $OST1_VERSION -ge $(version_code 2.12.55) ]] && do_facet ost1 \ + $LCTL set_param -n obdfilter.$ost_name.no_precreate=0 sleep_maxage new_status=$(ost_dev_status $ost_idx) - [[ -z "$new_status" ]] || - error "OST $ost_name is in status of '$new_status', not ''" + [[ ! "$new_status" =~ "D" && ! "$new_status" =~ "N" ]] || + error "$ost_name status is '$new_status', has 'D' and/or 'N'" } run_test 56c "check 'lfs df' showing device status" @@ -5857,6 +5873,8 @@ test_56r() { run_test 56r "check lfs find -size works" test_56ra() { + [[ $MDS1_VERSION -gt $(version_code 2.12.58) ]] || + skip "MDS < 2.12.58 doesn't return LSOM data" local dir=$DIR/$tdir [[ $OSC == "mdc" ]] && skip "DoM files" && return @@ -6227,7 +6245,7 @@ test_56w() { done # $LFS_MIGRATE will fail if hard link migration is unsupported - if [[ $(lustre_version_code mds1) -gt $(version_code 2.5.55) ]]; then + if [[ $MDS1_VERSION -gt $(version_code 2.5.55) ]]; then createmany -l$dir/dir1/file1 $dir/dir1/link 200 || error "creating links to $dir/dir1/file1 failed" fi @@ -6565,6 +6583,7 @@ check_migrate_links() { local file1="$dir/file1" local begin="$2" local count="$3" + local runas="$4" local total_count=$(($begin + $count - 1)) local symlink_count=10 local uniq_count=10 @@ -6609,7 +6628,7 @@ check_migrate_links() { fi echo -n "migrating files..." - local migrate_out=$($LFS_MIGRATE -y -S '1m' $dir) + local migrate_out=$($runas $LFS_MIGRATE -y -S '1m' $dir) local rc=$? [ $rc -eq 0 ] || error "migrate failed rc = $rc" echo "done" @@ -6664,6 +6683,9 @@ test_56xb() { echo "testing rsync mode when all links do not fit within xattrs" LFS_MIGRATE_RSYNC_MODE=true check_migrate_links "$dir" 101 100 + chown -R $RUNAS_ID $dir + echo "testing non-root lfs migrate mode when not all links are in xattr" + LFS_MIGRATE_RSYNC_MODE=false check_migrate_links "$dir" 101 100 "$RUNAS" # clean up rm -rf $dir @@ -8667,7 +8689,6 @@ cleanup_101a() { test_101a() { [ $PARALLEL == "yes" ] && skip "skip parallel run" - [ $MDSCOUNT -ge 2 ] && skip_env "needs < 2 MDTs" #LU-4322 local s local discard @@ -8692,9 +8713,12 @@ test_101a() { done cleanup_101a - if [[ $(($discard * 10)) -gt $nreads ]]; then - $LCTL get_param osc.*-osc*.rpc_stats - $LCTL get_param llite.*.read_ahead_stats + $LCTL get_param osc.*-osc*.rpc_stats + $LCTL get_param llite.*.read_ahead_stats + + # Discard is generally zero, but sometimes a few random reads line up + # and trigger larger readahead, which is wasted & leads to discards. + if [[ $(($discard)) -gt $nreads ]]; then error "too many ($discard) discarded pages" fi rm -f $DIR/$tfile || true @@ -20732,87 +20756,86 @@ test_412() { } run_test 412 "mkdir on specific MDTs" -test_413a() { - [ $MDSCOUNT -lt 2 ] && - skip "We need at least 2 MDTs for this test" - - if [ $(lustre_version_code mds1) -lt $(version_code 2.10.55) ]; then - skip "Need server version at least 2.10.55" - fi - - mkdir $DIR/$tdir || error "mkdir failed" - - # find MDT that is the most full - local max=$($LFS df | grep MDT | - awk 'BEGIN { a=0 } - { sub("%", "", $5) - if (0+$5 >= a) - { - a = $5 - b = $6 - } - } - END { split(b, c, ":") - sub("]", "", c[2]) - print c[2] - }') - - for i in $(seq $((MDSCOUNT - 1))); do - $LFS mkdir -c $i $DIR/$tdir/d$i || - error "mkdir d$i failed" - $LFS getdirstripe $DIR/$tdir/d$i - local stripe_index=$($LFS getdirstripe -i $DIR/$tdir/d$i) - [ $stripe_index -ne $max ] || - error "don't expect $max" - done -} -run_test 413a "mkdir on less full MDTs" - -test_413b() { - [ $MDSCOUNT -lt 2 ] && - skip "We need at least 2 MDTs for this test" - - [ $MDS1_VERSION -lt $(version_code 2.12.52) ] && - skip "Need server version at least 2.12.52" - - mkdir $DIR/$tdir || error "mkdir failed" - $LFS setdirstripe -D -i -1 -H space $DIR/$tdir || - error "setdirstripe failed" +test_qos_mkdir() { + local mkdir_cmd=$1 + local stripe_count=$2 + local mdts=$(comma_list $(mdts_nodes)) - local qos_prio_free - local qos_threshold_rr + local testdir + local lmv_qos_prio_free + local lmv_qos_threshold_rr + local lmv_qos_maxage + local lod_qos_prio_free + local lod_qos_threshold_rr + local lod_qos_maxage local count + local i - qos_prio_free=$($LCTL get_param -n lmv.*.qos_prio_free | head -n1) - qos_prio_free=${qos_prio_free%%%} - qos_threshold_rr=$($LCTL get_param -n lmv.*.qos_threshold_rr | head -n1) - qos_threshold_rr=${qos_threshold_rr%%%} - qos_maxage=$($LCTL get_param -n lmv.*.qos_maxage) - - stack_trap "$LCTL set_param lmv.*.qos_prio_free=$qos_prio_free" EXIT - stack_trap "$LCTL set_param lmv.*.qos_threshold_rr=$qos_threshold_rr" \ + lmv_qos_prio_free=$($LCTL get_param -n lmv.*.qos_prio_free | head -n1) + lmv_qos_prio_free=${lmv_qos_prio_free%%%} + lmv_qos_threshold_rr=$($LCTL get_param -n lmv.*.qos_threshold_rr | + head -n1) + lmv_qos_threshold_rr=${lmv_qos_threshold_rr%%%} + lmv_qos_maxage=$($LCTL get_param -n lmv.*.qos_maxage) + stack_trap "$LCTL set_param \ + lmv.*.qos_prio_free=$lmv_qos_prio_free > /dev/null" EXIT + stack_trap "$LCTL set_param \ + lmv.*.qos_threshold_rr=$lmv_qos_threshold_rr > /dev/null" EXIT + stack_trap "$LCTL set_param \ + lmv.*.qos_maxage=$lmv_qos_maxage > /dev/null" EXIT + + lod_qos_prio_free=$(do_facet mds1 $LCTL get_param -n \ + lod.lustre-MDT0000-mdtlov.mdt_qos_prio_free | head -n1) + lod_qos_prio_free=${lod_qos_prio_free%%%} + lod_qos_threshold_rr=$(do_facet mds1 $LCTL get_param -n \ + lod.lustre-MDT0000-mdtlov.mdt_qos_threshold_rr | head -n1) + lod_qos_threshold_rr=${lod_qos_threshold_rr%%%} + lod_qos_maxage=$(do_facet mds1 $LCTL get_param -n \ + lod.lustre-MDT0000-mdtlov.qos_maxage | awk '{ print $1 }') + stack_trap "do_nodes $mdts $LCTL set_param \ + lod.*.mdt_qos_prio_free=$lod_qos_prio_free > /dev/null" EXIT + stack_trap "do_nodes $mdts $LCTL set_param \ + lod.*.mdt_qos_threshold_rr=$lod_qos_threshold_rr > /dev/null" \ EXIT - stack_trap "$LCTL set_param lmv.*.qos_maxage=$qos_maxage" EXIT + stack_trap "do_nodes $mdts $LCTL set_param \ + lod.*.mdt_qos_maxage=$lod_qos_maxage > /dev/null" EXIT + + echo + echo "Mkdir (stripe_count $stripe_count) roundrobin:" + + $LCTL set_param lmv.*.qos_threshold_rr=100 > /dev/null + do_nodes $mdts $LCTL set_param lod.*.mdt_qos_threshold_rr=100 > /dev/null - echo "mkdir with roundrobin" + testdir=$DIR/$tdir-s$stripe_count/rr - $LCTL set_param lmv.*.qos_threshold_rr=100 for i in $(seq $((100 * MDSCOUNT))); do - mkdir $DIR/$tdir/subdir$i || error "mkdir subdir$i failed" + eval $mkdir_cmd $testdir/subdir$i || + error "$mkdir_cmd subdir$i failed" done + for i in $(seq $MDSCOUNT); do - count=$($LFS getdirstripe -i $DIR/$tdir/* | grep ^$((i - 1))$ | - wc -w) + count=$($LFS getdirstripe -i $testdir/* | + grep ^$((i - 1))$ | wc -l) echo "$count directories created on MDT$((i - 1))" [ $count -eq 100 ] || error "subdirs are not evenly distributed" + + if [ $stripe_count -gt 1 ]; then + count=$($LFS getdirstripe $testdir/* | + grep -P "^\s+$((i - 1))\t" | wc -l) + echo "$count stripes created on MDT$((i - 1))" + # deviation should < 5% of average + [ $count -lt $((95 * stripe_count)) ] || + [ $count -gt $((105 * stripe_count)) ] && + error "stripes are not evenly distributed" + fi done - rm -rf $DIR/$tdir/* + $LCTL set_param lmv.*.qos_threshold_rr=$lmv_qos_threshold_rr > /dev/null + do_nodes $mdts $LCTL set_param \ + lod.*.mdt_qos_threshold_rr=$lod_qos_threshold_rr > /dev/null - $LCTL set_param lmv.*.qos_threshold_rr=$qos_threshold_rr - # Shorten statfs result age, so that it can be updated in time - $LCTL set_param lmv.*.qos_maxage=1 - sleep_maxage + echo + echo "Check for uneven MDTs: " local ffree local bavail @@ -20849,9 +20872,8 @@ test_413b() { # Check if we need to generate uneven MDTs local threshold=50 - local diff=$(((max - min ) * 100 / min)) + local diff=$(((max - min) * 100 / min)) local value="$(generate_string 1024)" - local i while [ $diff -lt $threshold ]; do # generate uneven MDTs, create till $threshold% diff @@ -20866,11 +20888,11 @@ test_413b() { error "mkdir $tdir-MDT$min_index failed" for i in $(seq $count); do $OPENFILE -f O_CREAT:O_LOV_DELAY_CREATE \ - $DIR/$tdir-MDT$min_index/f$i > /dev/null || - error "create f$i failed" + $DIR/$tdir-MDT$min_index/f$j_$i > /dev/null || + error "create f$j_$i failed" setfattr -n user.413b -v $value \ - $DIR/$tdir-MDT$min_index/f$i || - error "setfattr f$i failed" + $DIR/$tdir-MDT$min_index/f$j_$i || + error "setfattr f$j_$i failed" done ffree=($(lctl get_param -n mdc.*[mM][dD][cC]-*.filesfree)) @@ -20886,31 +20908,95 @@ test_413b() { echo "MDT blocks available: ${bavail[@]}" echo "weight diff=$diff%" - echo "mkdir with balanced space usage" - $LCTL set_param lmv.*.qos_prio_free=100 + echo + echo "Mkdir (stripe_count $stripe_count) with balanced space usage:" + + $LCTL set_param lmv.*.qos_prio_free=100 > /dev/null + do_nodes $mdts $LCTL set_param lod.*.mdt_qos_prio_free=100 > /dev/null + # decrease statfs age, so that it can be updated in time + $LCTL set_param lmv.*.qos_maxage=1 > /dev/null + do_nodes $mdts $LCTL set_param lod.*.mdt_qos_maxage=1 > /dev/null + + sleep 1 + + testdir=$DIR/$tdir-s$stripe_count/qos + for i in $(seq $((100 * MDSCOUNT))); do - mkdir $DIR/$tdir/subdir$i || error "mkdir subdir$i failed" + eval $mkdir_cmd $testdir/subdir$i || + error "$mkdir_cmd subdir$i failed" done for i in $(seq $MDSCOUNT); do - count=$($LFS getdirstripe -i $DIR/$tdir/* | grep ^$((i - 1))$ | - wc -w) + count=$($LFS getdirstripe -i $testdir/* | grep ^$((i - 1))$ | + wc -l) echo "$count directories created on MDT$((i - 1))" + + if [ $stripe_count -gt 1 ]; then + count=$($LFS getdirstripe $testdir/* | + grep -P "^\s+$((i - 1))\t" | wc -l) + echo "$count stripes created on MDT$((i - 1))" + fi done - max=$($LFS getdirstripe -i $DIR/$tdir/* | grep ^$max_index$ | wc -l) - min=$($LFS getdirstripe -i $DIR/$tdir/* | grep ^$min_index$ | wc -l) + max=$($LFS getdirstripe -i $testdir/* | grep ^$max_index$ | wc -l) + min=$($LFS getdirstripe -i $testdir/* | grep ^$min_index$ | wc -l) + # D-value should > 10% of averge [ $((max - min)) -lt 10 ] && error "subdirs shouldn't be evenly distributed" - which getfattr > /dev/null 2>&1 || skip_env "no getfattr command" + # ditto + if [ $stripe_count -gt 1 ]; then + max=$($LFS getdirstripe $testdir/* | + grep -P "^\s+$max_index\t" | wc -l) + min=$($LFS getdirstripe $testdir/* | + grep -P "^\s+$min_index\t" | wc -l) + [ $((max - min)) -le $((10 * stripe_count)) ] && + error "stripes shouldn't be evenly distributed"|| true + fi +} - $LFS setdirstripe -D -d $DIR/$tdir || error "setdirstripe -d failed" - getfattr -n trusted.dmv $DIR/$tdir && - error "default dir layout exists" || true +test_413a() { + [ $MDSCOUNT -lt 2 ] && + skip "We need at least 2 MDTs for this test" + + [ $MDS1_VERSION -lt $(version_code 2.12.52) ] && + skip "Need server version at least 2.12.52" + + local stripe_count + + for stripe_count in $(seq 1 $((MDSCOUNT - 1))); do + mkdir $DIR/$tdir-s$stripe_count || error "mkdir failed" + mkdir $DIR/$tdir-s$stripe_count/rr || error "mkdir failed" + mkdir $DIR/$tdir-s$stripe_count/qos || error "mkdir failed" + test_qos_mkdir "$LFS mkdir -c $stripe_count" $stripe_count + done +} +run_test 413a "QoS mkdir with 'lfs mkdir -i -1'" + +test_413b() { + [ $MDSCOUNT -lt 2 ] && + skip "We need at least 2 MDTs for this test" + + [ $MDS1_VERSION -lt $(version_code 2.12.52) ] && + skip "Need server version at least 2.12.52" + + local stripe_count + + for stripe_count in $(seq 1 $((MDSCOUNT - 1))); do + mkdir $DIR/$tdir-s$stripe_count || error "mkdir failed" + mkdir $DIR/$tdir-s$stripe_count/rr || error "mkdir failed" + mkdir $DIR/$tdir-s$stripe_count/qos || error "mkdir failed" + $LFS setdirstripe -D -c $stripe_count \ + $DIR/$tdir-s$stripe_count/rr || + error "setdirstripe failed" + $LFS setdirstripe -D -c $stripe_count \ + $DIR/$tdir-s$stripe_count/qos || + error "setdirstripe failed" + test_qos_mkdir "mkdir" $stripe_count + done } -run_test 413b "mkdir with balanced space usage" +run_test 413b "QoS mkdir under dir whose default LMV starting MDT offset is -1" test_414() { #define OBD_FAIL_PTLRPC_BULK_ATTACH 0x521 @@ -21411,6 +21497,10 @@ test_422() { wait at_max_set $amc client at_max_set $amo mds1 + + # LU-12838 - verify the ptlrpc thread watchdog is not always throttled + do_facet mds1 "dmesg | grep 'Dumping the stack trace for debugging'" || + error "Watchdog is always throttled" } run_test 422 "kill a process with RPC in progress" @@ -21861,7 +21951,7 @@ cleanup_805() { } test_805() { - local zfs_version=$(do_node $SINGLEMDS cat /sys/module/zfs/version) + local zfs_version=$(do_facet mds1 cat /sys/module/zfs/version) [ "$mds1_FSTYPE" != "zfs" ] && skip "ZFS specific test" [ $(version_code $zfs_version) -lt $(version_code 0.7.2) ] && skip "netfree not implemented before 0.7" @@ -22138,6 +22228,8 @@ run_test 809 "Verify no SOM xattr store for DoM-only files" test_810() { [ $PARALLEL == "yes" ] && skip "skip parallel run" $GSS && skip_env "could not run with gss" + [[ $OST1_VERSION -gt $(version_code 2.12.58) ]] || + skip "OST < 2.12.58 doesn't align checksum" set_checksums 1 stack_trap "set_checksums $ORIG_CSUM" EXIT