Whamcloud - gitweb
LU-3802 tests: only start mdt0 for conf-sanity 68
[fs/lustre-release.git] / lustre / tests / conf-sanity.sh
index 6575658..1f22874 100644 (file)
@@ -1490,6 +1490,7 @@ t32_test() {
        local tarball=$1
        local writeconf=$2
        local dne_upgrade=${dne_upgrade:-"no"}
+       local ff_convert=${ff_convert:-"no"}
        local shall_cleanup_mdt=false
        local shall_cleanup_mdt1=false
        local shall_cleanup_ost=false
@@ -1530,6 +1531,9 @@ t32_test() {
        echo "  Kernel: $img_kernel"
        echo "    Arch: $img_arch"
 
+       local version=$(version_code $img_commit)
+       [[ $version -gt $(version_code 2.4.0) ]] && ff_convert="no"
+
        $r $LCTL set_param debug="$PTLDEBUG"
 
        $r $TUNEFS --dryrun $tmp/mdt || {
@@ -1663,6 +1667,30 @@ t32_test() {
                return 1
        }
 
+       if [ "$ff_convert" != "no" -a $(facet_fstype ost1) == "ldiskfs" ]; then
+               $r $LCTL lfsck_start -M $fsname-OST0000 || {
+                       error_noexit "Start OI scrub on OST0"
+                       return 1
+               }
+
+               # The oi_scrub should be on ost1, but for test_32(),
+               # all on the SINGLEMDS.
+               wait_update_facet $SINGLEMDS "$LCTL get_param -n \
+                       osd-ldiskfs.$fsname-OST0000.oi_scrub |
+                       awk '/^status/ { print \\\$2 }'" "completed" 30 || {
+                       error_noexit "Failed to get the expected 'completed'"
+                       return 1
+               }
+
+               local UPDATED=$($r $LCTL get_param -n \
+                               osd-ldiskfs.$fsname-OST0000.oi_scrub |
+                               awk '/^updated/ { print $2 }')
+               [ $UPDATED -ge 1 ] || {
+                       error_noexit "Only $UPDATED objects have been converted"
+                       return 1
+               }
+       fi
+
        if [ "$dne_upgrade" != "no" ]; then
                $r $LCTL conf_param \
                                $fsname-MDT0001.mdc.max_rpcs_in_flight=9 || {
@@ -1892,6 +1920,19 @@ test_32c() {
 }
 run_test 32c "dne upgrade test"
 
+test_32d() {
+       local tarballs
+       local tarball
+       local rc=0
+
+       t32_check
+       for tarball in $tarballs; do
+               ff_convert=yes t32_test $tarball || rc=$?
+       done
+       return $rc
+}
+run_test 32d "convert ff test"
+
 test_33a() { # bug 12333, was test_33
         local rc=0
         local FSNAME2=test-123
@@ -3775,6 +3816,52 @@ test_67() { #LU-2950
 }
 run_test 67 "test routes conversion and configuration"
 
+test_68() {
+       local fid
+       local seq
+       local START
+       local END
+
+       [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.4.53) ] ||
+               { skip "Need MDS version at least 2.4.53"; return 0; }
+
+       umount_client $MOUNT || error "umount client failed"
+
+       start_mdt 1 || error "MDT start failed"
+       start_ost
+
+       # START-END - the sequences we'll be reserving
+       START=$(do_facet $SINGLEMDS \
+               lctl get_param -n seq.ctl*.space | awk -F'[[ ]' '{print $2}')
+       END=$((START + (1 << 30)))
+       do_facet $SINGLEMDS \
+               lctl set_param seq.ctl*.fldb="[$START-$END\):0:mdt"
+
+       # reset the sequences MDT0000 has already assigned
+       do_facet $SINGLEMDS \
+               lctl set_param seq.srv*MDT0000.space=clear
+
+       # remount to let the client allocate new sequence
+       mount_client $MOUNT || error "mount client failed"
+
+       touch $DIR/$tfile
+       do_facet $SINGLEMDS \
+               lctl get_param seq.srv*MDT0000.space
+       $LFS path2fid $DIR/$tfile
+
+       local old_ifs="$IFS"
+       IFS='[:]'
+       fid=($($LFS path2fid $DIR/$tfile))
+       IFS="$old_ifs"
+       let seq=${fid[1]}
+
+       if [[ $seq < $END ]]; then
+               error "used reserved sequence $seq?"
+       fi
+       cleanup || return $?
+}
+run_test 68 "be able to reserve specific sequences in FLDB"
+
 test_70a() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
        local MDTIDX=1
@@ -4089,6 +4176,133 @@ test_74() { # LU-1606
 }
 run_test 74 "Lustre client api program can compile and link"
 
+test_75() { # LU-2374
+       [[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.4.1) ]] &&
+                       skip "Need MDS version at least 2.4.1" && return
+
+       local index=0
+       local opts_mds="$(mkfs_opts mds1 $(mdsdevname 1)) \
+               --reformat $(mdsdevname 1) $(mdsvdevname 1)"
+       local opts_ost="$(mkfs_opts ost1 $(ostdevname 1)) \
+               --reformat $(ostdevname 1) $(ostvdevname 1)"
+
+       #check with default parameters
+       add mds1 $opts_mds || error "add mds1 failed for default params"
+       add ost1 $opts_ost || error "add ost1 failed for default params"
+
+       opts_mds=$(echo $opts_mds | sed -e "s/--mdt//")
+       opts_mds=$(echo $opts_mds |
+                  sed -e "s/--index=$index/--index=$index --mdt/")
+       opts_ost=$(echo $opts_ost | sed -e "s/--ost//")
+       opts_ost=$(echo $opts_ost |
+                  sed -e "s/--index=$index/--index=$index --ost/")
+
+       add mds1 $opts_mds || error "add mds1 failed for new params"
+       add ost1 $opts_ost || error "add ost1 failed for new params"
+       return 0
+}
+run_test 75 "The order of --index should be irrelevant"
+
+test_76() {
+       [[ $(lustre_version_code mgs) -ge $(version_code 2.4.52) ]] ||
+               { skip "Need MDS version at least 2.4.52" && return 0; }
+       setup
+       local MDMB_PARAM="osc.*.max_dirty_mb"
+       echo "Change MGS params"
+       local MAX_DIRTY_MB=$($LCTL get_param -n $MDMB_PARAM |
+               head -1)
+       echo "max_dirty_mb: $MAX_DIRTY_MB"
+       local NEW_MAX_DIRTY_MB=$((MAX_DIRTY_MB + MAX_DIRTY_MB))
+       echo "new_max_dirty_mb: $NEW_MAX_DIRTY_MB"
+       do_facet mgs $LCTL set_param -P $MDMB_PARAM=$NEW_MAX_DIRTY_MB
+       wait_update $HOSTNAME "lctl get_param -n $MDMB_PARAM |
+               head -1" $NEW_MAX_DIRTY_MB
+       MAX_DIRTY_MB=$($LCTL get_param -n $MDMB_PARAM | head -1)
+       echo "$MAX_DIRTY_MB"
+       [ $MAX_DIRTY_MB = $NEW_MAX_DIRTY_MB ] ||
+               error "error while apply max_dirty_mb"
+
+       echo "Check the value is stored after remount"
+       stopall
+       setupall
+       wait_update $HOSTNAME "lctl get_param -n $MDMB_PARAM |
+               head -1" $NEW_MAX_DIRTY_MB
+       MAX_DIRTY_MB=$($LCTL get_param -n $MDMB_PARAM | head -1)
+       [ $MAX_DIRTY_MB = $NEW_MAX_DIRTY_MB ] ||
+               error "max_dirty_mb is not saved after remount"
+
+       echo "Change OST params"
+       CLIENT_PARAM="obdfilter.*.client_cache_count"
+       local CLIENT_CACHE_COUNT
+       CLIENT_CACHE_COUNT=$(do_facet ost1 $LCTL get_param -n $CLIENT_PARAM |
+               head -1)
+       echo "client_cache_count: $CLIENT_CACHE_COUNT"
+       NEW_CLIENT_CACHE_COUNT=$((CLIENT_CACHE_COUNT+CLIENT_CACHE_COUNT))
+       echo "new_client_cache_count: $NEW_CLIENT_CACHE_COUNT"
+       do_facet mgs $LCTL set_param -P $CLIENT_PARAM=$NEW_CLIENT_CACHE_COUNT
+       wait_update $(facet_host ost1) "lctl get_param -n $CLIENT_PARAM |
+               head -1" $NEW_CLIENT_CACHE_COUNT
+       CLIENT_CACHE_COUNT=$(do_facet ost1 $LCTL get_param -n $CLIENT_PARAM |
+               head -1)
+       echo "$CLIENT_CACHE_COUNT"
+       [ $CLIENT_CACHE_COUNT = $NEW_CLIENT_CACHE_COUNT ] ||
+               error "error while apply client_cache_count"
+
+       echo "Check the value is stored after remount"
+       stopall
+       setupall
+       wait_update $(facet_host ost1) "lctl get_param -n $CLIENT_PARAM |
+               head -1" $NEW_CLIENT_CACHE_COUNT
+       CLIENT_CACHE_COUNT=$(do_facet ost1 $LCTL get_param -n $CLIENT_PARAM |
+               head -1)
+       echo "$CLIENT_CACHE_COUNT"
+       [ $CLIENT_CACHE_COUNT = $NEW_CLIENT_CACHE_COUNT ] ||
+               error "client_cache_count is not saved after remount"
+       stopall
+}
+run_test 76 "set permanent params set_param -P"
+
+test_77() { # LU-3445
+       local server_version=$(lustre_version_code $SINGLEMDS)
+
+       [[ $server_version -ge $(version_code 2.2.60) ]] &&
+       [[ $server_version -le $(version_code 2.4.0) ]] &&
+               skip "Need MDS version < 2.2.60 or > 2.4.0" && return
+
+       if [[ -z "$fs2ost_DEV" || -z "$fs2mds_DEV" ]]; then
+               is_blkdev $SINGLEMDS $(mdsdevname ${SINGLEMDS//mds/}) &&
+               skip_env "mixed loopback and real device not working" && return
+       fi
+
+       local fs2mdsdev=$(mdsdevname 1_2)
+       local fs2ostdev=$(ostdevname 1_2)
+       local fs2mdsvdev=$(mdsvdevname 1_2)
+       local fs2ostvdev=$(ostvdevname 1_2)
+       local fsname=test1234
+       local mgsnid
+       local failnid="$(h2$NETTYPE 1.2.3.4),$(h2$NETTYPE 4.3.2.1)"
+
+       add fs2mds $(mkfs_opts mds1 $fs2mdsdev) --mgs --fsname=$fsname \
+               --reformat $fs2mdsdev $fs2mdsvdev || error "add fs2mds failed"
+       start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && trap cleanup_24a EXIT INT ||
+               error "start fs2mds failed"
+
+       mgsnid=$(do_facet fs2mds $LCTL list_nids | xargs | tr ' ' ,)
+       [[ $mgsnid = *,* ]] || mgsnid+=",$mgsnid"
+
+       add fs2ost $(mkfs_opts ost1 $fs2ostdev) --mgsnode=$mgsnid \
+               --failnode=$failnid --fsname=$fsname \
+               --reformat $fs2ostdev $fs2ostvdev ||
+                       error "add fs2ost failed"
+       start fs2ost $fs2ostdev $OST_MOUNT_OPTS || error "start fs2ost failed"
+
+       mkdir -p $MOUNT2
+       mount -t lustre $mgsnid:/$fsname $MOUNT2 || error "mount $MOUNT2 failed"
+       DIR=$MOUNT2 MOUNT=$MOUNT2 check_mount || error "check $MOUNT2 failed"
+       cleanup_24a
+}
+run_test 77 "comma-separated MGS NIDs and failover node NIDs"
+
 if ! combined_mgs_mds ; then
        stop mgs
 fi