X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fsanity-pfl.sh;h=e83a9fe04ec6cc8dec737ce28fe0e95e5bc378de;hp=9c7144965919eaaabe47415ebe0e9340a980714b;hb=803a59b87d9b0de8c059447902db176dfd37a24a;hpb=63e90bdb42a9fedd368726877fd4edfaf8e328c7 diff --git a/lustre/tests/sanity-pfl.sh b/lustre/tests/sanity-pfl.sh index 9c71449..e83a9fe 100644 --- a/lustre/tests/sanity-pfl.sh +++ b/lustre/tests/sanity-pfl.sh @@ -12,14 +12,20 @@ init_test_env $@ init_logging # bug number for skipped test: -ALWAYS_EXCEPT="$SANITY_PFL_EXCEPT" +ALWAYS_EXCEPT="$SANITY_PFL_EXCEPT " # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT! +# Skip tests for PPC that fail frequently +if [[ $(uname -m) = ppc64 ]]; then + # bug number: LU-13186 LU-13205 LU-13207 LU-13186 + ALWAYS_EXCEPT+=" 14 16a 16b 17" +fi + build_test_filter check_and_setup_lustre -if [[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.9.51) ]]; then +if [[ "$MDS1_VERSION" -lt $(version_code 2.9.51) ]]; then skip_env "Need MDS version at least 2.9.51" fi @@ -528,7 +534,8 @@ test_11() { [[ -n $f4 ]] && error "1: 4th component instantiated" # the first 2 components instantiated - $TRUNCATE $comp_file $((1024*1024*1+1)) + # Truncate to exact start of new component - LU-12586 + $TRUNCATE $comp_file $((1024*1024*1)) f2=$($LFS getstripe -I2 $comp_file | grep "l_fid") [[ -z $f2 ]] && error "2: 2nd component uninstantiated" @@ -538,7 +545,7 @@ test_11() { [[ -n $f4 ]] && error "2: 4th component instantiated" # the first 3 components instantiated - $TRUNCATE $comp_file $((1024*1024*3)) + $TRUNCATE $comp_file $((1024*1024*3 - 1)) $TRUNCATE $comp_file $((1024*1024*1+1)) f2=$($LFS getstripe -I2 $comp_file | grep "l_fid") @@ -674,7 +681,7 @@ test_15() { $LFS setstripe -E 1M -S 1M -E 10M -E eof $parent/f1 || error "create f1" $LFS setstripe -E 4M -E 20M -E eof $parent/f2 || error "create f2" test_mkdir $parent/subdir - $LFS setstripe -E 6M -S 1M -E 30M -E eof $parent/subdir || + $LFS setstripe -E 6M -S 1M -c1 -E 30M -c4 -E eof -c -1 $parent/subdir || error "setstripe to subdir" $LFS setstripe -E 8M -E eof $parent/subdir/f3 || error "create f3" $LFS setstripe -c 1 $parent/subdir/f4 || error "create f4" @@ -724,6 +731,15 @@ test_15() { found=$($LFS find $ext_opts ! $cnt_opts $flg_opts $parent | wc -l) [ $found -eq 2 ] || error "start-1M, end+5M, !count+2, flag=init, $found != 2" + + # check last component stripe count + if [ $OSTCOUNT -gt 1 ]; then + touch $parent/subdir/f5 + $TRUNCATE $parent/subdir/f5 $((32*1024*1024)) + found=$($LFS find $parent/subdir -c $OSTCOUNT) + [[ "$found" == "$parent/subdir/f5" ]] || + error "got '$found' with stripe_count=$OSTCOUNT, not f5" + fi } run_test 15 "Verify component options for lfs find" @@ -835,6 +851,37 @@ test_16b() { } run_test 16b "Verify setstripe/getstripe with YAML config file + overstriping" +test_16c() { + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + + local file=$DIR/$tdir/$tfile + local dir=$DIR/$tdir/dir + local temp=$DIR/$tdir/template + rm -rf $DIR/$tdir + test_mkdir $DIR/$tdir + + ##################################################################### + # 1. SEL file + # set stripe for source file + $LFS setstripe -E256M -S 1M -c2 -o0,1 -z 64M -E-1 -o1,0 -z 128M \ + $file || error "Create $file failed" + + echo "1. SEL file" + verify_yaml_layout $file $file.copy $temp "1. PFL file" + + ##################################################################### + # 2. SEL dir + # set stripe for source dir + test_mkdir $dir + $LFS setstripe -E256M -S 1M -c2 -z 64M -E-1 -z 128M \ + $dir || error "setstripe $dir failed" + + test_mkdir $dir.copy + echo "2. SEL template on dir" + verify_yaml_layout $dir $dir.copy $temp.dir "2. PFL dir" +} +run_test 16c "Verify setstripe/getstripe for SEL layout with YAML config file" + test_17() { [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" local file=$DIR/$tdir/$tfile @@ -1028,8 +1075,8 @@ test19_io_base() { # Self-extending PFL tests test_19a() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" test19_io_base $DIR/$tdir/$tfile @@ -1038,11 +1085,12 @@ run_test 19a "Simple test of extension behavior" # Same as 19a, but with default layout set on directory rather than on file test_19b() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile + local comp_dir=$DIR/$tdir/$tdir local flg_opts="" local found="" @@ -1050,15 +1098,24 @@ test_19b() { $LFS setstripe --ext-size 64M -c 1 -E -1 $DIR/$tdir || error "Setstripe on $DIR/$tdir failed" + # check inheritance for a sub-dir and a file + test_mkdir $comp_dir + found=$($LFS find --comp-start 0 -E 64M $comp_dir | wc -l) + [ $found -eq 1 ] || error "Dir Inheritance: wrong first component size" + + flg_opts="--comp-flags extension" + found=$($LFS find --comp-start 64M -E EOF $flg_opts $comp_dir | wc -l) + [ $found -eq 1 ] || error "Dir Inheritance: Second component not found" + touch $comp_file flg_opts="--comp-flags init" found=$($LFS find --comp-start 0 -E 64M $flg_opts $comp_file | wc -l) - [ $found -eq 1 ] || error "Inheritance: wrong first component size" + [ $found -eq 1 ] || error "File Inheritance: wrong first component size" flg_opts="--comp-flags extension" found=$($LFS find --comp-start 64M -E EOF $flg_opts $comp_file | wc -l) - [ $found -eq 1 ] || error "Inheritance: Second component not found" + [ $found -eq 1 ] || error "File Inheritance: Second component not found" test19_io_base $comp_file 1 } @@ -1066,8 +1123,8 @@ run_test 19b "Simple test of SEL as default layout" # Test behavior when seeking deep in a file test_19c() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile @@ -1129,8 +1186,8 @@ test_19c() { run_test 19c "Test self-extending layout seeking behavior" test_19d() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile @@ -1183,8 +1240,8 @@ test_19e_check() { } test_19e() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile @@ -1238,8 +1295,8 @@ test_19e() { run_test 19e "Replay of layout instantiation & extension" test_19f() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile @@ -1256,8 +1313,8 @@ test_19f() { run_test 19f "Rejection of invalid layouts" test_19g() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local file1=$DIR/${tfile}-1 @@ -1333,8 +1390,8 @@ run_test 19g "component-add behaviour" # Test out of space behavior test_20a() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile @@ -1348,7 +1405,7 @@ test_20a() { wait_mds_ost_sync # First component is on OST0 - $LFS setstripe -E 256M -i 0 -z 64M -E -1 -z 1G $comp_file || + $LFS setstripe -E 256M -i 0 -z 64M -E -1 -z 128M $comp_file || error "Create $comp_file failed" # write past end of first component, so it is extended @@ -1372,12 +1429,12 @@ test_20a() { $LFS getstripe $comp_file flg_opts="--comp-flags init" - found=$($LFS find --comp-start 128M -E 1152M $flg_opts $comp_file | \ + found=$($LFS find --comp-start 128M -E 256M $flg_opts $comp_file | \ wc -l) [ $found -eq 1 ] || error "Write: third component not found" flg_opts="--comp-flags extension" - found=$($LFS find --comp-start 1152M -E EOF $flg_opts $comp_file |wc -l) + found=$($LFS find --comp-start 256M -E EOF $flg_opts $comp_file |wc -l) [ $found -eq 1 ] || error "Write: fourth extension component not found" sel_layout_sanity $comp_file 3 @@ -1385,8 +1442,8 @@ test_20a() { run_test 20a "Test out of space, spillover to defined component" test_20b() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile @@ -1401,7 +1458,7 @@ test_20b() { # normal component to 10M, extendable component to 1G # further extendable to EOF - $LFS setstripe -E 10M -E 1G -p $TESTNAME -z 64M -E -1 -p "" -z 512M \ + $LFS setstripe -E 10M -E 1G -p $TESTNAME -z 64M -E -1 -p "" -z 128M \ $comp_file || error "Create $comp_file failed" replay_barrier $SINGLEMDS @@ -1426,11 +1483,11 @@ test_20b() { [ $found -eq 0 ] || error "Write: zero length component still present" flg_opts="--comp-flags init" - found=$($LFS find --comp-start 10M -E 522M $flg_opts $comp_file | wc -l) + found=$($LFS find --comp-start 10M -E 138M $flg_opts $comp_file | wc -l) [ $found -eq 1 ] || error "Write: second component not found" flg_opts="--comp-flags extension" - found=$($LFS find --comp-start 522M -E EOF $flg_opts $comp_file | wc -l) + found=$($LFS find --comp-start 138M -E EOF $flg_opts $comp_file | wc -l) [ $found -eq 1 ] || error "Write: third component not found" fail $SINGLEMDS @@ -1439,11 +1496,11 @@ test_20b() { [ $found -eq 0 ] || error "Failover: 0-length component still present" flg_opts="--comp-flags init" - found=$($LFS find --comp-start 10M -E 522M $flg_opts $comp_file | wc -l) + found=$($LFS find --comp-start 10M -E 138M $flg_opts $comp_file | wc -l) [ $found -eq 1 ] || error "Failover: second component not found" flg_opts="--comp-flags extension" - found=$($LFS find --comp-start 522M -E EOF $flg_opts $comp_file | wc -l) + found=$($LFS find --comp-start 138M -E EOF $flg_opts $comp_file | wc -l) [ $found -eq 1 ] || error "Failover: third component not found" sel_layout_sanity $comp_file 3 @@ -1451,8 +1508,8 @@ test_20b() { run_test 20b "Remove component without instantiation when there is no space" test_20c() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile @@ -1502,8 +1559,8 @@ test_20c() { run_test 20c "Test inability to stripe new extension component" test_20d() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile @@ -1547,8 +1604,8 @@ test_20d() { run_test 20d "Low on space + 0-length comp: force extension" test_20e() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile @@ -1587,7 +1644,7 @@ run_test 20e "ENOSPC with next real comp: spillover and backward extension" # Simple DoM interaction test test_21a() { - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile @@ -1618,8 +1675,8 @@ run_test 21a "Simple DoM interaction tests" # DoM + extension + removal test_21b() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile @@ -1630,7 +1687,7 @@ test_21b() { test_mkdir -p $DIR/$tdir # DoM, extendable component, further extendable component - $LFS setstripe -E 1M -L mdt -E 256M -i 0 -z 64M -E -1 -z 1G \ + $LFS setstripe -E 1M -L mdt -E 256M -i 0 -z 64M -E -1 -z 128M \ $comp_file || error "Create $comp_file failed" found=$($LFS find --comp-start 1M -E 1M $flg_opts $comp_file | wc -l) @@ -1654,11 +1711,11 @@ test_21b() { [ $found -eq 0 ] || error "Write: Zero length component still present" flg_opts="--comp-flags init" - found=$($LFS find --comp-start 1M -E 1025M $flg_opts $comp_file | wc -l) + found=$($LFS find --comp-start 1M -E 129M $flg_opts $comp_file | wc -l) [ $found -eq 1 ] || error "Write: extended component not found" flg_opts="--comp-flags extension" - found=$($LFS find --comp-start 1025M -E EOF $flg_opts $comp_file |wc -l) + found=$($LFS find --comp-start 129M -E EOF $flg_opts $comp_file |wc -l) [ $found -eq 1 ] || error "Write: extension component not found" sel_layout_sanity $comp_file 3 @@ -1667,8 +1724,8 @@ run_test 21b "DoM followed by extendable component with removal" # Test of repeat component behavior with OOS/degraded OST test_22a() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile @@ -1739,8 +1796,8 @@ run_test 22a "Test repeat component behavior with degraded OST" # Test repeat behavior with low space test_22b() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile @@ -1795,8 +1852,8 @@ run_test 22b "Test simple 'out of space' condition with repeat" # This tests both "repeat" and "extend in place when repeat fails" aspects # of repeating components test_22c() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile @@ -1921,8 +1978,8 @@ test_22d_pre() { } test_22d() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile @@ -1972,8 +2029,8 @@ test_22d() { run_test 22d "out of/low on space + failed to repeat + forced extension" test_23a() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile @@ -1997,8 +2054,8 @@ test_23a() { run_test 23a "Append: remove EXT comp" test_23b() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile @@ -2022,8 +2079,8 @@ test_23b() { run_test 23b "Append with 0-length comp: remove EXT comp" test_23c() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile @@ -2056,8 +2113,8 @@ test_23c() { run_test 23c "Append with low on space + 0-length comp: force extension" test_23d() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile @@ -2081,8 +2138,8 @@ test_23d() { run_test 23d "Append with 0-length comp + next real comp: remove EXT comp" test_23e() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile @@ -2119,8 +2176,8 @@ test_23e() { run_test 23e "Append with next real comp: spillover and backward extension" test_23f() { - [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return - [ $(lustre_version_code $SINGLEMDS) -lt $(version_code $SEL_VER) ] && + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + [ "$MDS1_VERSION" -lt $(version_code $SEL_VER) ] && skip "skipped for lustre < $SEL_VER" local comp_file=$DIR/$tdir/$tfile